react-native-windows 0.81.35 → 0.81.36
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/Fabric/Composition/TooltipService.cpp +48 -2
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +40 -13
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Scripts/creaternwlib.cmd +2 -2
- package/external/fast-float/.syncignore +0 -1
- package/external/fast-float/README.md +545 -0
- package/external/fmt/.syncignore +0 -2
- package/external/fmt/README.md +484 -0
- package/external/fmt/doc/ChangeLog-old.md +3290 -0
- package/external/fmt/doc/api.md +650 -0
- package/external/fmt/doc/fmt.css +61 -0
- package/external/fmt/doc/fmt.js +4 -0
- package/external/fmt/doc/get-started.md +222 -0
- package/external/fmt/doc/index.md +151 -0
- package/external/fmt/doc/perf.svg +1 -0
- package/external/fmt/doc/python-license.txt +290 -0
- package/external/fmt/doc/syntax.md +887 -0
- package/external/folly/.syncignore +2 -3
- package/external/folly/README.md +263 -0
- package/external/folly/folly/docs/AtomicHashMap.md +134 -0
- package/external/folly/folly/docs/Benchmark.md +310 -0
- package/external/folly/folly/docs/Conv.md +291 -0
- package/external/folly/folly/docs/Dynamic.md +220 -0
- package/external/folly/folly/docs/DynamicConverter.md +71 -0
- package/external/folly/folly/docs/Executors.md +63 -0
- package/external/folly/folly/docs/FBString.md +46 -0
- package/external/folly/folly/docs/FBVector.md +200 -0
- package/external/folly/folly/docs/Fbvector--graphical_solutions.png +0 -0
- package/external/folly/folly/docs/Format.md +177 -0
- package/external/folly/folly/docs/Function.md +92 -0
- package/external/folly/folly/docs/Futures.md +263 -0
- package/external/folly/folly/docs/GroupVarint.md +46 -0
- package/external/folly/folly/docs/Histogram.md +104 -0
- package/external/folly/folly/docs/MapUtils.md +80 -0
- package/external/folly/folly/docs/Overview.md +263 -0
- package/external/folly/folly/docs/PackedSyncPtr.md +77 -0
- package/external/folly/folly/docs/Poly.md +500 -0
- package/external/folly/folly/docs/ProducerConsumerQueue.md +82 -0
- package/external/folly/folly/docs/Rcu.md +218 -0
- package/external/folly/folly/docs/SmallLocks.md +24 -0
- package/external/folly/folly/docs/Synchronized.md +793 -0
- package/external/folly/folly/docs/ThreadCachedInt.md +98 -0
- package/external/folly/folly/docs/ThreadLocal.md +105 -0
- package/external/folly/folly/docs/Traits.md +161 -0
- package/external/folly/folly/docs/small_vector.md +64 -0
- package/external/folly/folly/docs/style.css +23 -0
- package/external/folly/static/logo.svg +1 -0
- package/package.json +2 -2
- package/templates/cpp-lib/example/metro.config.js +31 -6
- package/Scripts/Warm-RnwFeedCache.ps1 +0 -413
|
@@ -135,6 +135,49 @@ LRESULT CALLBACK TooltipWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM l
|
|
|
135
135
|
return DefWindowProc(hwnd, message, wparam, lparam);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
POINT ClampTooltipPositionToMonitor(const POINT &anchorPt, int &tooltipWidth, int &tooltipHeight, int margin) noexcept {
|
|
139
|
+
POINT result = {anchorPt.x - tooltipWidth / 2, anchorPt.y - tooltipHeight - margin};
|
|
140
|
+
|
|
141
|
+
HMONITOR hMonitor = MonitorFromPoint(anchorPt, MONITOR_DEFAULTTONEAREST);
|
|
142
|
+
MONITORINFO monitorInfo = {};
|
|
143
|
+
monitorInfo.cbSize = sizeof(monitorInfo);
|
|
144
|
+
if (!GetMonitorInfo(hMonitor, &monitorInfo)) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const RECT &bounds = monitorInfo.rcWork;
|
|
149
|
+
|
|
150
|
+
// Cap the tooltip size to the work area so the position clamping below is guaranteed to keep
|
|
151
|
+
// the whole tooltip on-screen, even for unusually long tooltip text.
|
|
152
|
+
tooltipWidth = std::min(tooltipWidth, static_cast<int>(bounds.right - bounds.left));
|
|
153
|
+
tooltipHeight = std::min(tooltipHeight, static_cast<int>(bounds.bottom - bounds.top));
|
|
154
|
+
|
|
155
|
+
result = {anchorPt.x - tooltipWidth / 2, anchorPt.y - tooltipHeight - margin};
|
|
156
|
+
|
|
157
|
+
// Flip below the anchor if there isn't enough room above it within the work area.
|
|
158
|
+
if (result.y < bounds.top) {
|
|
159
|
+
result.y = anchorPt.y + margin;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Clamp vertically so the tooltip never extends past the work area.
|
|
163
|
+
if (result.y + tooltipHeight > bounds.bottom) {
|
|
164
|
+
result.y = bounds.bottom - tooltipHeight;
|
|
165
|
+
}
|
|
166
|
+
if (result.y < bounds.top) {
|
|
167
|
+
result.y = bounds.top;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Clamp horizontally so the tooltip never extends past the work area.
|
|
171
|
+
if (result.x + tooltipWidth > bounds.right) {
|
|
172
|
+
result.x = bounds.right - tooltipWidth;
|
|
173
|
+
}
|
|
174
|
+
if (result.x < bounds.left) {
|
|
175
|
+
result.x = bounds.left;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
|
|
138
181
|
void RegisterTooltipWndClass() noexcept {
|
|
139
182
|
static bool registered = false;
|
|
140
183
|
if (registered) {
|
|
@@ -334,14 +377,17 @@ void TooltipTracker::ShowTooltip(const winrt::Microsoft::ReactNative::ComponentV
|
|
|
334
377
|
POINT pt = {static_cast<LONG>(m_pos.X * scaleFactor), static_cast<LONG>(m_pos.Y * scaleFactor)};
|
|
335
378
|
ClientToScreen(parentHwnd, &pt);
|
|
336
379
|
|
|
380
|
+
POINT tooltipPos = ClampTooltipPositionToMonitor(
|
|
381
|
+
pt, tooltipData->width, tooltipData->height, static_cast<int>(toolTipPlacementMargin * scaleFactor));
|
|
382
|
+
|
|
337
383
|
RegisterTooltipWndClass();
|
|
338
384
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
|
339
385
|
m_hwndTip = CreateWindow(
|
|
340
386
|
c_tooltipWindowClassName,
|
|
341
387
|
L"Tooltip",
|
|
342
388
|
WS_POPUP,
|
|
343
|
-
|
|
344
|
-
|
|
389
|
+
tooltipPos.x,
|
|
390
|
+
tooltipPos.y,
|
|
345
391
|
tooltipData->width,
|
|
346
392
|
tooltipData->height,
|
|
347
393
|
parentHwnd,
|
|
@@ -186,6 +186,16 @@ facebook::react::ImageRequest WindowsImageManager::requestImage(
|
|
|
186
186
|
auto weakObserverCoordinator = (std::weak_ptr<const facebook::react::ImageResponseObserverCoordinator>)
|
|
187
187
|
imageRequest.getSharedObserverCoordinator();
|
|
188
188
|
|
|
189
|
+
// ImageResponseObserverCoordinator copies its observer list under a lock but dereferences the raw
|
|
190
|
+
// observer pointers after releasing it. Observers are added and removed on the UI thread (from
|
|
191
|
+
// ImageComponentView::setStateAndResubscribeImageResponseObserver), and that is also where the
|
|
192
|
+
// owning ImageComponentView - and with it the WindowsImageResponseObserver - is destroyed. Notifying
|
|
193
|
+
// the coordinator from the download/completion threads therefore races that teardown and can call
|
|
194
|
+
// into a freed observer. Marshal every notification onto the UI thread so subscription and
|
|
195
|
+
// notification are serialized on the same thread. Image decoding deliberately stays off the UI
|
|
196
|
+
// thread; only the notification itself is posted.
|
|
197
|
+
auto uiDispatcher = m_reactContext.UIDispatcher();
|
|
198
|
+
|
|
189
199
|
auto rnImageSource = winrt::Microsoft::ReactNative::Composition::implementation::MakeImageSource(imageSource);
|
|
190
200
|
auto provider = m_uriImageManager->TryGetUriImageProvider(m_reactContext.Handle(), rnImageSource);
|
|
191
201
|
|
|
@@ -202,21 +212,39 @@ facebook::react::ImageRequest WindowsImageManager::requestImage(
|
|
|
202
212
|
source.sourceType = ImageSourceType::Download;
|
|
203
213
|
source.body = imageSource.body;
|
|
204
214
|
|
|
205
|
-
auto progressCallback = [weakObserverCoordinator](int64_t loaded, int64_t total) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
215
|
+
auto progressCallback = [weakObserverCoordinator, uiDispatcher](int64_t loaded, int64_t total) {
|
|
216
|
+
float progress = total > 0 ? static_cast<float>(loaded) / static_cast<float>(total) : 1.0f;
|
|
217
|
+
uiDispatcher.Post([weakObserverCoordinator, progress, loaded, total]() {
|
|
218
|
+
if (auto observerCoordinator = weakObserverCoordinator.lock()) {
|
|
219
|
+
observerCoordinator->nativeImageResponseProgress(progress, loaded, total);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
210
222
|
};
|
|
211
223
|
imageResponseTask = GetImageRandomAccessStreamAsync(source, progressCallback);
|
|
212
224
|
}
|
|
213
225
|
|
|
214
|
-
imageResponseTask.Completed([weakObserverCoordinator](auto asyncOp, auto status) {
|
|
215
|
-
|
|
216
|
-
if (!observerCoordinator) {
|
|
226
|
+
imageResponseTask.Completed([weakObserverCoordinator, uiDispatcher](auto asyncOp, auto status) {
|
|
227
|
+
if (weakObserverCoordinator.expired()) {
|
|
217
228
|
return;
|
|
218
229
|
}
|
|
219
230
|
|
|
231
|
+
auto postComplete = [weakObserverCoordinator, uiDispatcher](auto image) {
|
|
232
|
+
uiDispatcher.Post([weakObserverCoordinator, image = std::move(image)]() {
|
|
233
|
+
if (auto observerCoordinator = weakObserverCoordinator.lock()) {
|
|
234
|
+
observerCoordinator->nativeImageResponseComplete(facebook::react::ImageResponse(image, nullptr /*metadata*/));
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
auto postFailure = [weakObserverCoordinator,
|
|
240
|
+
uiDispatcher](std::shared_ptr<facebook::react::ImageErrorInfo> errorInfo) {
|
|
241
|
+
uiDispatcher.Post([weakObserverCoordinator, errorInfo = std::move(errorInfo)]() {
|
|
242
|
+
if (auto observerCoordinator = weakObserverCoordinator.lock()) {
|
|
243
|
+
observerCoordinator->nativeImageResponseFailed(facebook::react::ImageLoadError(errorInfo));
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
|
|
220
248
|
switch (status) {
|
|
221
249
|
case winrt::Windows::Foundation::AsyncStatus::Completed: {
|
|
222
250
|
auto imageResponse = asyncOp.GetResults();
|
|
@@ -224,23 +252,22 @@ facebook::react::ImageRequest WindowsImageManager::requestImage(
|
|
|
224
252
|
winrt::get_self<winrt::Microsoft::ReactNative::Composition::implementation::ImageResponse>(imageResponse);
|
|
225
253
|
auto imageResultOrError = selfImageResponse->ResolveImage();
|
|
226
254
|
if (imageResultOrError.image) {
|
|
227
|
-
|
|
228
|
-
facebook::react::ImageResponse(imageResultOrError.image, nullptr /*metadata*/));
|
|
255
|
+
postComplete(std::move(imageResultOrError.image));
|
|
229
256
|
} else {
|
|
230
|
-
|
|
257
|
+
postFailure(std::move(imageResultOrError.errorInfo));
|
|
231
258
|
}
|
|
232
259
|
break;
|
|
233
260
|
}
|
|
234
261
|
case winrt::Windows::Foundation::AsyncStatus::Canceled: {
|
|
235
262
|
auto errorInfo = std::make_shared<facebook::react::ImageErrorInfo>();
|
|
236
263
|
errorInfo->error = FormatHResultError(winrt::hresult_error(asyncOp.ErrorCode()));
|
|
237
|
-
|
|
264
|
+
postFailure(std::move(errorInfo));
|
|
238
265
|
break;
|
|
239
266
|
}
|
|
240
267
|
case winrt::Windows::Foundation::AsyncStatus::Error: {
|
|
241
268
|
auto errorInfo = std::make_shared<facebook::react::ImageErrorInfo>();
|
|
242
269
|
errorInfo->error = FormatHResultError(winrt::hresult_error(asyncOp.ErrorCode()));
|
|
243
|
-
|
|
270
|
+
postFailure(std::move(errorInfo));
|
|
244
271
|
break;
|
|
245
272
|
}
|
|
246
273
|
}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.81.
|
|
13
|
+
<ReactNativeWindowsVersion>0.81.36</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>81</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>36</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>87ecc02fbc3641eb70d8179f61fdb98ba5dd8f04</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
package/Scripts/creaternwlib.cmd
CHANGED
|
@@ -119,8 +119,8 @@ for /f "delims=" %%a in ('npm show react@%R_VERSION% version') do @set R_VERSION
|
|
|
119
119
|
|
|
120
120
|
@echo creaternwlib.cmd Creating RNW lib "%LIB_NAME%" with react@%R_VERSION%, react-native@%RN_VERSION%, and react-native-windows@%RNW_VERSION%
|
|
121
121
|
|
|
122
|
-
@echo creaternwlib.cmd Creating base RN library project with: npx --yes create-react-native-library@0.
|
|
123
|
-
call npx --yes create-react-native-library@0.
|
|
122
|
+
@echo creaternwlib.cmd Creating base RN library project with: npx --yes create-react-native-library@0.63.0 --slug %LIB_NAME% --description %LIB_NAME% --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --type %RN_TEMPLATE_TYPE% --tools=eslint --tools=jest --tools=lefthook --tools=release-it --tools=vite --react-native-version %RN_VERSION% --example vanilla %LIB_NAME%
|
|
123
|
+
call npx --yes create-react-native-library@0.63.0 --slug %LIB_NAME% --description %LIB_NAME% --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --type %RN_TEMPLATE_TYPE% --tools=eslint --tools=jest --tools=lefthook --tools=release-it --tools=vite --react-native-version %RN_VERSION% --example vanilla %LIB_NAME%
|
|
124
124
|
|
|
125
125
|
if %ERRORLEVEL% neq 0 (
|
|
126
126
|
@echo creaternwlib.cmd: Unable to create base RN library project
|