react-native-windows 0.78.4 → 0.78.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.
Files changed (191) hide show
  1. package/Directory.Build.props +6 -4
  2. package/Folly/Folly.vcxproj +46 -6
  3. package/Folly/Folly.vcxproj.filters +16 -4
  4. package/Folly/TEMP_UntilFollyUpdate/ConstexprMath.h +26 -18
  5. package/Folly/TEMP_UntilFollyUpdate/Conv.cpp +1205 -0
  6. package/Folly/TEMP_UntilFollyUpdate/chrono/Hardware.h +155 -0
  7. package/Folly/TEMP_UntilFollyUpdate/concurrency/CacheLocality.cpp +633 -0
  8. package/Folly/TEMP_UntilFollyUpdate/{dynamic-inl.h → json/dynamic-inl.h} +3 -4
  9. package/Folly/TEMP_UntilFollyUpdate/{json.cpp → json/json.cpp} +14 -10
  10. package/Folly/TEMP_UntilFollyUpdate/lang/SafeAssert.h +7 -14
  11. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +6 -6
  12. package/Folly/ThreadNameStub.cpp +10 -0
  13. package/Folly/cgmanifest.json +11 -1
  14. package/Libraries/Components/View/View.windows.js +107 -56
  15. package/Libraries/Components/View/ViewAccessibility.d.ts +60 -1
  16. package/Libraries/Image/Image.windows.js +42 -21
  17. package/Libraries/Modal/Modal.d.ts +7 -0
  18. package/Libraries/Modal/Modal.windows.js +7 -1
  19. package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
  20. package/Libraries/Text/Text.d.ts +18 -0
  21. package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +4 -25
  22. package/Microsoft.ReactNative/AsynchronousEventBeat.h +0 -3
  23. package/Microsoft.ReactNative/Base/FollyIncludes.h +1 -0
  24. package/Microsoft.ReactNative/CallInvoker.cpp +42 -0
  25. package/Microsoft.ReactNative/CallInvoker.h +34 -0
  26. package/Microsoft.ReactNative/{JSDispatcherWriter.cpp → CallInvokerWriter.cpp} +35 -47
  27. package/Microsoft.ReactNative/CallInvokerWriter.h +74 -0
  28. package/Microsoft.ReactNative/CompositionComponentView.idl +0 -5
  29. package/Microsoft.ReactNative/CompositionSwitcher.idl +7 -0
  30. package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +8 -10
  31. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +4 -1
  32. package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +12 -2
  33. package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.h +2 -0
  34. package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.cpp +100 -0
  35. package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.h +31 -0
  36. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +77 -11
  37. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +43 -1
  38. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +7 -0
  39. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +86 -56
  40. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +5 -1
  41. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +0 -4
  42. package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.cpp +0 -2
  43. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +118 -63
  44. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -0
  45. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +133 -8
  46. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +16 -2
  47. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +4 -2
  48. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +9 -1
  49. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +34 -11
  50. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +3 -0
  51. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +133 -135
  52. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +9 -6
  53. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +46 -49
  54. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +6 -1
  55. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +13 -8
  56. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
  57. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +146 -25
  58. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +14 -0
  59. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +160 -12
  60. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +6 -0
  61. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +47 -0
  62. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +15 -1
  63. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +6 -2
  64. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +4 -1
  65. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +7 -9
  66. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -1
  67. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +5 -0
  68. package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +40 -36
  69. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +68 -0
  70. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +11 -0
  71. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +70 -13
  72. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +10 -2
  73. package/Microsoft.ReactNative/Fabric/ImageManager.cpp +5 -5
  74. package/Microsoft.ReactNative/Fabric/ImageRequestParams.cpp +26 -0
  75. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +47 -8
  76. package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +10 -1
  77. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/CompositionAccessibilityProps.h +67 -0
  78. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +22 -4
  79. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +15 -2
  80. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +20 -0
  81. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +5 -0
  82. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/MouseEvent.h +20 -0
  83. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +5 -8
  84. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorParser.h +1 -2
  85. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +247 -45
  86. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +15 -0
  87. package/Microsoft.ReactNative/Fabric/platform/react/threading/MessageQueueThreadImpl.cpp +39 -0
  88. package/Microsoft.ReactNative/Fabric/platform/react/threading/MessageQueueThreadImpl.h +54 -0
  89. package/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp +126 -0
  90. package/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h +73 -0
  91. package/Microsoft.ReactNative/IReactContext.cpp +17 -0
  92. package/Microsoft.ReactNative/IReactContext.h +1 -0
  93. package/Microsoft.ReactNative/IReactContext.idl +18 -1
  94. package/Microsoft.ReactNative/IReactDispatcher.idl +1 -0
  95. package/Microsoft.ReactNative/IReactModuleBuilder.cpp +12 -0
  96. package/Microsoft.ReactNative/IReactModuleBuilder.h +2 -0
  97. package/Microsoft.ReactNative/IReactModuleBuilder.idl +8 -0
  98. package/Microsoft.ReactNative/JsiApi.cpp +10 -2
  99. package/Microsoft.ReactNative/JsiApi.h +1 -0
  100. package/Microsoft.ReactNative/JsiApi.idl +1 -0
  101. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -3
  102. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +2 -3
  103. package/Microsoft.ReactNative/Modules/AlertModule.cpp +7 -12
  104. package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.cpp +2 -1
  105. package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.cpp +4 -8
  106. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +2 -2
  107. package/Microsoft.ReactNative/Modules/ClipboardModule.cpp +6 -8
  108. package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
  109. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +6 -15
  110. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +13 -24
  111. package/Microsoft.ReactNative/QuirkSettings.cpp +0 -16
  112. package/Microsoft.ReactNative/QuirkSettings.h +0 -3
  113. package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +11 -1
  114. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +78 -68
  115. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -2
  116. package/Microsoft.ReactNative/ReactInstanceSettings.cpp +12 -0
  117. package/Microsoft.ReactNative/ReactInstanceSettings.h +2 -0
  118. package/Microsoft.ReactNative/ReactInstanceSettings.idl +6 -0
  119. package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -0
  120. package/Microsoft.ReactNative/ReactSupport.cpp +44 -11
  121. package/Microsoft.ReactNative/RedBox.cpp +30 -1
  122. package/Microsoft.ReactNative/SchedulerSettings.cpp +4 -4
  123. package/Microsoft.ReactNative/SchedulerSettings.h +1 -1
  124. package/Microsoft.ReactNative/TurboModulesProvider.cpp +30 -12
  125. package/Microsoft.ReactNative/Utils/ImageUtils.h +1 -0
  126. package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +37 -31
  127. package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.cpp +1 -0
  128. package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.inc +2 -0
  129. package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_posix.cpp +1 -1
  130. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +94 -27
  131. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +27 -6
  132. package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.cpp +45 -11
  133. package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +6 -0
  134. package/Microsoft.ReactNative.Cxx/JSI/decorator.h +220 -0
  135. package/Microsoft.ReactNative.Cxx/JSI/instrumentation.h +28 -0
  136. package/Microsoft.ReactNative.Cxx/JSI/jsi-inl.h +6 -0
  137. package/Microsoft.ReactNative.Cxx/JSI/jsi.cpp +241 -4
  138. package/Microsoft.ReactNative.Cxx/JSI/jsi.h +207 -19
  139. package/Microsoft.ReactNative.Cxx/JSValue.cpp +19 -3
  140. package/Microsoft.ReactNative.Cxx/JSValue.h +15 -7
  141. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +2 -2
  142. package/Microsoft.ReactNative.Cxx/NativeModules.h +60 -2
  143. package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.cpp +1267 -614
  144. package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.h +4 -2
  145. package/Microsoft.ReactNative.Cxx/ReactContext.h +7 -0
  146. package/Microsoft.ReactNative.Cxx/TurboModuleProvider.cpp +11 -13
  147. package/Microsoft.ReactNative.Cxx/TurboModuleProvider.h +2 -3
  148. package/Microsoft.ReactNative.Cxx/node-api/js_native_api.h +81 -20
  149. package/Microsoft.ReactNative.Cxx/node-api/js_native_api_types.h +47 -2
  150. package/Microsoft.ReactNative.Cxx/node-api/js_runtime_api.h +13 -0
  151. package/Microsoft.ReactNative.Cxx/stubs/glog/logging.h +1 -1
  152. package/Microsoft.ReactNative.Managed/ReactContext.cs +3 -1
  153. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  154. package/PropertySheets/JSEngine.props +1 -1
  155. package/PropertySheets/React.Cpp.props +2 -1
  156. package/PropertySheets/WebView2.props +1 -1
  157. package/PropertySheets/WinUI.props +2 -2
  158. package/ReactCommon/TEMP_UntilReactCommonUpdate/jserrorhandler/JsErrorHandler.cpp +429 -0
  159. package/ReactCommon/cgmanifest.json +1 -1
  160. package/Shared/HermesRuntimeHolder.cpp +6 -0
  161. package/Shared/JSI/ChakraRuntime.cpp +4 -0
  162. package/Shared/JSI/ChakraRuntime.h +2 -0
  163. package/Shared/Modules/BlobModule.cpp +14 -16
  164. package/Shared/Modules/BlobModule.h +3 -1
  165. package/Shared/Networking/WinRTWebSocketResource.cpp +82 -101
  166. package/Shared/Networking/WinRTWebSocketResource.h +91 -7
  167. package/Shared/Shared.vcxitems +11 -7
  168. package/Shared/Shared.vcxitems.filters +6 -1
  169. package/Shared/TurboModuleManager.cpp +0 -15
  170. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +6 -6
  171. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +6 -6
  172. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +6 -6
  173. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +6 -6
  174. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +6 -6
  175. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +6 -6
  176. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +6 -6
  177. package/codegen/react/components/rnwcore/InputAccessory.g.h +6 -6
  178. package/codegen/react/components/rnwcore/ModalHostView.g.h +11 -7
  179. package/codegen/react/components/rnwcore/Props.cpp +2 -1
  180. package/codegen/react/components/rnwcore/Props.h +1 -0
  181. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +6 -6
  182. package/codegen/react/components/rnwcore/SafeAreaView.g.h +6 -6
  183. package/codegen/react/components/rnwcore/Switch.g.h +6 -6
  184. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +6 -6
  185. package/index.windows.js +4 -2
  186. package/package.json +3 -4
  187. package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
  188. package/stubs/glog/logging.h +1 -1
  189. package/Microsoft.ReactNative/JSDispatcherWriter.h +0 -47
  190. package/Microsoft.ReactNative/SynchronousEventBeat.cpp +0 -51
  191. package/Microsoft.ReactNative/SynchronousEventBeat.h +0 -31
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- #include <folly/json.h>
17
+ #include <folly/json/json.h>
18
18
 
