react-native-windows 0.82.0 → 0.82.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 (36) hide show
  1. package/Microsoft.ReactNative/Base/CxxReactIncludes.h +11 -0
  2. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +52 -2
  3. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +70 -49
  4. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -1
  5. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +7 -2
  6. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
  7. package/Microsoft.ReactNative/Pch/pch.h +2 -0
  8. package/Microsoft.ReactNative/ReactHost/CrashManager.cpp +5 -0
  9. package/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +1 -0
  10. package/PropertySheets/CIBuildOptimizations.props +29 -0
  11. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.props +10 -0
  12. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +10 -0
  13. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  14. package/README.md +1 -1
  15. package/ReactCommon/ReactCommon.vcxproj +10 -10
  16. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +379 -0
  17. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +47 -0
  18. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +143 -0
  19. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +98 -0
  20. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +254 -0
  21. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +9 -0
  22. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +91 -0
  23. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +147 -0
  24. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +622 -0
  25. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +121 -0
  26. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +409 -0
  27. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/BaseViewProps.cpp +628 -0
  28. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +79 -0
  29. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +138 -0
  30. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +732 -0
  31. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +687 -0
  32. package/Scripts/OfficeReact.Win32.nuspec +0 -11
  33. package/Shared/Networking/WinRTWebSocketResource.cpp +5 -4
  34. package/Shared/Shared.vcxitems +9 -9
  35. package/package.json +1 -1
  36. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +2 -0
@@ -7,9 +7,20 @@
7
7
 
8
8
  #include "FollyIncludes.h"
9
9
 
10
+ #pragma warning(push)
11
+ #pragma warning(disable : 4996) // deprecated APIs in cxxreact headers
12
+
10
13
  #include <cxxreact/JSBigString.h>
14
+ #include <cxxreact/JSExecutor.h>
11
15
  #include <cxxreact/MessageQueueThread.h>
16
+ #include <cxxreact/ModuleRegistry.h>
17
+ #include <cxxreact/NativeModule.h>
18
+ #include <cxxreact/RAMBundleRegistry.h>
12
19
  #include <fbsystrace.h>
20
+ #include <jsiexecutor/jsireact/JSIExecutor.h>
21
+ #include <jsiexecutor/jsireact/JSINativeModules.h>
13
22
  #include <yoga/Yoga.h>
14
23
 
15
24
  #include <ReactCommon/TurboModule.h>
