react-native-windows 0.76.10 → 0.76.12

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.
Files changed (58) hide show
  1. package/Directory.Build.props +2 -2
  2. package/Folly/TEMP_UntilFollyUpdate/json.cpp +4 -0
  3. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +23 -15
  4. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +5 -5
  5. package/Folly/cgmanifest.json +1 -1
  6. package/Libraries/Components/Button.windows.js +3 -0
  7. package/Libraries/Components/ScrollView/ScrollView.windows.js +1959 -0
  8. package/Libraries/Components/View/View.windows.js +107 -56
  9. package/Libraries/Image/Image.windows.js +42 -21
  10. package/Libraries/Text/Text.d.ts +16 -1
  11. package/Microsoft.ReactNative/CompositionComponentView.idl +0 -5
  12. package/Microsoft.ReactNative/CompositionSwitcher.idl +4 -0
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +32 -0
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +159 -4
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +11 -4
  16. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +0 -4
  17. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +22 -17
  18. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +1 -27
  19. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +0 -2
  20. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +36 -11
  21. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +3 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +50 -125
  23. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +9 -6
  24. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +31 -12
  25. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +6 -1
  26. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +2 -2
  27. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +145 -19
  28. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +13 -0
  29. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +0 -2
  30. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +134 -11
  31. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +6 -0
  32. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +31 -0
  33. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +14 -1
  34. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +6 -2
  35. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +4 -1
  36. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +127 -109
  37. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +28 -25
  38. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +8 -18
  39. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +12 -35
  40. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +53 -11
  41. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +10 -2
  42. package/Microsoft.ReactNative/Fabric/ImageRequestParams.cpp +26 -0
  43. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +38 -8
  44. package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +3 -1
  45. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +206 -41
  46. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +14 -0
  47. package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.cpp +2 -1
  48. package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -0
  49. package/Microsoft.ReactNative/Utils/ImageUtils.h +1 -0
  50. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  51. package/PropertySheets/NuGet.LockFile.props +1 -1
  52. package/PropertySheets/WebView2.props +1 -1
  53. package/PropertySheets/WinUI.props +1 -1
  54. package/Shared/Networking/WinRTWebSocketResource.cpp +82 -96
  55. package/Shared/Networking/WinRTWebSocketResource.h +91 -7
  56. package/Shared/Shared.vcxitems +3 -1
  57. package/Shared/Shared.vcxitems.filters +1 -0
  58. package/package.json +1 -1
@@ -20,8 +20,8 @@
20
20
  <EnableSourceLink Condition="'$(EnableSourceLink)' == '' AND '$(BuildingInRnwRepo)' == 'true'">true</EnableSourceLink>
21
21
  <EnableSourceLink Condition="'$(EnableSourceLink)' == ''">false</EnableSourceLink>
22
22
  <!-- When bumping the Folly version, be sure to bump the git hash of that version's commit and build Folly.vcxproj (to update its cgmanifest.json) too. -->
23
- <FollyVersion>2023.11.06.00</FollyVersion>
24
- <FollyCommitHash>d62707bf4dc8c58bcc317260611b8cbe25c7f444</FollyCommitHash>
23
+ <FollyVersion>2024.01.01.00</FollyVersion>
24
+ <FollyCommitHash>234d39a36a43106747d10cc19efada72fd810dd3</FollyCommitHash>
25
25
  <!-- When bumping the fmt version, be sure to bump the git hash of that version's commit and build fmt.vcxproj (to update its cgmanifest.json) too. -->
26
26
  <FmtVersion>10.1.0</FmtVersion>
27
27
  <FmtCommitHash>ca2e3685b160617d3d95fcd9e789c4e06ca88</FmtCommitHash>
@@ -849,6 +849,10 @@ void escapeStringImpl(
849
849
  }
850
850
  auto prefix = firstEscapableInWord<EnableExtraAsciiEscapes>(word, opts);
851
851
  DCHECK_LE(prefix, avail);
