react-native-windows 0.69.3 → 0.69.6
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/Microsoft.ReactNative/IReactNotificationService.cpp +197 -70
- package/Microsoft.ReactNative/IReactNotificationService.h +11 -30
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +13 -8
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +9 -9
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.targets +3 -3
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +2 -2
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets +3 -3
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/package.json +2 -2
- package/stubs/double-conversion/double-conversion.h +18 -9
|
@@ -8,77 +8,183 @@
|
|
|
8
8
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
9
9
|
|
|
10
10
|
//=============================================================================
|
|
11
|
-
//
|
|
11
|
+
// IReactNotificationSubscription implementation
|
|
12
12
|
//=============================================================================
|
|
13
13
|
|
|
14
|
-
ReactNotificationSubscription
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
14
|
+
// Common interface to share functionality between ReactNotificationSubscription and ReactNotificationSubscriptionView
|
|
15
|
+
MSO_GUID(IReactNotificationSubscriptionPrivate, "09437980-3508-4690-930c-7c310e205e6b")
|
|
16
|
+
struct IReactNotificationSubscriptionPrivate : ::IUnknown {
|
|
17
|
+
virtual void SetParent(IReactNotificationSubscription const &parentSubscription) noexcept = 0;
|
|
18
|
+
virtual void CallHandler(
|
|
19
|
+
Windows::Foundation::IInspectable const &sender,
|
|
20
|
+
Windows::Foundation::IInspectable const &data) noexcept = 0;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// The Notification subscription class.
|
|
24
|
+
// Instances of this class are stored in the "child" notification services.
|
|
25
|
+
struct ReactNotificationSubscription
|
|
26
|
+
: implements<ReactNotificationSubscription, IReactNotificationSubscription, IReactNotificationSubscriptionPrivate> {
|
|
27
|
+
ReactNotificationSubscription(
|
|
28
|
+
Mso::RefCountedPtr<std::mutex> const &mutex,
|
|
29
|
+
weak_ref<ReactNotificationService> &¬ificationService,
|
|
30
|
+
IReactPropertyName const ¬ificationName,
|
|
31
|
+
IReactDispatcher const &dispatcher,
|
|
32
|
+
ReactNotificationHandler const &handler) noexcept
|
|
33
|
+
: m_mutex{mutex},
|
|
34
|
+
m_notificationService{std::move(notificationService)},
|
|
35
|
+
m_notificationName{notificationName},
|
|
36
|
+
m_dispatcher{dispatcher},
|
|
37
|
+
m_handler{handler} {}
|
|
38
|
+
|
|
39
|
+
~ReactNotificationSubscription() noexcept {
|
|
40
|
+
Unsubscribe();
|
|
41
|
+
}
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
public: // IReactNotificationSubscription implementation
|
|
44
|
+
IReactNotificationService NotificationService() const noexcept {
|
|
45
|
+
return m_notificationService.get().as<IReactNotificationService>();
|
|
46
|
+
}
|
|
41
47
|
|
|
42
|
-
IReactPropertyName
|
|
43
|
-
|
|
44
|
-
}
|
|
48
|
+
IReactPropertyName NotificationName() const noexcept {
|
|
49
|
+
return m_notificationName;
|
|
50
|
+
}
|
|
45
51
|
|
|
46
|
-
IReactDispatcher
|
|
47
|
-
|
|
48
|
-
}
|
|
52
|
+
IReactDispatcher Dispatcher() const noexcept {
|
|
53
|
+
return m_dispatcher;
|
|
54
|
+
}
|
|
49
55
|
|
|
50
|
-
bool
|
|
51
|
-
|
|
52
|
-
}
|
|
56
|
+
bool IsSubscribed() const noexcept {
|
|
57
|
+
return GetHandler() != nullptr;
|
|
58
|
+
}
|
|
53
59
|
|
|
54
|
-
void
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
void Unsubscribe() noexcept {
|
|
61
|
+
if (m_parentSubscription) {
|
|
62
|
+
m_parentSubscription.Unsubscribe();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
bool isSubscribed{false};
|
|
66
|
+
{
|
|
67
|
+
std::scoped_lock lock{*m_mutex};
|
|
68
|
+
if (m_handler) {
|
|
69
|
+
isSubscribed = true;
|
|
70
|
+
// Remove handler to free any objects captured by it.
|
|
71
|
+
m_handler = nullptr;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (isSubscribed) {
|
|
76
|
+
if (auto notificationService = m_notificationService.get()) {
|
|
77
|
+
notificationService->Unsubscribe(*this);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public: // IReactNotificationSubscriptionPrivate implementation
|
|
83
|
+
void SetParent(IReactNotificationSubscription const &parentSubscription) noexcept override {
|
|
84
|
+
m_parentSubscription = parentSubscription;
|
|
57
85
|
}
|
|
58
86
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
87
|
+
void CallHandler(IInspectable const &sender, IInspectable const &data) noexcept override {
|
|
88
|
+
auto args = make<ReactNotificationArgs>(*this, data);
|
|
89
|
+
if (auto handler = GetHandler()) {
|
|
90
|
+
if (m_dispatcher) {
|
|
91
|
+
m_dispatcher.Post([thisPtr = get_strong(), sender, args]() noexcept {
|
|
92
|
+
if (auto handler = thisPtr->GetHandler()) {
|
|
93
|
+
handler(sender, args);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
handler(sender, args);
|
|
98
|
+
}
|
|
62
99
|
}
|
|
63
100
|
}
|
|
64
|
-
}
|
|
65
101
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
private:
|
|
103
|
+
ReactNotificationHandler GetHandler() const noexcept {
|
|
104
|
+
std::scoped_lock lock{*m_mutex};
|
|
105
|
+
return m_handler;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private:
|
|
109
|
+
Mso::RefCountedPtr<std::mutex> m_mutex;
|
|
110
|
+
IReactNotificationSubscription m_parentSubscription{nullptr};
|
|
111
|
+
const weak_ref<ReactNotificationService> m_notificationService{nullptr};
|
|
112
|
+
const IReactPropertyName m_notificationName{nullptr};
|
|
113
|
+
const IReactDispatcher m_dispatcher{nullptr};
|
|
114
|
+
ReactNotificationHandler m_handler{nullptr};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// The notification subscription view to wrap up child notification service.
|
|
118
|
+
// Instances of this class are stored in the parent notification services.
|
|
119
|
+
struct ReactNotificationSubscriptionView : implements<
|
|
120
|
+
ReactNotificationSubscriptionView,
|
|
121
|
+
IReactNotificationSubscription,
|
|
122
|
+
IReactNotificationSubscriptionPrivate> {
|
|
123
|
+
ReactNotificationSubscriptionView(
|
|
124
|
+
weak_ref<ReactNotificationService> &¬ificationService,
|
|
125
|
+
IReactNotificationSubscription const &childSubscription) noexcept
|
|
126
|
+
: m_notificationService{std::move(notificationService)}, m_childSubscription{weak_ref(childSubscription)} {
|
|
127
|
+
childSubscription.as<IReactNotificationSubscriptionPrivate>()->SetParent(*this);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
~ReactNotificationSubscriptionView() noexcept {
|
|
131
|
+
Unsubscribe();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public: // IReactNotificationSubscription implementation
|
|
135
|
+
IReactNotificationService NotificationService() const noexcept {
|
|
136
|
+
return m_notificationService.get().as<IReactNotificationService>();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
IReactPropertyName NotificationName() const noexcept {
|
|
140
|
+
if (auto childSubscription = m_childSubscription.get()) {
|
|
141
|
+
return childSubscription.NotificationName();
|
|
77
142
|
} else {
|
|
78
|
-
|
|
143
|
+
return IReactPropertyName{nullptr};
|
|
79
144
|
}
|
|
80
145
|
}
|
|
81
|
-
|
|
146
|
+
|
|
147
|
+
IReactDispatcher Dispatcher() const noexcept {
|
|
148
|
+
if (auto childSubscription = m_childSubscription.get()) {
|
|
149
|
+
return childSubscription.Dispatcher();
|
|
150
|
+
} else {
|
|
151
|
+
return IReactDispatcher{nullptr};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
bool IsSubscribed() const noexcept {
|
|
156
|
+
return m_isSubscribed;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
void Unsubscribe() noexcept {
|
|
160
|
+
if (m_parentSubscription) {
|
|
161
|
+
m_parentSubscription.Unsubscribe();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (m_isSubscribed.exchange(false)) {
|
|
165
|
+
if (auto notificationService = m_notificationService.get()) {
|
|
166
|
+
notificationService->Unsubscribe(*this);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public: // IReactNotificationSubscriptionPrivate implementation
|
|
172
|
+
void SetParent(IReactNotificationSubscription const &parentSubscription) noexcept override {
|
|
173
|
+
m_parentSubscription = parentSubscription;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
void CallHandler(IInspectable const &sender, IInspectable const &data) noexcept override {
|
|
177
|
+
if (auto childSubscription = m_childSubscription.get()) {
|
|
178
|
+
childSubscription.as<IReactNotificationSubscriptionPrivate>()->CallHandler(sender, data);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
private:
|
|
183
|
+
IReactNotificationSubscription m_parentSubscription{nullptr};
|
|
184
|
+
const weak_ref<IReactNotificationSubscription> m_childSubscription{nullptr};
|
|
185
|
+
const weak_ref<ReactNotificationService> m_notificationService{nullptr};
|
|
186
|
+
std::atomic_bool m_isSubscribed{true};
|
|
187
|
+
};
|
|
82
188
|
|
|
83
189
|
//=============================================================================
|
|
84
190
|
// ReactNotificationService implementation
|
|
@@ -99,7 +205,7 @@ void ReactNotificationService::ModifySubscriptions(
|
|
|
99
205
|
// Get the current snapshot under the lock
|
|
100
206
|
SubscriptionSnapshotPtr currentSnapshotPtr;
|
|
101
207
|
{
|
|
102
|
-
std::scoped_lock lock{m_mutex};
|
|
208
|
+
std::scoped_lock lock{*m_mutex};
|
|
103
209
|
auto it = m_subscriptions.find(notificationName);
|
|
104
210
|
if (it != m_subscriptions.end()) {
|
|
105
211
|
currentSnapshotPtr = it->second;
|
|
@@ -113,7 +219,7 @@ void ReactNotificationService::ModifySubscriptions(
|
|
|
113
219
|
|
|
114
220
|
// Try to set the new snapshot under the lock
|
|
115
221
|
SubscriptionSnapshotPtr snapshotPtr;
|
|
116
|
-
std::scoped_lock lock{m_mutex};
|
|
222
|
+
std::scoped_lock lock{*m_mutex};
|
|
117
223
|
auto it = m_subscriptions.find(notificationName);
|
|
118
224
|
if (it != m_subscriptions.end()) {
|
|
119
225
|
snapshotPtr = it->second;
|
|
@@ -146,20 +252,42 @@ IReactNotificationSubscription ReactNotificationService::Subscribe(
|
|
|
146
252
|
IReactPropertyName const ¬ificationName,
|
|
147
253
|
IReactDispatcher const &dispatcher,
|
|
148
254
|
ReactNotificationHandler const &handler) noexcept {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
255
|
+
VerifyElseCrashSz(notificationName, "notificationName must be not null");
|
|
256
|
+
VerifyElseCrashSz(handler, "handler must be not null");
|
|
257
|
+
|
|
258
|
+
IReactNotificationSubscription subscription =
|
|
259
|
+
make<ReactNotificationSubscription>(m_mutex, get_weak(), notificationName, dispatcher, handler);
|
|
260
|
+
AddSubscription(notificationName, subscription);
|
|
261
|
+
AddSubscriptionToParent(notificationName, subscription);
|
|
262
|
+
return subscription;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
void ReactNotificationService::AddSubscription(
|
|
266
|
+
IReactPropertyName const ¬ificationName,
|
|
267
|
+
IReactNotificationSubscription const &subscription) noexcept {
|
|
156
268
|
ModifySubscriptions(
|
|
157
269
|
notificationName, [&subscription](std::vector<IReactNotificationSubscription> const &snapshot) noexcept {
|
|
158
270
|
auto newSnapshot = std::vector<IReactNotificationSubscription>(snapshot);
|
|
159
271
|
newSnapshot.push_back(subscription);
|
|
160
272
|
return newSnapshot;
|
|
161
273
|
});
|
|
162
|
-
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
void ReactNotificationService::AddSubscriptionToParent(
|
|
277
|
+
IReactPropertyName const ¬ificationName,
|
|
278
|
+
IReactNotificationSubscription const &subscription) noexcept {
|
|
279
|
+
if (m_parentNotificationService) {
|
|
280
|
+
get_self<ReactNotificationService>(m_parentNotificationService)
|
|
281
|
+
->AddSubscriptionFromChild(notificationName, subscription);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
void ReactNotificationService::AddSubscriptionFromChild(
|
|
286
|
+
IReactPropertyName const ¬ificationName,
|
|
287
|
+
IReactNotificationSubscription const &childSubscription) noexcept {
|
|
288
|
+
auto subscription = make<ReactNotificationSubscriptionView>(get_weak(), childSubscription);
|
|
289
|
+
AddSubscription(notificationName, subscription);
|
|
290
|
+
AddSubscriptionToParent(notificationName, subscription);
|
|
163
291
|
}
|
|
164
292
|
|
|
165
293
|
void ReactNotificationService::Unsubscribe(IReactNotificationSubscription const &subscription) noexcept {
|
|
@@ -180,7 +308,7 @@ void ReactNotificationService::UnsubscribeAll() noexcept {
|
|
|
180
308
|
// The subscription will call the parent Unsubscribe on its own.
|
|
181
309
|
decltype(m_subscriptions) subscriptions;
|
|
182
310
|
{
|
|
183
|
-
std::scoped_lock lock{m_mutex};
|
|
311
|
+
std::scoped_lock lock{*m_mutex};
|
|
184
312
|
subscriptions = std::move(m_subscriptions);
|
|
185
313
|
}
|
|
186
314
|
|
|
@@ -203,7 +331,7 @@ void ReactNotificationService::SendNotification(
|
|
|
203
331
|
SubscriptionSnapshotPtr currentSnapshotPtr;
|
|
204
332
|
|
|
205
333
|
{
|
|
206
|
-
std::scoped_lock lock{m_mutex};
|
|
334
|
+
std::scoped_lock lock{*m_mutex};
|
|
207
335
|
auto it = m_subscriptions.find(notificationName);
|
|
208
336
|
if (it != m_subscriptions.end()) {
|
|
209
337
|
currentSnapshotPtr = it->second;
|
|
@@ -213,8 +341,7 @@ void ReactNotificationService::SendNotification(
|
|
|
213
341
|
// Call notification handlers outside of lock.
|
|
214
342
|
if (currentSnapshotPtr) {
|
|
215
343
|
for (auto &subscription : *currentSnapshotPtr) {
|
|
216
|
-
|
|
217
|
-
get_self<ReactNotificationSubscription>(subscription)->CallHandler(sender, args);
|
|
344
|
+
subscription.as<IReactNotificationSubscriptionPrivate>()->CallHandler(sender, data);
|
|
218
345
|
}
|
|
219
346
|
}
|
|
220
347
|
}
|
|
@@ -91,9 +91,19 @@ struct ReactNotificationService : implements<ReactNotificationService, IReactNot
|
|
|
91
91
|
IReactPropertyName const ¬ificationName,
|
|
92
92
|
Mso::FunctorRef<SubscriptionSnapshot(SubscriptionSnapshot const &)> const &modifySnapshot);
|
|
93
93
|
|
|
94
|
+
void AddSubscription(
|
|
95
|
+
IReactPropertyName const ¬ificationName,
|
|
96
|
+
IReactNotificationSubscription const &subscription) noexcept;
|
|
97
|
+
void AddSubscriptionToParent(
|
|
98
|
+
IReactPropertyName const ¬ificationName,
|
|
99
|
+
IReactNotificationSubscription const &subscription) noexcept;
|
|
100
|
+
void AddSubscriptionFromChild(
|
|
101
|
+
IReactPropertyName const ¬ificationName,
|
|
102
|
+
IReactNotificationSubscription const &childSubscription) noexcept;
|
|
103
|
+
|
|
94
104
|
private:
|
|
95
105
|
const IReactNotificationService m_parentNotificationService;
|
|
96
|
-
std::mutex m_mutex;
|
|
106
|
+
Mso::RefCountedPtr<std::mutex> m_mutex{Mso::Make_RefCounted<std::mutex>()};
|
|
97
107
|
std::unordered_map<IReactPropertyName, SubscriptionSnapshotPtr> m_subscriptions;
|
|
98
108
|
};
|
|
99
109
|
|
|
@@ -103,35 +113,6 @@ struct ReactNotificationServiceHelper {
|
|
|
103
113
|
static IReactNotificationService CreateNotificationService() noexcept;
|
|
104
114
|
};
|
|
105
115
|
|
|
106
|
-
struct ReactNotificationSubscription : implements<ReactNotificationSubscription, IReactNotificationSubscription> {
|
|
107
|
-
ReactNotificationSubscription(
|
|
108
|
-
IReactNotificationSubscription const &parentSubscription,
|
|
109
|
-
weak_ref<ReactNotificationService> &¬ificationService,
|
|
110
|
-
IReactPropertyName const ¬ificationName,
|
|
111
|
-
IReactDispatcher const &dispatcher) noexcept;
|
|
112
|
-
ReactNotificationSubscription(
|
|
113
|
-
weak_ref<ReactNotificationService> &¬ificationService,
|
|
114
|
-
IReactPropertyName const ¬ificationName,
|
|
115
|
-
IReactDispatcher const &dispatcher,
|
|
116
|
-
ReactNotificationHandler const &handler) noexcept;
|
|
117
|
-
~ReactNotificationSubscription() noexcept;
|
|
118
|
-
|
|
119
|
-
IReactNotificationService NotificationService() const noexcept;
|
|
120
|
-
IReactPropertyName NotificationName() const noexcept;
|
|
121
|
-
IReactDispatcher Dispatcher() const noexcept;
|
|
122
|
-
bool IsSubscribed() const noexcept;
|
|
123
|
-
void Unsubscribe() noexcept;
|
|
124
|
-
void CallHandler(IInspectable const &sender, IReactNotificationArgs const &args) noexcept;
|
|
125
|
-
|
|
126
|
-
private:
|
|
127
|
-
const IReactNotificationSubscription m_parentSubscription{nullptr};
|
|
128
|
-
const weak_ref<ReactNotificationService> m_notificationService;
|
|
129
|
-
const IReactPropertyName m_notificationName;
|
|
130
|
-
const IReactDispatcher m_dispatcher;
|
|
131
|
-
const ReactNotificationHandler m_handler;
|
|
132
|
-
std::atomic_bool m_isSubscribed{true};
|
|
133
|
-
};
|
|
134
|
-
|
|
135
116
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
136
117
|
|
|
137
118
|
namespace winrt::Microsoft::ReactNative::factory_implementation {
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
<PackageReference Include="boost" Version="1.76.0.0" />
|
|
726
726
|
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" />
|
|
727
727
|
<PackageReference Include="ReactNative.Hermes.Windows" Version="$(HermesVersion)" />
|
|
728
|
-
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
|
|
728
|
+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
729
729
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
|
|
730
730
|
</ItemGroup>
|
|
731
731
|
<Choose>
|
|
@@ -118,17 +118,22 @@ struct BrushCache {
|
|
|
118
118
|
return RegisterBrush(resourceName, brush);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
auto brush = xaml::Media::
|
|
127
|
-
|
|
121
|
+
const auto appResources{winrt::Application::Current().Resources()};
|
|
122
|
+
const auto boxedResourceName{winrt::box_value(resourceName)};
|
|
123
|
+
if (appResources.HasKey(boxedResourceName)) {
|
|
124
|
+
winrt::IInspectable resource{appResources.Lookup(boxedResourceName)};
|
|
125
|
+
|
|
126
|
+
if (auto brush = resource.try_as<xaml::Media::Brush>()) {
|
|
127
|
+
return RegisterBrush(resourceName, brush);
|
|
128
|
+
} else if (auto color = resource.try_as<winrt::Windows::UI::Color>()) {
|
|
129
|
+
auto brush = xaml::Media::SolidColorBrush(color.value());
|
|
130
|
+
return RegisterBrush(resourceName, brush);
|
|
131
|
+
}
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
assert(false && "Resource is not a Color or Brush");
|
|
131
|
-
return
|
|
135
|
+
return xaml::Media::SolidColorBrush(winrt::Colors::Transparent());
|
|
136
|
+
;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
xaml::Media::Brush RegisterBrush(winrt::hstring resourceName, const xaml::Media::Brush &brush) {
|
|
@@ -143,7 +143,7 @@ bool ImageViewManager::UpdateProperty(
|
|
|
143
143
|
} else if (propertyName == "tintColor") {
|
|
144
144
|
const auto isValidColorValue = IsValidColorValue(propertyValue);
|
|
145
145
|
if (isValidColorValue || propertyValue.IsNull()) {
|
|
146
|
-
const auto color = isValidColorValue ?
|
|
146
|
+
const auto color = isValidColorValue ? SolidColorBrushFrom(propertyValue).Color() : winrt::Colors::Transparent();
|
|
147
147
|
reactImage->TintColor(color);
|
|
148
148
|
}
|
|
149
149
|
// Override default accessibility behavior
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!--
|
|
2
|
+
<!--
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
Licensed under the MIT License.
|
|
5
5
|
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
<ItemGroup>
|
|
18
18
|
<!-- WinUI package name and version are set by WinUI.props -->
|
|
19
|
-
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
|
|
19
|
+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
20
20
|
<!-- Hermes version is set by JSEngine.props -->
|
|
21
21
|
<PackageReference Include="ReactNative.Hermes.Windows" Version="$(HermesVersion)" Condition="$(UseHermes)" />
|
|
22
22
|
</ItemGroup>
|
|
23
23
|
|
|
24
|
-
<Import Project="$(ReactNativeWindowsDir)PropertySheets\ManagedCodeGen\Microsoft.ReactNative.Managed.CodeGen.targets"
|
|
24
|
+
<Import Project="$(ReactNativeWindowsDir)PropertySheets\ManagedCodeGen\Microsoft.ReactNative.Managed.CodeGen.targets"
|
|
25
25
|
Condition="'$(ReactNativeCodeGenEnabled)' == 'true' and '$(UseExperimentalNuget)' != 'true'" />
|
|
26
26
|
|
|
27
27
|
<!-- The props file for bundling is not set up to be just defaults, it assumes to be run at the end of the project. -->
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
<Import Project="$(ProjectDir)\AutolinkedNativeModules.g.targets"
|
|
32
32
|
Condition="Exists('$(ProjectDir)\AutolinkedNativeModules.g.targets')" />
|
|
33
33
|
|
|
34
|
-
<Import Project="$(AppxPackageRecipe)"
|
|
34
|
+
<Import Project="$(AppxPackageRecipe)"
|
|
35
35
|
Condition="Exists('$(AppxPackageRecipe)') And '$(DeployLayout)'=='true'" />
|
|
36
36
|
<Target Name="Deploy" Condition="'$(DeployLayout)'=='true'">
|
|
37
|
-
<Error Condition="!Exists('$(AppxPackageRecipe)')"
|
|
37
|
+
<Error Condition="!Exists('$(AppxPackageRecipe)')"
|
|
38
38
|
Text="You must first build the project before deploying it. Did not find: $(AppxPackageRecipe)" />
|
|
39
|
-
<Copy SourceFiles="%(AppxPackagedFile.Identity)"
|
|
39
|
+
<Copy SourceFiles="%(AppxPackagedFile.Identity)"
|
|
40
40
|
DestinationFiles="$(MSBuildProjectDirectory)\$(OutputPath)Appx\%(AppxPackagedFile.PackagePath)" />
|
|
41
|
-
<Copy SourceFiles="%(AppXManifest.Identity)"
|
|
42
|
-
DestinationFiles="$(MSBuildProjectDirectory)\$(OutputPath)Appx\%(AppxManifest.PackagePath)"
|
|
41
|
+
<Copy SourceFiles="%(AppXManifest.Identity)"
|
|
42
|
+
DestinationFiles="$(MSBuildProjectDirectory)\$(OutputPath)Appx\%(AppxManifest.PackagePath)"
|
|
43
43
|
Condition="'%(AppxManifest.SubType)'!='Designer'"/>
|
|
44
|
-
<Exec Command="powershell -NonInteractive -NoProfile -Command Add-AppxPackage -Register $(MSBuildProjectDirectory)\$(OutputPath)Appx\AppxManifest.xml"
|
|
44
|
+
<Exec Command="powershell -NonInteractive -NoProfile -Command Add-AppxPackage -Register $(MSBuildProjectDirectory)\$(OutputPath)Appx\AppxManifest.xml"
|
|
45
45
|
ContinueOnError="false" />
|
|
46
46
|
</Target>
|
|
47
47
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!--
|
|
2
|
+
<!--
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
Licensed under the MIT License.
|
|
5
5
|
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
<ItemGroup>
|
|
18
18
|
<!-- WinUI package name and version are set by WinUI.props -->
|
|
19
|
-
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
|
|
19
|
+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
20
20
|
</ItemGroup>
|
|
21
21
|
|
|
22
22
|
<Target Name="Deploy" />
|
|
23
23
|
|
|
24
|
-
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ManagedCodeGen\Microsoft.ReactNative.Managed.CodeGen.targets"
|
|
24
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ManagedCodeGen\Microsoft.ReactNative.Managed.CodeGen.targets"
|
|
25
25
|
Condition="'$(ReactNativeCodeGenEnabled)' == 'true' and '$(UseExperimentalNuget)' != 'true'" />
|
|
26
26
|
|
|
27
27
|
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\RequireSolution.targets" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!--
|
|
2
|
+
<!--
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
Licensed under the MIT License.
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<ItemGroup>
|
|
18
18
|
<!-- WinUI package name and version are set by WinUI.props -->
|
|
19
|
-
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
|
|
19
|
+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
20
20
|
<!-- Hermes version is set by JSEngine.props -->
|
|
21
21
|
<PackageReference Include="ReactNative.Hermes.Windows" Version="$(HermesVersion)" Condition="$(UseHermes)" />
|
|
22
22
|
</ItemGroup>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!--
|
|
2
|
+
<!--
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
Licensed under the MIT License.
|
|
5
5
|
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
<ItemGroup>
|
|
18
18
|
<!-- WinUI package name and version are set by WinUI.props -->
|
|
19
|
-
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
|
|
19
|
+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
20
20
|
</ItemGroup>
|
|
21
21
|
|
|
22
22
|
<Target Name="Deploy" />
|
|
23
23
|
|
|
24
24
|
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\RequireSolution.targets" />
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
<ItemDefinitionGroup>
|
|
27
27
|
<Reference>
|
|
28
28
|
<Private Condition="'$(ConfigurationType)' != 'Application'">false</Private>
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.69.
|
|
13
|
+
<ReactNativeWindowsVersion>0.69.6</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>69</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>6</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
18
|
</PropertyGroup>
|
|
19
19
|
</Project>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.69.
|
|
3
|
+
"version": "0.69.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "^8.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "^8.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "^8.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.69.
|
|
29
|
+
"@react-native-windows/cli": "0.69.2",
|
|
30
30
|
"@react-native-windows/virtualized-list": "0.69.0",
|
|
31
31
|
"@react-native/assets": "1.0.0",
|
|
32
32
|
"@react-native/normalize-color": "2.0.0",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#pragma once
|
|
8
8
|
|
|
9
9
|
#include <glog/logging.h>
|
|
10
|
+
#include <charconv>
|
|
10
11
|
#include <sstream>
|
|
11
12
|
|
|
12
13
|
static inline void nyi() {
|
|
@@ -127,19 +128,27 @@ class StringToDoubleConverter {
|
|
|
127
128
|
// nyi();
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
double StringToDouble(const char *
|
|
131
|
-
|
|
132
|
-
std::
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
double StringToDouble(const char *buf, int length, int *consumed) {
|
|
132
|
+
double d{};
|
|
133
|
+
auto ret = std::from_chars(buf, buf + length, d);
|
|
134
|
+
if (ret.ec == std::errc{}) {
|
|
135
|
+
*consumed = static_cast<int>(ret.ptr - buf);
|
|
136
|
+
} else {
|
|
137
|
+
*consumed = 0;
|
|
138
|
+
assert(false && "Conversion to double failed");
|
|
139
|
+
}
|
|
135
140
|
return d;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
float StringToFloat(const char *buf, int length, int *consumed) {
|
|
139
|
-
|
|
140
|
-
std::
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
float f{};
|
|
145
|
+
auto ret = std::from_chars(buf, buf + length, f);
|
|
146
|
+
if (ret.ec == std::errc{}) {
|
|
147
|
+
*consumed = static_cast<int>(ret.ptr - buf);
|
|
148
|
+
} else {
|
|
149
|
+
*consumed = 0;
|
|
150
|
+
assert(false && "Conversion to float failed");
|
|
151
|
+
}
|
|
143
152
|
return f;
|
|
144
153
|
}
|
|
145
154
|
};
|