react-native-windows 0.76.1 → 0.76.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.
Files changed (118) hide show
  1. package/Libraries/Components/View/View.windows.js +76 -52
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/Core/setUpErrorHandling.js +1 -7
  4. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  5. package/Libraries/Modal/Modal.windows.js +352 -0
  6. package/Libraries/ReactNative/AppRegistry.js +3 -3
  7. package/Libraries/Text/Text.windows.js +1 -1
  8. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -1
  9. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +4 -1
  10. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +1 -1
  11. package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +7 -0
  12. package/Microsoft.ReactNative/Fabric/AbiViewProps.h +2 -0
  13. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +45 -50
  14. package/Microsoft.ReactNative/Fabric/ComponentView.h +14 -22
  15. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp +943 -0
  16. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.h +80 -0
  17. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +26 -3
  18. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +187 -6
  19. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +10 -1
  20. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +8 -32
  21. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +336 -929
  22. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +32 -29
  23. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +9 -2
  24. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +2 -1
  25. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +1 -1
  26. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +181 -123
  27. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +16 -8
  28. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +99 -37
  29. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +25 -3
  30. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +63 -2
  31. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -0
  32. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +51 -3
  33. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +3 -0
  34. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -8
  35. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +3 -0
  36. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +54 -5
  37. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -0
  38. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +9 -3
  39. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +11 -0
  40. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
  41. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -1
  42. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +1 -5
  43. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +26 -0
  44. package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +1 -1
  45. package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -2
  46. package/Microsoft.ReactNative/ViewProps.idl +2 -0
  47. package/Microsoft.ReactNative.Cxx/ComponentView.Experimental.interop.h +14 -0
  48. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  49. package/Shared/Shared.vcxitems +3 -0
  50. package/Shared/Shared.vcxitems.filters +1 -0
  51. package/codegen/NativeAccessibilityInfoSpec.g.h +1 -0
  52. package/codegen/NativeAccessibilityManagerSpec.g.h +1 -0
  53. package/codegen/NativeActionSheetManagerSpec.g.h +1 -0
  54. package/codegen/NativeAlertManagerSpec.g.h +1 -0
  55. package/codegen/NativeAnimatedModuleSpec.g.h +1 -0
  56. package/codegen/NativeAnimatedTurboModuleSpec.g.h +1 -0
  57. package/codegen/NativeAppStateSpec.g.h +1 -0
  58. package/codegen/NativeAppThemeSpec.g.h +1 -0
  59. package/codegen/NativeAppearanceSpec.g.h +1 -0
  60. package/codegen/NativeBlobModuleSpec.g.h +1 -0
  61. package/codegen/NativeBugReportingSpec.g.h +1 -0
  62. package/codegen/NativeClipboardSpec.g.h +1 -0
  63. package/codegen/NativeDOMSpec.g.h +1 -0
  64. package/codegen/NativeDevLoadingViewSpec.g.h +1 -0
  65. package/codegen/NativeDevMenuSpec.g.h +1 -0
  66. package/codegen/NativeDevSettingsSpec.g.h +1 -0
  67. package/codegen/NativeDevToolsSettingsManagerSpec.g.h +1 -0
  68. package/codegen/NativeDeviceEventManagerSpec.g.h +1 -0
  69. package/codegen/NativeDeviceInfoSpec.g.h +1 -0
  70. package/codegen/NativeDialogManagerAndroidSpec.g.h +1 -0
  71. package/codegen/NativeDialogManagerWindowsSpec.g.h +1 -0
  72. package/codegen/NativeExceptionsManagerSpec.g.h +1 -0
  73. package/codegen/NativeFileReaderModuleSpec.g.h +1 -0
  74. package/codegen/NativeFrameRateLoggerSpec.g.h +1 -0
  75. package/codegen/NativeHeadlessJsTaskSupportSpec.g.h +1 -0
  76. package/codegen/NativeI18nManagerSpec.g.h +1 -0
  77. package/codegen/NativeIdleCallbacksSpec.g.h +1 -0
  78. package/codegen/NativeImageEditorSpec.g.h +1 -0
  79. package/codegen/NativeImageLoaderAndroidSpec.g.h +1 -0
  80. package/codegen/NativeImageLoaderIOSSpec.g.h +1 -0
  81. package/codegen/NativeImageStoreAndroidSpec.g.h +1 -0
  82. package/codegen/NativeImageStoreIOSSpec.g.h +1 -0
  83. package/codegen/NativeIntentAndroidSpec.g.h +1 -0
  84. package/codegen/NativeIntersectionObserverSpec.g.h +1 -0
  85. package/codegen/NativeJSCHeapCaptureSpec.g.h +1 -0
  86. package/codegen/NativeJSCSamplingProfilerSpec.g.h +1 -0
  87. package/codegen/NativeKeyboardObserverSpec.g.h +1 -0
  88. package/codegen/NativeLinkingManagerSpec.g.h +1 -0
  89. package/codegen/NativeLogBoxSpec.g.h +1 -0
  90. package/codegen/NativeMicrotasksSpec.g.h +1 -0
  91. package/codegen/NativeModalManagerSpec.g.h +1 -0
  92. package/codegen/NativeMutationObserverSpec.g.h +1 -0
  93. package/codegen/NativeNetworkingAndroidSpec.g.h +1 -0
  94. package/codegen/NativeNetworkingIOSSpec.g.h +1 -0
  95. package/codegen/NativePerformanceObserverSpec.g.h +1 -0
  96. package/codegen/NativePerformanceSpec.g.h +1 -0
  97. package/codegen/NativePermissionsAndroidSpec.g.h +1 -0
  98. package/codegen/NativePlatformConstantsAndroidSpec.g.h +1 -0
  99. package/codegen/NativePlatformConstantsIOSSpec.g.h +1 -0
  100. package/codegen/NativePlatformConstantsWindowsSpec.g.h +1 -0
  101. package/codegen/NativePushNotificationManagerIOSSpec.g.h +1 -0
  102. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +1 -0
  103. package/codegen/NativeRedBoxSpec.g.h +1 -0
  104. package/codegen/NativeSampleTurboModuleSpec.g.h +1 -0
  105. package/codegen/NativeSegmentFetcherSpec.g.h +1 -0
  106. package/codegen/NativeSettingsManagerSpec.g.h +1 -0
  107. package/codegen/NativeShareModuleSpec.g.h +1 -0
  108. package/codegen/NativeSoundManagerSpec.g.h +1 -0
  109. package/codegen/NativeSourceCodeSpec.g.h +1 -0
  110. package/codegen/NativeStatusBarManagerAndroidSpec.g.h +1 -0
  111. package/codegen/NativeStatusBarManagerIOSSpec.g.h +1 -0
  112. package/codegen/NativeTimingSpec.g.h +1 -0
  113. package/codegen/NativeToastAndroidSpec.g.h +1 -0
  114. package/codegen/NativeUIManagerSpec.g.h +1 -0
  115. package/codegen/NativeVibrationSpec.g.h +1 -0
  116. package/codegen/NativeWebSocketModuleSpec.g.h +1 -0
  117. package/package.json +12 -12
  118. package/types/modules/Codegen.d.ts +6 -0
