react-native-windows 0.83.0-preview.3 → 0.83.0

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.
@@ -1064,6 +1064,11 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::get_SelectionContainer(I
1064
1064
  *pRetVal = nullptr;
1065
1065
 
1066
1066
  auto selectionContainerView = GetSelectionContainer();
1067
+ // Per UIA spec, returning S_OK with *pRetVal == nullptr is correct when the element
1068
+ // is not contained within a selection container.
1069
+ if (!selectionContainerView)
1070
+ return S_OK;
1071
+
1067
1072
  auto uiaProvider =
1068
1073
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(selectionContainerView)
1069
1074
  ->EnsureUiaProvider();
@@ -169,12 +169,22 @@ TooltipTracker::TooltipTracker(
169
169
  view.PointerEntered({this, &TooltipTracker::OnPointerEntered});
170
170
  view.PointerExited({this, &TooltipTracker::OnPointerExited});
171
171
  view.PointerMoved({this, &TooltipTracker::OnPointerMoved});
172
+ view.GotFocus({this, &TooltipTracker::OnGotFocus});
173
+ view.LostFocus({this, &TooltipTracker::OnLostFocus});
172
174
  view.Unmounted({this, &TooltipTracker::OnUnmounted});
173
175
  }
174
176
 
175
177
  TooltipTracker::~TooltipTracker() {
176
178
  DestroyTimer();
177
179
  DestroyTooltip();
180
+ m_outer->NotifyDismiss(this);
181
+ }
182
+
183
+ void TooltipTracker::DismissForExternalRequest() noexcept {
184
+ // Service is already updating its active slot; do not call back into it.
185
+ m_focusTooltip = false;
186
+ DestroyTimer();
187
+ DestroyTooltip();
178
188
  }
179
189
 
180
190
  facebook::react::Tag TooltipTracker::Tag() const noexcept {
@@ -192,6 +202,9 @@ void TooltipTracker::OnPointerEntered(
192
202
  auto pp = args.GetCurrentPoint(-1);
193
203
  m_pos = pp.Position();
194
204
 
205
+ // Claim the single tooltip slot, dismissing any other tracker's pending or visible tooltip.
206
+ m_outer->NotifyShow(this);
207
+
195
208
  m_timer = winrt::Microsoft::ReactNative::Timer::Create(m_properties.Handle());
196
209
  m_timer.Interval(std::chrono::milliseconds(toolTipTimeToShowMs));
197
210
  m_timer.Tick({this, &TooltipTracker::OnTick});
@@ -225,6 +238,56 @@ void TooltipTracker::OnPointerExited(
225
238
  return;
226
239
  DestroyTimer();
227
240
  DestroyTooltip();
241
+ m_outer->NotifyDismiss(this);
242
+ }
243
+
244
+ void TooltipTracker::OnGotFocus(
245
+ const winrt::Windows::Foundation::IInspectable & /*sender*/,
246
+ const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs & /*args*/) noexcept {
247
+ // Skip if a mouse-driven tooltip or its dwell timer is already in flight on this view.
248
+ if (m_hwndTip || m_timer) {
249
+ return;
250
+ }
251
+
252
+ auto view = m_view.view();
253
+ if (!view) {
254
+ return;
255
+ }
256
+
257
+ auto viewCompView = view.try_as<winrt::Microsoft::ReactNative::Composition::ViewComponentView>();
258
+ if (!viewCompView) {
259
+ return;
260
+ }
261
+ auto selfView =
262
+ winrt::get_self<winrt::Microsoft::ReactNative::Composition::implementation::ViewComponentView>(viewCompView);
263
+ RECT rc = selfView->getClientRect();
264
+ auto scaleFactor = view.LayoutMetrics().PointScaleFactor;
265
+ if (scaleFactor <= 0) {
266
+ return;
267
+ }
268
+
269
+ // Anchor in DIPs at the horizontal center of the view's top edge; ShowTooltip re-applies scaleFactor.
270
+ m_pos = {static_cast<float>(rc.left + rc.right) / 2.0f / scaleFactor, static_cast<float>(rc.top) / scaleFactor};
271
+
272
+ m_focusTooltip = true;
273
+ // Claim the single tooltip slot, dismissing any other tracker's pending or visible tooltip.
274
+ m_outer->NotifyShow(this);
275
+ m_timer = winrt::Microsoft::ReactNative::Timer::Create(m_properties.Handle());
276
+ m_timer.Interval(std::chrono::milliseconds(toolTipTimeToShowMs));
277
+ m_timer.Tick({this, &TooltipTracker::OnTick});
278
+ m_timer.Start();
279
+ }
280
+
281
+ void TooltipTracker::OnLostFocus(
282
+ const winrt::Windows::Foundation::IInspectable & /*sender*/,
283
+ const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs & /*args*/) noexcept {
284
+ if (!m_focusTooltip) {
285
+ return;
286
+ }
287
+ m_focusTooltip = false;
288
+ DestroyTimer();
289
+ DestroyTooltip();
290
+ m_outer->NotifyDismiss(this);
228
291
  }
229
292
 
230
293
  void TooltipTracker::OnUnmounted(
@@ -232,6 +295,7 @@ void TooltipTracker::OnUnmounted(
232
295
  const winrt::Microsoft::ReactNative::ComponentView &) noexcept {
233
296
  DestroyTimer();
234
297
  DestroyTooltip();
298
+ m_outer->NotifyDismiss(this);
235
299
  }
236
300
 
237
301
  void TooltipTracker::ShowTooltip(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
@@ -326,6 +390,22 @@ void TooltipService::StopTracking(const winrt::Microsoft::ReactNative::Component
326
390
  }
327
391
  }
328
392
 
393
+ void TooltipService::NotifyShow(TooltipTracker *tracker) noexcept {
394
+ if (m_activeTracker == tracker) {
395
+ return;
396
+ }
397
+ if (m_activeTracker) {
398
+ m_activeTracker->DismissForExternalRequest();
399
+ }
400
+ m_activeTracker = tracker;
401
+ }
402
+
403
+ void TooltipService::NotifyDismiss(TooltipTracker *tracker) noexcept {
404
+ if (m_activeTracker == tracker) {
405
+ m_activeTracker = nullptr;
406
+ }
407
+ }
408
+
329
409
  static const ReactPropertyId<winrt::Microsoft::ReactNative::ReactNonAbiValue<std::shared_ptr<TooltipService>>>
330
410
  &TooltipServicePropertyId() noexcept {
331
411
  static const ReactPropertyId<winrt::Microsoft::ReactNative::ReactNonAbiValue<std::shared_ptr<TooltipService>>> prop{
@@ -27,6 +27,12 @@ struct TooltipTracker {
27
27
  void OnPointerExited(
28
28
  const winrt::Windows::Foundation::IInspectable &sender,
29
29
  const winrt::Microsoft::ReactNative::Composition::Input::PointerRoutedEventArgs &args) noexcept;
30
+ void OnGotFocus(
31
+ const winrt::Windows::Foundation::IInspectable &sender,
32
+ const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
33
+ void OnLostFocus(
34
+ const winrt::Windows::Foundation::IInspectable &sender,
35
+ const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
30
36
  void OnTick(
31
37
  const winrt::Windows::Foundation::IInspectable &,
32
38
  const winrt::Windows::Foundation::IInspectable &) noexcept;
@@ -36,6 +42,10 @@ struct TooltipTracker {
36
42
 
37
43
  facebook::react::Tag Tag() const noexcept;
38
44
 
45
+ // Cancel pending dwell timer and close any visible tooltip popup; used by the service when another tracker takes
46
+ // over.
47
+ void DismissForExternalRequest() noexcept;
48
+
39
49
  private:
40
50
  void ShowTooltip(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept;
41
51
  void DestroyTimer() noexcept;
@@ -46,6 +56,7 @@ struct TooltipTracker {
46
56
  ::Microsoft::ReactNative::ReactTaggedView m_view;
47
57
  winrt::Microsoft::ReactNative::ITimer m_timer;
48
58
  HWND m_hwndTip{nullptr};
59
+ bool m_focusTooltip{false};
49
60
  winrt::Microsoft::ReactNative::ReactPropertyBag m_properties;
50
61
  };
51
62
 
@@ -54,12 +65,18 @@ struct TooltipService {
54
65
  void StartTracking(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept;
55
66
  void StopTracking(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept;
56
67
 
68
+ // Enforce "only one tooltip visible at a time": dismisses the previously active tracker, if any.
69
+ void NotifyShow(TooltipTracker *tracker) noexcept;
70
+ // Clears the active-tracker slot if it still points at `tracker`.
71
+ void NotifyDismiss(TooltipTracker *tracker) noexcept;
72
+
57
73
  static std::shared_ptr<TooltipService> GetCurrent(
58
74
  const winrt::Microsoft::ReactNative::ReactPropertyBag &properties) noexcept;
59
75
 
60
76
  private:
61
77
  std::vector<std::shared_ptr<TooltipTracker>> m_enteredTrackers;
62
78
  std::vector<std::shared_ptr<TooltipTracker>> m_trackers;
79
+ TooltipTracker *m_activeTracker{nullptr};
63
80
  winrt::Microsoft::ReactNative::ReactPropertyBag m_properties;
64
81
  };
65
82
 
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.83.0-preview.3</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.83.0</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>83</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>d23bf1e20c21916c5c28bf4d5c781aa58e3999f5</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>0fc74b3bd7d368b133e5633b387a79b4df844a96</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -6,7 +6,7 @@
6
6
  <!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
7
7
  <UseHermes Condition="'$(UseHermes)' == ''">true</UseHermes>
8
8
  <!-- This will be true if (1) the client want to use hermes by setting UseHermes to true OR (2) We are building for UWP where dynamic switching is enabled -->
9
- <HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2512.22001-bc3d0ed7</HermesVersion>
9
+ <HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2604.21001-94aa5e1d</HermesVersion>
10
10
  <HermesPackageName Condition="'$(HermesPackageName)' == ''">Microsoft.JavaScript.Hermes</HermesPackageName>
11
11
  <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgMicrosoft_JavaScript_Hermes)')">$(PkgMicrosoft_JavaScript_Hermes)</HermesPackage>
12
12
  <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\$(HermesPackageName)\$(HermesVersion)</HermesPackage>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.83.0-preview.3",
3
+ "version": "0.83.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "20.0.0",
27
27
  "@react-native-community/cli-platform-android": "20.0.0",
28
28
  "@react-native-community/cli-platform-ios": "20.0.0",
29
- "@react-native-windows/cli": "0.83.0-preview.2",
29
+ "@react-native-windows/cli": "0.83.0",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.83.4",
32
32
  "@react-native/codegen": "0.83.4",
@@ -69,7 +69,7 @@
69
69
  "yargs": "^17.6.2"
70
70
  },
71
71
  "devDependencies": {
72
- "@react-native-windows/codegen": "0.83.0-preview.2",
72
+ "@react-native-windows/codegen": "0.83.0",
73
73
  "@react-native/metro-config": "0.83.4",
74
74
  "@rnw-scripts/babel-react-native-config": "0.0.0",
75
75
  "@rnw-scripts/eslint-config": "1.2.38",
@@ -86,7 +86,7 @@
86
86
  "prettier": "2.8.8",
87
87
  "react": "19.2.0",
88
88
  "react-native": "0.83.4",
89
- "react-native-platform-override": "0.83.0-preview.1",
89
+ "react-native-platform-override": "0.83.0",
90
90
  "react-refresh": "^0.14.0",
91
91
  "typescript": "5.0.4"
92
92
  },
@@ -96,11 +96,11 @@
96
96
  "react-native": "^0.83.0"
97
97
  },
98
98
  "beachball": {
99
- "defaultNpmTag": "preview",
99
+ "defaultNpmTag": "latest",
100
100
  "disallowedChangeTypes": [
101
101
  "major",
102
102
  "minor",
103
- "patch",
103
+ "prerelease",
104
104
  "premajor",
105
105
  "preminor",
106
106
  "prepatch"