react-native-windows 0.80.0-preview.9 → 0.80.1
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.
- package/Directory.Build.props +6 -0
- package/Folly/TEMP_UntilFollyUpdate/json/json.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +33 -15
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +47 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.h +8 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/Warnings.props +45 -0
- package/README.md +4 -0
- package/Scripts/rnw-dependencies.ps1 +16 -2
- package/package.json +5 -5
- package/templates/cpp-lib/example/metro.config.js +1 -1
package/Directory.Build.props
CHANGED
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
-->
|
|
20
20
|
<EnableSourceLink Condition="'$(EnableSourceLink)' == '' AND '$(BuildingInRnwRepo)' == 'true'">true</EnableSourceLink>
|
|
21
21
|
<EnableSourceLink Condition="'$(EnableSourceLink)' == ''">false</EnableSourceLink>
|
|
22
|
+
|
|
23
|
+
<!-- Symbol Publishing Compliance (Work Item 59264834) - Generate PDB files for Release builds -->
|
|
24
|
+
<DebugSymbols Condition="'$(Configuration)' == 'Release'">true</DebugSymbols>
|
|
25
|
+
<DebugType Condition="'$(Configuration)' == 'Release'">pdbonly</DebugType>
|
|
26
|
+
<IncludeSymbols Condition="'$(Configuration)' == 'Release'">true</IncludeSymbols>
|
|
27
|
+
<IncludeSource Condition="'$(Configuration)' == 'Release'">false</IncludeSource>
|
|
22
28
|
<!-- When bumping the Folly version, be sure to bump the git hash of that version's commit, find the matching fastfloat dependency and build Folly.vcxproj (to update its cgmanifest.json) too. -->
|
|
23
29
|
<FollyVersion>2024.10.14.00</FollyVersion>
|
|
24
30
|
<FastFloatVersion>6.1.4</FastFloatVersion>
|
|
@@ -908,7 +908,7 @@ void escapeStringImpl(
|
|
|
908
908
|
|
|
909
909
|
if (encodeUnicode) {
|
|
910
910
|
// note that this if condition captures utf8 chars
|
|
911
|
-
// with value > 127, so size > 1 byte (or they are
|
|
911
|
+
// with value > 127, so size > 1 byte (or they are allowlisted for
|
|
912
912
|
// Unicode encoding).
|
|
913
913
|
// NOTE: char32_t / char16_t are both unsigned.
|
|
914
914
|
char32_t cp = utf8ToCodePoint(p, e, opts.skip_invalid_utf8);
|
package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
#include <AutoDraw.h>
|
|
9
9
|
#include <Fabric/Composition/CompositionDynamicAutomationProvider.h>
|
|
10
10
|
#include <Fabric/Composition/UiaHelpers.h>
|
|
11
|
+
#include <Fabric/platform/react/renderer/graphics/PlatformColorUtils.h>
|
|
12
|
+
#include <Utils/ThemeUtils.h>
|
|
11
13
|
#include <Utils/ValueUtils.h>
|
|
12
14
|
#include <react/renderer/components/textinput/TextInputState.h>
|
|
15
|
+
#include <react/renderer/graphics/HostPlatformColor.h>
|
|
13
16
|
#include <react/renderer/textlayoutmanager/WindowsTextLayoutManager.h>
|
|
14
17
|
#include <tom.h>
|
|
15
18
|
#include <unicode.h>
|
|
@@ -316,8 +319,10 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
|
|
|
316
319
|
|
|
317
320
|
switch (nIndex) {
|
|
318
321
|
case COLOR_WINDOWTEXT:
|
|
319
|
-
if (m_outer->windowsTextInputProps().textAttributes.foregroundColor)
|
|
320
|
-
|
|
322
|
+
if (m_outer->windowsTextInputProps().textAttributes.foregroundColor) {
|
|
323
|
+
auto color = m_outer->theme()->Color(*m_outer->windowsTextInputProps().textAttributes.foregroundColor);
|
|
324
|
+
return RGB(color.R, color.G, color.B);
|
|
325
|
+
}
|
|
321
326
|
// cr = 0x000000FF;
|
|
322
327
|
break;
|
|
323
328
|
case COLOR_WINDOW:
|
|
@@ -326,8 +331,10 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
|
|
|
326
331
|
break;
|
|
327
332
|
|
|
328
333
|
case COLOR_HIGHLIGHT:
|
|
329
|
-
if (m_outer->windowsTextInputProps().selectionColor)
|
|
330
|
-
|
|
334
|
+
if (m_outer->windowsTextInputProps().selectionColor) {
|
|
335
|
+
auto color = m_outer->theme()->Color(*m_outer->windowsTextInputProps().selectionColor);
|
|
336
|
+
return RGB(color.R, color.G, color.B);
|
|
337
|
+
}
|
|
331
338
|
break;
|
|
332
339
|
|
|
333
340
|
case COLOR_HIGHLIGHTTEXT:
|
|
@@ -340,8 +347,9 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
|
|
|
340
347
|
int r = GetRValue(selectionColor);
|
|
341
348
|
int g = GetGValue(selectionColor);
|
|
342
349
|
int b = GetBValue(selectionColor);
|
|
343
|
-
int brightness = (r
|
|
344
|
-
return brightness >
|
|
350
|
+
int brightness = ::Microsoft::ReactNative::CalculateColorBrightness(r, g, b);
|
|
351
|
+
return brightness > ::Microsoft::ReactNative::kCaretSelectionBrightnessThreshold ? RGB(0, 0, 0)
|
|
352
|
+
: RGB(255, 255, 255);
|
|
345
353
|
}
|
|
346
354
|
break;
|
|
347
355
|
|
|
@@ -1077,13 +1085,9 @@ std::string WindowsTextInputComponentView::DefaultHelpText() const noexcept {
|
|
|
1077
1085
|
void WindowsTextInputComponentView::updateCursorColor(
|
|
1078
1086
|
const facebook::react::SharedColor &cursorColor,
|
|
1079
1087
|
const facebook::react::SharedColor &foregroundColor) noexcept {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
m_caretVisual.Brush(theme()->Brush(*foregroundColor));
|
|
1084
|
-
} else {
|
|
1085
|
-
m_caretVisual.Brush(theme()->PlatformBrush("TextControlForeground"));
|
|
1086
|
-
}
|
|
1088
|
+
const auto &props = windowsTextInputProps();
|
|
1089
|
+
auto caretColor = ::Microsoft::ReactNative::GetCaretColor(cursorColor, foregroundColor, props.backgroundColor);
|
|
1090
|
+
m_caretVisual.Brush(theme()->Brush(*caretColor));
|
|
1087
1091
|
}
|
|
1088
1092
|
|
|
1089
1093
|
void WindowsTextInputComponentView::updateProps(
|
|
@@ -1595,6 +1599,8 @@ void WindowsTextInputComponentView::ensureDrawingSurface() noexcept {
|
|
|
1595
1599
|
|
|
1596
1600
|
void WindowsTextInputComponentView::ShowCaret(bool show) noexcept {
|
|
1597
1601
|
ensureVisual();
|
|
1602
|
+
const auto &props = windowsTextInputProps();
|
|
1603
|
+
updateCursorColor(props.cursorColor, props.textAttributes.foregroundColor);
|
|
1598
1604
|
m_caretVisual.IsVisible(show);
|
|
1599
1605
|
}
|
|
1600
1606
|
|
|
@@ -1689,8 +1695,20 @@ void WindowsTextInputComponentView::DrawText() noexcept {
|
|
|
1689
1695
|
auto color = theme()->D2DColor(*props.placeholderTextColor);
|
|
1690
1696
|
winrt::check_hresult(d2dDeviceContext->CreateSolidColorBrush(color, brush.put()));
|
|
1691
1697
|
} else {
|
|
1692
|
-
|
|
1693
|
-
|
|
1698
|
+
// Use theme-aware placeholder color based on focus state and background
|
|
1699
|
+
// Color selection follows Windows 11 design system semantic colors:
|
|
1700
|
+
// - High contrast: System GrayText for accessibility
|
|
1701
|
+
// - Light backgrounds: Darker grays for better contrast
|
|
1702
|
+
// - Dark backgrounds: Lighter grays for readability
|
|
1703
|
+
winrt::Windows::UI::Color backgroundColor = {};
|
|
1704
|
+
if (facebook::react::isColorMeaningful(props.backgroundColor)) {
|
|
1705
|
+
auto bgColor = (*props.backgroundColor).AsWindowsColor();
|
|
1706
|
+
backgroundColor = bgColor;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
auto placeholderColor = facebook::react::GetTextInputPlaceholderColor(m_hasFocus, backgroundColor);
|
|
1710
|
+
auto d2dColor = theme()->D2DColor(*placeholderColor);
|
|
1711
|
+
winrt::check_hresult(d2dDeviceContext->CreateSolidColorBrush(d2dColor, brush.put()));
|
|
1694
1712
|
}
|
|
1695
1713
|
|
|
1696
1714
|
// Create placeholder text layout
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
#include "PlatformColorUtils.h"
|
|
5
5
|
#include <UI.Xaml.Media.h>
|
|
6
|
+
#include <Utils/ThemeUtils.h>
|
|
6
7
|
#include <Utils/ValueUtils.h>
|
|
7
8
|
#ifndef CORE_ABI
|
|
8
9
|
#include <XamlUtils.h>
|
|
9
10
|
#endif // CORE_ABI
|
|
11
|
+
#include <react/renderer/graphics/Color.h>
|
|
10
12
|
#include <winrt/Windows.UI.ViewManagement.h>
|
|
13
|
+
#include "HostPlatformColor.h"
|
|
11
14
|
|
|
12
15
|
namespace facebook::react {
|
|
13
16
|
|
|
@@ -142,4 +145,48 @@ winrt::Windows::UI::Color ResolvePlatformColor(const std::vector<std::string> &s
|
|
|
142
145
|
return {};
|
|
143
146
|
}
|
|
144
147
|
|
|
148
|
+
SharedColor GetTextInputPlaceholderColor(bool isFocused, const winrt::Windows::UI::Color &backgroundColor) {
|
|
149
|
+
// In high contrast mode, always use system GrayText for accessibility
|
|
150
|
+
auto accessibilitySettings{winrt::Windows::UI::ViewManagement::AccessibilitySettings()};
|
|
151
|
+
if (accessibilitySettings.HighContrast()) {
|
|
152
|
+
auto uiSettings{winrt::Windows::UI::ViewManagement::UISettings()};
|
|
153
|
+
auto grayText = uiSettings.UIElementColor(winrt::Windows::UI::ViewManagement::UIElementType::GrayText);
|
|
154
|
+
return hostPlatformColorFromRGBA(grayText.R, grayText.G, grayText.B, grayText.A);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// When no background color provided (transparent), use Windows system default
|
|
158
|
+
if (backgroundColor.A == 0) {
|
|
159
|
+
// Use system WindowText for default placeholder - matches RN Core behavior
|
|
160
|
+
auto uiSettings{winrt::Windows::UI::ViewManagement::UISettings()};
|
|
161
|
+
auto windowText = uiSettings.UIElementColor(winrt::Windows::UI::ViewManagement::UIElementType::WindowText);
|
|
162
|
+
// Make placeholder text lighter (60% opacity)
|
|
163
|
+
return hostPlatformColorFromRGBA(
|
|
164
|
+
windowText.R, windowText.G, windowText.B, static_cast<uint8_t>(windowText.A * 0.6f));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Use ITU-R BT.601 luminance calculation to determine background brightness
|
|
168
|
+
bool isLightBackground = Microsoft::ReactNative::IsColorLight(backgroundColor);
|
|
169
|
+
|
|
170
|
+
// Use Windows 11 design system semantic colors for optimal contrast and consistency
|
|
171
|
+
// Light backgrounds: TextFillColorPrimary (darker) for focus, TextFillColorSecondary for unfocused
|
|
172
|
+
// Dark backgrounds: TextFillColorPrimary (lighter) for focus, TextFillColorSecondary for unfocused
|
|
173
|
+
if (isLightBackground) {
|
|
174
|
+
if (isFocused) {
|
|
175
|
+
auto color = ResolvePlatformColor({"TextFillColorPrimary"});
|
|
176
|
+
return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
|
|
177
|
+
} else {
|
|
178
|
+
auto color = ResolvePlatformColor({"TextFillColorSecondary"});
|
|
179
|
+
return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
if (isFocused) {
|
|
183
|
+
auto color = ResolvePlatformColor({"TextFillColorPrimary"});
|
|
184
|
+
return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
|
|
185
|
+
} else {
|
|
186
|
+
auto color = ResolvePlatformColor({"TextFillColorSecondary"});
|
|
187
|
+
return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
145
192
|
} // namespace facebook::react
|
|
@@ -5,8 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
#include <winrt/Windows.UI.h>
|
|
7
7
|
|
|
8
|
+
// Forward declaration to avoid circular dependencies
|
|
9
|
+
namespace facebook::react {
|
|
10
|
+
class SharedColor;
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
namespace facebook::react {
|
|
9
14
|
|
|
10
15
|
winrt::Windows::UI::Color ResolvePlatformColor(const std::vector<std::string> &semanticItems);
|
|
11
16
|
|
|
17
|
+
// Get appropriate placeholder text color for TextInput based on focus state and background
|
|
18
|
+
SharedColor GetTextInputPlaceholderColor(bool isFocused, const winrt::Windows::UI::Color &backgroundColor = {});
|
|
19
|
+
|
|
12
20
|
} // namespace facebook::react
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
#include "pch.h"
|
|
5
5
|
#include <Utils/ThemeUtils.h>
|
|
6
6
|
|
|
7
|
+
#ifdef USE_FABRIC
|
|
8
|
+
#include <react/renderer/graphics/Color.h>
|
|
9
|
+
#include <react/renderer/graphics/HostPlatformColor.h>
|
|
10
|
+
#endif
|
|
7
11
|
#include <winuser.h>
|
|
8
12
|
|
|
9
13
|
namespace Microsoft::ReactNative {
|
|
@@ -30,4 +34,49 @@ bool IsInHighContrastWin32() noexcept {
|
|
|
30
34
|
return false;
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
int CalculateColorBrightness(const winrt::Windows::UI::Color &color) noexcept {
|
|
38
|
+
return CalculateColorBrightness(color.R, color.G, color.B);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
int CalculateColorBrightness(int r, int g, int b) noexcept {
|
|
42
|
+
return (r * kColorBrightnessRedWeight + g * kColorBrightnessGreenWeight + b * kColorBrightnessBlueWeight) /
|
|
43
|
+
kColorBrightnessDivisor;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#ifdef USE_FABRIC
|
|
47
|
+
bool isColorMeaningful(const facebook::react::SharedColor &color) noexcept {
|
|
48
|
+
return facebook::react::isColorMeaningful(color);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
facebook::react::SharedColor GetCaretColor(
|
|
52
|
+
const facebook::react::SharedColor &cursorColor,
|
|
53
|
+
const facebook::react::SharedColor &foregroundColor,
|
|
54
|
+
const facebook::react::SharedColor &backgroundColor) noexcept {
|
|
55
|
+
const auto defaultCaretColor =
|
|
56
|
+
facebook::react::hostPlatformColorFromRGBA(0, 0, 0, 0xFF); // Default caret color is black
|
|
57
|
+
|
|
58
|
+
if (cursorColor) {
|
|
59
|
+
return cursorColor;
|
|
60
|
+
} else if (foregroundColor) {
|
|
61
|
+
// Extra Caution if Background color is present
|
|
62
|
+
auto fgWindows = (*foregroundColor).AsWindowsColor();
|
|
63
|
+
int fgBrightness = CalculateColorBrightness(fgWindows);
|
|
64
|
+
|
|
65
|
+
// If foreground is very light and background is also very light, force black caret.
|
|
66
|
+
if (fgBrightness > kCaretLightForegroundThreshold && Microsoft::ReactNative::isColorMeaningful(backgroundColor)) {
|
|
67
|
+
auto bgWindows = (*backgroundColor).AsWindowsColor();
|
|
68
|
+
int bgBrightness = CalculateColorBrightness(bgWindows);
|
|
69
|
+
if (bgBrightness > kCaretLightBackgroundThreshold) {
|
|
70
|
+
// Use opaque black caret
|
|
71
|
+
return defaultCaretColor;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return foregroundColor;
|
|
76
|
+
} else {
|
|
77
|
+
return defaultCaretColor;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
#endif
|
|
81
|
+
|
|
33
82
|
} // namespace Microsoft::ReactNative
|
|
@@ -4,10 +4,41 @@
|
|
|
4
4
|
#pragma once
|
|
5
5
|
|
|
6
6
|
#include <winrt/Windows.UI.h>
|
|
7
|
+
#ifdef USE_FABRIC
|
|
8
|
+
#include <react/renderer/graphics/Color.h>
|
|
9
|
+
#endif
|
|
7
10
|
|
|
8
11
|
namespace Microsoft::ReactNative {
|
|
9
12
|
|
|
13
|
+
// RGB luminance weights per ITU-R BT.601 standard (legacy NTSC weights)
|
|
14
|
+
constexpr int kColorBrightnessRedWeight = 299; // Red coefficient: 299/1000 = 0.299
|
|
15
|
+
constexpr int kColorBrightnessGreenWeight = 587; // Green coefficient: 587/1000 = 0.587
|
|
16
|
+
constexpr int kColorBrightnessBlueWeight = 114; // Blue coefficient: 114/1000 = 0.114
|
|
17
|
+
constexpr int kColorBrightnessDivisor = 1000;
|
|
18
|
+
|
|
19
|
+
// Caret color threshold constants
|
|
20
|
+
constexpr int kCaretLightForegroundThreshold = 240;
|
|
21
|
+
constexpr int kCaretLightBackgroundThreshold = 186;
|
|
22
|
+
constexpr int kCaretSelectionBrightnessThreshold = 125;
|
|
23
|
+
|
|
10
24
|
bool IsColorLight(const winrt::Windows::UI::Color &clr) noexcept;
|
|
11
25
|
bool IsInHighContrastWin32() noexcept;
|
|
12
26
|
|
|
27
|
+
// Calculate brightness using ITU-R BT.601 luminance formula
|
|
28
|
+
int CalculateColorBrightness(const winrt::Windows::UI::Color &color) noexcept;
|
|
29
|
+
|
|
30
|
+
// Calculate brightness from RGB values
|
|
31
|
+
int CalculateColorBrightness(int r, int g, int b) noexcept;
|
|
32
|
+
|
|
33
|
+
#ifdef USE_FABRIC
|
|
34
|
+
// Check if a color is meaningful (handles both PAPER and Fabric architectures)
|
|
35
|
+
bool isColorMeaningful(const facebook::react::SharedColor &color) noexcept;
|
|
36
|
+
|
|
37
|
+
// Determine appropriate caret color based on foreground and background colors
|
|
38
|
+
facebook::react::SharedColor GetCaretColor(
|
|
39
|
+
const facebook::react::SharedColor &cursorColor,
|
|
40
|
+
const facebook::react::SharedColor &foregroundColor,
|
|
41
|
+
const facebook::react::SharedColor &backgroundColor) noexcept;
|
|
42
|
+
#endif
|
|
43
|
+
|
|
13
44
|
} // namespace Microsoft::ReactNative
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.80.
|
|
13
|
+
<ReactNativeWindowsVersion>0.80.1</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>80</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>1</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>220e035c393ea33ba5ddbbf668a576f4334b8928</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
3
|
|
|
4
4
|
<PropertyGroup>
|
|
5
|
+
<!-- SDL MANDATORY WARNINGS (Microsoft Security Development Lifecycle) -->
|
|
6
|
+
<!-- These warnings MUST be enabled and fixed per SDL requirements -->
|
|
7
|
+
<!-- Work Item: #58386089 - Fix warnings identified by native code compiler -->
|
|
8
|
+
<SDLMandatoryWarnings>
|
|
9
|
+
4018; <!-- 'expression' : signed/unsigned mismatch -->
|
|
10
|
+
4055; <!-- 'conversion' : from data pointer to function pointer -->
|
|
11
|
+
4146; <!-- unary minus operator applied to unsigned type -->
|
|
12
|
+
4242; <!-- 'identifier' : conversion with possible loss of data -->
|
|
13
|
+
4244; <!-- 'conversion' conversion with possible loss of data -->
|
|
14
|
+
4267; <!-- 'var' : conversion from size_t with possible loss of data -->
|
|
15
|
+
4302; <!-- 'conversion' : truncation from type1 to type2 -->
|
|
16
|
+
4308; <!-- negative integral constant converted to unsigned type -->
|
|
17
|
+
4509; <!-- nonstandard extension: SEH with destructor -->
|
|
18
|
+
4510; <!-- 'class' : default constructor could not be generated -->
|
|
19
|
+
4532; <!-- jump out of __finally/finally block undefined behavior -->
|
|
20
|
+
4533; <!-- initialization skipped by instruction -->
|
|
21
|
+
4610; <!-- object can never be instantiated -->
|
|
22
|
+
4611; <!-- interaction between function and C++ destruction non-portable -->
|
|
23
|
+
4700; <!-- uninitialized local variable used -->
|
|
24
|
+
4701; <!-- potentially uninitialized local variable used -->
|
|
25
|
+
4703; <!-- potentially uninitialized local pointer variable used -->
|
|
26
|
+
4789; <!-- destination of memory copy too small -->
|
|
27
|
+
4995; <!-- function marked as pragma deprecated -->
|
|
28
|
+
4996 <!-- deprecated function (including std::) -->
|
|
29
|
+
</SDLMandatoryWarnings>
|
|
30
|
+
|
|
31
|
+
<!-- SDL RECOMMENDED WARNINGS (Strongly recommended to fix) -->
|
|
32
|
+
<SDLRecommendedWarnings>
|
|
33
|
+
4287; <!-- unsigned/negative constant mismatch -->
|
|
34
|
+
4365; <!-- signed/unsigned mismatch -->
|
|
35
|
+
4388; <!-- signed/unsigned mismatch in comparison -->
|
|
36
|
+
4545; <!-- expression before comma evaluates to function missing argument list -->
|
|
37
|
+
4546; <!-- function call before comma missing argument list -->
|
|
38
|
+
4547; <!-- operator before comma has no effect -->
|
|
39
|
+
4549 <!-- operator before comma has no effect -->
|
|
40
|
+
</SDLRecommendedWarnings>
|
|
41
|
+
|
|
5
42
|
<!-- Office pre-disabled warnings -->
|
|
6
43
|
<!--
|
|
7
44
|
C4201 - nonstandard extension used : nameless struct/union
|
|
@@ -31,8 +68,16 @@
|
|
|
31
68
|
<!-- /permissive- by default to enforce standards conformance, unless ENABLEPermissive has been set -->
|
|
32
69
|
<AdditionalOptions Condition="'$(ENABLEPermissive)' == ''">/permissive- %(AdditionalOptions)</AdditionalOptions>
|
|
33
70
|
<DisableSpecificWarnings>$(OfficePreDisabledWarnings);$(ExtraWarningsToDisable);$(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
71
|
+
|
|
72
|
+
<!-- SDL REQUIREMENT: Treat warnings as errors -->
|
|
34
73
|
<TreatWarningAsError>true</TreatWarningAsError>
|
|
74
|
+
|
|
75
|
+
<!-- SDL REQUIREMENT: Use /W4 warning level -->
|
|
35
76
|
<WarningLevel>Level4</WarningLevel>
|
|
77
|
+
|
|
78
|
+
<!-- SDL REQUIREMENT: Explicitly enable mandatory warnings as errors -->
|
|
79
|
+
<!-- This ensures SDL mandatory warnings are NEVER disabled -->
|
|
80
|
+
<WarningAsError>$(SDLMandatoryWarnings);%(WarningAsError)</WarningAsError>
|
|
36
81
|
</ClCompile>
|
|
37
82
|
<Link>
|
|
38
83
|
<!--
|
package/README.md
CHANGED
|
@@ -58,6 +58,10 @@ Search the [existing issues](https://github.com/microsoft/react-native-windows/i
|
|
|
58
58
|
## Documentation
|
|
59
59
|
React Native has [great documentation](https://reactnative.dev/docs/getting-started). React Native for Windows adds its own separate [Windows and macOS documentation](https://microsoft.github.io/react-native-windows/) for desktop platform information like API docs and blog updates.
|
|
60
60
|
|
|
61
|
+
### Security Documentation
|
|
62
|
+
- **[Security Configuration Guide](https://github.com/microsoft/react-native-windows/blob/main/docs/security-configuration.md)** - Comprehensive guide for SDL-compliant security configurations
|
|
63
|
+
- **[Security Best Practices](https://github.com/microsoft/react-native-windows/blob/main/docs/security-best-practices.md)** - Secure coding patterns and security API usage
|
|
64
|
+
|
|
61
65
|
### Examples
|
|
62
66
|
- Using the CLI in the [Getting Started](https://microsoft.github.io/react-native-windows/docs/getting-started) guide will set you up with a sample React Native for Windows app that you can begin editing right away.
|
|
63
67
|
- Check the [samples repo](https://github.com/microsoft/react-native-windows-samples) for more standalone samples.
|
|
@@ -459,9 +459,23 @@ $requirements = @(
|
|
|
459
459
|
Install = {
|
|
460
460
|
$ProgressPreference = 'Ignore';
|
|
461
461
|
$url = "https://github.com/microsoft/WinAppDriver/releases/download/v1.2.1/WindowsApplicationDriver_1.2.1.msi";
|
|
462
|
+
$downloadPath = "$env:TEMP\WindowsApplicationDriver.msi"
|
|
462
463
|
Write-Verbose "Downloading WinAppDriver from $url";
|
|
463
|
-
Invoke-WebRequest -UseBasicParsing $url -OutFile $
|
|
464
|
-
|
|
464
|
+
Invoke-WebRequest -UseBasicParsing $url -OutFile $downloadPath
|
|
465
|
+
|
|
466
|
+
# SDL Compliance: Verify signature (Work Item 58386093)
|
|
467
|
+
$signature = Get-AuthenticodeSignature $downloadPath
|
|
468
|
+
if ($signature.Status -ne "Valid") {
|
|
469
|
+
Remove-Item $downloadPath -ErrorAction SilentlyContinue
|
|
470
|
+
throw "WinAppDriver signature verification failed"
|
|
471
|
+
}
|
|
472
|
+
if ($signature.SignerCertificate.Subject -notlike "*Microsoft*") {
|
|
473
|
+
Remove-Item $downloadPath -ErrorAction SilentlyContinue
|
|
474
|
+
throw "WinAppDriver not signed by Microsoft"
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
& $downloadPath /q
|
|
478
|
+
Remove-Item $downloadPath -ErrorAction SilentlyContinue
|
|
465
479
|
};
|
|
466
480
|
HasVerboseOutput = $true;
|
|
467
481
|
Optional = $true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "17.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "17.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "17.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.80.0
|
|
29
|
+
"@react-native-windows/cli": "0.80.0",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/assets-registry": "0.80.0",
|
|
32
32
|
"@react-native/codegen": "0.80.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"yargs": "^17.6.2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@react-native-windows/codegen": "0.80.0
|
|
71
|
+
"@react-native-windows/codegen": "0.80.0",
|
|
72
72
|
"@react-native/metro-config": "0.80.0",
|
|
73
73
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
74
74
|
"@rnw-scripts/eslint-config": "1.2.36",
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
"react-native": "^0.80.0"
|
|
96
96
|
},
|
|
97
97
|
"beachball": {
|
|
98
|
-
"defaultNpmTag": "
|
|
98
|
+
"defaultNpmTag": "latest",
|
|
99
99
|
"disallowedChangeTypes": [
|
|
100
100
|
"major",
|
|
101
101
|
"minor",
|
|
102
|
-
"
|
|
102
|
+
"prerelease",
|
|
103
103
|
"premajor",
|
|
104
104
|
"preminor",
|
|
105
105
|
"prepatch"
|
|
@@ -33,7 +33,7 @@ const config = {
|
|
|
33
33
|
// We need to make sure that only one version is loaded for peerDependencies
|
|
34
34
|
// So we block them at the root, and alias them to the versions in example's node_modules
|
|
35
35
|
resolver: {
|
|
36
|
-
|
|
36
|
+
blocklistRE: exclusionList(
|
|
37
37
|
modules.map(
|
|
38
38
|
(m) =>
|
|
39
39
|
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
|