@@ -165,6 +165,10 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
165
165
 
166
166
  //@cmember Show the caret
167
167
  BOOL TxShowCaret(BOOL fShow) override {
168
+ // Only show the caret if we have focus
169
+ if (fShow && !m_outer->m_hasFocus) {
170
+ return false;
171
+ }
168
172
  m_outer->ShowCaret(m_outer->windowsTextInputProps().caretHidden ? false : fShow);
169
173
  return true;
170
174
  }
@@ -232,19 +236,25 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
232
236
 
233
237
  //@cmember Establish a new cursor shape
234
238
  void TxSetCursor(HCURSOR hcur, BOOL fText) override {
235
- assert(false);
239
+ m_outer->m_hcursor = hcur;
236
240
  }
237
241
 
238
242
  //@cmember Converts screen coordinates of a specified point to the client coordinates
239
243
  BOOL TxScreenToClient(LPPOINT lppt) override {
240
- assert(false);
241
- return {};
244
+ winrt::Windows::Foundation::Point pt{static_cast<float>(lppt->x), static_cast<float>(lppt->y)};
245
+ auto localpt = m_outer->ScreenToLocal(pt);
246
+ lppt->x = static_cast<LONG>(localpt.X);
247
+ lppt->y = static_cast<LONG>(localpt.Y);
248
+ return true;
242
249
  }