852
+ // [Windows Sometimes prefix is completely wrong (corrupt?), only in Release, causing a later AV (see issue #14394).
853
+ // Prefix should always be <= avail, capping it here as a workaround, hoping the assert above eventually catches this in Debug.
854
+ prefix = std::min(prefix, (size_t)avail);
855
+ // Windows]
852
856
  firstEsc += prefix;
853
857
  if (prefix < 8) {
854
858
  break;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ struct to_ascii_array {
38
38
  return data.data[index];
39
39
  }
40
40
  };
41
-
42
41
  template <uint64_t Base, typename Alphabet>
43
42
  alignas(kIsMobile ? sizeof(size_t) : hardware_constructive_interference_size)
44
43
  typename to_ascii_array<Base, Alphabet>::data_type_ const
@@ -94,13 +93,13 @@ extern template to_ascii_table<10, to_ascii_alphabet_upper>::data_type_ const
94
93
  extern template to_ascii_table<16, to_ascii_alphabet_upper>::data_type_ const
95
94
  to_ascii_table<16, to_ascii_alphabet_upper>::data;
96
95
 
97
- template <uint64_t Base, typename I>
96
+ template <uint64_t Base, typename Int>
98
97
  struct to_ascii_powers {
99
- static constexpr size_t size_(I v) {
98
+ static constexpr size_t size_(Int v) {
100
99
  return 1 + (v < Base ? 0 : size_(v / Base));
101
100
  }
102
- static constexpr size_t const size = size_(~I(0));
103
- using data_type_ = c_array<I, size>;
101
+ static constexpr size_t const size = size_(~Int(0));
102
+ using data_type_ = c_array<Int, size>;
104
103
  static constexpr data_type_ data_() {
105
104
  data_type_ result{};
106
105
  for (size_t i = 0; i < size; ++i) {
@@ -111,12 +110,14 @@ struct to_ascii_powers {
111
110
  // @lint-ignore CLANGTIDY
112
111
  static data_type_ const data;
113
112
  };
114
- template <uint64_t Base, typename I>
115
- constexpr size_t const to_ascii_powers<Base, I>::size;
116
- template <uint64_t Base, typename I>
113
+ #if FOLLY_CPLUSPLUS < 201703L
114
+ template <uint64_t Base, typename Int>
115
+ constexpr size_t const to_ascii_powers<Base, Int>::size;
116
+ #endif
117
+ template <uint64_t Base, typename Int>
117
118
  alignas(hardware_constructive_interference_size)
118
- typename to_ascii_powers<Base, I>::data_type_ const
119
- to_ascii_powers<Base, I>::data = to_ascii_powers<Base, I>::data_();
119
+ typename to_ascii_powers<Base, Int>::data_type_ const
120
+ to_ascii_powers<Base, Int>::data = to_ascii_powers<Base, Int>::data_();
120
121
 
121
122
  extern template to_ascii_powers<8, uint64_t>::data_type_ const
122
123
  to_ascii_powers<8, uint64_t>::data;
@@ -151,7 +152,7 @@ template <uint64_t Base>
151
152
  FOLLY_ALWAYS_INLINE size_t to_ascii_size_array(uint64_t v) {
152
153
  using powers = to_ascii_powers<Base, uint64_t>;
153
154
  for (size_t i = 0u; i < powers::size; ++i) {
154
- if (FOLLY_LIKELY(v < powers::data.data[i])) {
155
+ if (FOLLY_UNLIKELY(v < powers::data.data[i])) {
155
156
  return i + size_t(i == 0);
156
157
  }
157
158
  }
@@ -272,6 +273,15 @@ FOLLY_ALWAYS_INLINE size_t to_ascii_with_table(char* out, uint64_t v) {
272
273
  return size;
273
274
  }
274
275
 
276
+ // Assumes that size >= number of digits in v. If >, the result is left-padded
277
+ // with 0s.
278
+ template <uint64_t Base, typename Alphabet>
279
+ FOLLY_ALWAYS_INLINE void to_ascii_with_route(
280
+ char* outb, size_t size, uint64_t v) {
281
+ kIsMobile //
282
+ ? to_ascii_with_array<Base, Alphabet>(outb, size, v)
283
+ : to_ascii_with_table<Base, Alphabet>(outb, size, v);
284
+ }
275
285
  template <uint64_t Base, typename Alphabet>
276
286
  FOLLY_ALWAYS_INLINE size_t
277
287
  to_ascii_with_route(char* outb, char const* oute, uint64_t v) {
@@ -279,9 +289,7 @@ to_ascii_with_route(char* outb, char const* oute, uint64_t v) {
279
289
  if (FOLLY_UNLIKELY(oute < outb || size_t(oute - outb) < size)) {
280
290
  return 0;
281
291
  }
282
- kIsMobile //
283
- ? to_ascii_with_array<Base, Alphabet>(outb, size, v)
284
- : to_ascii_with_table<Base, Alphabet>(outb, size, v);
292
+ to_ascii_with_route<Base, Alphabet>(outb, size, v);
285
293
  return size;
286
294
  }
287
295
  template <uint64_t Base, typename Alphabet, size_t N>
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -61,14 +61,14 @@ using to_ascii_alphabet_upper = to_ascii_alphabet<true>;
61
61
  // In base 10, u64 requires at most 20 bytes, u32 at most 10, u16 at most 5,
62
62
  // and u8 at most 3.
63
63
  /*
64
- template <uint64_t Base, typename I>
64
+ template <uint64_t Base, typename Int>
65
65
  FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max =
66
- detail::to_ascii_powers<Base, I>::size;
66
+ detail::to_ascii_powers<Base, Int>::size;
67
67
  */
68
68
  // to_ascii_size_max_decimal
69
69
  //
70
70
  // An alias to to_ascii_size_max<10>.
71
- template <typename I>
71
+ template <typename Int>
72
72
  FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal;
73
73
 
74
74
  template <>
@@ -170,7 +170,7 @@ size_t to_ascii_upper(char (&out)[N], uint64_t v) {
170
170
  //
171
171
  // An alias to to_ascii<10, false>.
172
172
  //
173
- // async-signals-afe
173
+ // async-signal-safe
174
174
  inline size_t to_ascii_decimal(char* outb, char const* oute, uint64_t v) {
175
175
  return to_ascii_lower<10>(outb, oute, v);
176
176
  }
@@ -6,7 +6,7 @@
6
6
  "Type": "git",
7
7
  "Git": {
8
8
  "RepositoryUrl": "https://github.com/facebook/folly",
9
- "CommitHash": "d62707bf4dc8c58bcc317260611b8cbe25c7f444"
9
+ "CommitHash": "234d39a36a43106747d10cc19efada72fd810dd3"
10
10
  }
11
11
  },
12
12
  "DevelopmentDependency": false
@@ -152,6 +152,7 @@ type ButtonProps = $ReadOnly<{|
152
152
  accessible?: ?boolean,
153
153
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
154
154
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
155
+ onAccessibilityTap?: ?() => void, // Windows
155
156
  accessibilityState?: ?AccessibilityState,
156
157
 
157
158
  /**
@@ -331,6 +332,7 @@ const Button: React.AbstractComponent<
331
332
  accessibilityHint,
332
333
  accessibilityLanguage,
333
334
  onAccessibilityAction,
335
+ onAccessibilityTap, // Windows
334
336
  tabIndex,
335
337
  } = props;
336
338
  const buttonStyles: Array<ViewStyleProp> = [styles.button];
@@ -389,6 +391,7 @@ const Button: React.AbstractComponent<
389
391
  accessibilityLanguage={accessibilityLanguage}
390
392
  accessibilityRole="button"
391
393
  accessibilityState={_accessibilityState}
394
+ onAccessibilityTap={onAccessibilityTap} // Windows
392
395
  importantForAccessibility={_importantForAccessibility}
393
396
  hasTVPreferredFocus={hasTVPreferredFocus}
394
397
  nextFocusDown={nextFocusDown}