react-native-windows 0.78.1 → 0.78.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/Directory.Build.props +2 -2
- package/Folly/TEMP_UntilFollyUpdate/json.cpp +4 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +23 -15
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +5 -5
- package/Folly/cgmanifest.json +1 -1
- package/Libraries/Components/ScrollView/ScrollView.windows.js +1920 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +282 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +12 -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/ScrollViewComponentView.cpp +24 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +14 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/WebView2.props +2 -1
- package/PropertySheets/WinUI.props +5 -2
- package/Shared/Shared.vcxitems +6 -0
- package/Shared/Shared.vcxitems.filters +8 -0
- package/package.json +5 -5
|
@@ -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
|
|
@@ -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;
|
|
@@ -254,4 +254,18 @@ ToggleState GetToggleState(const std::optional<facebook::react::AccessibilitySta
|
|
|
254
254
|
return ToggleState::ToggleState_Off;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
TextDecorationLineStyle GetTextDecorationLineStyle(facebook::react::TextDecorationStyle style) noexcept {
|
|
258
|
+
if (style == facebook::react::TextDecorationStyle::Dashed) {
|
|
259
|
+
return TextDecorationLineStyle_Dash;
|
|
260
|
+
} else if (style == facebook::react::TextDecorationStyle::Dotted) {
|
|
261
|
+
return TextDecorationLineStyle_Dot;
|
|
262
|
+
} else if (style == facebook::react::TextDecorationStyle::Double) {
|
|
263
|
+
return TextDecorationLineStyle_Double;
|
|
264
|
+
} else if (style == facebook::react::TextDecorationStyle::Solid) {
|
|
265
|
+
return TextDecorationLineStyle_Single;
|
|
266
|
+
} else {
|
|
267
|
+
return TextDecorationLineStyle_Single;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
257
271
|
} // 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
|
|
|
@@ -41,4 +42,6 @@ void AddSelectionItemsToContainer(CompositionDynamicAutomationProvider *provider
|
|
|
41
42
|
void RemoveSelectionItemsFromContainer(CompositionDynamicAutomationProvider *provider) noexcept;
|
|
42
43
|
|
|
43
44
|
ToggleState GetToggleState(const std::optional<facebook::react::AccessibilityState> &state) noexcept;
|
|
45
|
+
|
|
46
|
+
TextDecorationLineStyle GetTextDecorationLineStyle(facebook::react::TextDecorationStyle style) noexcept;
|
|
44
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.78.
|
|
13
|
+
<ReactNativeWindowsVersion>0.78.3</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>78</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>3</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>04930ad6dce2cbc6d2e5d79760b13b77443912e4</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
3
|
<PropertyGroup Label="WebView2 versioning">
|
|
4
4
|
<!-- WinAppSDK 1.6+ has a dependency on Microsoft.Web.WebView2, there are a few places we need to pull in this package explicitly. -->
|
|
5
|
-
|
|
5
|
+
<!-- This minimum fallback version should be greater than or equal to what's needed by both the default and experimental versions of WinAppSDK in WinUI.props. -->
|
|
6
|
+
<WebView2PackageVersion Condition="'$(WebView2PackageVersion)'=='' Or $([MSBuild]::VersionLessThan('$(WebView2PackageVersion)', '1.0.2792.45'))">1.0.2792.45</WebView2PackageVersion>
|
|
6
7
|
</PropertyGroup>
|
|
7
8
|
</Project>
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
<PropertyGroup Label="WinUI3 versioning">
|
|
4
4
|
|
|
5
5
|
<!--
|
|
6
|
-
Internal versions are located at: https://microsoft.visualstudio.com/DefaultCollection/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK/versions
|
|
7
|
-
For local testing of internal versions, modify WinUI3ExperimentalVersion, and comment out the
|
|
6
|
+
Internal versions are typically only located at: https://microsoft.visualstudio.com/DefaultCollection/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK/versions
|
|
7
|
+
For local testing of internal versions, modify WinUI3ExperimentalVersion, and comment out the additional nuget source in NuGet.Config
|
|
8
|
+
When this version is updated, be sure to update the default for the enableInternalFeed parameter of /.ado/templates/enable-experimental-winui3.yml and the minimum version of WebView in WebView2.props
|
|
8
9
|
-->
|
|
9
10
|
<WinUI3ExperimentalVersion Condition="'$(WinUI3ExperimentalVersion)'==''">1.7.250109001-experimental2</WinUI3ExperimentalVersion>
|
|
10
11
|
<!-- This value is also used by the CLI, see /packages/@react-native-windows/cli/.../autolinkWindows.ts -->
|
|
11
12
|
<WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">$(WinUI3ExperimentalVersion)</WinUI3Version>
|
|
12
13
|
<WinUI3Version Condition="'$(WinUI3Version)'==''">1.6.240923002</WinUI3Version>
|
|
14
|
+
<!-- This is needed to prevent build errors with WinAppSDK >= 1.7 trying to double build WindowsAppRuntimeAutoInitializer.cpp -->
|
|
15
|
+
<WindowsAppSdkAutoInitialize Condition="'$(WindowsAppSdkAutoInitialize)'=='' And $([MSBuild]::VersionGreaterThan('$(WinUI3Version)', '1.7.0'))">false</WindowsAppSdkAutoInitialize>
|
|
13
16
|
</PropertyGroup>
|
|
14
17
|
|
|
15
18
|
<PropertyGroup Label="WinUI2x versioning">
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionDynamicAutomationProvider.cpp">
|
|
68
68
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
69
69
|
</ClCompile>
|
|
70
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextProvider.cpp">
|
|
71
|
+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
72
|
+
</ClCompile>
|
|
73
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextRangeProvider.cpp">
|
|
74
|
+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
75
|
+
</ClCompile>
|
|
70
76
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.cpp">
|
|
71
77
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
72
78
|
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeIsland.idl</DependentUpon>
|
|
@@ -209,6 +209,12 @@
|
|
|
209
209
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionDynamicAutomationProvider.cpp">
|
|
210
210
|
<Filter>Source Files\Fabric\Composition</Filter>
|
|
211
211
|
</ClCompile>
|
|
212
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextProvider.cpp">
|
|
213
|
+
<Filter>Source Files\Fabric\Composition</Filter>
|
|
214
|
+
</ClCompile>
|
|
215
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextRangeProvider.cpp">
|
|
216
|
+
<Filter>Source Files\Fabric\Composition</Filter>
|
|
217
|
+
</ClCompile>
|
|
212
218
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.cpp">
|
|
213
219
|
<Filter>Source Files\Fabric\Composition</Filter>
|
|
214
220
|
</ClCompile>
|
|
@@ -330,6 +336,8 @@
|
|
|
330
336
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\TracingAgent.cpp" />
|
|
331
337
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\codegen\rnwcoreJSI-generated.cpp" />
|
|
332
338
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\PerformanceTracer.cpp" />
|
|
339
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextProvider.cpp" />
|
|
340
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextRangeProvider.cpp" />
|
|
333
341
|
</ItemGroup>
|
|
334
342
|
<ItemGroup>
|
|
335
343
|
<Filter Include="Source Files">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.78.
|
|
3
|
+
"version": "0.78.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "^7.0.0",
|
|
25
25
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
26
|
-
"@react-native-community/cli": "15.0.0
|
|
27
|
-
"@react-native-community/cli-platform-android": "15.0.0
|
|
28
|
-
"@react-native-community/cli-platform-ios": "15.0.0
|
|
29
|
-
"@react-native-windows/cli": "0.78.
|
|
26
|
+
"@react-native-community/cli": "^15.0.0",
|
|
27
|
+
"@react-native-community/cli-platform-android": "^15.0.0",
|
|
28
|
+
"@react-native-community/cli-platform-ios": "^15.0.0",
|
|
29
|
+
"@react-native-windows/cli": "0.78.1",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/assets-registry": "0.78.0",
|
|
32
32
|
"@react-native/codegen": "0.78.0",
|