243
250
 
244
251
  //@cmember Converts the client coordinates of a specified point to screen coordinates
245
252
  BOOL TxClientToScreen(LPPOINT lppt) override {
246
- assert(false);
247
- return {};
253
+ winrt::Windows::Foundation::Point pt{static_cast<float>(lppt->x), static_cast<float>(lppt->y)};
254
+ auto screenpt = m_outer->LocalToScreen(pt);
255
+ lppt->x = static_cast<LONG>(screenpt.X);
256
+ lppt->y = static_cast<LONG>(screenpt.Y);
257
+ return true;
248
258
  }
249
259
 
250
260
  //@cmember Request host to activate text services
@@ -722,6 +732,9 @@ void WindowsTextInputComponentView::OnPointerMoved(
722
732
  auto hr = m_textServices->TxSendMessage(msg, static_cast<WPARAM>(wParam), static_cast<LPARAM>(lParam), &lresult);
723
733
  args.Handled(hr != S_FALSE);
724
734
  }
735
+
736
+ m_textServices->OnTxSetCursor(
737
+ DVASPECT_CONTENT, -1, nullptr, nullptr, nullptr, nullptr, nullptr, ptContainer.x, ptContainer.y);
725
738
  }
726
739
 
727
740
  void WindowsTextInputComponentView::OnKeyDown(
@@ -870,6 +883,7 @@ void WindowsTextInputComponentView::OnCharacterReceived(
870
883
  emitter->onKeyPress(onKeyPressArgs);
871
884
 
872
885
  WPARAM wParam = static_cast<WPARAM>(args.KeyCode());
886
+
873
887
  LPARAM lParam = 0;
874
888
  lParam = args.KeyStatus().RepeatCount; // bits 0-15
875
889
  lParam |= args.KeyStatus().ScanCode << 16; // bits 16-23
@@ -908,6 +922,7 @@ void WindowsTextInputComponentView::UnmountChildComponentView(
908
922
 
909
923
  void WindowsTextInputComponentView::onLostFocus(
910
924
  const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept {
925
+ m_hasFocus = false;
911
926
  Super::onLostFocus(args);
912
927
  if (m_textServices) {
913
928
  LRESULT lresult;
@@ -919,6 +934,7 @@ void WindowsTextInputComponentView::onLostFocus(
919
934
 
920
935
  void WindowsTextInputComponentView::onGotFocus(
921
936
  const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept {
937
+ m_hasFocus = true;
922
938
  Super::onGotFocus(args);
923
939
  if (m_textServices) {
924
940
  LRESULT lresult;
@@ -1022,6 +1038,10 @@ void WindowsTextInputComponentView::updateProps(
1022
1038
  m_submitKeyEvents.clear();
1023
1039
  }
1024
1040
 
1041
+ if (oldTextInputProps.autoCapitalize != newTextInputProps.autoCapitalize) {
1042
+ autoCapitalizeOnUpdateProps(oldTextInputProps.autoCapitalize, newTextInputProps.autoCapitalize);
1043
+ }
1044
+
1025
1045
  UpdatePropertyBits();
1026
1046
  }
1027
1047
 
@@ -1462,6 +1482,10 @@ WindowsTextInputComponentView::createVisual() noexcept {
1462
1482
  return visual;
1463
1483
  }
1464
1484
 
1485
+ std::pair<facebook::react::Cursor, HCURSOR> WindowsTextInputComponentView::cursor() const noexcept {
1486
+ return {viewProps()->cursor, m_hcursor};
1487
+ }
1488
+
1465
1489
  void WindowsTextInputComponentView::onThemeChanged() noexcept {
1466
1490
  const auto &props = windowsTextInputProps();
1467
1491
  updateCursorColor(props.cursorColor, props.textAttributes.foregroundColor);
@@ -1476,4 +1500,29 @@ winrt::Microsoft::ReactNative::ComponentView WindowsTextInputComponentView::Crea
1476
1500
  return winrt::make<WindowsTextInputComponentView>(compContext, tag, reactContext);
1477
1501
  }
1478
1502
 
1503
+ // This function assumes that previous and new capitalization types are different.
1504
+ void WindowsTextInputComponentView::autoCapitalizeOnUpdateProps(
1505
+ const std::string &previousCapitalizationType,
1506
+ const std::string &newCapitalizationType) noexcept {
1507
+ /*
1508
+ Possible values are:
1509
+ Characters - All characters.
1510
+ Words - First letter of each word.
1511
+ Sentences - First letter of each sentence.
1512
+ None - Do not autocapitalize anything.
1513
+
1514
+ For now, only characters and none are supported.
1515
+ */
1516
+
1517
+ if (previousCapitalizationType == "characters") {
1518
+ winrt::check_hresult(m_textServices->TxSendMessage(
1519
+ EM_SETEDITSTYLE, 0 /* disable */, SES_UPPERCASE /* flag affected */, nullptr /* LRESULT */));
1520
+ }
1521
+
1522
+ if (newCapitalizationType == "characters") {
1523
+ winrt::check_hresult(m_textServices->TxSendMessage(
1524
+ EM_SETEDITSTYLE, SES_UPPERCASE /* enable */, SES_UPPERCASE /* flag affected */, nullptr /* LRESULT */));
1525
+ }
1526
+ }
1527
+
1479
1528
  } // namespace winrt::Microsoft::ReactNative::Composition::implementation
@@ -78,6 +78,8 @@ struct WindowsTextInputComponentView
78
78
 
79
79
  winrt::Microsoft::ReactNative::Composition::Experimental::IVisual createVisual() noexcept;
80
80
 
81
+ std::pair<facebook::react::Cursor, HCURSOR> cursor() const noexcept override;
82
+
81
83
  private:
82
84
  struct DrawBlock {
83
85
  DrawBlock(WindowsTextInputComponentView &view);
@@ -104,6 +106,10 @@ struct WindowsTextInputComponentView
104
106
  void InternalFinalize() noexcept;
105
107
  void UpdatePropertyBits() noexcept;
106
108
 
109
+ void autoCapitalizeOnUpdateProps(
110
+ const std::string &previousCapitalizationType,
111
+ const std::string &newcapitalizationType) noexcept;
112
+
107
113
  winrt::Windows::UI::Composition::CompositionSurfaceBrush m_brush{nullptr};
108
114
  winrt::Microsoft::ReactNative::Composition::Experimental::ICaretVisual m_caretVisual{nullptr};
109
115
  winrt::Microsoft::ReactNative::Composition::Experimental::IDrawingSurfaceBrush m_drawingSurface{nullptr};
@@ -124,10 +130,12 @@ struct WindowsTextInputComponentView
124
130
  int m_cDrawBlock{0};
125
131
  bool m_needsRedraw{false};
126
132
  bool m_drawing{false};
133
+ bool m_hasFocus{false};
127
134
  bool m_clearTextOnSubmit{false};
128
135
  bool m_multiline{false};
129
136
  DWORD m_propBitsMask{0};
130
137
  DWORD m_propBits{0};
138
+ HCURSOR m_hcursor{nullptr};
131
139
  std::vector<facebook::react::CompWindowsTextInputSubmitKeyEventsStruct> m_submitKeyEvents;
132
140
  };
133
141
 
@@ -330,7 +330,9 @@ bool Theme::TryGetPlatformColor(const std::string &platformColor, winrt::Windows
330
330
  {"AcrylicInAppFillColorDefault", {0x9E, 0xFF, 0xFF, 0xFF}},
331
331
  {"SystemChromeMediumLowColor", {0xFF, 0xF2, 0xF2, 0xF2}},
332
332
  {"SystemControlForegroundBaseHighColor", {0xFF, 0x00, 0x00, 0x00}},
333
- {"SystemControlTransientBorderColor", {0x24, 0x00, 0x00, 0x00}}};
333
+ {"SystemControlTransientBorderColor", {0x24, 0x00, 0x00, 0x00}},
334
+ {"FocusVisualPrimary", {0xFF, 0x00, 0x00, 0x00}},
335
+ {"FocusVisualSecondary", {0x99, 0xFF, 0xFF, 0xFF}}};
334
336
 
335
337
  static std::unordered_map<std::string, winrt::Windows::UI::Color, std::hash<std::string_view>, std::equal_to<>>
336
338
  s_darkColors = {
@@ -362,7 +364,9 @@ bool Theme::TryGetPlatformColor(const std::string &platformColor, winrt::Windows
362
364
  {"AcrylicInAppFillColorDefault", {0x9E, 0x00, 0x00, 0x00}},
363
365
  {"SystemChromeMediumLowColor", {0xFF, 0x2B, 0x2B, 0x2B}},
364
366
  {"SystemControlForegroundBaseHighColor", {0xFF, 0xFF, 0xFF, 0xFF}},
365
- {"SystemControlTransientBorderColor", {0x5C, 0x00, 0x00, 0x00}}};
367
+ {"SystemControlTransientBorderColor", {0x5C, 0x00, 0x00, 0x00}},
368
+ {"FocusVisualPrimary", {0xFF, 0xFF, 0xFF, 0xFF}},
369
+ {"FocusVisualSecondary", {0x99, 0x00, 0x00, 0x00F}}};
366
370
 
367
371
  static std::unordered_map<
368
372
  std::string,
@@ -399,7 +403,9 @@ bool Theme::TryGetPlatformColor(const std::string &platformColor, winrt::Windows
399
403
  {"ControlStrongFillColorDisabled", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonFace, {}}},
400
404
  {"SystemChromeMediumLowColor", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonFace, {}}},
401
405
  {"SystemControlForegroundBaseHighColor", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonText, {}}},
402
- {"SystemControlTransientBorderColor", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonText, {}}}};
406
+ {"SystemControlTransientBorderColor", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonText, {}}},
407
+ {"FocusVisualPrimary", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonText, {}}},
408
+ {"FocusVisualSecondary", {winrt::Windows::UI::ViewManagement::UIElementType::ButtonFace, {}}}};
403
409
 
