react-native-windows 0.74.45 → 0.74.47
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/Libraries/Components/View/View.windows.js +13 -5
- package/Libraries/Components/View/ViewAccessibility.d.ts +67 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +47 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +81 -94
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp +115 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h +41 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +319 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h +59 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +47 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +43 -34
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +11 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +149 -17
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +43 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +27 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +22 -4
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +16 -3
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +24 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +4 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/MouseEvent.h +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +133 -32
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +12 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +1 -3
- package/Microsoft.ReactNative.Cxx/JSValue.cpp +19 -3
- package/Microsoft.ReactNative.Cxx/JSValue.h +15 -7
- package/Microsoft.ReactNative.Managed.CodeGen/Microsoft.ReactNative.Managed.CodeGen.csproj +1 -1
- package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Debug.pubxml +1 -1
- package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Release.pubxml +1 -1
- package/Microsoft.ReactNative.Managed.CodeGen/packages.lock.json +3 -3
- package/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props +4 -4
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Scripts/Tfs/Start-TestServers.ps1 +2 -1
- package/Scripts/rnw-dependencies.ps1 +38 -25
- package/Shared/Shared.vcxitems +6 -0
- package/Shared/Shared.vcxitems.filters +8 -0
- package/package.json +3 -3
|
@@ -39,6 +39,26 @@ HostPlatformViewProps::HostPlatformViewProps(
|
|
|
39
39
|
CoreFeatures::enablePropIteratorSetter
|
|
40
40
|
? sourceProps.accessibilitySetSize
|
|
41
41
|
: convertRawProp(context, rawProps, "accessibilitySetSize", sourceProps.accessibilitySetSize, 0)),
|
|
42
|
+
accessibilityLevel(
|
|
43
|
+
CoreFeatures::enablePropIteratorSetter
|
|
44
|
+
? sourceProps.accessibilityLevel
|
|
45
|
+
: convertRawProp(context, rawProps, "accessibilityLevel", sourceProps.accessibilityLevel, 0)),
|
|
46
|
+
accessibilityItemType(
|
|
47
|
+
CoreFeatures::enablePropIteratorSetter
|
|
48
|
+
? sourceProps.accessibilityItemType
|
|
49
|
+
: convertRawProp(context, rawProps, "accessibilityItemType", sourceProps.accessibilityItemType, {})),
|
|
50
|
+
accessibilityAccessKey(
|
|
51
|
+
CoreFeatures::enablePropIteratorSetter
|
|
52
|
+
? sourceProps.accessibilityAccessKey
|
|
53
|
+
: convertRawProp(context, rawProps, "accessibilityAccessKey", sourceProps.accessibilityAccessKey, {})),
|
|
54
|
+
accessibilityDescription(
|
|
55
|
+
CoreFeatures::enablePropIteratorSetter ? sourceProps.accessibilityDescription
|
|
56
|
+
: convertRawProp(
|
|
57
|
+
context,
|
|
58
|
+
rawProps,
|
|
59
|
+
"accessibilityDescription",
|
|
60
|
+
sourceProps.accessibilityDescription,
|
|
61
|
+
{})),
|
|
42
62
|
accessibilityLiveRegion(
|
|
43
63
|
CoreFeatures::enablePropIteratorSetter ? sourceProps.accessibilityLiveRegion
|
|
44
64
|
: convertRawProp(
|
|
@@ -83,6 +103,10 @@ void HostPlatformViewProps::setProp(
|
|
|
83
103
|
RAW_SET_PROP_SWITCH_CASE_BASIC(focusable);
|
|
84
104
|
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityPosInSet);
|
|
85
105
|
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilitySetSize);
|
|
106
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityLevel);
|
|
107
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityItemType);
|
|
108
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityAccessKey);
|
|
109
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityDescription);
|
|
86
110
|
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityLiveRegion);
|
|
87
111
|
RAW_SET_PROP_SWITCH_CASE_BASIC(keyDownEvents);
|
|
88
112
|
RAW_SET_PROP_SWITCH_CASE_BASIC(keyUpEvents);
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h
CHANGED
|
@@ -27,6 +27,10 @@ class HostPlatformViewProps : public BaseViewProps {
|
|
|
27
27
|
int accessibilityPosInSet{0};
|
|
28
28
|
int accessibilitySetSize{0};
|
|
29
29
|
std::string accessibilityLiveRegion{"none"};
|
|
30
|
+
int accessibilityLevel{0};
|
|
31
|
+
std::optional<std::string> accessibilityItemType{};
|
|
32
|
+
std::optional<std::string> accessibilityAccessKey{};
|
|
33
|
+
std::optional<std::string> accessibilityDescription{};
|
|
30
34
|
|
|
31
35
|
// std::optional<std::string> overflowAnchor{};
|
|
32
36
|
std::optional<std::string> tooltip{};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include <react/renderer/components/view/PointerEvent.h>
|
|
7
|
+
|
|
8
|
+
namespace facebook::react {
|
|
9
|
+
|
|
10
|
+
struct MouseEvent : public PointerEvent {
|
|
11
|
+
MouseEvent(PointerEvent &event) : PointerEvent(event){};
|
|
12
|
+
|
|
13
|
+
// We override the type so that it is not recorded as a PointerType,
|
|
14
|
+
// otherwise PointerEventsProcessor gets confused by the Windows specific MouseEvents
|
|
15
|
+
EventPayloadType getType() const override {
|
|
16
|
+
return static_cast<EventPayloadType>(-1);
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
} // namespace facebook::react
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp
CHANGED
|
@@ -19,7 +19,7 @@ namespace facebook::react {
|
|
|
19
19
|
void TextLayoutManager::GetTextLayout(
|
|
20
20
|
AttributedStringBox attributedStringBox,
|
|
21
21
|
ParagraphAttributes paragraphAttributes,
|
|
22
|
-
|
|
22
|
+
Size size,
|
|
23
23
|
winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept {
|
|
24
24
|
if (attributedStringBox.getValue().isEmpty())
|
|
25
25
|
return;
|
|
@@ -43,10 +43,7 @@ void TextLayoutManager::GetTextLayout(
|
|
|
43
43
|
static_cast<facebook::react::FontWeight>(DWRITE_FONT_WEIGHT_REGULAR))),
|
|
44
44
|
style,
|
|
45
45
|
DWRITE_FONT_STRETCH_NORMAL,
|
|
46
|
-
|
|
47
|
-
!std::isnan(outerFragment.textAttributes.fontSizeMultiplier))
|
|
48
|
-
? (outerFragment.textAttributes.fontSizeMultiplier * outerFragment.textAttributes.fontSize)
|
|
49
|
-
: outerFragment.textAttributes.fontSize,
|
|
46
|
+
outerFragment.textAttributes.fontSize,
|
|
50
47
|
L"",
|
|
51
48
|
spTextFormat.put()));
|
|
52
49
|
|
|
@@ -95,11 +92,44 @@ void TextLayoutManager::GetTextLayout(
|
|
|
95
92
|
str.c_str(), // The string to be laid out and formatted.
|
|
96
93
|
static_cast<UINT32>(str.size()), // The length of the string.
|
|
97
94
|
spTextFormat.get(), // The text format to apply to the string (contains font information, etc).
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
size.width, // The width of the layout box.
|
|
96
|
+
size.height, // The height of the layout box.
|
|
100
97
|
spTextLayout.put() // The IDWriteTextLayout interface pointer.
|
|
101
98
|
));
|
|
102
99
|
|
|
100
|
+
// Apply max width constraint and ellipsis trimming to ensure consistency with rendering
|
|
101
|
+
DWRITE_TEXT_METRICS metrics;
|
|
102
|
+
winrt::check_hresult(spTextLayout->GetMetrics(&metrics));
|
|
103
|
+
|
|
104
|
+
if (metrics.width > size.width) {
|
|
105
|
+
spTextLayout->SetMaxWidth(size.width);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Apply DWRITE_TRIMMING for ellipsizeMode
|
|
109
|
+
DWRITE_TRIMMING trimming = {};
|
|
110
|
+
winrt::com_ptr<IDWriteInlineObject> ellipsisSign;
|
|
111
|
+
|
|
112
|
+
switch (paragraphAttributes.ellipsizeMode) {
|
|
113
|
+
case facebook::react::EllipsizeMode::Tail:
|
|
114
|
+
trimming.granularity = DWRITE_TRIMMING_GRANULARITY_CHARACTER;
|
|
115
|
+
break;
|
|
116
|
+
case facebook::react::EllipsizeMode::Clip:
|
|
117
|
+
trimming.granularity = DWRITE_TRIMMING_GRANULARITY_NONE;
|
|
118
|
+
break;
|
|
119
|
+
default:
|
|
120
|
+
trimming.granularity = DWRITE_TRIMMING_GRANULARITY_CHARACTER; // Default to tail behavior
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Use DWriteFactory to create the ellipsis trimming sign
|
|
125
|
+
if (trimming.granularity != DWRITE_TRIMMING_GRANULARITY_NONE) {
|
|
126
|
+
auto dwriteFactory = Microsoft::ReactNative::DWriteFactory();
|
|
127
|
+
HRESULT hr = dwriteFactory->CreateEllipsisTrimmingSign(spTextLayout.get(), ellipsisSign.put());
|
|
128
|
+
if (SUCCEEDED(hr)) {
|
|
129
|
+
spTextLayout->SetTrimming(&trimming, ellipsisSign.get());
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
103
133
|
unsigned int position = 0;
|
|
104
134
|
unsigned int length = 0;
|
|
105
135
|
for (const auto &fragment : fragments) {
|
|
@@ -121,11 +151,7 @@ void TextLayoutManager::GetTextLayout(
|
|
|
121
151
|
attributes.fontWeight.value_or(static_cast<facebook::react::FontWeight>(DWRITE_FONT_WEIGHT_REGULAR))),
|
|
122
152
|
range));
|
|
123
153
|
winrt::check_hresult(spTextLayout->SetFontStyle(fragmentStyle, range));
|
|
124
|
-
winrt::check_hresult(spTextLayout->SetFontSize(
|
|
125
|
-
(attributes.allowFontScaling.value_or(true) && !std::isnan(attributes.fontSizeMultiplier))
|
|
126
|
-
? (attributes.fontSizeMultiplier * attributes.fontSize)
|
|
127
|
-
: attributes.fontSize,
|
|
128
|
-
range));
|
|
154
|
+
winrt::check_hresult(spTextLayout->SetFontSize(attributes.fontSize, range));
|
|
129
155
|
|
|
130
156
|
if (!isnan(attributes.letterSpacing)) {
|
|
131
157
|
winrt::check_hresult(
|
|
@@ -136,6 +162,18 @@ void TextLayoutManager::GetTextLayout(
|
|
|
136
162
|
}
|
|
137
163
|
}
|
|
138
164
|
|
|
165
|
+
void TextLayoutManager::GetTextLayout(
|
|
166
|
+
AttributedStringBox attributedStringBox,
|
|
167
|
+
ParagraphAttributes paragraphAttributes,
|
|
168
|
+
LayoutConstraints layoutConstraints,
|
|
169
|
+
winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept {
|
|
170
|
+
if (attributedStringBox.getValue().isEmpty())
|
|
171
|
+
return;
|
|
172
|
+
|
|
173
|
+
GetTextLayout(attributedStringBox, paragraphAttributes, layoutConstraints.maximumSize, spTextLayout);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// measure entire text (inluding attachments)
|
|
139
177
|
TextMeasurement TextLayoutManager::measure(
|
|
140
178
|
AttributedStringBox attributedStringBox,
|
|
141
179
|
ParagraphAttributes paragraphAttributes,
|
|
@@ -198,25 +236,6 @@ TextMeasurement TextLayoutManager::measureCachedSpannableById(
|
|
|
198
236
|
return {};
|
|
199
237
|
}
|
|
200
238
|
|
|
201
|
-
LinesMeasurements TextLayoutManager::measureLines(
|
|
202
|
-
AttributedString attributedString,
|
|
203
|
-
ParagraphAttributes paragraphAttributes,
|
|
204
|
-
Size size) const {
|
|
205
|
-
assert(false);
|
|
206
|
-
return {};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
std::shared_ptr<void> TextLayoutManager::getHostTextStorage(
|
|
210
|
-
AttributedString attributedString,
|
|
211
|
-
ParagraphAttributes paragraphAttributes,
|
|
212
|
-
LayoutConstraints layoutConstraints) const {
|
|
213
|
-
return nullptr;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
void *TextLayoutManager::getNativeTextLayoutManager() const {
|
|
217
|
-
return (void *)this;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
239
|
Microsoft::ReactNative::TextTransform ConvertTextTransform(std::optional<TextTransform> const &transform) {
|
|
221
240
|
if (transform) {
|
|
222
241
|
switch (transform.value()) {
|
|
@@ -232,10 +251,92 @@ Microsoft::ReactNative::TextTransform ConvertTextTransform(std::optional<TextTra
|
|
|
232
251
|
break;
|
|
233
252
|
}
|
|
234
253
|
}
|
|
235
|
-
|
|
236
254
|
return Microsoft::ReactNative::TextTransform::Undefined;
|
|
237
255
|
}
|
|
238
256
|
|
|
257
|
+
LinesMeasurements TextLayoutManager::measureLines(
|
|
258
|
+
AttributedString attributedString,
|
|
259
|
+
ParagraphAttributes paragraphAttributes,
|
|
260
|
+
Size size) const {
|
|
261
|
+
LinesMeasurements lineMeasurements{};
|
|
262
|
+
|
|
263
|
+
winrt::com_ptr<IDWriteTextLayout> spTextLayout;
|
|
264
|
+
|
|
265
|
+
GetTextLayout(AttributedStringBox(attributedString), paragraphAttributes, size, spTextLayout);
|
|
266
|
+
|
|
267
|
+
if (spTextLayout) {
|
|
268
|
+
std::vector<DWRITE_LINE_METRICS> lineMetrics;
|
|
269
|
+
uint32_t actualLineCount;
|
|
270
|
+
spTextLayout->GetLineMetrics(nullptr, 0, &actualLineCount);
|
|
271
|
+
lineMetrics.resize(static_cast<size_t>(actualLineCount));
|
|
272
|
+
winrt::check_hresult(spTextLayout->GetLineMetrics(lineMetrics.data(), actualLineCount, &actualLineCount));
|
|
273
|
+
uint32_t startRange = 0;
|
|
274
|
+
const auto count = (paragraphAttributes.maximumNumberOfLines > 0)
|
|
275
|
+
? std::min(static_cast<uint32_t>(paragraphAttributes.maximumNumberOfLines), actualLineCount)
|
|
276
|
+
: actualLineCount;
|
|
277
|
+
for (uint32_t i = 0; i < count; ++i) {
|
|
278
|
+
UINT32 actualHitTestCount = 0;
|
|
279
|
+
spTextLayout->HitTestTextRange(
|
|
280
|
+
startRange,
|
|
281
|
+
lineMetrics[i].length,
|
|
282
|
+
0, // x
|
|
283
|
+
0, // y
|
|
284
|
+
NULL,
|
|
285
|
+
0, // metrics count
|
|
286
|
+
&actualHitTestCount);
|
|
287
|
+
|
|
288
|
+
// Allocate enough room to return all hit-test metrics.
|
|
289
|
+
std::vector<DWRITE_HIT_TEST_METRICS> hitTestMetrics(actualHitTestCount);
|
|
290
|
+
spTextLayout->HitTestTextRange(
|
|
291
|
+
startRange,
|
|
292
|
+
lineMetrics[i].length,
|
|
293
|
+
0, // x
|
|
294
|
+
0, // y
|
|
295
|
+
&hitTestMetrics[0],
|
|
296
|
+
static_cast<UINT32>(hitTestMetrics.size()),
|
|
297
|
+
&actualHitTestCount);
|
|
298
|
+
|
|
299
|
+
float width = 0;
|
|
300
|
+
for (auto tm : hitTestMetrics) {
|
|
301
|
+
width += tm.width;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
std::string str;
|
|
305
|
+
for (const auto &fragment : attributedString.getFragments()) {
|
|
306
|
+
str = str +
|
|
307
|
+
winrt::to_string(Microsoft::ReactNative::TransformableText::TransformText(
|
|
308
|
+
winrt::hstring{Microsoft::Common::Unicode::Utf8ToUtf16(fragment.string)},
|
|
309
|
+
ConvertTextTransform(fragment.textAttributes.textTransform)));
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
lineMeasurements.emplace_back(LineMeasurement(
|
|
313
|
+
str.substr(startRange, lineMetrics[i].length),
|
|
314
|
+
{{hitTestMetrics[0].left, hitTestMetrics[0].top}, // origin
|
|
315
|
+
{width, lineMetrics[i].height}},
|
|
316
|
+
0.0f, // TODO descender
|
|
317
|
+
0.0f, // TODO: capHeight
|
|
318
|
+
0.0f, // TODO ascender
|
|
319
|
+
0.0f // TODO: xHeight
|
|
320
|
+
));
|
|
321
|
+
|
|
322
|
+
startRange += lineMetrics[i].length;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return lineMeasurements;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
std::shared_ptr<void> TextLayoutManager::getHostTextStorage(
|
|
330
|
+
AttributedString attributedString,
|
|
331
|
+
ParagraphAttributes paragraphAttributes,
|
|
332
|
+
LayoutConstraints layoutConstraints) const {
|
|
333
|
+
return nullptr;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
void *TextLayoutManager::getNativeTextLayoutManager() const {
|
|
337
|
+
return (void *)this;
|
|
338
|
+
}
|
|
339
|
+
|
|
239
340
|
winrt::hstring TextLayoutManager::GetTransformedText(AttributedStringBox const &attributedStringBox) {
|
|
240
341
|
winrt::hstring result{};
|
|
241
342
|
for (const auto &fragment : attributedStringBox.getValue().getFragments()) {
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h
CHANGED
|
@@ -74,10 +74,22 @@ class TextLayoutManager {
|
|
|
74
74
|
LayoutConstraints layoutConstraints,
|
|
75
75
|
winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept;
|
|
76
76
|
|
|
77
|
+
static void GetTextLayoutByAdjustingFontSizeToFit(
|
|
78
|
+
AttributedStringBox attributedStringBox,
|
|
79
|
+
const ParagraphAttributes ¶graphAttributes,
|
|
80
|
+
LayoutConstraints layoutConstraints,
|
|
81
|
+
winrt::com_ptr<IDWriteTextLayout> &spTextLayout,
|
|
82
|
+
TextMeasurement::Attachments &attachments) noexcept;
|
|
83
|
+
|
|
77
84
|
#pragma endregion
|
|
78
85
|
|
|
79
86
|
private:
|
|
80
87
|
static winrt::hstring GetTransformedText(AttributedStringBox const &attributedStringBox);
|
|
88
|
+
static void GetTextLayout(
|
|
89
|
+
AttributedStringBox attributedString,
|
|
90
|
+
ParagraphAttributes paragraphAttributes,
|
|
91
|
+
Size size,
|
|
92
|
+
winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept;
|
|
81
93
|
|
|
82
94
|
ContextContainer::Shared m_contextContainer;
|
|
83
95
|
#pragma warning(push)
|
|
@@ -123,9 +123,6 @@
|
|
|
123
123
|
<ClCompile Include="Modules\NativeUIManager.cpp">
|
|
124
124
|
<Filter>Modules</Filter>
|
|
125
125
|
</ClCompile>
|
|
126
|
-
<ClCompile Include="Modules\TimingModule.cpp">
|
|
127
|
-
<Filter>Modules</Filter>
|
|
128
|
-
</ClCompile>
|
|
129
126
|
<ClCompile Include="Views\Image\ImageViewManager.cpp">
|
|
130
127
|
<Filter>Views\Image</Filter>
|
|
131
128
|
</ClCompile>
|
|
@@ -292,6 +289,7 @@
|
|
|
292
289
|
<ClCompile Include="Views\FrameworkElementTransferProperties.cpp" />
|
|
293
290
|
<ClCompile Include="Views\ReactViewInstance.cpp" />
|
|
294
291
|
<ClCompile Include="Utils\KeyboardUtils.cpp" />
|
|
292
|
+
<ClCompile Include="Views\DebuggingOverlayViewManager.cpp" />
|
|
295
293
|
</ItemGroup>
|
|
296
294
|
<ItemGroup>
|
|
297
295
|
<ClInclude Include="ABICxxModule.h" />
|
|
@@ -278,7 +278,7 @@ JSValue const &JSValueObject::operator[](std::string_view propertyName) const no
|
|
|
278
278
|
return it->second;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
return JSValue::
|
|
281
|
+
return JSValue::NullRef();
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
bool JSValueObject::Equals(JSValueObject const &other) const noexcept {
|
|
@@ -434,6 +434,22 @@ void JSValueArray::WriteTo(IJSValueWriter const &writer) const noexcept {
|
|
|
434
434
|
/*static*/ JSValue const JSValue::EmptyArray{JSValueArray{}};
|
|
435
435
|
/*static*/ JSValue const JSValue::EmptyString{std::string{}};
|
|
436
436
|
|
|
437
|
+
const JSValue &JSValue::NullRef() noexcept {
|
|
438
|
+
return JSValue::Null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const JSValue &JSValue::EmptyObjectRef() noexcept {
|
|
442
|
+
return JSValue::EmptyObject;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const JSValue &JSValue::EmptyArrayRef() noexcept {
|
|
446
|
+
return JSValue::EmptyArray;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const JSValue &JSValue::EmptyStringRef() noexcept {
|
|
450
|
+
return JSValue::EmptyString;
|
|
451
|
+
}
|
|
452
|
+
|
|
437
453
|
#pragma warning(push)
|
|
438
454
|
#pragma warning(disable : 26495) // False positive for union member not initialized
|
|
439
455
|
JSValue::JSValue(JSValue &&other) noexcept : m_type{other.m_type} {
|
|
@@ -739,7 +755,7 @@ JSValue const *JSValue::TryGetObjectProperty(std::string_view propertyName) cons
|
|
|
739
755
|
|
|
740
756
|
JSValue const &JSValue::GetObjectProperty(std::string_view propertyName) const noexcept {
|
|
741
757
|
auto result = TryGetObjectProperty(propertyName);
|
|
742
|
-
return result ? *result :
|
|
758
|
+
return result ? *result : NullRef();
|
|
743
759
|
}
|
|
744
760
|
|
|
745
761
|
size_t JSValue::ItemCount() const noexcept {
|
|
@@ -752,7 +768,7 @@ JSValue const *JSValue::TryGetArrayItem(JSValueArray::size_type index) const noe
|
|
|
752
768
|
|
|
753
769
|
JSValue const &JSValue::GetArrayItem(JSValueArray::size_type index) const noexcept {
|
|
754
770
|
auto result = TryGetArrayItem(index);
|
|
755
|
-
return result ? *result :
|
|
771
|
+
return result ? *result : NullRef();
|
|
756
772
|
}
|
|
757
773
|
|
|
758
774
|
bool JSValue::Equals(JSValue const &other) const noexcept {
|
|
@@ -181,17 +181,25 @@ bool operator!=(JSValueArray const &left, JSValueArray const &right) noexcept;
|
|
|
181
181
|
//! For copy operations the explicit Copy() method must be used.
|
|
182
182
|
//! Note that the move operations are not thread safe.
|
|
183
183
|
struct JSValue {
|
|
184
|
-
//! JSValue with JSValueType::Null.
|
|
184
|
+
//! JSValue with JSValueType::Null. - Maybe removed in future version - replaced with NullRef
|
|
185
185
|
static JSValue const Null;
|
|
186
|
+
//! JSValue with JSValueType::Null.
|
|
187
|
+
static const JSValue &NullRef() noexcept;
|
|
186
188
|
|
|
187
|
-
//! JSValue with empty object.
|
|
189
|
+
//! JSValue with empty object. - Maybe removed in future version - replaced with EmptyObjectRef
|
|
188
190
|
static JSValue const EmptyObject;
|
|
191
|
+
//! JSValue with empty object.
|
|
192
|
+
static const JSValue &EmptyObjectRef() noexcept;
|
|
189
193
|
|
|
190
|
-
//! JSValue with empty array.
|
|
194
|
+
//! JSValue with empty array. - Maybe removed in future version - replaced with EmptyArrayRef
|
|
191
195
|
static JSValue const EmptyArray;
|
|
196
|
+
//! JSValue with empty array.
|
|
197
|
+
static const JSValue &EmptyArrayRef() noexcept;
|
|
192
198
|
|
|
193
|
-
//! JSValue with empty string.
|
|
199
|
+
//! JSValue with empty string. - Maybe removed in future version - replaced with EmptyStringRef
|
|
194
200
|
static JSValue const EmptyString;
|
|
201
|
+
//! JSValue with empty string.
|
|
202
|
+
static const JSValue &EmptyStringRef() noexcept;
|
|
195
203
|
|
|
196
204
|
//! Create a Null JSValue.
|
|
197
205
|
JSValue() noexcept;
|
|
@@ -654,11 +662,11 @@ inline double const *JSValue::TryGetDouble() const noexcept {
|
|
|
654
662
|
}
|
|
655
663
|
|
|
656
664
|
inline JSValueObject const &JSValue::AsObject() const noexcept {
|
|
657
|
-
return (m_type == JSValueType::Object) ? m_object :
|
|
665
|
+
return (m_type == JSValueType::Object) ? m_object : EmptyObjectRef().m_object;
|
|
658
666
|
}
|
|
659
667
|
|
|
660
668
|
inline JSValueArray const &JSValue::AsArray() const noexcept {
|
|
661
|
-
return (m_type == JSValueType::Array) ? m_array :
|
|
669
|
+
return (m_type == JSValueType::Array) ? m_array : EmptyArrayRef().m_array;
|
|
662
670
|
}
|
|
663
671
|
|
|
664
672
|
inline int8_t JSValue::AsInt8() const noexcept {
|
|
@@ -860,7 +868,7 @@ inline const JSValueArray &JSValue::Array() const noexcept {
|
|
|
860
868
|
}
|
|
861
869
|
|
|
862
870
|
inline const std::string &JSValue::String() const noexcept {
|
|
863
|
-
return (m_type == JSValueType::String) ? m_string :
|
|
871
|
+
return (m_type == JSValueType::String) ? m_string : EmptyStringRef().m_string;
|
|
864
872
|
}
|
|
865
873
|
|
|
866
874
|
inline bool JSValue::Boolean() const noexcept {
|
package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Debug.pubxml
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<PublishProtocol>FileSystem</PublishProtocol>
|
|
7
7
|
<Configuration>Debug</Configuration>
|
|
8
8
|
<Platform>x64</Platform>
|
|
9
|
-
<TargetFramework>
|
|
9
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
10
10
|
<PublishDir>$(OutDir)publish</PublishDir>
|
|
11
11
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
12
12
|
<SelfContained>true</SelfContained>
|
package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Release.pubxml
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<PublishProtocol>FileSystem</PublishProtocol>
|
|
7
7
|
<Configuration>Release</Configuration>
|
|
8
8
|
<Platform>x64</Platform>
|
|
9
|
-
<TargetFramework>
|
|
9
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
10
10
|
<PublishDir>$(OutDir)publish</PublishDir>
|
|
11
11
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
12
12
|
<SelfContained>true</SelfContained>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"
|
|
4
|
+
"net8.0": {
|
|
5
5
|
"Humanizer": {
|
|
6
6
|
"type": "Direct",
|
|
7
7
|
"requested": "[2.14.1, )",
|
|
@@ -1507,7 +1507,7 @@
|
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
1509
|
},
|
|
1510
|
-
"
|
|
1510
|
+
"net8.0/win-x64": {
|
|
1511
1511
|
"Microsoft.Win32.Primitives": {
|
|
1512
1512
|
"type": "Transitive",
|
|
1513
1513
|
"resolved": "4.3.0",
|
|
@@ -2350,7 +2350,7 @@
|
|
|
2350
2350
|
}
|
|
2351
2351
|
}
|
|
2352
2352
|
},
|
|
2353
|
-
"
|
|
2353
|
+
"net8.0/win-x86": {
|
|
2354
2354
|
"Microsoft.Win32.Primitives": {
|
|
2355
2355
|
"type": "Transitive",
|
|
2356
2356
|
"resolved": "4.3.0",
|
|
@@ -12,20 +12,20 @@
|
|
|
12
12
|
See https://microsoft.github.io/react-native-windows/docs/win10-compat
|
|
13
13
|
-->
|
|
14
14
|
<PropertyGroup Label="Globals" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
|
|
15
|
-
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)'=='' Or '$(WindowsTargetPlatformVersion)'=='10.0.0.0'">10.0.
|
|
15
|
+
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)'=='' Or '$(WindowsTargetPlatformVersion)'=='10.0.0.0'">10.0.22621.0</WindowsTargetPlatformVersion>
|
|
16
16
|
<WindowsTargetPlatformMinVersion Condition="'$(WindowsTargetPlatformMinVersion)'=='' Or '$(WindowsTargetPlatformMinVersion)'=='10.0.0.0'">10.0.17763.0</WindowsTargetPlatformMinVersion>
|
|
17
17
|
|
|
18
18
|
<!-- WinAppSDK/Composition projects have higher version requirements. -->
|
|
19
|
-
<WindowsTargetPlatformVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformVersion)', '10.0.
|
|
19
|
+
<WindowsTargetPlatformVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformVersion)', '10.0.22621.0'))">10.0.22621.0</WindowsTargetPlatformVersion>
|
|
20
20
|
<WindowsTargetPlatformMinVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformMinVersion)', '10.0.18362.0'))">10.0.18362.0</WindowsTargetPlatformMinVersion>
|
|
21
21
|
</PropertyGroup>
|
|
22
22
|
|
|
23
23
|
<PropertyGroup Label="Globals" Condition="'$(MSBuildProjectExtension)' == '.csproj' Or '$(MSBuildProjectExtension)' == '.wapproj'">
|
|
24
|
-
<TargetPlatformVersion Condition="'$(TargetPlatformVersion)'==''">10.0.
|
|
24
|
+
<TargetPlatformVersion Condition="'$(TargetPlatformVersion)'==''">10.0.22621.0</TargetPlatformVersion>
|
|
25
25
|
<TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)'==''">10.0.17763.0</TargetPlatformMinVersion>
|
|
26
26
|
|
|
27
27
|
<!-- WinAppSDK/Composition projects have higher version requirements. -->
|
|
28
|
-
<TargetPlatformVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformVersion)', '
|
|
28
|
+
<TargetPlatformVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformVersion)', '110.0.22621.0'))">10.0.22621.0</TargetPlatformVersion>
|
|
29
29
|
<TargetPlatformMinVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformMinVersion)', '10.0.17763.0'))">10.0.17763.0</TargetPlatformMinVersion>
|
|
30
30
|
</PropertyGroup>
|
|
31
31
|
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.74.
|
|
13
|
+
<ReactNativeWindowsVersion>0.74.47</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>47</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>919860a4f95c8a8b29bfa079475e5c76208c011d</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -16,7 +16,8 @@ Write-Host "Starting packager"
|
|
|
16
16
|
|
|
17
17
|
Set-Location -Path "$PSScriptRoot\..\.."
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
$npmCmd = (Get-Command npm.cmd -ErrorAction Stop).Source
|
|
20
|
+
Start-Process $npmCmd -PassThru `
|
|
20
21
|
-NoNewWindow `
|
|
21
22
|
-WorkingDirectory "$PSScriptRoot\..\.." `
|
|
22
23
|
-ArgumentList "run start" `
|