react-native-windows 0.74.37 → 0.74.38

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.
@@ -260,7 +260,7 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
260
260
  return S_OK;
261
261
  }
262
262
 
263
- long GetControlType(const std::string &role) noexcept {
263
+ long GetControlTypeFromString(const std::string &role) noexcept {
264
264
  if (role == "adjustable") {
265
265
  return UIA_SliderControlTypeId;
266
266
  } else if (role == "group" || role == "search" || role == "radiogroup" || role == "timer" || role.empty()) {
@@ -323,6 +323,96 @@ long GetControlType(const std::string &role) noexcept {
323
323
  return UIA_GroupControlTypeId;
324
324
  }
325
325
 
326
+ long GetControlTypeFromRole(const facebook::react::Role &role) noexcept {
327
+ switch (role) {
328
+ case facebook::react::Role::Alert:
329
+ return UIA_TextControlTypeId;
330
+ case facebook::react::Role::Application:
331
+ return UIA_WindowControlTypeId;
332
+ case facebook::react::Role::Button:
333
+ return UIA_ButtonControlTypeId;
334
+ case facebook::react::Role::Checkbox:
335
+ return UIA_CheckBoxControlTypeId;
336
+ case facebook::react::Role::Columnheader:
337
+ return UIA_HeaderControlTypeId;
338
+ case facebook::react::Role::Combobox:
339
+ return UIA_ComboBoxControlTypeId;
340
+ case facebook::react::Role::Document:
341
+ return UIA_DocumentControlTypeId;
342
+ case facebook::react::Role::Grid:
343
+ return UIA_GroupControlTypeId;
344
+ case facebook::react::Role::Group:
345
+ return UIA_GroupControlTypeId;
346
+ case facebook::react::Role::Heading:
347
+ return UIA_TextControlTypeId;
348
+ case facebook::react::Role::Img:
349
+ return UIA_ImageControlTypeId;
350
+ case facebook::react::Role::Link:
351
+ return UIA_HyperlinkControlTypeId;
352
+ case facebook::react::Role::List:
353
+ return UIA_ListControlTypeId;
354
+ case facebook::react::Role::Listitem:
355
+ return UIA_ListItemControlTypeId;
356
+ case facebook::react::Role::Menu:
357
+ return UIA_MenuControlTypeId;
358
+ case facebook::react::Role::Menubar:
359
+ return UIA_MenuBarControlTypeId;
360
+ case facebook::react::Role::Menuitem:
361
+ return UIA_MenuItemControlTypeId;
362
+ case facebook::react::Role::None:
363
+ return UIA_GroupControlTypeId;
364
+ case facebook::react::Role::Presentation:
365
+ return UIA_GroupControlTypeId;
366
+ case facebook::react::Role::Progressbar:
367
+ return UIA_ProgressBarControlTypeId;
368
+ case facebook::react::Role::Radio:
369
+ return UIA_RadioButtonControlTypeId;
370
+ case facebook::react::Role::Radiogroup:
371
+ return UIA_GroupControlTypeId;
372
+ case facebook::react::Role::Rowgroup:
373
+ return UIA_GroupControlTypeId;
374
+ case facebook::react::Role::Rowheader:
375
+ return UIA_HeaderControlTypeId;
376
+ case facebook::react::Role::Scrollbar:
377
+ return UIA_ScrollBarControlTypeId;
378
+ case facebook::react::Role::Searchbox:
379
+ return UIA_EditControlTypeId;
380
+ case facebook::react::Role::Separator:
381
+ return UIA_SeparatorControlTypeId;
382
+ case facebook::react::Role::Slider:
383
+ return UIA_SliderControlTypeId;
384
+ case facebook::react::Role::Spinbutton:
385
+ return UIA_SpinnerControlTypeId;
386
+ case facebook::react::Role::Status:
387
+ return UIA_StatusBarControlTypeId;
388
+ case facebook::react::Role::Summary:
389
+ return UIA_GroupControlTypeId;
390
+ case facebook::react::Role::Switch:
391
+ return UIA_ButtonControlTypeId;
392
+ case facebook::react::Role::Tab:
393
+ return UIA_TabItemControlTypeId;
394
+ case facebook::react::Role::Table:
395
+ return UIA_TableControlTypeId;
396
+ case facebook::react::Role::Tablist:
397
+ return UIA_TabControlTypeId;
398
+ case facebook::react::Role::Tabpanel:
399
+ return UIA_TabControlTypeId;
400
+ case facebook::react::Role::Timer:
401
+ return UIA_ButtonControlTypeId;
402
+ case facebook::react::Role::Toolbar:
403
+ return UIA_ToolBarControlTypeId;
404
+ case facebook::react::Role::Tooltip:
405
+ return UIA_ToolTipControlTypeId;
406
+ case facebook::react::Role::Tree:
407
+ return UIA_TreeControlTypeId;
408
+ case facebook::react::Role::Treegrid:
409
+ return UIA_TreeControlTypeId;
410
+ case facebook::react::Role::Treeitem:
411
+ return UIA_TreeItemControlTypeId;
412
+ }
413
+ return UIA_GroupControlTypeId;
414
+ }
415
+
326
416
  HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERTYID propertyId, VARIANT *pRetVal) {
327
417
  if (pRetVal == nullptr)
328
418
  return E_POINTER;
@@ -348,8 +438,10 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
348
438
  switch (propertyId) {
349
439
  case UIA_ControlTypePropertyId: {
350
440
  pRetVal->vt = VT_I4;
351
- auto role = props->accessibilityRole.empty() ? compositionView->DefaultControlType() : props->accessibilityRole;
352
- pRetVal->lVal = GetControlType(role);
441
+ pRetVal->lVal = props->role == facebook::react::Role::None ? props->accessibilityRole.empty()
442
+ ? GetControlTypeFromString(compositionView->DefaultControlType())
443
+ : GetControlTypeFromString(props->accessibilityRole)
444
+ : GetControlTypeFromRole(props->role);
353
445
  break;
354
446
  }
355
447
  case UIA_AutomationIdPropertyId: {
@@ -389,12 +481,18 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
389
481
  }
390
482
  case UIA_IsContentElementPropertyId: {
391
483
  pRetVal->vt = VT_BOOL;
392
- pRetVal->boolVal = (props->accessible && props->accessibilityRole != "none") ? VARIANT_TRUE : VARIANT_FALSE;
484
+ pRetVal->boolVal =
485
+ (props->accessible && (props->accessibilityRole != "none" || props->role != facebook::react::Role::None))
486
+ ? VARIANT_TRUE
487
+ : VARIANT_FALSE;
393
488
  break;
394
489
  }
395
490
  case UIA_IsControlElementPropertyId: {
396
491
  pRetVal->vt = VT_BOOL;
397
- pRetVal->boolVal = (props->accessible && props->accessibilityRole != "none") ? VARIANT_TRUE : VARIANT_FALSE;
492
+ pRetVal->boolVal =
493
+ (props->accessible && (props->accessibilityRole != "none" || props->role != facebook::react::Role::None))
494
+ ? VARIANT_TRUE
495
+ : VARIANT_FALSE;
398
496
  break;
399
497
  }
400
498
  case UIA_IsOffscreenPropertyId: {
@@ -541,7 +639,6 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::get_IsReadOnly(BOOL *pRe
541
639
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(strongView)->props());
542
640
  if (props == nullptr)
543
641
  return UIA_E_ELEMENTNOTAVAILABLE;
544
- auto accessibilityRole = props->accessibilityRole;
545
642
  if (props->accessibilityState.has_value() && props->accessibilityState->readOnly.has_value()) {
546
643
  *pRetVal = props->accessibilityState->readOnly.value();
547
644
  } else {
@@ -197,6 +197,20 @@ void CompositionEventHandler::Initialize() noexcept {
197
197
  }
198
198
  });
199
199
 
200
+ m_pointerExitedToken = pointerSource.PointerExited([wkThis = weak_from_this()](
201
+ winrt::Microsoft::UI::Input::InputPointerSource const &,
202
+ winrt::Microsoft::UI::Input::PointerEventArgs const &args) {
203
+ if (auto strongThis = wkThis.lock()) {
204
+ if (auto strongRootView = strongThis->m_wkRootView.get()) {
205
+ if (strongThis->SurfaceId() == -1)
206
+ return;
207
+ auto pp = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::PointerPoint>(
208
+ args.CurrentPoint(), strongRootView.ScaleFactor());
209
+ strongThis->onPointerExited(pp, args.KeyModifiers());
210
+ }
211
+ }
212
+ });
213
+
200
214
  m_pointerCaptureLostToken =
201
215
  pointerSource.PointerCaptureLost([wkThis = weak_from_this()](
202
216
  winrt::Microsoft::UI::Input::InputPointerSource const &,
@@ -1068,6 +1082,34 @@ void CompositionEventHandler::onPointerMoved(
1068
1082
  }
1069
1083
  }
1070
1084
 
1085
+ void CompositionEventHandler::onPointerExited(
1086
+ const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
1087
+ winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept {
1088
+ if (SurfaceId() == -1)
1089
+ return;
1090
+
1091
+ int pointerId = pointerPoint.PointerId();
1092
+ auto position = pointerPoint.Position();
1093
+
1094
+ if (std::shared_ptr<FabricUIManager> fabricuiManager =
1095
+ ::Microsoft::ReactNative::FabricUIManager::FromProperties(m_context.Properties())) {
1096
+ facebook::react::Tag tag = -1;
1097
+ facebook::react::Point ptLocal, ptScaled;
1098
+ getTargetPointerArgs(fabricuiManager, pointerPoint, tag, ptScaled, ptLocal);
1099
+
1100
+ tag = -1;
1101
+
1102
+ auto args = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::PointerRoutedEventArgs>(
1103
+ m_context, tag, pointerPoint, keyModifiers);
1104
+
1105
+ facebook::react::PointerEvent pointerEvent = CreatePointerEventFromIncompleteHoverData(ptScaled, ptLocal);
1106
+
1107
+ auto handler = [](std::vector<winrt::Microsoft::ReactNative::ComponentView> &eventPathViews) {};
1108
+
1109
+ HandleIncomingPointerEvent(pointerEvent, nullptr, pointerPoint, keyModifiers, handler);
1110
+ }
1111
+ }
1112
+
1071
1113
  void CompositionEventHandler::onPointerPressed(
1072
1114
  const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
1073
1115
  winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept {
@@ -57,6 +57,9 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
57
57
  void onPointerMoved(
58
58
  const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
59
59
  winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
60
+ void onPointerExited(
61
+ const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
62
+ winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
60
63
  void onPointerWheelChanged(
61
64
  const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
62
65
  winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
@@ -169,6 +172,7 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
169
172
  winrt::event_token m_pointerMovedToken;
170
173
  winrt::event_token m_pointerWheelChangedToken;
171
174
  winrt::event_token m_pointerCaptureLostToken;
175
+ winrt::event_token m_pointerExitedToken;
172
176
  winrt::event_token m_keyDownToken;
173
177
  winrt::event_token m_keyUpToken;
174
178
  winrt::event_token m_characterReceivedToken;
@@ -972,10 +972,10 @@ ReactNativeIsland::GetComponentView() noexcept {
972
972
 
973
973
  if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
974
974
  winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) {
975
- auto rootComponentViewDescriptor = fabricuiManager->GetViewRegistry().componentViewDescriptorWithTag(
976
- static_cast<facebook::react::SurfaceId>(m_rootTag));
977
- return rootComponentViewDescriptor.view
978
- .as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
975
+ if (auto view = fabricuiManager->GetViewRegistry().findComponentViewWithTag(
976
+ static_cast<facebook::react::SurfaceId>(m_rootTag))) {
977
+ return view.as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
978
+ }
979
979
  }
980
980
  return nullptr;
981
981
  }
@@ -38,7 +38,9 @@ struct Color {
38
38
  };
39
39
 
40
40
  namespace HostPlatformColor {
41
- static const facebook::react::Color UndefinedColor{{0, 0, 0, 0} /*Black*/, {} /*Empty PlatformColors*/};
41
+ static const facebook::react::Color UndefinedColor{
42
+ {0, 0, 0, 0} /*Black*/,
43
+ {"__undefinedColor"} /*Empty PlatformColors*/};
42
44
  } // namespace HostPlatformColor
43
45
 
44
46
  inline Color hostPlatformColorFromComponents(ColorComponents components) {
@@ -16,7 +16,7 @@
16
16
  <TurboModule_SourcePath Condition="'$(TurboModule_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\react\nativemodule\core</TurboModule_SourcePath>
17
17
  <TurboModule_SourcePath Condition="'$(TurboModule_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)ReactCommon\TurboModule.h')">$(MSBuildThisFileDirectory)</TurboModule_SourcePath>
18
18
  <Bridging_SourcePath Condition="'$(Bridging_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\react\bridging</Bridging_SourcePath>
19
- <Bridging_SourcePath Condition="'$(Bridging_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)ReactCommon\CallbackWrapper.h')">$(MSBuildThisFileDirectory)ReactCommon</Bridging_SourcePath>
19
+ <Bridging_SourcePath Condition="'$(Bridging_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)react\bridging\CallbackWrapper.h')">$(MSBuildThisFileDirectory)react\bridging</Bridging_SourcePath>
20
20
 
21
21
  <NodeApiJsiCommitHash>83cfef428a97627c9185c73da097e42742de56eb</NodeApiJsiCommitHash>
22
22
  <NodeApiJsiLocal Condition="Exists('$(MSBuildThisFileDirectory)NodeApiJsiRuntime.cpp')">true</NodeApiJsiLocal>
@@ -58,7 +58,7 @@
58
58
  <ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\CallInvoker.h" />
59
59
  <ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\SchedulerPriority.h" />
60
60
  <ClInclude Include="$(MSBuildThisFileDirectory)XamlUtils.h" />
61
- <ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\LongLivedObject.h" />
61
+ <ClInclude Include="$(Bridging_SourcePath)\LongLivedObject.h" />
62
62
  <ClInclude Include="$(Bridging_SourcePath)\CallbackWrapper.h" />
63
63
  <ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\TurboModule.h" />
64
64
  <ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\TurboModuleUtils.h" />
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.74.37</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.74.38</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>37</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>38</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>4ad063f22757b42a70478b2c145520e621fd2bf5</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>0438560b807679d6b74c3410fe2b9502300256ba</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -77,11 +77,25 @@ Copy-Item -Force -Path $NodeApiJsiRoot\src\NodeApiJsiRuntime.h -Destination $Tar
77
77
 
78
78
  # Microsoft.ReactNative.CXX project TurboModule files
79
79
  New-Item -ItemType Directory -Path $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon -Force
80
+ New-Item -ItemType Directory -Path $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging -Force
80
81
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\callinvoker\ReactCommon\CallInvoker.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
81
82
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\callinvoker\ReactCommon\SchedulerPriority.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
82
- Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\CallbackWrapper.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
83
- Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\LongLivedObject.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
84
- Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\LongLivedObject.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
83
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Array.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
84
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\AString.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
85
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Base.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
86
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Bool.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
87
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Bridging.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
88
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\CallbackWrapper.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
89
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Class.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
90
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Convert.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
91
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Error.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
92
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Function.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
93
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\LongLivedObject.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
94
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\LongLivedObject.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
95
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Number.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
96
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Object.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
97
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Promise.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
98
+ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Value.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
85
99
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
86
100
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
87
101
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleUtils.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.74.37",
3
+ "version": "0.74.38",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",