react-native-windows 0.74.22 → 0.74.24

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.
Files changed (46) hide show
  1. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -1
  2. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +4 -1
  3. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +1 -1
  4. package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +7 -0
  5. package/Microsoft.ReactNative/Fabric/AbiViewProps.h +2 -0
  6. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +11 -4
  7. package/Microsoft.ReactNative/Fabric/ComponentView.h +3 -2
  8. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp +926 -0
  9. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.h +76 -0
  10. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +31 -13
  11. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +27 -3
  12. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +3 -1
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +193 -892
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +17 -22
  15. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +1 -1
  16. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +129 -122
  17. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +14 -8
  18. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +34 -20
  19. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +5 -3
  20. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +40 -2
  21. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +9 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +31 -3
  23. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +8 -8
  24. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +31 -1
  25. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -0
  26. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +9 -3
  27. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +11 -0
  28. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
  29. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
  30. package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +1 -1
  31. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +25 -129
  32. package/Microsoft.ReactNative/ReactNativeAppBuilder.h +5 -13
  33. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +13 -34
  34. package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -2
  35. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +129 -18
  36. package/Microsoft.ReactNative/ReactNativeWin32App.h +14 -5
  37. package/Microsoft.ReactNative/ViewProps.idl +2 -0
  38. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  39. package/Shared/Shared.vcxitems +3 -10
  40. package/Shared/Shared.vcxitems.filters +1 -0
  41. package/package.json +3 -3
  42. package/templates/cpp-app/template.config.js +1 -1
  43. package/templates/cpp-app/windows/MyApp/MyApp.cpp +46 -130
  44. package/templates/cpp-lib/template.config.js +1 -1
  45. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +0 -59
  46. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +0 -23
@@ -22,8 +22,9 @@ namespace Microsoft.ReactNative.Composition
22
22
  NativeBorder = 0x00000001,
23
23
  ShadowProps = 0x00000002,
24
24
  Background = 0x00000004,
25
+ FocusVisual = 0x00000008,
25
26
 
26
- Default = 0x00000007, // ShadowProps | NativeBorder | Background
27
+ Default = 0x0000000F, // ShadowProps | NativeBorder | Background | FocusVisual
27
28
  };
28
29
 
29
30
  namespace Experimental {
@@ -106,7 +106,10 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps(
106
106
  rawProps);
107
107
  auto userProps =
108
108
  winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
109
- ->CreateProps(nullptr);
109
+ ->CreateProps(
110
+ nullptr,
111
+ props ? static_cast<winrt::Microsoft::ReactNative::implementation::AbiProps const &>(*props).UserProps()
112
+ : nullptr);
110
113
  shadowNodeProps->SetUserProps(userProps);
111
114
 
112
115
  rawProps.iterateOverValues(
@@ -103,7 +103,7 @@ facebook::react::Props::Shared AbiViewComponentDescriptor::cloneProps(
103
103
  winrt::make<winrt::Microsoft::ReactNative::implementation::ViewProps>(shadowNodeProps, false /*holdRef*/);
104
104
  auto userProps =
105
105
  winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
106
- ->CreateProps(viewProps);
106
+ ->CreateProps(viewProps, props ? static_cast<AbiViewProps const &>(*props).UserProps() : nullptr);
107
107
  shadowNodeProps->SetUserProps(userProps, viewProps);
108
108
 
109
109
  rawProps.iterateOverValues(
@@ -65,6 +65,13 @@ winrt::Microsoft::ReactNative::Composition::Experimental::IBrush Color::AsIntern
65
65
  return winrt::get_self<winrt::Microsoft::ReactNative::Composition::implementation::Theme>(theme)->Brush(*m_color);
66
66
  }
67
67
 
68
+ bool Color::Equals(const winrt::Microsoft::ReactNative::Color &color) const noexcept {
69
+ if (!color) {
70
+ return false;
71
+ }
72
+ return m_color == winrt::get_self<Color>(color)->m_color;
73
+ }
74
+
68
75
  winrt::Microsoft::ReactNative::Color Color::ReadValue(
69
76
  const winrt::Microsoft::ReactNative::IJSValueReader &reader) noexcept {
70
77
  switch (reader.ValueType()) {
@@ -50,6 +50,8 @@ struct Color : ColorT<Color, Composition::Experimental::IInternalColor> {
50
50
  winrt::Microsoft::ReactNative::Composition::Experimental::IBrush AsInternalBrush(
51
51
  const winrt::Microsoft::ReactNative::Composition::Theme theme) noexcept;
52
52
 
53
+ bool Equals(const winrt::Microsoft::ReactNative::Color &color) const noexcept;
54
+
53
55
  static winrt::Microsoft::ReactNative::Color ReadValue(
54
56
  const winrt::Microsoft::ReactNative::IJSValueReader &reader) noexcept;
55
57
  static void WriteValue(
@@ -73,6 +73,10 @@ void ComponentView::onMounted() noexcept {
73
73
  m_mountedEvent(*this, *this);
74
74
  }
75
75
 
76
+ bool ComponentView::isMounted() noexcept {
77
+ return m_mounted;
78
+ }
79
+
76
80
  winrt::event_token ComponentView::Mounted(
77
81
  winrt::Windows::Foundation::EventHandler<winrt::Microsoft::ReactNative::ComponentView> const &handler) noexcept {
78
82
  return m_mountedEvent.add(handler);
@@ -342,10 +346,13 @@ bool ComponentView::runOnChildren(
342
346
  return true;
343
347
  }
344
348
  } else {
345
- // TODO is this conversion from rend correct?
346
- for (auto it = m_children.end(); it != m_children.begin(); --it) {
347
- if (fn(*winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(*it)))
348
- return true;
349
+ if (m_children.Size()) {
350
+ auto it = m_children.end();
351
+ do {
352
+ it--;
353
+ if (fn(*winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(*it)))
354
+ return true;
355
+ } while (it != m_children.begin());
349
356
  }
350
357
  }
351
358
  return false;
@@ -37,11 +37,11 @@ struct BringIntoViewOptions {
37
37
  bool AnimationDesired{false};
38
38
  // NaN will bring the element fully into view aligned to the nearest edge of the viewport
39
39
  float HorizontalAlignmentRatio{std::numeric_limits<float>::quiet_NaN()};
40
- float HorizontalOffset{0};
40
+ float HorizontalOffset{20};
41
41
  std::optional<facebook::react::Rect> TargetRect;
42
42
  // NaN will bring the element fully into view aligned to the nearest edge of the viewport
43
43
  float VerticalAlignmentRatio{std::numeric_limits<float>::quiet_NaN()};
44
- float VerticalOffset{0};
44
+ float VerticalOffset{20};
45
45
  };
46
46
 
47
47
  struct LayoutMetricsChangedArgs : public LayoutMetricsChangedArgsT<LayoutMetricsChangedArgs> {
@@ -113,6 +113,7 @@ struct ComponentView : public ComponentViewT<ComponentView> {
113
113
  virtual void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
114
114
  void MarkAsCustomComponent() noexcept;
115
115
  virtual void onMounted() noexcept;
116
+ bool isMounted() noexcept;
116
117
  virtual void onUnmounted() noexcept;
117
118
  void onDestroying() noexcept;
118
119