react-native-windows 0.75.8 → 0.75.10

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 (49) 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 +19 -4
  7. package/Microsoft.ReactNative/Fabric/ComponentView.h +8 -3
  8. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp +931 -0
  9. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.h +80 -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/CompositionRootAutomationProvider.cpp +8 -32
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +302 -895
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +26 -26
  16. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +1 -1
  17. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +130 -122
  18. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +14 -8
  19. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +34 -20
  20. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +5 -3
  21. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +63 -2
  22. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -0
  23. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +51 -3
  24. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +3 -0
  25. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -8
  26. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +3 -0
  27. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +46 -4
  28. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +5 -0
  29. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +9 -3
  30. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +11 -0
  31. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
  32. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -1
  33. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
  34. package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +1 -1
  35. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +25 -129
  36. package/Microsoft.ReactNative/ReactNativeAppBuilder.h +5 -13
  37. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +13 -34
  38. package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -2
  39. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +129 -18
  40. package/Microsoft.ReactNative/ReactNativeWin32App.h +14 -5
  41. package/Microsoft.ReactNative/ViewProps.idl +2 -0
  42. package/Microsoft.ReactNative.Cxx/ComponentView.Experimental.interop.h +14 -0
  43. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  44. package/Shared/Shared.vcxitems +3 -10
  45. package/Shared/Shared.vcxitems.filters +1 -0
  46. package/package.json +4 -4
  47. package/templates/cpp-app/windows/MyApp/MyApp.cpp +46 -130
  48. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +0 -59
  49. 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;
@@ -356,6 +363,14 @@ RECT ComponentView::getClientRect() const noexcept {
356
363
  return {};
357
364
  }
358
365
 
366
+ winrt::Windows::Foundation::Point ComponentView::ScreenToLocal(winrt::Windows::Foundation::Point pt) noexcept {
367
+ return rootComponentView()->ConvertScreenToLocal(pt);
368
+ }
369
+
370
+ winrt::Windows::Foundation::Point ComponentView::LocalToScreen(winrt::Windows::Foundation::Point pt) noexcept {
371
+ return rootComponentView()->ConvertLocalToScreen(pt);
372
+ }
373
+
359
374
  // The offset from this elements parent to its children (accounts for things like scroll position)
360
375
  facebook::react::Point ComponentView::getClientOffset() const noexcept {
361
376
  assert(false);
@@ -11,6 +11,7 @@
11
11
  #include <react/renderer/components/view/ViewProps.h>
12
12
  #include <react/renderer/core/LayoutMetrics.h>
13
13
 
14
+ #include <ComponentView.Experimental.interop.h>
14
15
  #include <Fabric/Composition/Theme.h>
15
16
  #include <uiautomationcore.h>
16
17
  #include <winrt/Microsoft.ReactNative.Composition.Input.h>
@@ -37,11 +38,11 @@ struct BringIntoViewOptions {
37
38
  bool AnimationDesired{false};
38
39
  // NaN will bring the element fully into view aligned to the nearest edge of the viewport
39
40
  float HorizontalAlignmentRatio{std::numeric_limits<float>::quiet_NaN()};
40
- float HorizontalOffset{0};
41
+ float HorizontalOffset{20};
41
42
  std::optional<facebook::react::Rect> TargetRect;
42
43
  // NaN will bring the element fully into view aligned to the nearest edge of the viewport
43
44
  float VerticalAlignmentRatio{std::numeric_limits<float>::quiet_NaN()};
44
- float VerticalOffset{0};
45
+ float VerticalOffset{20};
45
46
  };
46
47
 
47
48
  struct LayoutMetricsChangedArgs : public LayoutMetricsChangedArgsT<LayoutMetricsChangedArgs> {
@@ -77,7 +78,8 @@ struct UnmountChildComponentViewArgs : public UnmountChildComponentViewArgsT<Unm
77
78
  uint32_t m_index;
78
79
  };
79
80
 
80
- struct ComponentView : public ComponentViewT<ComponentView> {
81
+ struct ComponentView
82
+ : public ComponentViewT<ComponentView, ::Microsoft::ReactNative::Composition::Experimental::IComponentViewInterop> {
81
83
  ComponentView(facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext);
82
84
 
83
85
  virtual std::vector<facebook::react::ComponentDescriptorProvider> supplementalComponentDescriptorProviders() noexcept;
@@ -105,6 +107,8 @@ struct ComponentView : public ComponentViewT<ComponentView> {
105
107
  // returns true if the fn ever returned true
106
108
  bool runOnChildren(bool forward, Mso::Functor<bool(ComponentView &)> &fn) noexcept;
107
109
  virtual RECT getClientRect() const noexcept;
110
+ winrt::Windows::Foundation::Point ScreenToLocal(winrt::Windows::Foundation::Point pt) noexcept;
111
+ winrt::Windows::Foundation::Point LocalToScreen(winrt::Windows::Foundation::Point pt) noexcept;
108
112
  // The offset from this elements parent to its children (accounts for things like scroll position)
109
113
  virtual facebook::react::Point getClientOffset() const noexcept;
110
114
  virtual void onLosingFocus(const winrt::Microsoft::ReactNative::LosingFocusEventArgs &args) noexcept;
@@ -113,6 +117,7 @@ struct ComponentView : public ComponentViewT<ComponentView> {
113
117
  virtual void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
114
118
  void MarkAsCustomComponent() noexcept;
115
119
  virtual void onMounted() noexcept;
120
+ bool isMounted() noexcept;
116
121
  virtual void onUnmounted() noexcept;
117
122
  void onDestroying() noexcept;
118
123