react-native-windows 0.81.12 → 0.81.15

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 (29) hide show
  1. package/Common/Common.vcxproj +1 -1
  2. package/Folly/Folly.vcxproj +1 -1
  3. package/Libraries/Modal/Modal.windows.js +1 -7
  4. package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp +53 -66
  5. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +58 -21
  6. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +197 -54
  7. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +12 -3
  8. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +14 -9
  9. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +4 -6
  10. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +101 -44
  11. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -2
  12. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +3 -3
  13. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.h +3 -1
  14. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +0 -1
  15. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
  16. package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.cpp +3 -3
  17. package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.h +3 -2
  18. package/Microsoft.ReactNative/Modules/Timing.h +2 -1
  19. package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +10 -10
  20. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.targets +2 -2
  21. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.targets +2 -2
  22. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  23. package/ReactCommon/ReactCommon.vcxproj +1 -1
  24. package/Scripts/OfficeReact.Win32.nuspec +44 -44
  25. package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
  26. package/Shared/Shared.vcxitems.filters +0 -2
  27. package/package.json +1 -1
  28. package/Scripts/OpenSSL.nuspec +0 -39
  29. package/Scripts/OpenSSL.targets +0 -36
@@ -18,6 +18,7 @@
18
18
  #include <winrt/Microsoft.UI.Input.h>
19
19
  #include <winrt/Windows.System.h>
20
20
  #include <winrt/Windows.UI.h>
21
+ #include <mutex>
21
22
  #include "../Composition.Input.h"
22
23
  #include "../CompositionHelpers.h"
23
24
  #include "../RootComponentView.h"