25
+
26
+ #pragma warning(pop)
@@ -1210,6 +1210,30 @@ void CompositionEventHandler::onPointerPressed(
1210
1210
  ActiveTouch activeTouch{0};
1211
1211
  activeTouch.touchType = UITouchType::Mouse;
1212
1212
 
1213
+ // Map PointerUpdateKind to W3C button value
1214
+ // https://developer.mozilla.org/docs/Web/API/MouseEvent/button
1215
+ auto updateKind = pointerPoint.Properties().PointerUpdateKind();
1216
+ switch (updateKind) {
1217
+ case Composition::Input::PointerUpdateKind::LeftButtonPressed:
1218
+ activeTouch.button = 0;
1219
+ break;
1220
+ case Composition::Input::PointerUpdateKind::MiddleButtonPressed:
1221
+ activeTouch.button = 1;
1222
+ break;
1223
+ case Composition::Input::PointerUpdateKind::RightButtonPressed:
1224
+ activeTouch.button = 2;
1225
+ break;
1226
+ case Composition::Input::PointerUpdateKind::XButton1Pressed:
1227
+ activeTouch.button = 3;
1228
+ break;
1229
+ case Composition::Input::PointerUpdateKind::XButton2Pressed:
1230
+ activeTouch.button = 4;
1231
+ break;
1232
+ default:
1233
+ activeTouch.button = -1;
1234
+ break;
1235
+ }
1236
+
1213
1237
  while (targetComponentView) {
1214
1238
  if (auto eventEmitter =
1215
1239
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(targetComponentView)
@@ -1394,8 +1418,34 @@ facebook::react::PointerEvent CompositionEventHandler::CreatePointerEventFromAct
1394
1418
 
1395
1419
  event.detail = 0;
1396
1420
 
1397
- // event.button = activeTouch.button;
1398
- // event.buttons = ButtonMaskToButtons(activeTouch.buttonMask);
1421
+ event.button = activeTouch.button;
1422
+
1423
+ // Build W3C buttons bitmask from the active button
1424
+ // https://developer.mozilla.org/docs/Web/API/MouseEvent/buttons
1425
+ if (IsEndishEventType(eventType)) {
1426
+ event.buttons = 0;
1427
+ } else {
1428
+ switch (activeTouch.button) {
1429
+ case 0:
1430
+ event.buttons = 1;
1431
+ break; // primary
1432
+ case 1:
1433
+ event.buttons = 4;
1434
+ break; // auxiliary (middle)
1435
+ case 2:
1436
+ event.buttons = 2;
1437
+ break; // secondary (right)
1438
+ case 3:
1439
+ event.buttons = 8;
1440
+ break; // X1
1441
+ case 4:
1442
+ event.buttons = 16;
1443
+ break; // X2
1444
+ default:
1445
+ event.buttons = 0;
1446
+ break;
1447
+ }
1448
+ }
1399
1449
 
1400
1450
  // UpdatePointerEventModifierFlags(event, activeTouch.modifierFlags);
1401
1451
 
@@ -246,6 +246,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
246
246
  //@cmember Converts screen coordinates of a specified point to the client coordinates
247
247
  BOOL TxScreenToClient(LPPOINT lppt) override {
248
248
  winrt::Windows::Foundation::Point pt{static_cast<float>(lppt->x), static_cast<float>(lppt->y)};
249
+ pt.X -= m_outer->m_contentOffsetPx.x;
250
+ pt.Y -= m_outer->m_contentOffsetPx.y;
249
251
  auto localpt = m_outer->ScreenToLocal(pt);
250
252
  lppt->x = static_cast<LONG>(localpt.X);
251
253
  lppt->y = static_cast<LONG>(localpt.Y);
@@ -255,9 +257,14 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
255
257
  //@cmember Converts the client coordinates of a specified point to screen coordinates
256
258
  BOOL TxClientToScreen(LPPOINT lppt) override {
257
259
  winrt::Windows::Foundation::Point pt{static_cast<float>(lppt->x), static_cast<float>(lppt->y)};
260
+
261
+ if (!m_outer->m_parent) {
262
+ return false;
263
+ }
264
+
258
265
  auto screenpt = m_outer->LocalToScreen(pt);
259
- lppt->x = static_cast<LONG>(screenpt.X);
260
- lppt->y = static_cast<LONG>(screenpt.Y);
266
+ lppt->x = static_cast<LONG>(screenpt.X) + m_outer->m_contentOffsetPx.x;
267
+ lppt->y = static_cast<LONG>(screenpt.Y) + m_outer->m_contentOffsetPx.y;
261
268
  return true;
262
269
  }
263
270
 
@@ -276,20 +283,25 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
276
283
  //@cmember Retrieves the coordinates of a window's client area
277
284
  HRESULT TxGetClientRect(LPRECT prc) override {
278
285
  *prc = m_outer->getClientRect();
286
+
287
+ prc->top += m_outer->m_contentOffsetPx.y;
288
+ prc->bottom += m_outer->m_contentOffsetPx.y -
289
+ static_cast<LONG>(m_outer->m_layoutMetrics.contentInsets.bottom * m_outer->m_layoutMetrics.pointScaleFactor);
290
+ prc->left += m_outer->m_contentOffsetPx.x;
291
+ prc->right += m_outer->m_contentOffsetPx.x -
292
+ static_cast<LONG>(m_outer->m_layoutMetrics.contentInsets.right * m_outer->m_layoutMetrics.pointScaleFactor);
293
+
279
294
  return S_OK;
280
295
  }
281
296
 
282
297
  //@cmember Get the view rectangle relative to the inset
283
298
  HRESULT TxGetViewInset(LPRECT prc) override {
284
299
  // Inset is in HIMETRIC
285
- constexpr float HmPerInchF = 2540.0f;
286
- constexpr float PointsPerInch = 96.0f;
287
- constexpr float dipToHm = HmPerInchF / PointsPerInch;
288
300
 
289
- prc->left = static_cast<LONG>(m_outer->m_layoutMetrics.contentInsets.left * dipToHm);
290
- prc->top = static_cast<LONG>(m_outer->m_layoutMetrics.contentInsets.top * dipToHm);
291
- prc->bottom = static_cast<LONG>(m_outer->m_layoutMetrics.contentInsets.bottom * dipToHm);
292
- prc->right = static_cast<LONG>(m_outer->m_layoutMetrics.contentInsets.right * dipToHm);
301
+ prc->left = 0;
302
+ prc->top = 0;
303
+ prc->bottom = 0;
304
+ prc->right = 0;
293
305
 
294
306
  return NOERROR;
295
307
  }
@@ -492,11 +504,6 @@ AutoCorrectOffCallback(LANGID langid, const WCHAR *pszBefore, WCHAR *pszAfter, L
492
504
  facebook::react::AttributedString WindowsTextInputComponentView::getAttributedString() const {
493
505
  // Use BaseTextShadowNode to get attributed string from children
494
506
 
495
- auto childTextAttributes = facebook::react::TextAttributes::defaultTextAttributes();
496
- childTextAttributes.fontSizeMultiplier = m_fontSizeMultiplier;
497
-
498
- childTextAttributes.apply(windowsTextInputProps().textAttributes);
499
-
500
507
  auto attributedString = facebook::react::AttributedString{};
501
508
  // auto attachments = facebook::react::BaseTextShadowNode::Attachments{};
502
509
 
@@ -1114,6 +1121,9 @@ void WindowsTextInputComponentView::updateProps(
1114
1121
  !facebook::react::floatEquality(
1115
1122
  oldTextInputProps.textAttributes.letterSpacing, newTextInputProps.textAttributes.letterSpacing) ||
1116
1123
  oldTextInputProps.textAttributes.fontFamily != newTextInputProps.textAttributes.fontFamily ||
1124
+ oldTextInputProps.textAttributes.fontStyle != newTextInputProps.textAttributes.fontStyle ||
1125
+ oldTextInputProps.textAttributes.textDecorationLineType !=
1126
+ newTextInputProps.textAttributes.textDecorationLineType ||
1117
1127
  !facebook::react::floatEquality(
1118
1128
  oldTextInputProps.textAttributes.maxFontSizeMultiplier,
1119
1129
  newTextInputProps.textAttributes.maxFontSizeMultiplier)) {
@@ -1129,6 +1139,7 @@ void WindowsTextInputComponentView::updateProps(
1129
1139
  }
1130
1140
 
1131
1141
  if (oldTextInputProps.multiline != newTextInputProps.multiline) {
1142
+ m_recalculateContentVerticalOffset = true;
1132
1143
  m_multiline = newTextInputProps.multiline;
1133
1144
  m_propBitsMask |= TXTBIT_MULTILINE | TXTBIT_WORDWRAP;
1134
1145
  if (newTextInputProps.multiline) {
@@ -1278,6 +1289,10 @@ void WindowsTextInputComponentView::updateLayoutMetrics(
1278
1289
  unsigned int newWidth = static_cast<unsigned int>(layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor);
1279
1290
  unsigned int newHeight = static_cast<unsigned int>(layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor);
1280
1291
 
1292
+ if (newHeight != m_imgHeight || oldLayoutMetrics.pointScaleFactor != layoutMetrics.pointScaleFactor) {
1293
+ m_recalculateContentVerticalOffset = true;
1294
+ }
1295
+
1281
1296
  if (newWidth != m_imgWidth || newHeight != m_imgHeight) {
1282
1297
  m_drawingSurface = nullptr; // Invalidate surface if we get a size change
1283
1298
  }
@@ -1416,6 +1431,8 @@ void WindowsTextInputComponentView::FinalizeUpdates(
1416
1431
 
1417
1432
  void WindowsTextInputComponentView::UpdatePropertyBits() noexcept {
1418
1433
  if (m_propBitsMask != 0) {
1434
+ if ((m_propBits & TXTBIT_CHARFORMATCHANGE) == TXTBIT_CHARFORMATCHANGE)
1435
+ m_recalculateContentVerticalOffset = true;
1419
1436
  DrawBlock db(*this);
1420
1437
  winrt::check_hresult(m_textServices->OnTxPropertyBitsChange(m_propBitsMask, m_propBits));
1421
1438
  m_propBitsMask = 0;
@@ -1427,6 +1444,10 @@ void WindowsTextInputComponentView::InternalFinalize() noexcept {
1427
1444
  if (m_mounted) {
1428
1445
  UpdatePropertyBits();
1429
1446
 
1447
+ if (m_recalculateContentVerticalOffset) {
1448
+ calculateContentVerticalOffset();
1449
+ }
1450
+
1430
1451
  ensureDrawingSurface();
1431
1452
  if (m_needsRedraw) {
1432
1453
  DrawText();
@@ -1488,12 +1509,6 @@ void WindowsTextInputComponentView::UpdateCharFormat() noexcept {
1488
1509
  // m_crText = RemoveAlpha(fontDetails.FontColor);
1489
1510
  // }
1490
1511
 
1491
- // set font face
1492
- // cfNew.dwMask |= CFM_FACE;
1493
- // NetUIWzCchCopy(cfNew.szFaceName, _countof(cfNew.szFaceName), fontDetails.FontName.c_str());
1494
- // cfNew.bPitchAndFamily = FF_DONTCARE;
1495
-
1496
- // set font size -- 15 to convert twips to pt
1497
1512
  const auto &props = windowsTextInputProps();
1498
1513
  float fontSize =
1499
1514
  (std::isnan(props.textAttributes.fontSize) ? facebook::react::TextAttributes::defaultTextAttributes().fontSize
@@ -1504,8 +1519,8 @@ void WindowsTextInputComponentView::UpdateCharFormat() noexcept {
1504
1519
  fontSize *=
1505
1520
  (maxFontSizeMultiplier >= 1.0f) ? std::min(maxFontSizeMultiplier, m_fontSizeMultiplier) : m_fontSizeMultiplier;
1506
1521
 
1507
- // TODO get fontSize from props.textAttributes, or defaultTextAttributes, or fragment?
1508
1522
  cfNew.dwMask |= CFM_SIZE;
1523
+ // set font size -- 15 to convert twips to pt
1509
1524
  cfNew.yHeight = static_cast<LONG>(fontSize * 15);
1510
1525
 
1511
1526
  // set bold
@@ -1540,7 +1555,11 @@ void WindowsTextInputComponentView::UpdateCharFormat() noexcept {
1540
1555
  std::wstring fontFamily =
1541
1556
  std::wstring(props.textAttributes.fontFamily.begin(), props.textAttributes.fontFamily.end());
1542
1557
  wcsncpy_s(cfNew.szFaceName, fontFamily.c_str(), LF_FACESIZE);
1558
+ } else {
1559
+ cfNew.dwMask |= CFM_FACE;
1560
+ wcsncpy_s(cfNew.szFaceName, L"Segoe UI\0", LF_FACESIZE);
1543
1561
  }
1562
+ cfNew.bPitchAndFamily = FF_DONTCARE;
1544
1563
 
1545
1564
  // set char offset
1546
1565
  cfNew.dwMask |= CFM_OFFSET;
@@ -1549,7 +1568,8 @@ void WindowsTextInputComponentView::UpdateCharFormat() noexcept {
1549
1568
  // set letter spacing
1550
1569
  float letterSpacing = props.textAttributes.letterSpacing;
1551
1570
  if (!std::isnan(letterSpacing)) {
1552
- updateLetterSpacing(letterSpacing);
1571
+ cfNew.dwMask |= CFM_SPACING;
1572
+ cfNew.sSpacing = static_cast<SHORT>(letterSpacing * 20); // Convert to TWIPS
1553
1573
  }
1554
1574
 
1555
1575
  // set charset
@@ -1665,7 +1685,7 @@ winrt::com_ptr<::IDWriteTextLayout> WindowsTextInputComponentView::CreatePlaceho
1665
1685
  const auto &props = windowsTextInputProps();
1666
1686
  facebook::react::TextAttributes textAttributes = props.textAttributes;
1667
1687
  if (std::isnan(props.textAttributes.fontSize)) {
1668
- textAttributes.fontSize = 12.0f;
1688
+ facebook::react::TextAttributes::defaultTextAttributes().fontSize;
1669
1689
  }
1670
1690
  textAttributes.fontSizeMultiplier = m_fontSizeMultiplier;
1671
1691
  fragment1.string = props.placeholder;
@@ -1682,6 +1702,26 @@ winrt::com_ptr<::IDWriteTextLayout> WindowsTextInputComponentView::CreatePlaceho
1682
1702
  return textLayout;
1683
1703
  }
1684
1704
 
1705
+ void WindowsTextInputComponentView::calculateContentVerticalOffset() noexcept {
1706
+ m_recalculateContentVerticalOffset = false;
1707
+
1708
+ const auto &props = windowsTextInputProps();
1709
+
1710
+ m_contentOffsetPx = {
1711
+ static_cast<LONG>(m_layoutMetrics.contentInsets.left * m_layoutMetrics.pointScaleFactor),
1712
+ static_cast<LONG>(m_layoutMetrics.contentInsets.top * m_layoutMetrics.pointScaleFactor)};
1713
+
1714
+ if (props.multiline) {
1715
+ // Align to the top for multiline
1716
+ return;
1717
+ }
1718
+
1719
+ auto [contentWidth, contentHeight] = GetContentSize();
1720
+
1721
+ m_contentOffsetPx.y += static_cast<LONG>(std::round(
1722
+ ((m_layoutMetrics.getContentFrame().size.height - contentHeight) / 2) * m_layoutMetrics.pointScaleFactor));
1723
+ }
1724
+
1685
1725
  void WindowsTextInputComponentView::DrawText() noexcept {
1686
1726
  m_needsRedraw = true;
1687
1727
  if (m_cDrawBlock || theme()->IsEmpty() || !m_textServices) {
@@ -1707,16 +1747,13 @@ void WindowsTextInputComponentView::DrawText() noexcept {
1707
1747
  assert(d2dDeviceContext->GetUnitMode() == D2D1_UNIT_MODE_DIPS);
1708
1748
 
1709
1749
  RECTL rc{
1710
- static_cast<LONG>(offset.x),
1711
- static_cast<LONG>(offset.y),
1712
- static_cast<LONG>(offset.x) + static_cast<LONG>(m_imgWidth),
1713
- static_cast<LONG>(offset.y) + static_cast<LONG>(m_imgHeight)};
1750
+ offset.x + m_contentOffsetPx.x,
1751
+ offset.y + m_contentOffsetPx.y,
1752
+ offset.x + m_contentOffsetPx.x + static_cast<LONG>(m_imgWidth),
1753
+ offset.y + m_contentOffsetPx.y + static_cast<LONG>(m_imgHeight)};
1714
1754
 
1715
1755
  RECT rcClient{
1716
- static_cast<LONG>(offset.x),
1717
- static_cast<LONG>(offset.y),
1718
- static_cast<LONG>(offset.x) + static_cast<LONG>(m_imgWidth),
1719
- static_cast<LONG>(offset.y) + static_cast<LONG>(m_imgHeight)};
1756
+ offset.x, offset.y, offset.x + static_cast<LONG>(m_imgWidth), offset.y + static_cast<LONG>(m_imgHeight)};
1720
1757
 
1721
1758
  {
1722
1759
  m_cDrawBlock++; // Dont use AutoDrawBlock as we are already in draw, and dont need to draw again.
@@ -1771,8 +1808,8 @@ void WindowsTextInputComponentView::DrawText() noexcept {
1771
1808
  // draw text
1772
1809
  d2dDeviceContext->DrawTextLayout(
1773
1810
  D2D1::Point2F(
1774
- static_cast<FLOAT>((offset.x + m_layoutMetrics.contentInsets.left) / m_layoutMetrics.pointScaleFactor),
1775
- static_cast<FLOAT>((offset.y + m_layoutMetrics.contentInsets.top) / m_layoutMetrics.pointScaleFactor)),
1811
+ static_cast<FLOAT>(offset.x + m_contentOffsetPx.x) / m_layoutMetrics.pointScaleFactor,
1812
+ static_cast<FLOAT>(offset.y + m_contentOffsetPx.y) / m_layoutMetrics.pointScaleFactor),
1776
1813
  textLayout.get(),
1777
1814
  brush.get(),
1778
1815
  D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT);
@@ -1848,22 +1885,6 @@ void WindowsTextInputComponentView::autoCapitalizeOnUpdateProps(
1848
1885
  }
1849
1886
  }
1850
1887
 
1851
- void WindowsTextInputComponentView::updateLetterSpacing(float letterSpacing) noexcept {
1852
- CHARFORMAT2W cf = {};
1853
- cf.cbSize = sizeof(CHARFORMAT2W);
1854
- cf.dwMask = CFM_SPACING;
1855
- cf.sSpacing = static_cast<SHORT>(letterSpacing * 20); // Convert to TWIPS
1856
-
1857
- LRESULT res;
1858
-
1859
- // Apply to all existing text like placeholder
1860
- winrt::check_hresult(m_textServices->TxSendMessage(EM_SETCHARFORMAT, SCF_ALL, reinterpret_cast<LPARAM>(&cf), &res));
1861
-
1862
- // Apply to future text input
1863
- winrt::check_hresult(
1864
- m_textServices->TxSendMessage(EM_SETCHARFORMAT, SCF_SELECTION, reinterpret_cast<LPARAM>(&cf), &res));
1865
- }
1866
-
1867
1888
  void WindowsTextInputComponentView::updateAutoCorrect(bool enable) noexcept {
1868
1889
  LRESULT lresult;
1869
1890
  winrt::check_hresult(m_textServices->TxSendMessage(
@@ -117,10 +117,10 @@ struct WindowsTextInputComponentView
117
117
  const std::string &previousCapitalizationType,
118
118
  const std::string &newcapitalizationType) noexcept;
119
119
 
120
- void updateLetterSpacing(float letterSpacing) noexcept;
121
120
  void updateAutoCorrect(bool value) noexcept;
122
121
  void updateSpellCheck(bool value) noexcept;
123
122
  void ShowContextMenu(const winrt::Windows::Foundation::Point &position) noexcept;
123
+ void calculateContentVerticalOffset() noexcept;
124
124
 
125
125
  winrt::Windows::UI::Composition::CompositionSurfaceBrush m_brush{nullptr};
126
126
  winrt::Microsoft::ReactNative::Composition::Experimental::ICaretVisual m_caretVisual{nullptr};
@@ -145,6 +145,9 @@ struct WindowsTextInputComponentView
145
145
  bool m_hasFocus{false};
146
146
  bool m_clearTextOnSubmit{false};
147
147
  bool m_multiline{false};
148
+ LONG m_contentVerticalOffsetPx{0}; // Used to center single line text within the client rect
149
+ bool m_recalculateContentVerticalOffset{true};
150
+ POINT m_contentOffsetPx{0, 0};
148
151
  DWORD m_propBitsMask{0};
149
152
  DWORD m_propBits{0};
150
153
  HCURSOR m_hcursor{nullptr};
@@ -96,7 +96,10 @@ void WindowsTextLayoutManager::GetTextLayout(
96
96
 
97
97
  winrt::com_ptr<IDWriteTextFormat> spTextFormat;
98
98
 
99
- float fontSizeText = outerFragment.textAttributes.fontSize;
99
+ float fontSizeText =
100
+ (std::isnan(outerFragment.textAttributes.fontSize)
101
+ ? facebook::react::TextAttributes::defaultTextAttributes().fontSize
102
+ : outerFragment.textAttributes.fontSize);
100
103
  if (outerFragment.textAttributes.allowFontScaling.value_or(true) &&
101
104
  !std::isnan(outerFragment.textAttributes.fontSizeMultiplier)) {
102
105
  float maxFontSizeMultiplierText = cDefaultMaxFontSizeMultiplier;
@@ -287,7 +290,9 @@ void WindowsTextLayoutManager::GetTextLayout(
287
290
  maxFontSizeMultiplier =
288
291
  (!std::isnan(attributes.maxFontSizeMultiplier) ? attributes.maxFontSizeMultiplier
289
292
  : cDefaultMaxFontSizeMultiplier);
290
- float fontSize = attributes.fontSize;
293
+ float fontSize =
294
+ (std::isnan(attributes.fontSize) ? facebook::react::TextAttributes::defaultTextAttributes().fontSize
295
+ : attributes.fontSize);
291
296
  if (attributes.allowFontScaling.value_or(true) && (!std::isnan(attributes.fontSizeMultiplier))) {
292
297
  fontSize *= (maxFontSizeMultiplier >= 1.0f) ? std::min(maxFontSizeMultiplier, attributes.fontSizeMultiplier)
293
298
  : attributes.fontSizeMultiplier;
@@ -365,7 +365,7 @@
365
365
  <ClCompile Include="Modules\I18nManagerModule.cpp" />
366
366
  <ClCompile Include="Modules\ImageViewManagerModule.cpp" />
367
367
  <ClCompile Include="Modules\LinkingManagerModule.cpp" />
368
- <ClCompile Include="Modules\LogBoxModule.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
368
+ <ClCompile Include="Modules\LogBoxModule.cpp" />
369
369
  <ClCompile Include="Pch\pch.cpp">
370
370
  <PrecompiledHeader>Create</PrecompiledHeader>
371
371
  </ClCompile>
@@ -49,3 +49,5 @@
49
49
  #include <activeObject/activeObject.h>
50
50
  #include <functional/functorRef.h>
51
51
  #include <future/future.h>
52
+
53
+ #include <Base/CxxReactIncludes.h>
@@ -9,6 +9,9 @@
9
9
 
10
10
  #include <WerApi.h>
11
11
 
12
+ #pragma warning(push)
13
+ #pragma warning(disable : 4996) // signal, _wfopen_s, _fileno, tmpfile_s, fread — CRT deprecated warnings
14
+
12
15
  namespace Mso::React {
13
16
 
14
17
  // When calling SetUnhandledExceptionFilter the previous filter is returned.
@@ -123,3 +126,5 @@ void InternalUnregisterCustomHandler() noexcept {
123
126
  #endif
124
127
 
125
128
  } // namespace Mso::React
129
+
130
+ #pragma warning(pop)
@@ -12,6 +12,7 @@
12
12
  #pragma warning(disable : 4068)
13
13
  #pragma warning(disable : 4100)
14
14
  #pragma warning(disable : 4324) // structure was padded due to alignment specifier
15
+ #pragma warning(disable : 4996) // deprecated APIs in cxxreact headers
15
16
 
16
17
  #pragma push_macro("ERROR")
17
18
  #pragma push_macro("Check")
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <!--
4
+ CI-specific C++ build optimizations for the publish pipeline.
5
+
6
+ This file is injected via /p:ForceImportAfterCppTargets in .ado/publish.yml.
7
+ It overrides defaults that are tuned for developer workflows (incremental builds,
8
+ file tracking) with settings that are better for CI clean builds.
9
+
10
+ 1. Multi-threaded compilation: Use CL.exe internal /MP parallelism instead of
11
+ MSBuild's MultiToolTask (which spawns one CL.exe+Tracker.exe per source file).
12
+ /MP lets CL.exe compile all files in one process with shared PCH state.
13
+
14
+ 2. Disable file tracking: CI always does clean builds, so incremental build
15
+ tracking (MinimalRebuild, TrackFileAccess) is pure overhead.
16
+ -->
17
+ <PropertyGroup>
18
+ <MultiProcCL>false</MultiProcCL>
19
+ <MinimalRebuildFromTracking>false</MinimalRebuildFromTracking>
20
+ <TrackFileAccess>false</TrackFileAccess>
21
+ </PropertyGroup>
22
+ <ItemDefinitionGroup>
23
+ <ClCompile>
24
+ <MultiProcessorCompilation>false</MultiProcessorCompilation>
25
+ <MinimalRebuild>false</MinimalRebuild>
26
+ <AdditionalOptions>%(AdditionalOptions) /MP</AdditionalOptions>
27
+ </ClCompile>
28
+ </ItemDefinitionGroup>
29
+ </Project>
@@ -13,6 +13,16 @@
13
13
  <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
14
14
  </Target>
15
15
 
16
+ <!--
17
+ Lib/module projects generate Windows Metadata. Explicitly set this to
18
+ prevent the CppWinRT NuGet target CppWinRTComputeGetResolvedWinMD from
19
+ trying to compute it, which can cause MSB4006 circular dependency errors
20
+ during parallel builds (see https://github.com/microsoft/cppwinrt/issues/950).
21
+ -->
22
+ <PropertyGroup Label="CppWinRT">
23
+ <CppWinRTGenerateWindowsMetadata Condition="'$(CppWinRTGenerateWindowsMetadata)' == ''">true</CppWinRTGenerateWindowsMetadata>
24
+ </PropertyGroup>
25
+
16
26
  <!-- Import common props sheets common to all Composition projects. -->
17
27
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.Common.props" />
18
28
 
@@ -14,6 +14,16 @@
14
14
  <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
15
15
  </Target>
16
16
 
17
+ <!--
18
+ Lib/module projects generate Windows Metadata. Explicitly set this to
19
+ prevent the CppWinRT NuGet target CppWinRTComputeGetResolvedWinMD from
20
+ trying to compute it, which can cause MSB4006 circular dependency errors
21
+ during parallel builds (see https://github.com/microsoft/cppwinrt/issues/950).
22
+ -->
23
+ <PropertyGroup Label="CppWinRT">
24
+ <CppWinRTGenerateWindowsMetadata Condition="'$(CppWinRTGenerateWindowsMetadata)' == ''">true</CppWinRTGenerateWindowsMetadata>
25
+ </PropertyGroup>
26
+
17
27
  <!-- Import common props sheets common to all UWP projects. -->
18
28
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
19
29
 
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.82.0</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.82.3</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>82</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>3</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>b550ed8512916d3f58fc43e314f25aef5118605e</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>44975125c841b61bdf863328c0076bbf5bb3e7af</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
package/README.md CHANGED
@@ -63,7 +63,7 @@ React Native has [great documentation](https://reactnative.dev/docs/getting-star
63
63
  - Check the [samples repo](https://github.com/microsoft/react-native-windows-samples) for more standalone samples.
64
64
  - The [React Native Gallery](https://github.com/microsoft/react-native-gallery) app demonstrates various components in an interactive way.
65
65
  - Check out the [React Native Developer Blog](https://devblogs.microsoft.com/react-native/) to see examples from past conference talks, blog posts, and more.
66
- - For more sample code browse the [RNTester folder](https://github.com/microsoft/react-native-windows/tree/main/packages/e2e-test-app-fabric/windows/RNTesterApp) in the GitHub web UI.
66
+ - For more sample code browse the [RNTester folder](https://github.com/microsoft/react-native-windows/tree/main/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric) in the GitHub web UI.
67
67
 
68
68
  ## 📢 Contributing
69
69
  See [Contributing guidelines](https://github.com/microsoft/react-native-windows/blob/main/CONTRIBUTING.md) for how to setup your fork of the repo and start a PR to contribute to React Native for Windows.
@@ -118,16 +118,16 @@
118
118
  </ItemGroup>
119
119
  <ItemGroup>
120
120
  <!-- NEW ARCH: These files contain utility functions still used by New Architecture (with deprecated classes also present) -->
121
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\ReactMarker.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
122
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSExecutor.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
123
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\Instance.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
124
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeToJsBridge.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
125
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSIndexedRAMBundle.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
126
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\MethodCall.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
127
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\RAMBundleRegistry.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
128
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\ModuleRegistry.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
129
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
130
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
121
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\ReactMarker.cpp" />
122
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSExecutor.cpp" />
123
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\Instance.cpp" />
124
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeToJsBridge.cpp" />
125
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSIndexedRAMBundle.cpp" />
126
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\MethodCall.cpp" />
127
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\RAMBundleRegistry.cpp" />
128
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\ModuleRegistry.cpp" />
129
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp" />
130
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp" />
131
131
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsi\jsi\jsi.cpp" />
132
132
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsi\jsi\JSIDynamic.cpp" />
133
133
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.cpp" />