19
19
  #include <algorithm>
20
20
  #include <functional>
@@ -28,7 +28,6 @@
28
28
  #include <folly/Conv.h>
29
29
  #include <folly/Portability.h>
30
30
  #include <folly/Range.h>
31
- #include <folly/String.h>
32
31
  #include <folly/Unicode.h>
33
32
  #include <folly/Utility.h>
34
33
  #include <folly/lang/Bits.h>
@@ -104,7 +103,7 @@ struct Printer {
104
103
  }
105
104
  void operator()(dynamic const& v, const Context* context) const {
106
105
  switch (v.type()) {
107
- case dynamic::DOUBLE:
106
+ case dynamic::DOUBLE: {
108
107
  if (!opts_.allow_nan_inf) {
109
108
  if (std::isnan(v.asDouble())) {
110
109
  throw json::print_error(
@@ -120,10 +119,11 @@ struct Printer {
120
119
  toAppend(
121
120
  v.asDouble(),
122
121
  &out_,
123
- opts_.double_mode,
122
+ opts_.dtoa_mode,
124
123
  opts_.double_num_digits,
125
- opts_.double_flags);
124
+ opts_.dtoa_flags);
126
125
  break;
126
+ }
127
127
  case dynamic::INT64: {
128
128
  auto intval = v.asInt();
129
129
  if (opts_.javascript_safe) {
@@ -409,9 +409,13 @@ struct Input {
409
409
  return range_.subpiece(0, 16 /* arbitrary */).toString();
410
410
  }
411
411
 
412
- [[noreturn]] dynamic error(char const* what) const {
412
+ [[noreturn]] void error(char const* what) const {
413
413
  throw json::make_parse_error(lineNum_, context(), what);
414
414
  }
415
+ template <typename R>
416
+ R error(char const* what) const {
417
+ error(what);
418
+ }
415
419
 
416
420
  json::serialization_opts const& getOpts() { return opts_; }
417
421
 
@@ -620,7 +624,7 @@ void decodeUnicodeEscape(Input& in, std::string& out) {
620
624
  c >= '0' && c <= '9' ? c - '0' :
621
625
  c >= 'a' && c <= 'f' ? c - 'a' + 10 :
622
626
  c >= 'A' && c <= 'F' ? c - 'A' + 10 :
623
- (in.error("invalid hex digit"), 0));
627
+ in.error<uint16_t>("invalid hex digit"));
624
628
  // clang-format on
625
629
  };
626
630
 
@@ -737,7 +741,7 @@ dynamic parseValue(Input& in, json::metadata_map* map) {
737
741
  in.consume("NaN") ?
738
742
  (in.getOpts().parse_numbers_as_strings ? (dynamic)"NaN" :
739
743
  (dynamic)std::numeric_limits<double>::quiet_NaN()) :
740
- in.error("expected json value");
744
+ in.error<dynamic>("expected json value");
741
745
  // clang-format on
742
746
  }
743
747
 
@@ -796,7 +800,7 @@ size_t firstEscapableInWord(T s, const serialization_opts& opts) {
796
800
  // times. However, for the case where 0 or a handful of bits are set,
797
801
  // looping will be minimal through use of findFirstSet.
798
802
  for (size_t i = 0, e = opts.extra_ascii_to_escape_bitmap.size(); i < e;
799
- ++i) {
803
+ ++i) {
800
804
  const auto offset = i * 64;
801
805
  // Clear first 32 characters if this is the first index, since those are
802
806
  // always escaped.
@@ -1111,4 +1115,4 @@ void PrintTo(const dynamic& dyn, std::ostream* os) {
1111
1115
 
1112
1116
  //////////////////////////////////////////////////////////////////////
1113
1117
 
1114
- } // namespace folly
1118
+ } // namespace folly
@@ -126,7 +126,7 @@ struct safe_assert_msg_types_one_fn {
126
126
  c<safe_assert_msg_type::cstr> operator()(char const*) const;
127
127
  c<safe_assert_msg_type::ui64> operator()(uint64_t) const;
128
128
  };
129
- FOLLY_INLINE_VARIABLE constexpr safe_assert_msg_types_one_fn
129
+ inline constexpr safe_assert_msg_types_one_fn
130
130
  safe_assert_msg_types_one{}; // a function object to prevent extensions
131
131
 
132
132
  template <typename... A>
@@ -141,13 +141,6 @@ struct safe_assert_msg_types<safe_assert_msg_type_s<A...>> {
141
141
  static constexpr value_type value = {{A..., safe_assert_msg_type::term}};
142
142
  };
143
143
 
144
- #if FOLLY_CPLUSPLUS < 201703L
145
- template <safe_assert_msg_type... A>
146
- constexpr
147
- typename safe_assert_msg_types<safe_assert_msg_type_s<A...>>::value_type
148
- safe_assert_msg_types<safe_assert_msg_type_s<A...>>::value;
149
- #endif
150
-
151
144
  struct safe_assert_arg {
152
145
  char const* expr;
153
146
  char const* file;
@@ -160,21 +153,21 @@ struct safe_assert_msg_cast_one_fn {
160
153
  FOLLY_ERASE auto operator()(char const* const a) const { return a; }
161
154
  FOLLY_ERASE auto operator()(uint64_t const a) const { return a; }
162
155
  };
163
- FOLLY_INLINE_VARIABLE constexpr safe_assert_msg_cast_one_fn
156
+ inline constexpr safe_assert_msg_cast_one_fn
164
157
  safe_assert_msg_cast_one{}; // a function object to prevent extensions
165
158
 
166
159
  template <bool P>
167
- [[noreturn]] FOLLY_COLD FOLLY_NOINLINE void safe_assert_terminate(
160
+ [[noreturn, FOLLY_ATTR_GNU_COLD]] FOLLY_NOINLINE void safe_assert_terminate(
168
161
  safe_assert_arg const* arg, ...) noexcept; // the true backing function
169
162
 
170
163
  // [Win - Fixes Error C2908 explicit specialization; 'void folly::detail::safe_assert_terminate<false>(const folly::detail::safe_assert_arg *,...) noexcept' has already been instantiated
171
164
  template <>
172
- [[noreturn]] FOLLY_COLD FOLLY_NOINLINE void safe_assert_terminate<0>(
173
- safe_assert_arg const* arg, ...) noexcept;
165
+ [[noreturn, FOLLY_ATTR_GNU_COLD]] FOLLY_NOINLINE void safe_assert_terminate<0>(
166
+ safe_assert_arg const* arg, ...) noexcept;
174
167
 
175
168
  template <>
176
- [[noreturn]] FOLLY_COLD FOLLY_NOINLINE void safe_assert_terminate<1>(
177
- safe_assert_arg const* arg, ...) noexcept;
169
+ [[noreturn, FOLLY_ATTR_GNU_COLD]] FOLLY_NOINLINE void safe_assert_terminate<1>(
170
+ safe_assert_arg const* arg, ...) noexcept;
178
171
  // Win]
179
172
 
180
173
  template <bool P>
@@ -62,21 +62,21 @@ using to_ascii_alphabet_upper = to_ascii_alphabet<true>;
62
62
  // and u8 at most 3.
63
63
  /*
64
64
  template <uint64_t Base, typename Int>
65
- FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max =
66
- detail::to_ascii_powers<Base, Int>::size;
65
+ inline constexpr size_t to_ascii_size_max =
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
71
  template <typename Int>
72
- FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal;
72
+ inline constexpr size_t to_ascii_size_max_decimal;
73
73
 
74
74
  template <>
75
- FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal<uint16_t> = 5;
75
+ inline constexpr size_t to_ascii_size_max_decimal<uint16_t> = 5;
76
76
  template <>
77
- FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal<uint32_t> = 10;
77
+ inline constexpr size_t to_ascii_size_max_decimal<uint32_t> = 10;
78
78
  template <>
79
- FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal<uint64_t> = 20;
79
+ inline constexpr size_t to_ascii_size_max_decimal<uint64_t> = 20;
80
80
 
81
81
 
82
82
  namespace detail {
@@ -0,0 +1,10 @@
1
+ #include <folly/string.h>
2
+
3
+ // Avoid bringing in a bunch of folly threading just for setThreadName
4
+ namespace folly {
5
+ bool setThreadName(StringPiece)
6
+ {
7
+ return false;
8
+ }
9
+ }
10
+
@@ -6,7 +6,17 @@
6
6
  "Type": "git",
7
7
  "Git": {
8
8
  "RepositoryUrl": "https://github.com/facebook/folly",
9
- "CommitHash": "234d39a36a43106747d10cc19efada72fd810dd3"
9
+ "CommitHash": "ad90720829db5ba0c3d0e44994856dcce33d7940"
10
+ }
11
+ },
12
+ "DevelopmentDependency": false
13
+ },
14
+ {
15
+ "Component": {
16
+ "Type": "git",
17
+ "Git": {
18
+ "RepositoryUrl": "https://github.com/fastfloat/fast_float",
19
+ "CommitHash": "ad90720829db5ba0c3d0e44994856dcce33d7940"
10
20
  }
11
21
  },
12
22
  "DevelopmentDependency": false
@@ -101,6 +101,7 @@ const View: component(
101
101
  }: ViewProps,
102
102
  forwardedRef,
103
103
  ) => {
104
+ const hasTextAncestor = React.useContext(TextAncestor);
104
105
  const _accessibilityLabelledBy =
105
106
  ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
106
107
 
@@ -241,64 +242,114 @@ const View: component(
241
242
  );
242
243
  }
243
244
 
245
+ const actualView = (
246
+ <ViewNativeComponent
247
+ {...otherProps}
248
+ accessibilityLiveRegion={
249
+ ariaLive === 'off' ? 'none' : ariaLive ?? accessibilityLiveRegion
250
+ }
251
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
252
+ accessibilityLevel={ariaLevel ?? accessibilityLevel}
253
+ accessibilityPosInSet={ariaPosinset ?? accessibilityPosInSet}
254
+ accessibilitySetSize={ariaSetsize ?? accessibilitySetSize}
255
+ focusable={_focusable}
256
+ disabled={disabled}
257
+ accessibilityState={_accessibilityState}
258
+ accessibilityElementsHidden={ariaHidden ?? accessibilityElementsHidden}
259
+ accessibilityLabelledBy={_accessibilityLabelledBy}
260
+ accessibilityValue={_accessibilityValue}
261
+ importantForAccessibility={
262
+ ariaHidden === true
263
+ ? 'no-hide-descendants'
264
+ : importantForAccessibility
265
+ }
266
+ nativeID={id ?? nativeID}
267
+ ref={forwardedRef}
268
+ onKeyDown={_keyDown}
269
+ onKeyDownCapture={_keyDownCapture}
270
+ onKeyUp={_keyUp}
271
+ onKeyUpCapture={_keyUpCapture}
272
+ // [Windows
273
+ accessible={_accessible}
274
+ children={
275
+ importantForAccessibility === 'no-hide-descendants'
276
+ ? childrenWithImportantForAccessibility(otherProps.children)
277
+ : otherProps.children
278
+ }
279
+ // Windows]
280
+ />
281
+ );
282
+
283
+ // [Windows - Paper doesn't support Views in Text while Fabric does
284
+ if (global.RN$Bridgeless !== true) {
285
+ return (
286
+ // [Windows
287
+ // In core this is a TextAncestor.Provider value={false} See
288
+ // https://github.com/facebook/react-native/commit/66601e755fcad10698e61d20878d52194ad0e90c
289
+ // But since Views are not currently supported in Text, we do not need the extra provider
290
+ <TextAncestor.Consumer>
291
+ {hasTextAncestor => {
292
+ invariant(
293
+ !hasTextAncestor,
294
+ 'Nesting of <View> within <Text> is not currently supported.',
295
+ );
296
+ return (
297
+ <ViewNativeComponent
298
+ {...otherProps}
299
+ accessibilityLiveRegion={
300
+ ariaLive === 'off'
301
+ ? 'none'
302
+ : ariaLive ?? accessibilityLiveRegion
303
+ }
304
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
305
+ accessibilityLevel={ariaLevel ?? accessibilityLevel}
306
+ accessibilityPosInSet={ariaPosinset ?? accessibilityPosInSet}
307
+ accessibilitySetSize={ariaSetsize ?? accessibilitySetSize}
308
+ focusable={_focusable}
309
+ disabled={disabled}
310
+ accessibilityState={_accessibilityState}
311
+ accessibilityElementsHidden={
312
+ ariaHidden ?? accessibilityElementsHidden
313
+ }
314
+ accessibilityLabelledBy={_accessibilityLabelledBy}
315
+ accessibilityValue={_accessibilityValue}
316
+ importantForAccessibility={
317
+ ariaHidden === true
318
+ ? 'no-hide-descendants'
319
+ : importantForAccessibility
320
+ }
321
+ nativeID={id ?? nativeID}
322
+ ref={forwardedRef}
323
+ onKeyDown={_keyDown}
324
+ onKeyDownCapture={_keyDownCapture}
325
+ onKeyUp={_keyUp}
326
+ onKeyUpCapture={_keyUpCapture}
327
+ // [Windows
328
+ accessible={_accessible}
329
+ children={
330
+ importantForAccessibility === 'no-hide-descendants'
331
+ ? childrenWithImportantForAccessibility(otherProps.children)
332
+ : otherProps.children
333
+ }
334
+ // Windows]
335
+ />
336
+ );
337
+ }}
338
+ </TextAncestor.Consumer>
339
+ // Windows]
340
+ );
341
+ } else {
342
+ if (hasTextAncestor) {
343
+ return (
344
+ <TextAncestor.Provider value={false}>
345
+ {actualView}
346
+ </TextAncestor.Provider>
347
+ );
348
+ }
349
+ }
244
350
  // Windows]
245
351
 
246
- return (
247
- // [Windows
248
- // In core this is a TextAncestor.Provider value={false} See
249
- // https://github.com/facebook/react-native/commit/66601e755fcad10698e61d20878d52194ad0e90c
250
- // But since Views are not currently supported in Text, we do not need the extra provider
251
- <TextAncestor.Consumer>
252
- {hasTextAncestor => {
253
- invariant(
254
- !hasTextAncestor,
255
- 'Nesting of <View> within <Text> is not currently supported.',
256
- );
257
- return (
258
- <ViewNativeComponent
259
- {...otherProps}
260
- accessibilityLiveRegion={
261
- ariaLive === 'off'
262
- ? 'none'
263
- : ariaLive ?? accessibilityLiveRegion
264
- }
265
- accessibilityLabel={ariaLabel ?? accessibilityLabel}
266
- accessibilityLevel={ariaLevel ?? accessibilityLevel}
267
- accessibilityPosInSet={ariaPosinset ?? accessibilityPosInSet}
268
- accessibilitySetSize={ariaSetsize ?? accessibilitySetSize}
269
- focusable={_focusable}
270
- disabled={disabled}
271
- accessibilityState={_accessibilityState}
272
- accessibilityElementsHidden={
273
- ariaHidden ?? accessibilityElementsHidden
274
- }
275
- accessibilityLabelledBy={_accessibilityLabelledBy}
276
- accessibilityValue={_accessibilityValue}
277
- importantForAccessibility={
278
- ariaHidden === true
279
- ? 'no-hide-descendants'
280
- : importantForAccessibility
281
- }
282
- nativeID={id ?? nativeID}
283
- ref={forwardedRef}
284
- onKeyDown={_keyDown}
285
- onKeyDownCapture={_keyDownCapture}
286
- onKeyUp={_keyUp}
287
- onKeyUpCapture={_keyUpCapture}
288
- // [Windows
289
- accessible={_accessible}
290
- children={
291
- importantForAccessibility === 'no-hide-descendants'
292
- ? childrenWithImportantForAccessibility(otherProps.children)
293
- : otherProps.children
294
- }
295
- // Windows]
296
- />
297
- );
298
- }}
299
- </TextAncestor.Consumer>
300
- // Windows]
301
- );
352
+ return actualView;
302
353
  },
303
354
  );
304
355
 
@@ -13,7 +13,8 @@ import {NativeSyntheticEvent} from '../../Types/CoreEventTypes';
13
13
  * @see https://reactnative.dev/docs/accessibility#accessibility-properties
14
14
  */
15
15
  export interface AccessibilityProps
16
- extends AccessibilityPropsAndroid,
16
+ extends AccessibilityPropsWindows,
17
+ AccessibilityPropsAndroid,
17
18
  AccessibilityPropsIOS {
18
19
  /**
19
20
  * When true, indicates that the view is an accessibility element.
@@ -258,6 +259,64 @@ export type AccessibilityRole =
258
259
  | 'listitem' // Windows
259
260
  | 'toolbar';
260
261
 
262
+ // [Windows]
263
+ export type AnnotationType =
264
+ | 'AdvanceProofingIssue'
265
+ | 'Author'
266
+ | 'CircularReferenceError'
267
+ | 'Comment'
268
+ | 'ConflictingChange'
269
+ | 'DataValidationError'
270
+ | 'DeletionChange'
271
+ | 'EditingLockedChange'
272
+ | 'Endnote'
273
+ | 'ExternalChange'
274
+ | 'Footer'
275
+ | 'Footnote'
276
+ | 'FormatChange'
277
+ | 'FormulaError'
278
+ | 'GrammarError'
279
+ | 'Header'
280
+ | 'Highlighted'
281
+ | 'InsertionChange'
282
+ | 'Mathematics'
283
+ | 'MoveChange'
284
+ | 'SpellingError'
285
+ | 'TrackChanges'
286
+ | 'Unknown'
287
+ | 'UnsyncedChange';
288
+
289
+ // [Windows]
290
+ export type AccessibilityAnnotationInfo = Readonly<{
291
+ typeID: AnnotationType;
292
+ typeName?: string;
293
+ author?: string;
294
+ dateTime?: string;
295
+ target?: string;
296
+ }>;
297
+ export interface AccessibilityPropsWindows {
298
+ /**
299
+ * Tells a person using a screen reader what kind of annotation they
300
+ * have selected. If available, it will also tell a person the author of the annotation and
301
+ * the date and time the annotation was posted.
302
+ *
303
+ * Note: If typeID is 'Unknown', a typeName must be provided.
304
+ */
305
+ accessibilityAnnotation?: AccessibilityAnnotationInfo; //Windows
306
+
307
+ /**
308
+ * Identifies the ItemType property, which is a text string describing the type of the automation element.
309
+ * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a "Document File" or a "Folder".
310
+ */
311
+ accessibilityItemType?: string; //Windows
312
+
313
+ /**
314
+ * An access key to hook up to the UIA_AccessKey_Property.
315
+ * Access keys are used in keyboard navigation to allow quick navigation to UI in an application.
316
+ */
317
+ accessibilityAccessKey?: string; //Windows
318
+ }
319
+
261
320
  export interface AccessibilityPropsAndroid {
262
321
  /**
263
322
  * Identifies the element that labels the element it is applied to. When the assistive technology focuses on the component with this props,
@@ -28,6 +28,7 @@ import {convertObjectFitToResizeMode} from './ImageUtils';
28
28
  import ImageViewNativeComponent from './ImageViewNativeComponent';
29
29
  import NativeImageLoaderIOS from './NativeImageLoaderIOS';
30
30
  import resolveAssetSource from './resolveAssetSource';
31
+ import TextInlineImageNativeComponent from './TextInlineImageNativeComponent';
31
32
  import * as React from 'react';
32
33
 
33
34
  function getSize(
@@ -170,20 +171,20 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
170
171
 
171
172
  const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
172
173
 
173
- return (
174
- // [Windows
175
- <TextAncestor.Consumer>
176
- {hasTextAncestor => {
177
- invariant(
178
- !hasTextAncestor,
179
- 'Nesting of <Image> within <Text> is not currently supported.',
180
- );
181
- // windows]
182
-
183
- return (
184
- <ImageAnalyticsTagContext.Consumer>
185
- {analyticTag => {
186
- return (
174
+ // [Windows - Paper doesn't support Views in Text while Fabric does
175
+ if (global.RN$Bridgeless !== true) {
176
+ return (
177
+ // [Windows
178
+ <TextAncestor.Consumer>
179
+ {hasTextAncestor => {
180
+ invariant(
181
+ !hasTextAncestor,
182
+ 'Nesting of <Image> within <Text> is not currently supported.',
183
+ );
184
+ // windows]
185
+ return (
186
+ <ImageAnalyticsTagContext.Consumer>
187
+ {analyticTag => (
187
188
  <ImageViewNativeComponent
188
189
  accessibilityState={_accessibilityState}
189
190
  {...restProps}
@@ -196,13 +197,33 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
196
197
  source={sources}
197
198
  internal_analyticTag={analyticTag}
198
199
  />
199
- );
200
- }}
201
- </ImageAnalyticsTagContext.Consumer>
202
- );
203
- }}
204
- </TextAncestor.Consumer>
205
- );
200
+ )}
201
+ </ImageAnalyticsTagContext.Consumer>
202
+ );
203
+ }}
204
+ </TextAncestor.Consumer>
205
+ );
206
+ } else {
207
+ return (
208
+ <ImageAnalyticsTagContext.Consumer>
209
+ {analyticTag => (
210
+ <ImageViewNativeComponent
211
+ accessibilityState={_accessibilityState}
212
+ {...restProps}
213
+ accessible={props.alt !== undefined ? true : props.accessible}
214
+ accessibilityLabel={accessibilityLabel ?? props.alt}
215
+ ref={actualRef}
216
+ style={style}
217
+ resizeMode={resizeMode}
218
+ tintColor={tintColor}
219
+ source={sources}
220
+ internal_analyticTag={analyticTag}
221
+ />
222
+ )}
223
+ </ImageAnalyticsTagContext.Consumer>
224
+ );
225
+ }
226
+ // Windows]
206
227
  });
207
228
 
208
229
  const imageComponentDecorator = unstable_getImageComponentDecorator();
@@ -107,10 +107,17 @@ export interface ModalPropsAndroid {
107
107
  */
108
108
  navigationBarTranslucent?: boolean | undefined;
109
109
  }
110
+ export interface ModalWindowsProps {
111
+ /* title for the modal, shown in the title bar */
112
+ // [Windows
113
+ title?: string | undefined;
114
+ // Windows]
115
+ }
110
116
 
111
117
  export type ModalProps = ModalBaseProps &
112
118
  ModalPropsIOS &
113
119
  ModalPropsAndroid &
120
+ ModalWindowsProps &
114
121
  ViewProps;
115
122
 
116
123
  export class Modal extends React.Component<ModalProps> {}
@@ -174,6 +174,11 @@ export type Props = $ReadOnly<{|
174
174
  * Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
175
175
  */
176
176
  backdropColor?: ?string,
177
+
178
+ /**
179
+ * [Windows] The `title` prop sets the title of the modal window.
180
+ */
181
+ title?: ?string,
177
182
  |}>;
178
183
 
179
184
  function confirmProps(props: Props) {
@@ -329,7 +334,8 @@ class Modal extends React.Component<Props, State> {
329
334
  onStartShouldSetResponder={this._shouldSetResponder}
330
335
  supportedOrientations={this.props.supportedOrientations}
331
336
  onOrientationChange={this.props.onOrientationChange}
332
- testID={this.props.testID}>
337
+ testID={this.props.testID}
338
+ title={this.props.title}>
333
339
  <VirtualizedListContextResetter>
334
340
  <ScrollView.Context.Provider value={null}>
335
341
  <View
@@ -371,6 +371,9 @@ const validAttributesForNonEventProps = {
371
371
  accessibilityLiveRegion: true, // [Windows]
372
372
  accessibilityPosInSet: true, // [Windows]
373
373
  accessibilitySetSize: true, // [Windows]
374
+ accessibilityAnnotation: true, // [Windows]
375
+ accessibilityItemType: true, // [Windows]
376
+ accessibilityAccessKey: true, // [Windows]
374
377
  disabled: true, // [Windows]
375
378
  focusable: true, // [Windows]
376
379
  keyDownEvents: true, // [Windows]
@@ -101,10 +101,20 @@ export interface TextPropsAndroid {
101
101
  android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined;
102
102
  }
103
103
 
104
+ export interface TextPropsWindows {
105
+ /**
106
+ * The tooltip to show when the text is clicked.
107
+ */
108
+ // [Windows
109
+ tooltip?: string | undefined;
110
+ // Windows]
111
+ }
112
+
104
113
  // https://reactnative.dev/docs/text#props
105
114
  export interface TextProps
106
115
  extends TextPropsIOS,
107
116
  TextPropsAndroid,
117
+ TextPropsWindows,
108
118
  AccessibilityProps {
109
119
  /**
110
120
  * Specifies whether fonts should scale to respect Text Size accessibility settings.
@@ -214,6 +224,14 @@ export interface TextProps
214
224
  * Controls how touch events are handled. Similar to `View`'s `pointerEvents`.
215
225
  */
216
226
  pointerEvents?: ViewStyle['pointerEvents'] | undefined;
227
+
228
+ /**
229
+ * Insets for press retention.
230
+ * Example: { top: 20, left: 20, bottom: 20, right: 20 }
231
+ */
232
+ pressRetentionOffset?:
233
+ | {top: number; left: number; bottom: number; right: number}
234
+ | undefined;
217
235
  }
218
236
 
219
237
  /**
@@ -6,37 +6,16 @@ AsynchronousEventBeat::AsynchronousEventBeat(
6
6
  std::shared_ptr<facebook::react::EventBeat::OwnerBox> const ownerBox,
7
7
  const winrt::Microsoft::ReactNative::ReactContext &context,
8
8
  std::shared_ptr<facebook::react::RuntimeScheduler> runtimeScheduler)
9
- : EventBeat(ownerBox, *runtimeScheduler), m_context(context), m_runtimeScheduler(std::move(runtimeScheduler)) {}
10
-
11
- void AsynchronousEventBeat::induce() const {
12
- if (!isEventBeatRequested_ || m_isBeatCallbackScheduled) {
13
- isEventBeatRequested_ = false;
14
- return;
15
- }
16
- isEventBeatRequested_ = false;
17
- m_isBeatCallbackScheduled = true;
18
-
19
- facebook::react::RuntimeScheduler &schedulerRef = *m_runtimeScheduler.get();
20
- schedulerRef.scheduleWork([this, ownerBox = ownerBox_](facebook::jsi::Runtime &runtime) {
21
- auto owner = ownerBox->owner.lock();
22
- if (!owner) {
23
- return;
24
- }
25
-
26
- m_isBeatCallbackScheduled = false;
27
- if (beatCallback_) {
28
- beatCallback_(runtime);
29
- }
30
- });
31
- }
9
+ : EventBeat(ownerBox, *runtimeScheduler), m_context(context) {}
32
10
 
33
11
  void AsynchronousEventBeat::request() const {
34
12
  bool alreadyRequested = isEventBeatRequested_.exchange(true);
35
13
  if (!alreadyRequested) {
36
- if (m_context.UIDispatcher().HasThreadAccess()) {
14
+ auto uiDispatcher = m_context.UIDispatcher();
15
+ if (uiDispatcher.HasThreadAccess()) {
37
16
  induce();
38
17
  } else {
39
- m_context.UIDispatcher().Post([this, ownerBox = ownerBox_]() {
18
+ uiDispatcher.Post([this, ownerBox = ownerBox_]() {
40
19
  auto owner = ownerBox->owner.lock();
41
20
  if (!owner) {
42
21
  return;
@@ -11,13 +11,10 @@ class AsynchronousEventBeat final : public facebook::react::EventBeat {
11
11
  const winrt::Microsoft::ReactNative::ReactContext &context,
12
12
  std::shared_ptr<facebook::react::RuntimeScheduler> runtimeScheduler);
13
13
 
14
- void induce() const;
15
14
  void request() const override;
16
15
 
17
16
  private:
18
- mutable std::atomic<bool> m_isBeatCallbackScheduled{false};
19
17
  winrt::Microsoft::ReactNative::ReactContext m_context;
20
- std::shared_ptr<facebook::react::RuntimeScheduler> m_runtimeScheduler;
21
18
  };
22
19
 
23
20
  } // namespace Microsoft::ReactNative