@@ -75,37 +76,38 @@ WindowsTextInputComponentView::DrawBlock::~DrawBlock() {
75
76
 
76
77
  // Msftedit.dll vs "Riched20.dll"?
77
78
 
79
+ static std::once_flag g_richEditLoadedFlag;
78
80
  static HINSTANCE g_hInstRichEdit = nullptr;
79
81
  static PCreateTextServices g_pfnCreateTextServices;
80
82
 
81
83
  HRESULT HrEnsureRichEd20Loaded() noexcept {
82
- if (g_hInstRichEdit == nullptr) {
84
+ HRESULT hr = S_OK;
85
+ std::call_once(g_richEditLoadedFlag, [&hr]() {
83
86
  g_hInstRichEdit = LoadLibrary(L"Msftedit.dll");
84
- if (!g_hInstRichEdit)
85
- return E_FAIL;
87
+ if (!g_hInstRichEdit) {
88
+ hr = E_FAIL;
89
+ return;
90
+ }
86
91
 
87
92
  // Create the windowless control (text services object)
88
93
  g_pfnCreateTextServices = (PCreateTextServices)GetProcAddress(g_hInstRichEdit, "CreateTextServices");
89
- if (!g_pfnCreateTextServices)
90
- return E_FAIL;
91
-
92
- /*
93
- // Calling the REExtendedRegisterClass() function is required for
94
- // registering the REComboboxW and REListBoxW window classes.
95
- PFNREGISTER pfnRegister = (PFNREGISTER)GetProcAddress(g_hInstRichEdit, "REExtendedRegisterClass");
96
- if (pfnRegister) {
97
- pfnRegister();
98
- return S_OK;
99
- } else
100
- return E_FAIL;
101
- */
102
- }
103
- return NOERROR;
94
+ if (!g_pfnCreateTextServices) {
95
+ hr = E_FAIL;
96
+ return;
97
+ }
98
+ });
99
+ if (!g_hInstRichEdit || !g_pfnCreateTextServices)
100
+ return E_FAIL;
101
+ return hr;
104
102
  }
105
103
 
106
104
  struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
107
105
  CompTextHost(WindowsTextInputComponentView *outer) : m_outer(outer) {}
108
106
 
107
+ void Detach() {
108
+ m_outer = nullptr;
109
+ }
110
+
109
111
  //@cmember Get the DC for the host
110
112
  HDC TxGetDC() override {
111
113
  assert(false);
@@ -144,6 +146,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
144
146
 
145
147
  //@cmember InvalidateRect
146
148
  void TxInvalidateRect(LPCRECT prc, BOOL fMode) override {
149
+ if (!m_outer)
150
+ return;
147
151
  if (m_outer->m_drawing)
148
152
  return;
149
153
  m_outer->DrawText();
@@ -151,6 +155,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
151
155
 
152
156
  //@cmember Send a WM_PAINT to the window
153
157
  void TxViewChange(BOOL fUpdate) override {
158
+ if (!m_outer)
159
+ return;
154
160
  // When keyboard scrolling without scrollbar, TxInvalidateRect is not called.
155
161
  // Instead TxViewChange is called with fUpdate = true
156
162
  // if (fUpdate && !OnInnerViewerExtentChanged())
@@ -163,12 +169,16 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
163
169
 
164
170
  //@cmember Create the caret
165
171
  BOOL TxCreateCaret(HBITMAP hbmp, INT xWidth, INT yHeight) override {
172
+ if (!m_outer)
173
+ return false;
166
174
  m_outer->m_caretVisual.Size({static_cast<float>(xWidth), static_cast<float>(yHeight)});
167
175
  return true;
168
176
  }
169
177
 
170
178
  //@cmember Show the caret
171
179
  BOOL TxShowCaret(BOOL fShow) override {
180
+ if (!m_outer)
181
+ return false;
172
182
  // Only show the caret if we have focus
173
183
  if (fShow && !m_outer->m_hasFocus) {
174
184
  return false;
@@ -179,6 +189,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
179
189
 
180
190
  //@cmember Set the caret position
181
191
  BOOL TxSetCaretPos(INT x, INT y) override {
192
+ if (!m_outer)
193
+ return false;
182
194
  if (x < 0 && y < 0) {
183
195
  // RichEdit sends (-32000,-32000) when the caret is not currently visible.
184
196
  return false;
@@ -217,6 +229,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
217
229
 
218
230
  //@cmember Get mouse capture
219
231
  void TxSetCapture(BOOL fCapture) override {
232
+ if (!m_outer)
233
+ return;
220
234
  auto mousePointer = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::Pointer>(
221
235
  winrt::Microsoft::ReactNative::Composition::Input::PointerDeviceType::Mouse, 1 /* 1 is Mouse PointerId*/);
222
236
 
@@ -229,6 +243,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
229
243
 
230
244
  //@cmember Set the focus to the text window
231
245
  void TxSetFocus() override {
246
+ if (!m_outer)
247
+ return;
232
248
  winrt::Microsoft::ReactNative::ComponentView view{nullptr};
233
249
  winrt::check_hresult(
234
250
  m_outer->QueryInterface(winrt::guid_of<winrt::Microsoft::ReactNative::ComponentView>(), winrt::put_abi(view)));
@@ -242,11 +258,15 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
242
258
 
243
259
  //@cmember Establish a new cursor shape
244
260
  void TxSetCursor(HCURSOR hcur, BOOL fText) override {
261
+ if (!m_outer)
262
+ return;
245
263
  m_outer->m_hcursor = hcur;
246
264
  }
247
265
 
248
266
  //@cmember Converts screen coordinates of a specified point to the client coordinates
249
267
  BOOL TxScreenToClient(LPPOINT lppt) override {
268
+ if (!m_outer)
269
+ return false;
250
270
  winrt::Windows::Foundation::Point pt{static_cast<float>(lppt->x), static_cast<float>(lppt->y)};
251
271
  pt.X -= m_outer->m_contentOffsetPx.x;
252
272
  pt.Y -= m_outer->m_contentOffsetPx.y;
@@ -258,6 +278,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
258
278
 
259
279
  //@cmember Converts the client coordinates of a specified point to screen coordinates
260
280
  BOOL TxClientToScreen(LPPOINT lppt) override {
281
+ if (!m_outer)
282
+ return false;
261
283
  winrt::Windows::Foundation::Point pt{static_cast<float>(lppt->x), static_cast<float>(lppt->y)};
262
284
 
263
285
  if (!m_outer->m_parent) {
@@ -284,6 +306,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
284
306
 
285
307
  //@cmember Retrieves the coordinates of a window's client area
286
308
  HRESULT TxGetClientRect(LPRECT prc) override {
309
+ if (!m_outer)
310
+ return E_FAIL;
287
311
  *prc = m_outer->getClientRect();
288
312
 
289
313
  prc->top += m_outer->m_contentOffsetPx.y;
@@ -310,6 +334,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
310
334
 
311
335
  //@cmember Get the default character format for the text
312
336
  HRESULT TxGetCharFormat(const CHARFORMATW **ppCF) override {
337
+ if (!m_outer)
338
+ return E_FAIL;
313
339
  m_outer->UpdateCharFormat();
314
340
 
315
341
  *ppCF = &(m_outer->m_cf);
@@ -318,6 +344,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
318
344
 
319
345
  //@cmember Get the default paragraph format for the text
320
346
  HRESULT TxGetParaFormat(const PARAFORMAT **ppPF) override {
347
+ if (!m_outer)
348
+ return E_FAIL;
321
349
  m_outer->UpdateParaFormat();
322
350
 
323
351
  *ppPF = &(m_outer->m_pf);
@@ -326,6 +354,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
326
354
 
327
355
  //@cmember Get the background color for the window
328
356
  COLORREF TxGetSysColor(int nIndex) override {
357
+ if (!m_outer)
358
+ return GetSysColor(nIndex);
329
359
  // if (/* !m_isDisabled || */ nIndex != COLOR_WINDOW && nIndex != COLOR_WINDOWTEXT && nIndex != COLOR_GRAYTEXT) {
330
360
  // This window is either not disabled or the color isn't interesting
331
361
  // in the disabled case.
@@ -400,6 +430,10 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
400
430
 
401
431
  //@cmember Get the maximum length for the text
402
432
  HRESULT TxGetMaxLength(DWORD *plength) override {
433
+ if (!m_outer) {
434
+ *plength = std::numeric_limits<DWORD>::max();
435
+ return S_OK;
436
+ }
403
437
  auto length = m_outer->windowsTextInputProps().maxLength;
404
438
  if (length > static_cast<decltype(m_outer->windowsTextInputProps().maxLength)>(std::numeric_limits<DWORD>::max())) {
405
439
  length = std::numeric_limits<DWORD>::max();
@@ -410,6 +444,10 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
410
444
 
411
445
  //@cmember Get the bits representing requested scroll bars for the window
412
446
  HRESULT TxGetScrollBars(DWORD *pdwScrollBar) override {
447
+ if (!m_outer) {
448
+ *pdwScrollBar = WS_HSCROLL | ES_AUTOHSCROLL;
449
+ return S_OK;
450
+ }
413
451
  if (m_outer->m_multiline) {
414
452
  *pdwScrollBar = WS_VSCROLL | WS_HSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL;
415
453
  } else {
@@ -457,7 +495,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
457
495
 
458
496
  //@cmember Notify host of events
459
497
  HRESULT TxNotify(DWORD iNotify, void *pv) override {
460
- // TODO
498
+ if (!m_outer)
499
+ return S_OK;
461
500
 
462
501
  switch (iNotify) {
463
502
  case EN_UPDATE:
@@ -542,6 +581,16 @@ WindowsTextInputComponentView::WindowsTextInputComponentView(
542
581
  reactContext,
543
582
  ComponentViewFeatures::Default & ~ComponentViewFeatures::Background) {}
544
583
 
584
+ WindowsTextInputComponentView::~WindowsTextInputComponentView() {
585
+ // Release text services first to prevent further callbacks into CompTextHost.
586
+ m_textServices = nullptr;
587
+
588
+ // Detach the CompTextHost so any lingering references cannot use a dangling pointer.
589
+ if (m_textHost) {
590
+ winrt::get_self<CompTextHost>(m_textHost)->Detach();
591
+ }
592
+ }
593
+
545
594
  void WindowsTextInputComponentView::HandleCommand(
546
595
  const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
547
596
  Super::HandleCommand(args);
@@ -649,17 +698,22 @@ WPARAM PointerRoutedEventArgsToMouseWParam(
649
698
  return wParam;
650
699
  }
651
700
 
652
- bool WindowsTextInputComponentView::IsDoubleClick() {
701
+ bool WindowsTextInputComponentView::IsDoubleClick(uint32_t pointerId) {
653
702
  using namespace std::chrono;
654
703
 
655
704
  auto now = steady_clock::now();
656
- auto duration = duration_cast<milliseconds>(now - m_lastClickTime).count();
705
+ auto it = m_lastClickTimeByPointer.find(pointerId);
706
+ bool isDouble = false;
657
707
 
658
- const int DOUBLE_CLICK_TIME_MS = ::GetDoubleClickTime();
659
-
660
- m_lastClickTime = now;
708
+ if (it != m_lastClickTimeByPointer.end()) {
709
+ auto duration = duration_cast<milliseconds>(now - it->second).count();
710
+ isDouble = (duration < ::GetDoubleClickTime());
711
+ it->second = now;
712
+ } else {
713
+ m_lastClickTimeByPointer[pointerId] = now;
714
+ }
661
715
 
662
- return (duration < DOUBLE_CLICK_TIME_MS);
716
+ return isDouble;
663
717
  }
664
718
 
665
719
  void WindowsTextInputComponentView::OnPointerPressed(
@@ -678,7 +732,7 @@ void WindowsTextInputComponentView::OnPointerPressed(
678
732
  if (pp.PointerDeviceType() == winrt::Microsoft::ReactNative::Composition::Input::PointerDeviceType::Mouse) {
679
733
  switch (pp.Properties().PointerUpdateKind()) {
680
734
  case winrt::Microsoft::ReactNative::Composition::Input::PointerUpdateKind::LeftButtonPressed:
681
- if (IsDoubleClick()) {
735
+ if (IsDoubleClick(pp.PointerId())) {
682
736
  msg = WM_LBUTTONDBLCLK;
683
737
  } else {
684
738
  msg = WM_LBUTTONDOWN;
@@ -699,10 +753,14 @@ void WindowsTextInputComponentView::OnPointerPressed(
699
753
  wParam |= (XBUTTON2 << 16);
700
754
  break;
701
755
  }
702
- wParam = PointerRoutedEventArgsToMouseWParam(args);
756
+ wParam |= PointerRoutedEventArgsToMouseWParam(args);
703
757
  } else {
704
- msg = WM_POINTERDOWN;
705
- wParam = PointerPointToPointerWParam(pp);
758
+ if (IsDoubleClick(pp.PointerId())) {
759
+ msg = WM_LBUTTONDBLCLK;
760
+ } else {
761
+ msg = WM_LBUTTONDOWN;
762
+ }
763
+ wParam = PointerRoutedEventArgsToMouseWParam(args);
706
764
  }
707
765
 
708
766
  if (m_textServices && msg) {
@@ -764,10 +822,10 @@ void WindowsTextInputComponentView::OnPointerReleased(
764
822
  wParam |= (XBUTTON2 << 16);
765
823
  break;
766
824
  }
767
- wParam = PointerRoutedEventArgsToMouseWParam(args);
825
+ wParam |= PointerRoutedEventArgsToMouseWParam(args);
768
826
  } else {
769
- msg = WM_POINTERUP;
770
- wParam = PointerPointToPointerWParam(pp);
827
+ msg = WM_LBUTTONUP;
828
+ wParam = PointerRoutedEventArgsToMouseWParam(args);
771
829
  }
772
830
 
773
831
  if (m_textServices && msg) {
@@ -817,23 +875,18 @@ void WindowsTextInputComponentView::OnPointerMoved(
817
875
  static_cast<LONG>(position.Y * m_layoutMetrics.pointScaleFactor)};
818
876
  lParam = static_cast<LPARAM>(POINTTOPOINTS(ptContainer));
819
877
 
820
- if (pp.PointerDeviceType() == winrt::Microsoft::ReactNative::Composition::Input::PointerDeviceType::Mouse) {
821
- msg = WM_MOUSEMOVE;
822
- wParam = PointerRoutedEventArgsToMouseWParam(args);
823
- } else {
824
- msg = WM_POINTERUPDATE;
825
- wParam = PointerPointToPointerWParam(pp);
826
- }
878
+ msg = WM_MOUSEMOVE;
879
+ wParam = PointerRoutedEventArgsToMouseWParam(args);
827
880
 
828
881
  if (m_textServices) {
829
882
  LRESULT lresult;
830
883
  DrawBlock db(*this);
831
884
  auto hr = m_textServices->TxSendMessage(msg, static_cast<WPARAM>(wParam), static_cast<LPARAM>(lParam), &lresult);
832
885
  args.Handled(hr != S_FALSE);
833
- }
834
886
 
835
- m_textServices->OnTxSetCursor(
836
- DVASPECT_CONTENT, -1, nullptr, nullptr, nullptr, nullptr, nullptr, ptContainer.x, ptContainer.y);
887
+ m_textServices->OnTxSetCursor(
888
+ DVASPECT_CONTENT, -1, nullptr, nullptr, nullptr, nullptr, nullptr, ptContainer.x, ptContainer.y);
889
+ }
837
890
  }
838
891
 
839
892
  void WindowsTextInputComponentView::OnPointerWheelChanged(
@@ -935,7 +988,7 @@ bool WindowsTextInputComponentView::ShouldSubmit(
935
988
  bool ctrlDown = (args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Control) &
936
989
  winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
937
990
  winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
938
- bool altDown = (args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Control) &
991
+ bool altDown = (args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Menu) &
939
992
  winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
940
993
  winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
941
994
  bool metaDown = (args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::LeftWindows) &
@@ -946,7 +999,7 @@ bool WindowsTextInputComponentView::ShouldSubmit(
946
999
  winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
947
1000
  return (submitKeyEvent.shiftKey && shiftDown) || (submitKeyEvent.ctrlKey && ctrlDown) ||
948
1001
  (submitKeyEvent.altKey && altDown) || (submitKeyEvent.metaKey && metaDown) ||
949
- (!submitKeyEvent.shiftKey && !submitKeyEvent.altKey && !submitKeyEvent.metaKey && !submitKeyEvent.altKey &&
1002
+ (!submitKeyEvent.shiftKey && !submitKeyEvent.ctrlKey && !submitKeyEvent.altKey && !submitKeyEvent.metaKey &&
950
1003
  !shiftDown && !ctrlDown && !altDown && !metaDown);
951
1004
  } else {
952
1005
  shouldSubmit = false;
@@ -1780,7 +1833,10 @@ void WindowsTextInputComponentView::DrawText() noexcept {
1780
1833
  }
1781
1834
 
1782
1835
  // TODO keep track of proper invalid rect
1836
+ // Prevent reentrancy: TxDrawD2D may call TxViewChange -> DrawText
1837
+ m_cDrawBlock++;
1783
1838
  auto hrDraw = m_textServices->TxDrawD2D(d2dDeviceContext, &rc, nullptr, TXTVIEW_ACTIVE);
1839
+ m_cDrawBlock--;
1784
1840
  winrt::check_hresult(hrDraw);
1785
1841
 
1786
1842
  // draw placeholder text if needed
@@ -1833,6 +1889,7 @@ WindowsTextInputComponentView::createVisual() noexcept {
1833
1889
  winrt::com_ptr<::IUnknown> spUnk;
1834
1890
  winrt::check_hresult(g_pfnCreateTextServices(nullptr, m_textHost.get(), spUnk.put()));
1835
1891
  spUnk.as(m_textServices);
1892
+ winrt::check_bool(m_textServices != nullptr);
1836
1893
 
1837
1894
  LRESULT res;
1838
1895
  winrt::check_hresult(m_textServices->TxSendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0, &res));
@@ -11,6 +11,7 @@
11
11
  #include <textserv.h>
12
12
  #include <windows.ui.composition.interop.h>
13
13
  #include <winrt/Windows.UI.Composition.h>
14
+ #include <unordered_map>
14
15
  #include "../ComponentView.h"
15
16
  #include "../CompositionHelpers.h"
16
17
  #include "../CompositionViewComponentView.h"
@@ -74,12 +75,13 @@ struct WindowsTextInputComponentView
74
75
  std::optional<std::string> getAccessiblityValue() noexcept override;
75
76
  void setAcccessiblityValue(std::string &&value) noexcept override;
76
77
  bool getAcccessiblityIsReadOnly() noexcept override;
77
- bool IsDoubleClick();
78
+ bool IsDoubleClick(uint32_t pointerId);
78
79
 
79
80
  WindowsTextInputComponentView(
80
81
  const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
81
82
  facebook::react::Tag tag,
82
83
  winrt::Microsoft::ReactNative::ReactContext const &reactContext);
84
+ ~WindowsTextInputComponentView();
83
85
 
84
86
  winrt::Microsoft::ReactNative::Composition::Experimental::IVisual createVisual() noexcept;
85
87
 
@@ -152,7 +154,7 @@ struct WindowsTextInputComponentView
152
154
  DWORD m_propBits{0};
153
155
  HCURSOR m_hcursor{nullptr};
154
156
  POINT m_caretPosition{0, 0};
155
- std::chrono::steady_clock::time_point m_lastClickTime{};
157
+ std::unordered_map<uint32_t, std::chrono::steady_clock::time_point> m_lastClickTimeByPointer;
156
158
  std::vector<facebook::react::CompWindowsTextInputSubmitKeyEventsStruct> m_submitKeyEvents;
157
159
  };
158
160
 
@@ -46,12 +46,12 @@ WindowsComponentDescriptorRegistry::WindowsComponentDescriptorRegistry()
46
46
  }
47
47
 
48
48
  void WindowsComponentDescriptorRegistry::add(const facebook::react::ComponentDescriptorProvider &provider) noexcept {
49
- m_componentNames.push_back(provider.name);
49
+ m_componentNames.insert(provider.name);
50
50
  m_componentDescriptorRegistry->add(provider);
51
51
  }
52
52
 
53
53
  bool WindowsComponentDescriptorRegistry::hasComponentProvider(const std::string &name) noexcept {
54
- return std::find(m_componentNames.begin(), m_componentNames.end(), name) != m_componentNames.end();
54
+ return m_componentNames.count(name) != 0;
55
55
  }
56
56
 
57
57
  void WindowsComponentDescriptorRegistry::Add(
@@ -60,7 +60,7 @@ void WindowsComponentDescriptorRegistry::Add(
60
60
  auto builder = winrt::make<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>();
61
61
  provider(builder);
62
62
 
63
- m_componentNames.push_back(winrt::to_string(componentName));
63
+ m_componentNames.insert(winrt::to_string(componentName));
64
64
  m_descriptorFlavors.emplace_back(std::make_shared<std::string>(winrt::to_string(componentName)));
65
65
  auto handle = reinterpret_cast<facebook::react::ComponentHandle>(
66
66
  facebook::react::ComponentName(m_descriptorFlavors.back()->c_str()));
@@ -10,6 +10,8 @@
10
10
  #include <ReactPropertyBag.h>
11
11
  #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
12
12
 
13
+ #include <unordered_set>
14
+
13
15
  namespace Microsoft::ReactNative {
14
16
 
15
17
  struct WindowsComponentDescriptorRegistry {
@@ -38,7 +40,7 @@ struct WindowsComponentDescriptorRegistry {
38
40
  void add(const facebook::react::ComponentDescriptorProvider &provider) noexcept;
39
41
 
40
42
  std::vector<std::shared_ptr<const std::string>> m_descriptorFlavors;
41
- std::vector<std::string> m_componentNames;
43
+ std::unordered_set<std::string> m_componentNames;
42
44
  std::shared_ptr<facebook::react::ComponentDescriptorProviderRegistry> m_componentDescriptorRegistry;
43
45
 
44
46
  std::map<std::shared_ptr<const std::string>, winrt::Microsoft::ReactNative::IReactViewComponentBuilder const>
@@ -72,7 +72,6 @@ wicBitmapSourceFromStream(const winrt::Windows::Storage::Streams::IRandomAccessS
72
72
  return {decodedFrame, imagingFactory, nullptr};
73
73
  } catch (winrt::hresult_error const &ex) {
74
74
  auto errorInfo = std::make_shared<facebook::react::ImageErrorInfo>();
75
- errorInfo = std::make_shared<facebook::react::ImageErrorInfo>();
76
75
  errorInfo->error = ::Microsoft::ReactNative::FormatHResultError(winrt::hresult_error(ex));
77
76
  return {nullptr, nullptr, errorInfo};
78
77
  }
@@ -635,7 +635,7 @@
635
635
  </Page>
636
636
  </ItemGroup>
637
637
  <ItemGroup>
638
- <PackageReference Include="boost" Version="1.83.0.0" />
638
+ <PackageReference Include="boost" Version="1.84.0.0" />
639
639
  <PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
640
640
  <PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" />
641
641
  <PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
@@ -22,19 +22,19 @@ int64_t AnimatedNode::Tag() {
22
22
  }
23
23
 
24
24
  void AnimatedNode::AddChild(const int64_t animatedNodeTag) {
25
- m_children.push_back(animatedNodeTag);
25
+ m_children.insert(animatedNodeTag);
26
26
  GetChildNode(animatedNodeTag)->OnAttachToNode(m_tag);
27
27
  }
28
28
 
29
29
  void AnimatedNode::RemoveChild(const int64_t tag) {
30
30
  if (const auto childNode = GetChildNode(tag)) {
31
31
  childNode->OnDetachedFromNode(m_tag);
32
- m_children.erase(std::find(m_children.begin(), m_children.end(), tag));
32
+ m_children.erase(tag);
33
33
  }
34
34
  }
35
35
 
36
36
  AnimatedNode *AnimatedNode::GetChildNode(int64_t tag) {
37
- if (std::find(m_children.begin(), m_children.end(), tag) != m_children.end()) {
37
+ if (m_children.count(tag)) {
38
38
  if (const auto manager = m_manager.lock()) {
39
39
  return manager->GetAnimatedNode(tag);
40
40
  }
@@ -6,6 +6,7 @@
6
6
  #include <JSValue.h>
7
7
  #include <cstdint>
8
8
  #include <memory>
9
+ #include <unordered_set>
9
10
  #include <vector>
10
11
 
11
12
  namespace Microsoft::ReactNative {
@@ -20,7 +21,7 @@ class AnimatedNode {
20
21
  void AddChild(int64_t animatedNode);
21
22
  void RemoveChild(int64_t animatedNode);
22
23
 
23
- std::vector<int64_t> &Children() {
24
+ std::unordered_set<int64_t> &Children() {
24
25
  return m_children;
25
26
  }
26
27
 
@@ -37,7 +38,7 @@ class AnimatedNode {
37
38
  AnimatedNode *GetChildNode(int64_t tag);
38
39
  int64_t m_tag{0};
39
40
  const std::weak_ptr<NativeAnimatedNodeManager> m_manager;
40
- std::vector<int64_t> m_children{};
41
+ std::unordered_set<int64_t> m_children{};
41
42
  bool m_useComposition{false};
42
43
 
43
44
  bool HasCompatibleAnimationDriver(int64_t tag);
@@ -9,6 +9,7 @@
9
9
  #include <ReactCoreInjection.h>
10
10
  #include <react/runtime/PlatformTimerRegistry.h>
11
11
  #include <react/runtime/TimerManager.h>
12
+ #include <atomic>
12
13
 
13
14
  namespace Microsoft::ReactNative {
14
15
 
@@ -114,7 +115,7 @@ struct Timing : public std::enable_shared_from_this<Timing> {
114
115
  xaml::Media::CompositionTarget::Rendering_revoker m_rendering;
115
116
  winrt::Microsoft::ReactNative::ITimer m_dispatcherQueueTimer{nullptr};
116
117
  winrt::weak_ref<winrt::Microsoft::ReactNative::IReactDispatcher> m_uiDispatcher;
117
- bool m_usingRendering{false};
118
+ std::atomic<bool> m_usingRendering{false};
118
119
  bool m_usePostForRendering{false};
119
120
  };
120
121
 
@@ -70,16 +70,16 @@ struct IsReactTurboModule : std::bool_constant<ReactIsReactTurboModuleImpl(stati
70
70
  INTERNAL_REACT_RECOMPOSER_4( \
71
71
  (__VA_ARGS__, INTERNAL_REACT_MODULE_3_ARGS, INTERNAL_REACT_MODULE_2_ARGS, INTERNAL_REACT_MODULE_1_ARG, ))
72
72
 
73
- #define INTERNAL_REACT_MODULE_NO_REGISTRATION_AND_PROVIDER( \
74
- moduleStruct, moduleName, eventEmitterName, isReactTurboModule) \
75
- struct moduleStruct; \
76
- \
77
- constexpr bool ReactIsReactTurboModuleImpl(moduleStruct *) noexcept { return isReactTurboModule; } \
78
- \
79
- template <class TRegistry> \
80
- constexpr void GetReactModuleInfo(moduleStruct *, TRegistry &registry) noexcept { \
81
- registry.RegisterModule( \
82
- moduleName, eventEmitterName, winrt::Microsoft::ReactNative::ReactAttributeId<__COUNTER__>{}); \
73
+ #define INTERNAL_REACT_MODULE_NO_REGISTRATION_AND_PROVIDER( \
74
+ moduleStruct, moduleName, eventEmitterName, isReactTurboModule) \
75
+ struct moduleStruct; \
76
+ \
77
+ [[maybe_unused]] constexpr bool ReactIsReactTurboModuleImpl(moduleStruct *) noexcept { return isReactTurboModule; } \
78
+ \
79
+ template <class TRegistry> \
80
+ constexpr void GetReactModuleInfo(moduleStruct *, TRegistry &registry) noexcept { \
81
+ registry.RegisterModule( \
82
+ moduleName, eventEmitterName, winrt::Microsoft::ReactNative::ReactAttributeId<__COUNTER__>{}); \
83
83
  }
84
84
 
85
85
  // Another version of REACT_MODULE but does not do auto registration
@@ -21,8 +21,8 @@
21
21
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets" />
22
22
 
23
23
  <ItemGroup>
24
- <PackageReference Include="boost" Version="1.83.0.0" />
24
+ <PackageReference Include="boost" Version="1.84.0.0" />
25
25
  <PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.2-rc" />
26
26
  </ItemGroup>
27
27
 
28
- </Project>
28
+ </Project>
@@ -23,8 +23,8 @@
23
23
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.targets" />
24
24
 
25
25
  <ItemGroup>
26
- <PackageReference Include="boost" Version="1.83.0.0" />
26
+ <PackageReference Include="boost" Version="1.84.0.0" />
27
27
  <PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.2-rc" />
28
28
  </ItemGroup>
29
29
 
30
- </Project>
30
+ </Project>
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.81.12</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.81.15</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>81</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>12</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>15</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>3cee5cf0696f319d4ce543e4267a96762b3a65a4</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>38021b85ed4f13c35a4c9aa7cb2fe2e873aa0117</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -249,7 +249,7 @@
249
249
  </ProjectReference>
250
250
  </ItemGroup>
251
251
  <ItemGroup>
252
- <PackageReference Include="boost" Version="1.83.0.0" />
252
+ <PackageReference Include="boost" Version="1.84.0.0" />
253
253
  <PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
254
254
  </ItemGroup>
255
255
  <PropertyGroup>