404
410
  auto alias = s_xamlAliasedColors.find(platformColor);
405
411
  if (alias != s_xamlAliasedColors.end()) {
@@ -214,4 +214,15 @@ ExpandCollapseState GetExpandCollapseState(const bool &expanded) noexcept {
214
214
  }
215
215
  }
216
216
 
217
+ ToggleState GetToggleState(const std::optional<facebook::react::AccessibilityState> &state) noexcept {
218
+ if (state.has_value()) {
219
+ if (state->checked == facebook::react::AccessibilityState::Checked) {
220
+ return ToggleState::ToggleState_On;
221
+ } else if (state->checked == facebook::react::AccessibilityState::Mixed) {
222
+ return ToggleState::ToggleState_Indeterminate;
223
+ }
224
+ }
225
+ return ToggleState::ToggleState_Off;
226
+ }
227
+
217
228
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -36,4 +36,6 @@ std::string extractAccessibilityValue(const facebook::react::AccessibilityValue
36
36
  void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept;
37
37
 
38
38
  ExpandCollapseState GetExpandCollapseState(const bool &expanded) noexcept;
39
+
40
+ ToggleState GetToggleState(const std::optional<facebook::react::AccessibilityState> &state) noexcept;
39
41
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -26,7 +26,7 @@ UnimplementedNativeViewComponentView::UnimplementedNativeViewComponentView(
26
26
  ~(ComponentViewFeatures::Background | ComponentViewFeatures::ShadowProps |
27
27
  ComponentViewFeatures::NativeBorder)) {
28
28
  m_labelVisual = compContext.CreateSpriteVisual();
29
- OuterVisual().InsertAt(m_labelVisual, 1);
29
+ OuterVisual().InsertAt(m_labelVisual, 0);
30
30
  }
31
31
 
32
32
  winrt::Microsoft::ReactNative::ComponentView UnimplementedNativeViewComponentView::Create(
@@ -9,11 +9,7 @@
9
9
  namespace facebook::react::HostPlatformViewTraitsInitializer {
10
10
 
11
11
  inline bool formsStackingContext(ViewProps const &viewProps) {
12
- // onFocus/onBlur are often just used for listening to bubbled events.
13
- // Only Views which are marked as focusable can actually trigger the events, which will already avoid being collapsed.
14
- constexpr decltype(WindowsViewEvents::bits) focusEventsMask = {
15
- (1 << (int)WindowsViewEvents::Offset::Focus) & (1 << (int)WindowsViewEvents::Offset::Blur)};
16
- return (viewProps.windowsEvents.bits & focusEventsMask).any() || viewProps.tooltip;
12
+ return !viewProps.keyDownEvents.empty() || !viewProps.keyUpEvents.empty() || viewProps.tooltip;
17
13
  }
18
14
 
19
15
  inline bool formsView(ViewProps const &viewProps) {
@@ -25,6 +25,29 @@ namespace Microsoft.ReactNative.Composition
25
25
  [webhosthidden]
26
26
  delegate Microsoft.UI.Composition.Visual CreateVisualDelegate(Microsoft.ReactNative.ComponentView view);
27
27
 
28
+ [experimental]
29
+ delegate void UpdateLayoutMetricsDelegate(Microsoft.ReactNative.ComponentView source, Microsoft.ReactNative.LayoutMetrics newLayoutMetrics, Microsoft.ReactNative.LayoutMetrics oldLayoutMetrics);
30
+
31
+ [experimental]
32
+ [webhosthidden]
33
+ delegate Microsoft.UI.Composition.Visual VisualToMountChildrenIntoDelegate(Microsoft.ReactNative.ComponentView view);
34
+
35
+ namespace Experimental {
36
+ [experimental]
37
+ [webhosthidden]
38
+ DOC_STRING("This type will be removed in future versions")
39
+ delegate Microsoft.ReactNative.Composition.Experimental.IVisual IVisualToMountChildrenIntoDelegate(Microsoft.ReactNative.ComponentView view);
40
+
41
+ [experimental]
42
+ [webhosthidden]
43
+ DOC_STRING("This interface is for use when running react-native-windows using a custom compositor. "
44
+ "This interface will be removed in future versions")
45
+ interface IReactCompositionViewComponentInternalBuilder
46
+ {
47
+ void SetIVisualToMountChildrenIntoHandler(IVisualToMountChildrenIntoDelegate impl);
48
+ };
49
+ }
50
+
28
51
  [webhosthidden]
29
52
  [experimental]
30
53
  DOC_STRING(".")
@@ -33,6 +56,9 @@ namespace Microsoft.ReactNative.Composition
33
56
  void SetViewComponentViewInitializer(ViewComponentViewInitializer initializer);
34
57
  void SetContentIslandComponentViewInitializer(ComponentIslandComponentViewInitializer initializer);
35
58
  void SetCreateVisualHandler(CreateVisualDelegate impl);
59
+ void SetViewFeatures(ComponentViewFeatures viewFeatures);
60
+ void SetUpdateLayoutMetricsHandler(UpdateLayoutMetricsDelegate impl);
61
+ void SetVisualToMountChildrenIntoHandler(VisualToMountChildrenIntoDelegate impl);
36
62
  };
37
63
 
38
64
  } // namespace Microsoft.ReactNative
@@ -56,7 +56,7 @@ namespace Microsoft.ReactNative
56
56
 
57
57
  [experimental]
58
58
  DOC_STRING("A delegate that creates a @IComponentProps object for an instance of @ViewProps. See @IReactViewComponentBuilder.SetCreateProps")
59
- delegate IComponentProps ViewPropsFactory(ViewProps props);
59
+ delegate IComponentProps ViewPropsFactory(ViewProps props, IComponentProps cloneFrom);
60
60
 
61
61
  [experimental]
62
62
  delegate Windows.Foundation.Size MeasureContentHandler(ShadowNode shadowNode, LayoutContext layoutContext, LayoutConstraints layoutConstraints);
@@ -78,11 +78,12 @@ namespace Microsoft.ReactNative
78
78
  DOC_STRING("A windows composition component that hosts React Native UI elements.")
79
79
  runtimeclass ReactNativeIsland
80
80
  {
81
- DOC_STRING("Creates a new instance of @ReactNativeIsland.")
81
+ DOC_STRING("Creates a new instance of @ReactNativeIsland. Can be implemented with a ReactViewHost or a ComponentView with reactContext")
82
82
  ReactNativeIsland();
83
83
 
84
84
  #ifdef USE_WINUI3
85
85
  ReactNativeIsland(Microsoft.UI.Composition.Compositor compositor);
86
+ ReactNativeIsland(Microsoft.UI.Composition.Compositor compositor, Microsoft.ReactNative.IReactContext context, Microsoft.ReactNative.ComponentView componentView);
86
87
  #endif
87
88
 
88
89
  DOC_STRING(
@@ -97,7 +98,7 @@ namespace Microsoft.ReactNative
97
98
 
98
99
  DOC_STRING("ScaleFactor for this windows (DPI/96)")
99
100
  Single ScaleFactor {get; set;};
100
-
101
+
101
102
  Single FontSizeMultiplier { get; };
102
103
 
103
104
  DOC_STRING("Move focus to this @ReactNativeIsland")
@@ -24,6 +24,8 @@ namespace Microsoft.ReactNative {
24
24
  Microsoft.UI.Composition.CompositionBrush AsBrush(Microsoft.ReactNative.Composition.Theme theme);
25
25
  #endif
26
26
 
27
+ Boolean Equals(Color color);
28
+
27
29
  static Color Black();
28
30
  static Color Transparent();
29
31
  static Color ReadValue(IJSValueReader reader);
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+
6
+ namespace Microsoft::ReactNative::Composition::Experimental {
7
+
8
+ // This interface will be removed once we complete internal transitions to ContentIsland, and new APIs for hosting
9
+ // popups/new windows from a ContentIsland
10
+ struct __declspec(uuid("2A60D68A-57B8-43CA-B1BA-2FAF0FCB344B")) IComponentViewInterop : IUnknown {
11
+ virtual HWND GetHwndForParenting() noexcept = 0;
12
+ };
13
+
14
+ } // namespace Microsoft::ReactNative::Composition::Experimental
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.76.1</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.76.3</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>76</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>1</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>3</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>244b8a1b45a3b4f2577b794b55ca2a00de0eb273</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>199b031a6ade89e4f3668a84d65d427ba2b73169</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -89,6 +89,9 @@
89
89
  <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\UriImageManager.idl</DependentUpon>
90
90
  <SubType>Code</SubType>
91
91
  </ClCompile>
92
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\BorderPrimitive.cpp">
93
+ <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
94
+ </ClCompile>
92
95
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ContentIslandComponentView.cpp">
93
96
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
94
97
  <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionComponentView.idl</DependentUpon>
@@ -334,6 +334,7 @@
334
334
  <ClCompile Include="$(MSBuildThisFileDirectory)Networking\NetworkPropertyIds.cpp" />
335
335
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiEventEmitter.cpp" />
336
336
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\TooltipService.cpp" />
337
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\BorderPrimitive.cpp" />
337
338
  </ItemGroup>
338
339
  <ItemGroup>
339
340
  <Filter Include="Source Files">
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>
@@ -7,6 +7,7 @@
7
7
  * by the TurboModule JS spec.
8
8
  */
9
9
  #pragma once
10
+ // clang-format off
10
11
 
11
12
  #include <NativeModules.h>
12
13
  #include <tuple>