react-native-windows 0.77.3 → 0.77.5
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/Button.windows.js +3 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +3 -0
- package/Libraries/Components/ScrollView/ScrollView.windows.js +1920 -0
- package/Libraries/Components/TextInput/TextInput.windows.js +3 -0
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +3 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +7 -2
- package/Libraries/Components/View/ViewAccessibility.windows.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +2 -3
- package/Libraries/Image/Image.windows.js +2 -0
- package/Libraries/Text/Text.windows.js +4 -0
- package/Libraries/Text/TextProps.windows.js +1 -0
- package/Libraries/Utilities/HMRClient.js +0 -28
- package/Libraries/Utilities/HMRClientProdShim.js +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +374 -21
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +21 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp +115 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h +41 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +298 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h +59 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +24 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +14 -10
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +3 -2
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/Shared/Networking/WinRTWebSocketResource.cpp +369 -7
- package/Shared/Networking/WinRTWebSocketResource.h +118 -0
- package/Shared/Shared.vcxitems +6 -0
- package/Shared/Shared.vcxitems.filters +8 -0
- package/package.json +9 -9
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "CompositionTextRangeProvider.h"
|
|
3
|
+
#include <Fabric/ComponentView.h>
|
|
4
|
+
#include <Fabric/Composition/ParagraphComponentView.h>
|
|
5
|
+
#include <Fabric/Composition/TextInput/WindowsTextInputComponentView.h>
|
|
6
|
+
#include <Fabric/platform/react/renderer/graphics/HostPlatformColor.h>
|
|
7
|
+
#include <Unicode.h>
|
|
8
|
+
#include "RootComponentView.h"
|
|
9
|
+
#include "UiaHelpers.h"
|
|
10
|
+
|
|
11
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
12
|
+
|
|
13
|
+
CompositionTextRangeProvider::CompositionTextRangeProvider(
|
|
14
|
+
const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView,
|
|
15
|
+
CompositionDynamicAutomationProvider *parentProvider) noexcept
|
|
16
|
+
: m_view{componentView} {
|
|
17
|
+
m_parentProvider.copy_from(parentProvider);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
HRESULT __stdcall CompositionTextRangeProvider::Clone(ITextRangeProvider **pRetVal) {
|
|
21
|
+
// no-op
|
|
22
|
+
*pRetVal = nullptr;
|
|
23
|
+
return S_OK;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
HRESULT __stdcall CompositionTextRangeProvider::Compare(ITextRangeProvider *range, BOOL *pRetVal) {
|
|
27
|
+
// no-op
|
|
28
|
+
*pRetVal = false;
|
|
29
|
+
return S_OK;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
HRESULT __stdcall CompositionTextRangeProvider::CompareEndpoints(
|
|
33
|
+
TextPatternRangeEndpoint endpoint,
|
|
34
|
+
ITextRangeProvider *targetRange,
|
|
35
|
+
TextPatternRangeEndpoint targetEndpoint,
|
|
36
|
+
int *pRetVal) {
|
|
37
|
+
// no-op
|
|
38
|
+
*pRetVal = 0;
|
|
39
|
+
return S_OK;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
HRESULT __stdcall CompositionTextRangeProvider::ExpandToEnclosingUnit(TextUnit unit) {
|
|
43
|
+
// no-op
|
|
44
|
+
return S_OK;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
HRESULT __stdcall CompositionTextRangeProvider::FindAttribute(
|
|
48
|
+
TEXTATTRIBUTEID attributeId,
|
|
49
|
+
VARIANT val,
|
|
50
|
+
BOOL backward,
|
|
51
|
+
ITextRangeProvider **pRetVal) {
|
|
52
|
+
// no-op
|
|
53
|
+
*pRetVal = nullptr;
|
|
54
|
+
return S_OK;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
HRESULT __stdcall CompositionTextRangeProvider::FindText(
|
|
58
|
+
BSTR text,
|
|
59
|
+
BOOL backward,
|
|
60
|
+
BOOL ignoreCase,
|
|
61
|
+
ITextRangeProvider **pRetVal) {
|
|
62
|
+
// no-op
|
|
63
|
+
*pRetVal = nullptr;
|
|
64
|
+
return S_OK;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
HRESULT __stdcall CompositionTextRangeProvider::GetAttributeValue(TEXTATTRIBUTEID attributeId, VARIANT *pRetVal) {
|
|
68
|
+
if (pRetVal == nullptr)
|
|
69
|
+
return E_POINTER;
|
|
70
|
+
auto strongView = m_view.view();
|
|
71
|
+
|
|
72
|
+
if (!strongView)
|
|
73
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
74
|
+
|
|
75
|
+
auto props = std::static_pointer_cast<const facebook::react::ParagraphProps>(
|
|
76
|
+
winrt::get_self<ComponentView>(strongView)->props());
|
|
77
|
+
|
|
78
|
+
auto textinputProps = std::static_pointer_cast<const facebook::react::WindowsTextInputProps>(
|
|
79
|
+
winrt::get_self<ComponentView>(strongView)->props());
|
|
80
|
+
|
|
81
|
+
auto isTextInput =
|
|
82
|
+
strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::WindowsTextInputComponentView>();
|
|
83
|
+
|
|
84
|
+
if (props == nullptr)
|
|
85
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
86
|
+
|
|
87
|
+
if (attributeId == UIA_BackgroundColorAttributeId) {
|
|
88
|
+
pRetVal->vt = VT_I4;
|
|
89
|
+
pRetVal->lVal = (*props->backgroundColor).AsColorRefWithAlpha();
|
|
90
|
+
} else if (attributeId == UIA_CapStyleAttributeId) {
|
|
91
|
+
pRetVal->vt = VT_I4;
|
|
92
|
+
auto fontVariant = facebook::react::FontVariant::Default;
|
|
93
|
+
auto textTransform = facebook::react::TextTransform::None;
|
|
94
|
+
if (props->textAttributes.fontVariant.has_value()) {
|
|
95
|
+
fontVariant = props->textAttributes.fontVariant.value();
|
|
96
|
+
}
|
|
97
|
+
if (props->textAttributes.textTransform.has_value()) {
|
|
98
|
+
textTransform = props->textAttributes.textTransform.value();
|
|
99
|
+
}
|
|
100
|
+
if (fontVariant == facebook::react::FontVariant::SmallCaps) {
|
|
101
|
+
return CapStyle_SmallCap;
|
|
102
|
+
} else if (textTransform == facebook::react::TextTransform::Capitalize) {
|
|
103
|
+
return CapStyle_Titling;
|
|
104
|
+
} else if (textTransform == facebook::react::TextTransform::Lowercase) {
|
|
105
|
+
return CapStyle_None;
|
|
106
|
+
} else if (textTransform == facebook::react::TextTransform::Uppercase) {
|
|
107
|
+
return CapStyle_AllCap;
|
|
108
|
+
}
|
|
109
|
+
} else if (attributeId == UIA_FontNameAttributeId) {
|
|
110
|
+
pRetVal->vt = VT_BSTR;
|
|
111
|
+
auto fontName = props->textAttributes.fontFamily;
|
|
112
|
+
if (fontName.empty()) {
|
|
113
|
+
fontName = "Segoe UI";
|
|
114
|
+
}
|
|
115
|
+
std::wstring wfontName(fontName.begin(), fontName.end());
|
|
116
|
+
pRetVal->bstrVal = SysAllocString(wfontName.c_str());
|
|
117
|
+
} else if (attributeId == UIA_FontSizeAttributeId) {
|
|
118
|
+
pRetVal->vt = VT_R8;
|
|
119
|
+
pRetVal->dblVal = props->textAttributes.fontSize;
|
|
120
|
+
} else if (attributeId == UIA_FontWeightAttributeId) {
|
|
121
|
+
if (props->textAttributes.fontWeight.has_value()) {
|
|
122
|
+
pRetVal->vt = VT_I4;
|
|
123
|
+
pRetVal->lVal = static_cast<long>(props->textAttributes.fontWeight.value());
|
|
124
|
+
}
|
|
125
|
+
} else if (attributeId == UIA_ForegroundColorAttributeId) {
|
|
126
|
+
pRetVal->vt = VT_I4;
|
|
127
|
+
pRetVal->lVal = (*props->textAttributes.foregroundColor).AsColorRefWithAlpha();
|
|
128
|
+
} else if (attributeId == UIA_IsItalicAttributeId) {
|
|
129
|
+
pRetVal->vt = VT_BOOL;
|
|
130
|
+
pRetVal->boolVal = (props->textAttributes.fontStyle.has_value() &&
|
|
131
|
+
props->textAttributes.fontStyle.value() == facebook::react::FontStyle::Italic)
|
|
132
|
+
? VARIANT_TRUE
|
|
133
|
+
: VARIANT_FALSE;
|
|
134
|
+
} else if (attributeId == UIA_IsReadOnlyAttributeId) {
|
|
135
|
+
pRetVal->vt = VT_BOOL;
|
|
136
|
+
pRetVal->boolVal = isTextInput ? textinputProps->editable ? VARIANT_FALSE : VARIANT_TRUE : VARIANT_TRUE;
|
|
137
|
+
} else if (attributeId == UIA_HorizontalTextAlignmentAttributeId) {
|
|
138
|
+
pRetVal->vt = VT_I4;
|
|
139
|
+
auto textAlign = facebook::react::TextAlignment::Center;
|
|
140
|
+
if (props->textAttributes.alignment.has_value()) {
|
|
141
|
+
textAlign = props->textAttributes.alignment.value();
|
|
142
|
+
}
|
|
143
|
+
if (textAlign == facebook::react::TextAlignment::Left) {
|
|
144
|
+
pRetVal->lVal = HorizontalTextAlignment_Left;
|
|
145
|
+
} else if (textAlign == facebook::react::TextAlignment::Right) {
|
|
146
|
+
pRetVal->lVal = HorizontalTextAlignment_Right;
|
|
147
|
+
} else if (textAlign == facebook::react::TextAlignment::Center) {
|
|
148
|
+
pRetVal->lVal = HorizontalTextAlignment_Centered;
|
|
149
|
+
} else if (textAlign == facebook::react::TextAlignment::Justified) {
|
|
150
|
+
pRetVal->lVal = HorizontalTextAlignment_Justified;
|
|
151
|
+
} else if (textAlign == facebook::react::TextAlignment::Natural) {
|
|
152
|
+
pRetVal->lVal = HorizontalTextAlignment_Left;
|
|
153
|
+
}
|
|
154
|
+
} else if (attributeId == UIA_StrikethroughColorAttributeId) {
|
|
155
|
+
if (props->textAttributes.textDecorationLineType.has_value() &&
|
|
156
|
+
(props->textAttributes.textDecorationLineType.value() ==
|
|
157
|
+
facebook::react::TextDecorationLineType::Strikethrough ||
|
|
158
|
+
props->textAttributes.textDecorationLineType.value() ==
|
|
159
|
+
facebook::react::TextDecorationLineType::UnderlineStrikethrough)) {
|
|
160
|
+
pRetVal->vt = VT_I4;
|
|
161
|
+
pRetVal->lVal = (*props->textAttributes.textDecorationColor).AsColorRefWithAlpha();
|
|
162
|
+
}
|
|
163
|
+
} else if (attributeId == UIA_StrikethroughStyleAttributeId) {
|
|
164
|
+
if (props->textAttributes.textDecorationLineType.has_value() &&
|
|
165
|
+
(props->textAttributes.textDecorationLineType.value() ==
|
|
166
|
+
facebook::react::TextDecorationLineType::Strikethrough ||
|
|
167
|
+
props->textAttributes.textDecorationLineType.value() ==
|
|
168
|
+
facebook::react::TextDecorationLineType::UnderlineStrikethrough)) {
|
|
169
|
+
pRetVal->vt = VT_I4;
|
|
170
|
+
auto style = props->textAttributes.textDecorationStyle.value();
|
|
171
|
+
pRetVal->lVal = GetTextDecorationLineStyle(style);
|
|
172
|
+
}
|
|
173
|
+
} else if (attributeId == UIA_UnderlineColorAttributeId) {
|
|
174
|
+
if (props->textAttributes.textDecorationLineType.has_value() &&
|
|
175
|
+
(props->textAttributes.textDecorationLineType.value() == facebook::react::TextDecorationLineType::Underline ||
|
|
176
|
+
props->textAttributes.textDecorationLineType.value() ==
|
|
177
|
+
facebook::react::TextDecorationLineType::UnderlineStrikethrough)) {
|
|
178
|
+
pRetVal->vt = VT_I4;
|
|
179
|
+
pRetVal->lVal = (*props->textAttributes.textDecorationColor).AsColorRefWithAlpha();
|
|
180
|
+
}
|
|
181
|
+
} else if (attributeId == UIA_UnderlineStyleAttributeId) {
|
|
182
|
+
if (props->textAttributes.textDecorationLineType.has_value() &&
|
|
183
|
+
(props->textAttributes.textDecorationLineType.value() == facebook::react::TextDecorationLineType::Underline ||
|
|
184
|
+
props->textAttributes.textDecorationLineType.value() ==
|
|
185
|
+
facebook::react::TextDecorationLineType::UnderlineStrikethrough)) {
|
|
186
|
+
pRetVal->vt = VT_I4;
|
|
187
|
+
auto style = props->textAttributes.textDecorationStyle.value();
|
|
188
|
+
pRetVal->lVal = GetTextDecorationLineStyle(style);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return S_OK;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
HRESULT __stdcall CompositionTextRangeProvider::GetBoundingRectangles(SAFEARRAY **pRetVal) {
|
|
195
|
+
if (pRetVal == nullptr)
|
|
196
|
+
return E_POINTER;
|
|
197
|
+
UiaRect rect;
|
|
198
|
+
auto hr = m_parentProvider->get_BoundingRectangle(&rect);
|
|
199
|
+
if (FAILED(hr))
|
|
200
|
+
return hr;
|
|
201
|
+
*pRetVal = SafeArrayCreateVector(VT_R8, 0, 4);
|
|
202
|
+
double *pData = nullptr;
|
|
203
|
+
hr = SafeArrayAccessData(*pRetVal, reinterpret_cast<void **>(&pData));
|
|
204
|
+
if (FAILED(hr))
|
|
205
|
+
return hr;
|
|
206
|
+
pData[0] = rect.left;
|
|
207
|
+
pData[1] = rect.top;
|
|
208
|
+
pData[2] = rect.width;
|
|
209
|
+
pData[3] = rect.height;
|
|
210
|
+
hr = SafeArrayUnaccessData(*pRetVal);
|
|
211
|
+
if (FAILED(hr))
|
|
212
|
+
return hr;
|
|
213
|
+
return S_OK;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
HRESULT __stdcall CompositionTextRangeProvider::GetChildren(SAFEARRAY **pRetVal) {
|
|
217
|
+
// no-op
|
|
218
|
+
*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 0);
|
|
219
|
+
return S_OK;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
HRESULT __stdcall CompositionTextRangeProvider::GetEnclosingElement(IRawElementProviderSimple **pRetVal) {
|
|
223
|
+
// no-op
|
|
224
|
+
*pRetVal = nullptr;
|
|
225
|
+
return S_OK;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
HRESULT __stdcall CompositionTextRangeProvider::GetText(int maxLength, BSTR *pRetVal) {
|
|
229
|
+
if (pRetVal == nullptr)
|
|
230
|
+
return E_POINTER;
|
|
231
|
+
auto strongView = m_view.view();
|
|
232
|
+
|
|
233
|
+
if (!strongView)
|
|
234
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
235
|
+
auto paragraphView =
|
|
236
|
+
strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::ParagraphComponentView>();
|
|
237
|
+
std::string text = "";
|
|
238
|
+
if (paragraphView) {
|
|
239
|
+
text = paragraphView->DefaultAccessibleName();
|
|
240
|
+
} else {
|
|
241
|
+
auto textInputView =
|
|
242
|
+
strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::WindowsTextInputComponentView>();
|
|
243
|
+
if (textInputView) {
|
|
244
|
+
text = textInputView->getAccessiblityValue().value().empty() ? textInputView->DefaultAccessibleName()
|
|
245
|
+
: textInputView->getAccessiblityValue().value();
|
|
246
|
+
} else {
|
|
247
|
+
return UIA_E_NOTSUPPORTED;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
std::wstring wtext(text.begin(), text.end());
|
|
252
|
+
*pRetVal = SysAllocString(wtext.c_str());
|
|
253
|
+
return S_OK;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
HRESULT __stdcall CompositionTextRangeProvider::Move(TextUnit unit, int count, int *pRetVal) {
|
|
257
|
+
// no-op
|
|
258
|
+
*pRetVal = 0;
|
|
259
|
+
return S_OK;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
HRESULT __stdcall CompositionTextRangeProvider::MoveEndpointByRange(
|
|
263
|
+
TextPatternRangeEndpoint endpoint,
|
|
264
|
+
ITextRangeProvider *targetRange,
|
|
265
|
+
TextPatternRangeEndpoint targetEndpoint) {
|
|
266
|
+
// no-op
|
|
267
|
+
return S_OK;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
HRESULT __stdcall CompositionTextRangeProvider::MoveEndpointByUnit(
|
|
271
|
+
TextPatternRangeEndpoint endpoint,
|
|
272
|
+
TextUnit unit,
|
|
273
|
+
int count,
|
|
274
|
+
int *pRetVal) {
|
|
275
|
+
// no-op
|
|
276
|
+
*pRetVal = 0;
|
|
277
|
+
return S_OK;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
HRESULT __stdcall CompositionTextRangeProvider::ScrollIntoView(BOOL alignToTop) {
|
|
281
|
+
// no-op
|
|
282
|
+
return S_OK;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
HRESULT __stdcall CompositionTextRangeProvider::AddToSelection() {
|
|
286
|
+
// no-op
|
|
287
|
+
return S_OK;
|
|
288
|
+
}
|
|
289
|
+
HRESULT __stdcall CompositionTextRangeProvider::RemoveFromSelection() {
|
|
290
|
+
// no-op
|
|
291
|
+
return S_OK;
|
|
292
|
+
}
|
|
293
|
+
HRESULT __stdcall CompositionTextRangeProvider::Select() {
|
|
294
|
+
// no-op
|
|
295
|
+
return S_OK;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <Fabric/Composition/CompositionDynamicAutomationProvider.h>
|
|
4
|
+
#include <Fabric/Composition/CompositionTextProvider.h>
|
|
5
|
+
#include <Fabric/Composition/CompositionViewComponentView.h>
|
|
6
|
+
#include <Fabric/ReactTaggedView.h>
|
|
7
|
+
#include <UIAutomation.h>
|
|
8
|
+
#include <inspectable.h>
|
|
9
|
+
#include <uiautomationcore.h>
|
|
10
|
+
|
|
11
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
12
|
+
|
|
13
|
+
class CompositionTextRangeProvider : public winrt::implements<CompositionTextRangeProvider, ITextRangeProvider> {
|
|
14
|
+
public:
|
|
15
|
+
CompositionTextRangeProvider(
|
|
16
|
+
const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView,
|
|
17
|
+
CompositionDynamicAutomationProvider *parentProvider) noexcept;
|
|
18
|
+
|
|
19
|
+
// inherited via ITextRangeProvider
|
|
20
|
+
virtual HRESULT __stdcall Clone(ITextRangeProvider **pRetVal) override;
|
|
21
|
+
virtual HRESULT __stdcall Compare(ITextRangeProvider *range, BOOL *pRetVal) override;
|
|
22
|
+
virtual HRESULT __stdcall CompareEndpoints(
|
|
23
|
+
TextPatternRangeEndpoint endpoint,
|
|
24
|
+
ITextRangeProvider *targetRange,
|
|
25
|
+
TextPatternRangeEndpoint targetEndpoint,
|
|
26
|
+
int *pRetVal) override;
|
|
27
|
+
virtual HRESULT __stdcall ExpandToEnclosingUnit(TextUnit unit) override;
|
|
28
|
+
virtual HRESULT __stdcall FindAttribute(
|
|
29
|
+
TEXTATTRIBUTEID attributeId,
|
|
30
|
+
VARIANT val,
|
|
31
|
+
BOOL backward,
|
|
32
|
+
ITextRangeProvider **pRetVal) override;
|
|
33
|
+
virtual HRESULT __stdcall FindText(BSTR text, BOOL backward, BOOL ignoreCase, ITextRangeProvider **pRetVal) override;
|
|
34
|
+
virtual HRESULT __stdcall GetAttributeValue(TEXTATTRIBUTEID attributeId, VARIANT *pRetVal) override;
|
|
35
|
+
virtual HRESULT __stdcall GetBoundingRectangles(SAFEARRAY **pRetVal) override;
|
|
36
|
+
virtual HRESULT __stdcall GetChildren(SAFEARRAY **pRetVal) override;
|
|
37
|
+
virtual HRESULT __stdcall GetEnclosingElement(IRawElementProviderSimple **pRetVal) override;
|
|
38
|
+
virtual HRESULT __stdcall GetText(int maxLength, BSTR *pRetVal) override;
|
|
39
|
+
virtual HRESULT __stdcall Move(TextUnit unit, int count, int *pRetVal) override;
|
|
40
|
+
virtual HRESULT __stdcall MoveEndpointByRange(
|
|
41
|
+
TextPatternRangeEndpoint endpoint,
|
|
42
|
+
ITextRangeProvider *targetRange,
|
|
43
|
+
TextPatternRangeEndpoint targetEndpoint) override;
|
|
44
|
+
virtual HRESULT __stdcall MoveEndpointByUnit(
|
|
45
|
+
TextPatternRangeEndpoint endpoint,
|
|
46
|
+
TextUnit unit,
|
|
47
|
+
int count,
|
|
48
|
+
int *pRetVal) override;
|
|
49
|
+
virtual HRESULT __stdcall ScrollIntoView(BOOL alignToTop) override;
|
|
50
|
+
virtual HRESULT __stdcall AddToSelection() override;
|
|
51
|
+
virtual HRESULT __stdcall RemoveFromSelection() override;
|
|
52
|
+
virtual HRESULT __stdcall Select() override;
|
|
53
|
+
|
|
54
|
+
private:
|
|
55
|
+
::Microsoft::ReactNative::ReactTaggedView m_view;
|
|
56
|
+
winrt::com_ptr<CompositionDynamicAutomationProvider> m_parentProvider;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -777,8 +777,7 @@ void ComponentView::updateAccessibilityProps(
|
|
|
777
777
|
}
|
|
778
778
|
|
|
779
779
|
std::optional<std::string> ComponentView::getAccessiblityValue() noexcept {
|
|
780
|
-
return
|
|
781
|
-
std::static_pointer_cast<const facebook::react::ViewProps>(props())->accessibilityValue);
|
|
780
|
+
return std::static_pointer_cast<const facebook::react::ViewProps>(props())->accessibilityValue.text.value();
|
|
782
781
|
}
|
|
783
782
|
|
|
784
783
|
void ComponentView::setAcccessiblityValue(std::string &&value) noexcept {
|
|
@@ -976,10 +976,16 @@ bool ScrollViewComponentView::scrollToStart(bool animate) noexcept {
|
|
|
976
976
|
}
|
|
977
977
|
|
|
978
978
|
bool ScrollViewComponentView::pageUp(bool animate) noexcept {
|
|
979
|
+
if (std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->horizontal) {
|
|
980
|
+
return scrollLeft(m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor, animate);
|
|
981
|
+
}
|
|
979
982
|
return scrollUp(m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor, animate);
|
|
980
983
|
}
|
|
981
984
|
|
|
982
985
|
bool ScrollViewComponentView::pageDown(bool animate) noexcept {
|
|
986
|
+
if (std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->horizontal) {
|
|
987
|
+
return scrollRight(m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor, animate);
|
|
988
|
+
}
|
|
983
989
|
return scrollDown(m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor, animate);
|
|
984
990
|
}
|
|
985
991
|
|
|
@@ -1036,7 +1042,7 @@ bool ScrollViewComponentView::scrollLeft(float delta, bool animate) noexcept {
|
|
|
1036
1042
|
return false;
|
|
1037
1043
|
}
|
|
1038
1044
|
|
|
1039
|
-
m_scrollVisual.ScrollBy({delta, 0, 0}, animate);
|
|
1045
|
+
m_scrollVisual.ScrollBy({-delta, 0, 0}, animate);
|
|
1040
1046
|
return true;
|
|
1041
1047
|
}
|
|
1042
1048
|
|
|
@@ -1259,7 +1265,7 @@ facebook::react::Point ScrollViewComponentView::getClientOffset() const noexcept
|
|
|
1259
1265
|
}
|
|
1260
1266
|
|
|
1261
1267
|
std::string ScrollViewComponentView::DefaultControlType() const noexcept {
|
|
1262
|
-
return "
|
|
1268
|
+
return "pane";
|
|
1263
1269
|
}
|
|
1264
1270
|
|
|
1265
1271
|
winrt::com_ptr<ComponentView> ScrollViewComponentView::focusVisualRoot(
|
|
@@ -1272,4 +1278,20 @@ ScrollViewComponentView::visualToHostFocus() noexcept {
|
|
|
1272
1278
|
return m_scrollVisual;
|
|
1273
1279
|
}
|
|
1274
1280
|
|
|
1281
|
+
int ScrollViewComponentView::getScrollPositionX() noexcept {
|
|
1282
|
+
return int((m_scrollVisual.ScrollPosition().x / m_horizontalScrollbarComponent->getScrollRange()) * 100);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
int ScrollViewComponentView::getScrollPositionY() noexcept {
|
|
1286
|
+
return int((m_scrollVisual.ScrollPosition().y / m_verticalScrollbarComponent->getScrollRange()) * 100);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
double ScrollViewComponentView::getVerticalSize() noexcept {
|
|
1290
|
+
return std::min((m_layoutMetrics.frame.size.height / m_contentSize.height * 100.0), 100.0);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
double ScrollViewComponentView::getHorizontalSize() noexcept {
|
|
1294
|
+
return std::min((m_layoutMetrics.frame.size.width / m_contentSize.width * 100.0), 100.0);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1275
1297
|
} // namespace winrt::Microsoft::ReactNative::Composition::implementation
|
|
@@ -113,6 +113,11 @@ struct ScrollInteractionTrackerOwner : public winrt::implements<
|
|
|
113
113
|
winrt::Microsoft::ReactNative::Composition::Experimental::IVisual visualToHostFocus() noexcept override;
|
|
114
114
|
winrt::com_ptr<ComponentView> focusVisualRoot(const facebook::react::Rect &focusRect) noexcept override;
|
|
115
115
|
|
|
116
|
+
int getScrollPositionX() noexcept;
|
|
117
|
+
int getScrollPositionY() noexcept;
|
|
118
|
+
double getVerticalSize() noexcept;
|
|
119
|
+
double getHorizontalSize() noexcept;
|
|
120
|
+
|
|
116
121
|
private:
|
|
117
122
|
void updateContentVisualSize() noexcept;
|
|
118
123
|
bool scrollToEnd(bool animate) noexcept;
|
|
@@ -174,16 +174,6 @@ long GetLiveSetting(const std::string &liveRegion) noexcept {
|
|
|
174
174
|
return LiveSetting::Off;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
std::string extractAccessibilityValue(const facebook::react::AccessibilityValue &value) noexcept {
|
|
178
|
-
if (value.now.has_value()) {
|
|
179
|
-
return std::to_string(value.now.value());
|
|
180
|
-
} else if (value.text.has_value()) {
|
|
181
|
-
return value.text.value();
|
|
182
|
-
} else {
|
|
183
|
-
return "";
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
177
|
void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept {
|
|
188
178
|
auto strongView = view.view();
|
|
189
179
|
|
|
@@ -249,4 +239,18 @@ ToggleState GetToggleState(const std::optional<facebook::react::AccessibilitySta
|
|
|
249
239
|
return ToggleState::ToggleState_Off;
|
|
250
240
|
}
|
|
251
241
|
|
|
242
|
+
TextDecorationLineStyle GetTextDecorationLineStyle(facebook::react::TextDecorationStyle style) noexcept {
|
|
243
|
+
if (style == facebook::react::TextDecorationStyle::Dashed) {
|
|
244
|
+
return TextDecorationLineStyle_Dash;
|
|
245
|
+
} else if (style == facebook::react::TextDecorationStyle::Dotted) {
|
|
246
|
+
return TextDecorationLineStyle_Dot;
|
|
247
|
+
} else if (style == facebook::react::TextDecorationStyle::Double) {
|
|
248
|
+
return TextDecorationLineStyle_Double;
|
|
249
|
+
} else if (style == facebook::react::TextDecorationStyle::Solid) {
|
|
250
|
+
return TextDecorationLineStyle_Single;
|
|
251
|
+
} else {
|
|
252
|
+
return TextDecorationLineStyle_Single;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
252
256
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#include <Fabric/ComponentView.h>
|
|
4
4
|
#include <Fabric/Composition/CompositionDynamicAutomationProvider.h>
|
|
5
|
+
#include <Fabric/Composition/ParagraphComponentView.h>
|
|
5
6
|
#include <Fabric/ReactTaggedView.h>
|
|
6
7
|
#include <UIAutomation.h>
|
|
7
8
|
|
|
@@ -32,8 +33,6 @@ void UpdateUiaProperty(
|
|
|
32
33
|
|
|
33
34
|
long GetLiveSetting(const std::string &liveRegion) noexcept;
|
|
34
35
|
|
|
35
|
-
std::string extractAccessibilityValue(const facebook::react::AccessibilityValue &value) noexcept;
|
|
36
|
-
|
|
37
36
|
void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept;
|
|
38
37
|
|
|
39
38
|
ExpandCollapseState GetExpandCollapseState(const bool &expanded) noexcept;
|
|
@@ -43,4 +42,6 @@ void AddSelectionItemsToContainer(CompositionDynamicAutomationProvider *provider
|
|
|
43
42
|
void RemoveSelectionItemsFromContainer(CompositionDynamicAutomationProvider *provider) noexcept;
|
|
44
43
|
|
|
45
44
|
ToggleState GetToggleState(const std::optional<facebook::react::AccessibilityState> &state) noexcept;
|
|
45
|
+
|
|
46
|
+
TextDecorationLineStyle GetTextDecorationLineStyle(facebook::react::TextDecorationStyle style) noexcept;
|
|
46
47
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.77.
|
|
13
|
+
<ReactNativeWindowsVersion>0.77.5</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>77</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>5</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>5f7c15de6e26afe3731e7f6af8257bd2655fe8ba</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -70,6 +70,7 @@ struct AccessibilityState {
|
|
|
70
70
|
std::optional<bool> selected{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionItemProvider Implementation
|
|
71
71
|
bool busy{false};
|
|
72
72
|
std::optional<bool> expanded{std::nullopt};
|
|
73
|
+
std::optional<bool> readOnly{std::nullopt}; // [Windows] - Do not remove; required for Windows IRangeValueProvider and IValueProvider Implementation
|
|
73
74
|
std::optional<bool> multiselectable{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionProvider Implementation
|
|
74
75
|
std::optional<bool> required{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionProvider Implementation
|
|
75
76
|
enum { Unchecked, Checked, Mixed, None } checked{None};
|
|
@@ -171,6 +171,10 @@ inline void fromRawValue(
|
|
|
171
171
|
fromRawValue(context, expanded->second, result.expanded);
|
|
172
172
|
}
|
|
173
173
|
// [Windows] - DO NOT REMOVE - required for Windows ISelectionProvider Implementation
|
|
174
|
+
auto readOnly = map.find("readOnly");
|
|
175
|
+
if (readOnly != map.end()) {
|
|
176
|
+
fromRawValue(context, readOnly->second, result.readOnly);
|
|
177
|
+
}
|
|
174
178
|
auto multiselectable = map.find("multiselectable");
|
|
175
179
|
if (multiselectable != map.end()) {
|
|
176
180
|
fromRawValue(context, multiselectable->second, result.multiselectable);
|