react-native-windows 0.80.0-preview.8 → 0.80.0-preview.9
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/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +21 -156
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +24 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +216 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +17 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/package.json +2 -2
|
@@ -313,161 +313,6 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
|
|
|
313
313
|
return S_OK;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
long GetControlTypeFromString(const std::string &role) noexcept {
|
|
317
|
-
if (role == "adjustable") {
|
|
318
|
-
return UIA_SliderControlTypeId;
|
|
319
|
-
} else if (role == "group" || role == "search" || role == "radiogroup" || role == "timer" || role.empty()) {
|
|
320
|
-
return UIA_GroupControlTypeId;
|
|
321
|
-
} else if (role == "button" || role == "imagebutton" || role == "switch" || role == "togglebutton") {
|
|
322
|
-
return UIA_ButtonControlTypeId;
|
|
323
|
-
} else if (role == "checkbox") {
|
|
324
|
-
return UIA_CheckBoxControlTypeId;
|
|
325
|
-
} else if (role == "combobox") {
|
|
326
|
-
return UIA_ComboBoxControlTypeId;
|
|
327
|
-
} else if (role == "alert" || role == "header" || role == "summary" || role == "text") {
|
|
328
|
-
return UIA_TextControlTypeId;
|
|
329
|
-
} else if (role == "image") {
|
|
330
|
-
return UIA_ImageControlTypeId;
|
|
331
|
-
} else if (role == "keyboardkey") {
|
|
332
|
-
return UIA_CustomControlTypeId;
|
|
333
|
-
} else if (role == "link") {
|
|
334
|
-
return UIA_HyperlinkControlTypeId;
|
|
335
|
-
}
|
|
336
|
-
// list and listitem were added by RNW to better support UIA Control Types
|
|
337
|
-
else if (role == "list") {
|
|
338
|
-
return UIA_ListControlTypeId;
|
|
339
|
-
} else if (role == "listitem") {
|
|
340
|
-
return UIA_ListItemControlTypeId;
|
|
341
|
-
} else if (role == "menu") {
|
|
342
|
-
return UIA_MenuControlTypeId;
|
|
343
|
-
} else if (role == "menubar") {
|
|
344
|
-
return UIA_MenuBarControlTypeId;
|
|
345
|
-
} else if (role == "menuitem") {
|
|
346
|
-
return UIA_MenuItemControlTypeId;
|
|
347
|
-
}
|
|
348
|
-
// If role is "none", remove the element from the control tree
|
|
349
|
-
// and expose it as a plain element would in the raw tree.
|
|
350
|
-
else if (role == "none") {
|
|
351
|
-
return UIA_GroupControlTypeId;
|
|
352
|
-
} else if (role == "progressbar") {
|
|
353
|
-
return UIA_ProgressBarControlTypeId;
|
|
354
|
-
} else if (role == "radio") {
|
|
355
|
-
return UIA_RadioButtonControlTypeId;
|
|
356
|
-
} else if (role == "scrollbar") {
|
|
357
|
-
return UIA_ScrollBarControlTypeId;
|
|
358
|
-
} else if (role == "spinbutton") {
|
|
359
|
-
return UIA_SpinnerControlTypeId;
|
|
360
|
-
} else if (role == "splitbutton") {
|
|
361
|
-
return UIA_SplitButtonControlTypeId;
|
|
362
|
-
} else if (role == "tab") {
|
|
363
|
-
return UIA_TabItemControlTypeId;
|
|
364
|
-
} else if (role == "tablist") {
|
|
365
|
-
return UIA_TabControlTypeId;
|
|
366
|
-
} else if (role == "textinput" || role == "searchbox") {
|
|
367
|
-
return UIA_EditControlTypeId;
|
|
368
|
-
} else if (role == "toolbar") {
|
|
369
|
-
return UIA_ToolBarControlTypeId;
|
|
370
|
-
} else if (role == "tree") {
|
|
371
|
-
return UIA_TreeControlTypeId;
|
|
372
|
-
} else if (role == "treeitem") {
|
|
373
|
-
return UIA_TreeItemControlTypeId;
|
|
374
|
-
} else if (role == "pane") {
|
|
375
|
-
return UIA_PaneControlTypeId;
|
|
376
|
-
}
|
|
377
|
-
assert(false);
|
|
378
|
-
return UIA_GroupControlTypeId;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
long GetControlTypeFromRole(const facebook::react::Role &role) noexcept {
|
|
382
|
-
switch (role) {
|
|
383
|
-
case facebook::react::Role::Alert:
|
|
384
|
-
return UIA_TextControlTypeId;
|
|
385
|
-
case facebook::react::Role::Application:
|
|
386
|
-
return UIA_WindowControlTypeId;
|
|
387
|
-
case facebook::react::Role::Button:
|
|
388
|
-
return UIA_ButtonControlTypeId;
|
|
389
|
-
case facebook::react::Role::Checkbox:
|
|
390
|
-
return UIA_CheckBoxControlTypeId;
|
|
391
|
-
case facebook::react::Role::Columnheader:
|
|
392
|
-
return UIA_HeaderControlTypeId;
|
|
393
|
-
case facebook::react::Role::Combobox:
|
|
394
|
-
return UIA_ComboBoxControlTypeId;
|
|
395
|
-
case facebook::react::Role::Document:
|
|
396
|
-
return UIA_DocumentControlTypeId;
|
|
397
|
-
case facebook::react::Role::Grid:
|
|
398
|
-
return UIA_GroupControlTypeId;
|
|
399
|
-
case facebook::react::Role::Group:
|
|
400
|
-
return UIA_GroupControlTypeId;
|
|
401
|
-
case facebook::react::Role::Heading:
|
|
402
|
-
return UIA_TextControlTypeId;
|
|
403
|
-
case facebook::react::Role::Img:
|
|
404
|
-
return UIA_ImageControlTypeId;
|
|
405
|
-
case facebook::react::Role::Link:
|
|
406
|
-
return UIA_HyperlinkControlTypeId;
|
|
407
|
-
case facebook::react::Role::List:
|
|
408
|
-
return UIA_ListControlTypeId;
|
|
409
|
-
case facebook::react::Role::Listitem:
|
|
410
|
-
return UIA_ListItemControlTypeId;
|
|
411
|
-
case facebook::react::Role::Menu:
|
|
412
|
-
return UIA_MenuControlTypeId;
|
|
413
|
-
case facebook::react::Role::Menubar:
|
|
414
|
-
return UIA_MenuBarControlTypeId;
|
|
415
|
-
case facebook::react::Role::Menuitem:
|
|
416
|
-
return UIA_MenuItemControlTypeId;
|
|
417
|
-
case facebook::react::Role::None:
|
|
418
|
-
return UIA_GroupControlTypeId;
|
|
419
|
-
case facebook::react::Role::Presentation:
|
|
420
|
-
return UIA_GroupControlTypeId;
|
|
421
|
-
case facebook::react::Role::Progressbar:
|
|
422
|
-
return UIA_ProgressBarControlTypeId;
|
|
423
|
-
case facebook::react::Role::Radio:
|
|
424
|
-
return UIA_RadioButtonControlTypeId;
|
|
425
|
-
case facebook::react::Role::Radiogroup:
|
|
426
|
-
return UIA_GroupControlTypeId;
|
|
427
|
-
case facebook::react::Role::Rowgroup:
|
|
428
|
-
return UIA_GroupControlTypeId;
|
|
429
|
-
case facebook::react::Role::Rowheader:
|
|
430
|
-
return UIA_HeaderControlTypeId;
|
|
431
|
-
case facebook::react::Role::Scrollbar:
|
|
432
|
-
return UIA_ScrollBarControlTypeId;
|
|
433
|
-
case facebook::react::Role::Searchbox:
|
|
434
|
-
return UIA_EditControlTypeId;
|
|
435
|
-
case facebook::react::Role::Separator:
|
|
436
|
-
return UIA_SeparatorControlTypeId;
|
|
437
|
-
case facebook::react::Role::Slider:
|
|
438
|
-
return UIA_SliderControlTypeId;
|
|
439
|
-
case facebook::react::Role::Spinbutton:
|
|
440
|
-
return UIA_SpinnerControlTypeId;
|
|
441
|
-
case facebook::react::Role::Status:
|
|
442
|
-
return UIA_StatusBarControlTypeId;
|
|
443
|
-
case facebook::react::Role::Summary:
|
|
444
|
-
return UIA_GroupControlTypeId;
|
|
445
|
-
case facebook::react::Role::Switch:
|
|
446
|
-
return UIA_ButtonControlTypeId;
|
|
447
|
-
case facebook::react::Role::Tab:
|
|
448
|
-
return UIA_TabItemControlTypeId;
|
|
449
|
-
case facebook::react::Role::Table:
|
|
450
|
-
return UIA_TableControlTypeId;
|
|
451
|
-
case facebook::react::Role::Tablist:
|
|
452
|
-
return UIA_TabControlTypeId;
|
|
453
|
-
case facebook::react::Role::Tabpanel:
|
|
454
|
-
return UIA_TabControlTypeId;
|
|
455
|
-
case facebook::react::Role::Timer:
|
|
456
|
-
return UIA_ButtonControlTypeId;
|
|
457
|
-
case facebook::react::Role::Toolbar:
|
|
458
|
-
return UIA_ToolBarControlTypeId;
|
|
459
|
-
case facebook::react::Role::Tooltip:
|
|
460
|
-
return UIA_ToolTipControlTypeId;
|
|
461
|
-
case facebook::react::Role::Tree:
|
|
462
|
-
return UIA_TreeControlTypeId;
|
|
463
|
-
case facebook::react::Role::Treegrid:
|
|
464
|
-
return UIA_TreeControlTypeId;
|
|
465
|
-
case facebook::react::Role::Treeitem:
|
|
466
|
-
return UIA_TreeItemControlTypeId;
|
|
467
|
-
}
|
|
468
|
-
return UIA_GroupControlTypeId;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
316
|
HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERTYID propertyId, VARIANT *pRetVal) {
|
|
472
317
|
if (pRetVal == nullptr)
|
|
473
318
|
return E_POINTER;
|
|
@@ -561,7 +406,18 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
|
|
|
561
406
|
}
|
|
562
407
|
case UIA_IsOffscreenPropertyId: {
|
|
563
408
|
pRetVal->vt = VT_BOOL;
|
|
564
|
-
|
|
409
|
+
|
|
410
|
+
// Check if element is offscreen - consider modal content special case
|
|
411
|
+
bool isOffscreen = (compositionView->getClipState() == ClipState::FullyClipped);
|
|
412
|
+
|
|
413
|
+
// Modal content may appear clipped but is visible in its own window
|
|
414
|
+
if (isOffscreen) {
|
|
415
|
+
if (const auto hwnd = compositionView->GetHwndForParenting()) {
|
|
416
|
+
isOffscreen = !(IsWindowVisible(hwnd) && !IsIconic(hwnd));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
pRetVal->boolVal = isOffscreen ? VARIANT_TRUE : VARIANT_FALSE;
|
|
565
421
|
break;
|
|
566
422
|
}
|
|
567
423
|
case UIA_HelpTextPropertyId: {
|
|
@@ -618,6 +474,11 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
|
|
|
618
474
|
pRetVal->bstrVal = SysAllocString(desc.c_str());
|
|
619
475
|
break;
|
|
620
476
|
}
|
|
477
|
+
case UIA_HeadingLevelPropertyId: {
|
|
478
|
+
pRetVal->vt = VT_I4;
|
|
479
|
+
pRetVal->lVal = GetHeadingLevel(props->accessibilityLevel, props->accessibilityRole, props->role);
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
621
482
|
}
|
|
622
483
|
return hr;
|
|
623
484
|
}
|
|
@@ -1009,7 +870,9 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::Expand() {
|
|
|
1009
870
|
|
|
1010
871
|
if (!strongView)
|
|
1011
872
|
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
873
|
+
|
|
1012
874
|
DispatchAccessibilityAction(m_view, "expand");
|
|
875
|
+
|
|
1013
876
|
return S_OK;
|
|
1014
877
|
}
|
|
1015
878
|
|
|
@@ -1018,7 +881,9 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::Collapse() {
|
|
|
1018
881
|
|
|
1019
882
|
if (!strongView)
|
|
1020
883
|
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
884
|
+
|
|
1021
885
|
DispatchAccessibilityAction(m_view, "collapse");
|
|
886
|
+
|
|
1022
887
|
return S_OK;
|
|
1023
888
|
}
|
|
1024
889
|
|
|
@@ -831,6 +831,30 @@ void ComponentView::updateAccessibilityProps(
|
|
|
831
831
|
oldViewProps.accessibilityValue.text,
|
|
832
832
|
newViewProps.accessibilityValue.text);
|
|
833
833
|
|
|
834
|
+
// Handle annotation properties with single call
|
|
835
|
+
winrt::Microsoft::ReactNative::implementation::UpdateUiaPropertiesForAnnotation(
|
|
836
|
+
EnsureUiaProvider(), oldViewProps.accessibilityAnnotation, newViewProps.accessibilityAnnotation);
|
|
837
|
+
|
|
838
|
+
// Handle expand/collapse state changes
|
|
839
|
+
if (oldViewProps.accessibilityState.has_value() != newViewProps.accessibilityState.has_value() ||
|
|
840
|
+
(oldViewProps.accessibilityState.has_value() && newViewProps.accessibilityState.has_value() &&
|
|
841
|
+
oldViewProps.accessibilityState->expanded != newViewProps.accessibilityState->expanded)) {
|
|
842
|
+
auto oldExpanded =
|
|
843
|
+
oldViewProps.accessibilityState.has_value() && oldViewProps.accessibilityState->expanded.has_value()
|
|
844
|
+
? oldViewProps.accessibilityState->expanded.value()
|
|
845
|
+
: false;
|
|
846
|
+
auto newExpanded =
|
|
847
|
+
newViewProps.accessibilityState.has_value() && newViewProps.accessibilityState->expanded.has_value()
|
|
848
|
+
? newViewProps.accessibilityState->expanded.value()
|
|
849
|
+
: false;
|
|
850
|
+
|
|
851
|
+
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
852
|
+
EnsureUiaProvider(),
|
|
853
|
+
UIA_ExpandCollapseExpandCollapseStatePropertyId,
|
|
854
|
+
static_cast<int>(winrt::Microsoft::ReactNative::implementation::GetExpandCollapseState(oldExpanded)),
|
|
855
|
+
static_cast<int>(winrt::Microsoft::ReactNative::implementation::GetExpandCollapseState(newExpanded)));
|
|
856
|
+
}
|
|
857
|
+
|
|
834
858
|
if ((oldViewProps.accessibilityState.has_value() && oldViewProps.accessibilityState->selected.has_value()) !=
|
|
835
859
|
((newViewProps.accessibilityState.has_value() && newViewProps.accessibilityState->selected.has_value()))) {
|
|
836
860
|
auto compProvider =
|
|
@@ -175,6 +175,15 @@ void UpdateUiaProperty(winrt::IInspectable provider, PROPERTYID propId, int oldV
|
|
|
175
175
|
UiaRaiseAutomationPropertyChangedEvent(spProviderSimple.get(), propId, CComVariant(oldValue), CComVariant(newValue));
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
void UpdateUiaProperty(winrt::IInspectable provider, PROPERTYID propId, long oldValue, long newValue) noexcept {
|
|
179
|
+
auto spProviderSimple = provider.try_as<IRawElementProviderSimple>();
|
|
180
|
+
|
|
181
|
+
if (spProviderSimple == nullptr || oldValue == newValue || !WasUiaPropertyAdvised(spProviderSimple, propId))
|
|
182
|
+
return;
|
|
183
|
+
|
|
184
|
+
UiaRaiseAutomationPropertyChangedEvent(spProviderSimple.get(), propId, CComVariant(oldValue), CComVariant(newValue));
|
|
185
|
+
}
|
|
186
|
+
|
|
178
187
|
void UpdateUiaProperty(
|
|
179
188
|
winrt::IInspectable provider,
|
|
180
189
|
PROPERTYID propId,
|
|
@@ -199,6 +208,29 @@ void UpdateUiaProperty(
|
|
|
199
208
|
UpdateUiaProperty(provider, propId, oldData, newData);
|
|
200
209
|
}
|
|
201
210
|
|
|
211
|
+
void UpdateUiaPropertiesForAnnotation(
|
|
212
|
+
winrt::IInspectable provider,
|
|
213
|
+
const std::optional<facebook::react::AccessibilityAnnotation> &oldAnnotation,
|
|
214
|
+
const std::optional<facebook::react::AccessibilityAnnotation> &newAnnotation) noexcept {
|
|
215
|
+
// if no value fall back to a default value.
|
|
216
|
+
const auto &old_annotation = oldAnnotation.value_or(facebook::react::AccessibilityAnnotation());
|
|
217
|
+
const auto &new_annotation = newAnnotation.value_or(facebook::react::AccessibilityAnnotation());
|
|
218
|
+
|
|
219
|
+
// Update all annotation properties
|
|
220
|
+
UpdateUiaProperty(
|
|
221
|
+
provider,
|
|
222
|
+
UIA_AnnotationAnnotationTypeIdPropertyId,
|
|
223
|
+
GetAnnotationTypeId(old_annotation.typeID),
|
|
224
|
+
GetAnnotationTypeId(new_annotation.typeID));
|
|
225
|
+
|
|
226
|
+
UpdateUiaProperty(
|
|
227
|
+
provider, UIA_AnnotationAnnotationTypeNamePropertyId, old_annotation.typeName, new_annotation.typeName);
|
|
228
|
+
|
|
229
|
+
UpdateUiaProperty(provider, UIA_AnnotationAuthorPropertyId, old_annotation.author, new_annotation.author);
|
|
230
|
+
|
|
231
|
+
UpdateUiaProperty(provider, UIA_AnnotationDateTimePropertyId, old_annotation.dateTime, new_annotation.dateTime);
|
|
232
|
+
}
|
|
233
|
+
|
|
202
234
|
long GetLiveSetting(const std::string &liveRegion) noexcept {
|
|
203
235
|
if (liveRegion == "polite") {
|
|
204
236
|
return LiveSetting::Polite;
|
|
@@ -259,6 +291,190 @@ long GetAnnotationTypeId(const std::string &annotationType) noexcept {
|
|
|
259
291
|
return AnnotationType_Unknown;
|
|
260
292
|
}
|
|
261
293
|
|
|
294
|
+
long GetControlTypeFromString(const std::string &role) noexcept {
|
|
295
|
+
if (role == "adjustable") {
|
|
296
|
+
return UIA_SliderControlTypeId;
|
|
297
|
+
} else if (role == "group" || role == "search" || role == "radiogroup" || role == "timer" || role.empty()) {
|
|
298
|
+
return UIA_GroupControlTypeId;
|
|
299
|
+
} else if (role == "button" || role == "imagebutton" || role == "switch" || role == "togglebutton") {
|
|
300
|
+
return UIA_ButtonControlTypeId;
|
|
301
|
+
} else if (role == "checkbox") {
|
|
302
|
+
return UIA_CheckBoxControlTypeId;
|
|
303
|
+
} else if (role == "combobox") {
|
|
304
|
+
return UIA_ComboBoxControlTypeId;
|
|
305
|
+
} else if (role == "alert" || role == "header" || role == "summary" || role == "text") {
|
|
306
|
+
return UIA_TextControlTypeId;
|
|
307
|
+
} else if (role == "image") {
|
|
308
|
+
return UIA_ImageControlTypeId;
|
|
309
|
+
} else if (role == "keyboardkey") {
|
|
310
|
+
return UIA_CustomControlTypeId;
|
|
311
|
+
} else if (role == "link") {
|
|
312
|
+
return UIA_HyperlinkControlTypeId;
|
|
313
|
+
}
|
|
314
|
+
// list and listitem were added by RNW to better support UIA Control Types
|
|
315
|
+
else if (role == "list") {
|
|
316
|
+
return UIA_ListControlTypeId;
|
|
317
|
+
} else if (role == "listitem") {
|
|
318
|
+
return UIA_ListItemControlTypeId;
|
|
319
|
+
} else if (role == "menu") {
|
|
320
|
+
return UIA_MenuControlTypeId;
|
|
321
|
+
} else if (role == "menubar") {
|
|
322
|
+
return UIA_MenuBarControlTypeId;
|
|
323
|
+
} else if (role == "menuitem") {
|
|
324
|
+
return UIA_MenuItemControlTypeId;
|
|
325
|
+
}
|
|
326
|
+
// If role is "none", remove the element from the control tree
|
|
327
|
+
// and expose it as a plain element would in the raw tree.
|
|
328
|
+
else if (role == "none") {
|
|
329
|
+
return UIA_GroupControlTypeId;
|
|
330
|
+
} else if (role == "progressbar") {
|
|
331
|
+
return UIA_ProgressBarControlTypeId;
|
|
332
|
+
} else if (role == "radio") {
|
|
333
|
+
return UIA_RadioButtonControlTypeId;
|
|
334
|
+
} else if (role == "scrollbar") {
|
|
335
|
+
return UIA_ScrollBarControlTypeId;
|
|
336
|
+
} else if (role == "spinbutton") {
|
|
337
|
+
return UIA_SpinnerControlTypeId;
|
|
338
|
+
} else if (role == "splitbutton") {
|
|
339
|
+
return UIA_SplitButtonControlTypeId;
|
|
340
|
+
} else if (role == "tab") {
|
|
341
|
+
return UIA_TabItemControlTypeId;
|
|
342
|
+
} else if (role == "tablist") {
|
|
343
|
+
return UIA_TabControlTypeId;
|
|
344
|
+
} else if (role == "textinput" || role == "searchbox") {
|
|
345
|
+
return UIA_EditControlTypeId;
|
|
346
|
+
} else if (role == "toolbar") {
|
|
347
|
+
return UIA_ToolBarControlTypeId;
|
|
348
|
+
} else if (role == "tree") {
|
|
349
|
+
return UIA_TreeControlTypeId;
|
|
350
|
+
} else if (role == "treeitem") {
|
|
351
|
+
return UIA_TreeItemControlTypeId;
|
|
352
|
+
} else if (role == "pane") {
|
|
353
|
+
return UIA_PaneControlTypeId;
|
|
354
|
+
}
|
|
355
|
+
assert(false);
|
|
356
|
+
return UIA_GroupControlTypeId;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
long GetControlTypeFromRole(const facebook::react::Role &role) noexcept {
|
|
360
|
+
switch (role) {
|
|
361
|
+
case facebook::react::Role::Alert:
|
|
362
|
+
return UIA_TextControlTypeId;
|
|
363
|
+
case facebook::react::Role::Application:
|
|
364
|
+
return UIA_WindowControlTypeId;
|
|
365
|
+
case facebook::react::Role::Button:
|
|
366
|
+
return UIA_ButtonControlTypeId;
|
|
367
|
+
case facebook::react::Role::Checkbox:
|
|
368
|
+
return UIA_CheckBoxControlTypeId;
|
|
369
|
+
case facebook::react::Role::Columnheader:
|
|
370
|
+
return UIA_HeaderControlTypeId;
|
|
371
|
+
case facebook::react::Role::Combobox:
|
|
372
|
+
return UIA_ComboBoxControlTypeId;
|
|
373
|
+
case facebook::react::Role::Document:
|
|
374
|
+
return UIA_DocumentControlTypeId;
|
|
375
|
+
case facebook::react::Role::Grid:
|
|
376
|
+
return UIA_GroupControlTypeId;
|
|
377
|
+
case facebook::react::Role::Group:
|
|
378
|
+
return UIA_GroupControlTypeId;
|
|
379
|
+
case facebook::react::Role::Heading:
|
|
380
|
+
return UIA_TextControlTypeId;
|
|
381
|
+
case facebook::react::Role::Img:
|
|
382
|
+
return UIA_ImageControlTypeId;
|
|
383
|
+
case facebook::react::Role::Link:
|
|
384
|
+
return UIA_HyperlinkControlTypeId;
|
|
385
|
+
case facebook::react::Role::List:
|
|
386
|
+
return UIA_ListControlTypeId;
|
|
387
|
+
case facebook::react::Role::Listitem:
|
|
388
|
+
return UIA_ListItemControlTypeId;
|
|
389
|
+
case facebook::react::Role::Menu:
|
|
390
|
+
return UIA_MenuControlTypeId;
|
|
391
|
+
case facebook::react::Role::Menubar:
|
|
392
|
+
return UIA_MenuBarControlTypeId;
|
|
393
|
+
case facebook::react::Role::Menuitem:
|
|
394
|
+
return UIA_MenuItemControlTypeId;
|
|
395
|
+
case facebook::react::Role::None:
|
|
396
|
+
return UIA_GroupControlTypeId;
|
|
397
|
+
case facebook::react::Role::Presentation:
|
|
398
|
+
return UIA_GroupControlTypeId;
|
|
399
|
+
case facebook::react::Role::Progressbar:
|
|
400
|
+
return UIA_ProgressBarControlTypeId;
|
|
401
|
+
case facebook::react::Role::Radio:
|
|
402
|
+
return UIA_RadioButtonControlTypeId;
|
|
403
|
+
case facebook::react::Role::Radiogroup:
|
|
404
|
+
return UIA_GroupControlTypeId;
|
|
405
|
+
case facebook::react::Role::Rowgroup:
|
|
406
|
+
return UIA_GroupControlTypeId;
|
|
407
|
+
case facebook::react::Role::Rowheader:
|
|
408
|
+
return UIA_HeaderControlTypeId;
|
|
409
|
+
case facebook::react::Role::Scrollbar:
|
|
410
|
+
return UIA_ScrollBarControlTypeId;
|
|
411
|
+
case facebook::react::Role::Searchbox:
|
|
412
|
+
return UIA_EditControlTypeId;
|
|
413
|
+
case facebook::react::Role::Separator:
|
|
414
|
+
return UIA_SeparatorControlTypeId;
|
|
415
|
+
case facebook::react::Role::Slider:
|
|
416
|
+
return UIA_SliderControlTypeId;
|
|
417
|
+
case facebook::react::Role::Spinbutton:
|
|
418
|
+
return UIA_SpinnerControlTypeId;
|
|
419
|
+
case facebook::react::Role::Status:
|
|
420
|
+
return UIA_StatusBarControlTypeId;
|
|
421
|
+
case facebook::react::Role::Summary:
|
|
422
|
+
return UIA_GroupControlTypeId;
|
|
423
|
+
case facebook::react::Role::Switch:
|
|
424
|
+
return UIA_ButtonControlTypeId;
|
|
425
|
+
case facebook::react::Role::Tab:
|
|
426
|
+
return UIA_TabItemControlTypeId;
|
|
427
|
+
case facebook::react::Role::Table:
|
|
428
|
+
return UIA_TableControlTypeId;
|
|
429
|
+
case facebook::react::Role::Tablist:
|
|
430
|
+
return UIA_TabControlTypeId;
|
|
431
|
+
case facebook::react::Role::Tabpanel:
|
|
432
|
+
return UIA_TabControlTypeId;
|
|
433
|
+
case facebook::react::Role::Timer:
|
|
434
|
+
return UIA_ButtonControlTypeId;
|
|
435
|
+
case facebook::react::Role::Toolbar:
|
|
436
|
+
return UIA_ToolBarControlTypeId;
|
|
437
|
+
case facebook::react::Role::Tooltip:
|
|
438
|
+
return UIA_ToolTipControlTypeId;
|
|
439
|
+
case facebook::react::Role::Tree:
|
|
440
|
+
return UIA_TreeControlTypeId;
|
|
441
|
+
case facebook::react::Role::Treegrid:
|
|
442
|
+
return UIA_TreeControlTypeId;
|
|
443
|
+
case facebook::react::Role::Treeitem:
|
|
444
|
+
return UIA_TreeItemControlTypeId;
|
|
445
|
+
}
|
|
446
|
+
return UIA_GroupControlTypeId;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
long GetHeadingLevel(int headingLevel, const std::string &strRole, const facebook::react::Role &role) noexcept {
|
|
450
|
+
if (strRole != "header" && role != facebook::react::Role::Heading) {
|
|
451
|
+
return HeadingLevel_None;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
switch (headingLevel) {
|
|
455
|
+
case 1:
|
|
456
|
+
return HeadingLevel1;
|
|
457
|
+
case 2:
|
|
458
|
+
return HeadingLevel2;
|
|
459
|
+
case 3:
|
|
460
|
+
return HeadingLevel3;
|
|
461
|
+
case 4:
|
|
462
|
+
return HeadingLevel4;
|
|
463
|
+
case 5:
|
|
464
|
+
return HeadingLevel5;
|
|
465
|
+
case 6:
|
|
466
|
+
return HeadingLevel6;
|
|
467
|
+
case 7:
|
|
468
|
+
return HeadingLevel7;
|
|
469
|
+
case 8:
|
|
470
|
+
return HeadingLevel8;
|
|
471
|
+
case 9:
|
|
472
|
+
return HeadingLevel9;
|
|
473
|
+
default:
|
|
474
|
+
return HeadingLevel_None;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
262
478
|
bool accessibilityAnnotationHasValue(
|
|
263
479
|
const std::optional<facebook::react::AccessibilityAnnotation> &annotation) noexcept {
|
|
264
480
|
return annotation.has_value() &&
|
|
@@ -35,6 +35,12 @@ void UpdateUiaProperty(
|
|
|
35
35
|
int oldValue,
|
|
36
36
|
int newValue) noexcept;
|
|
37
37
|
|
|
38
|
+
void UpdateUiaProperty(
|
|
39
|
+
winrt::Windows::Foundation::IInspectable provider,
|
|
40
|
+
PROPERTYID propId,
|
|
41
|
+
long oldValue,
|
|
42
|
+
long newValue) noexcept;
|
|
43
|
+
|
|
38
44
|
void UpdateUiaProperty(
|
|
39
45
|
winrt::Windows::Foundation::IInspectable provider,
|
|
40
46
|
PROPERTYID propId,
|
|
@@ -47,10 +53,21 @@ void UpdateUiaProperty(
|
|
|
47
53
|
const std::optional<std::string> &oldValue,
|
|
48
54
|
const std::optional<std::string> &newValue) noexcept;
|
|
49
55
|
|
|
56
|
+
void UpdateUiaPropertiesForAnnotation(
|
|
57
|
+
winrt::Windows::Foundation::IInspectable provider,
|
|
58
|
+
const std::optional<facebook::react::AccessibilityAnnotation> &oldAnnotation,
|
|
59
|
+
const std::optional<facebook::react::AccessibilityAnnotation> &newAnnotation) noexcept;
|
|
60
|
+
|
|
50
61
|
long GetLiveSetting(const std::string &liveRegion) noexcept;
|
|
51
62
|
|
|
52
63
|
long GetAnnotationTypeId(const std::string &annotationType) noexcept;
|
|
53
64
|
|
|
65
|
+
long GetControlTypeFromRole(const facebook::react::Role &role) noexcept;
|
|
66
|
+
|
|
67
|
+
long GetControlTypeFromString(const std::string &role) noexcept;
|
|
68
|
+
|
|
69
|
+
long GetHeadingLevel(int headingLevel, const std::string &strRole, const facebook::react::Role &role) noexcept;
|
|
70
|
+
|
|
54
71
|
bool accessibilityAnnotationHasValue(
|
|
55
72
|
const std::optional<facebook::react::AccessibilityAnnotation> &annotation) noexcept;
|
|
56
73
|
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.80.0-preview.
|
|
13
|
+
<ReactNativeWindowsVersion>0.80.0-preview.9</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>80</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>1b026c07b5e6f8a4ce73164aed620e4199567f22</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.80.0-preview.
|
|
3
|
+
"version": "0.80.0-preview.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "17.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "17.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "17.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.80.0-preview.
|
|
29
|
+
"@react-native-windows/cli": "0.80.0-preview.7",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/assets-registry": "0.80.0",
|
|
32
32
|
"@react-native/codegen": "0.80.0",
|