react-native-windows 0.76.3 → 0.77.0-preview.2

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 (367) hide show
  1. package/.flowconfig +5 -1
  2. package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
  3. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
  4. package/Libraries/Animated/AnimatedEvent.js +1 -1
  5. package/Libraries/Animated/AnimatedImplementation.js +2 -2
  6. package/Libraries/Animated/NativeAnimatedAllowlist.js +20 -9
  7. package/Libraries/Animated/animations/Animation.js +60 -25
  8. package/Libraries/Animated/animations/DecayAnimation.js +26 -38
  9. package/Libraries/Animated/animations/SpringAnimation.js +33 -39
  10. package/Libraries/Animated/animations/TimingAnimation.js +34 -42
  11. package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
  12. package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
  13. package/Libraries/Animated/createAnimatedComponent.js +60 -33
  14. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  15. package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
  16. package/Libraries/Animated/nodes/AnimatedNode.js +39 -45
  17. package/Libraries/Animated/nodes/AnimatedObject.js +13 -3
  18. package/Libraries/Animated/nodes/AnimatedProps.js +104 -46
  19. package/Libraries/Animated/nodes/AnimatedStyle.js +116 -39
  20. package/Libraries/Animated/nodes/AnimatedTransform.js +56 -23
  21. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  22. package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -3
  23. package/Libraries/Animated/useAnimatedProps.js +41 -35
  24. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  25. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +77 -5
  26. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +82 -5
  27. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
  28. package/Libraries/Components/Button.js +9 -4
  29. package/Libraries/Components/Button.windows.js +19 -5
  30. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
  31. package/Libraries/Components/Glyph/Glyph.js +2 -1
  32. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -0
  33. package/Libraries/Components/Popup/PopupNativeComponent.js +0 -1
  34. package/Libraries/Components/Pressable/Pressable.js +4 -4
  35. package/Libraries/Components/Pressable/Pressable.windows.js +10 -4
  36. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +13 -7
  37. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
  38. package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
  39. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
  40. package/Libraries/Components/ScrollView/ScrollView.js +49 -88
  41. package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
  42. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
  43. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
  44. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +0 -5
  45. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +8 -9
  46. package/Libraries/Components/Switch/Switch.js +8 -6
  47. package/Libraries/Components/Switch/Switch.windows.js +8 -6
  48. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
  49. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
  50. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
  51. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -1
  52. package/Libraries/Components/TextInput/TextInput.d.ts +27 -4
  53. package/Libraries/Components/TextInput/TextInput.flow.js +36 -19
  54. package/Libraries/Components/TextInput/TextInput.js +37 -13
  55. package/Libraries/Components/TextInput/TextInput.windows.js +47 -16
  56. package/Libraries/Components/TextInput/TextInputState.js +11 -13
  57. package/Libraries/Components/TextInput/TextInputState.windows.js +11 -13
  58. package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
  59. package/Libraries/Components/Touchable/Position.js +7 -2
  60. package/Libraries/Components/Touchable/Touchable.js +4 -0
  61. package/Libraries/Components/Touchable/Touchable.windows.js +4 -0
  62. package/Libraries/Components/Touchable/TouchableBounce.js +6 -2
  63. package/Libraries/Components/Touchable/TouchableBounce.windows.js +227 -0
  64. package/Libraries/Components/Touchable/TouchableHighlight.js +5 -5
  65. package/Libraries/Components/Touchable/TouchableHighlight.windows.js +5 -5
  66. package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +371 -0
  67. package/Libraries/Components/Touchable/TouchableOpacity.js +6 -5
  68. package/Libraries/Components/Touchable/TouchableOpacity.windows.js +11 -5
  69. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
  70. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +9 -3
  71. package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -1
  72. package/Libraries/Components/View/View.js +4 -4
  73. package/Libraries/Components/View/View.windows.js +12 -5
  74. package/Libraries/Components/View/ViewAccessibility.d.ts +10 -0
  75. package/Libraries/Components/View/ViewAccessibility.windows.js +2 -0
  76. package/Libraries/Components/View/ViewNativeComponent.js +6 -98
  77. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  78. package/Libraries/Components/View/ViewPropTypes.js +0 -3
  79. package/Libraries/Components/View/ViewPropTypes.windows.js +2 -3
  80. package/Libraries/Core/ExceptionsManager.js +50 -29
  81. package/Libraries/Core/ReactNativeVersion.js +3 -3
  82. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
  83. package/Libraries/Core/setUpBatchedBridge.js +1 -10
  84. package/Libraries/Core/setUpDeveloperTools.js +1 -5
  85. package/Libraries/Core/setUpErrorHandling.js +20 -18
  86. package/Libraries/Core/setUpReactDevTools.js +107 -8
  87. package/Libraries/Core/setUpSegmentFetcher.js +1 -0
  88. package/Libraries/Core/setUpTimers.js +21 -18
  89. package/Libraries/Debugging/DebuggingOverlay.js +4 -5
  90. package/Libraries/Image/AssetSourceResolver.js +12 -1
  91. package/Libraries/Image/AssetSourceResolver.windows.js +12 -1
  92. package/Libraries/Image/Image.android.js +1 -5
  93. package/Libraries/Image/Image.d.ts +20 -29
  94. package/Libraries/Image/Image.ios.js +0 -2
  95. package/Libraries/Image/Image.windows.js +5 -1
  96. package/Libraries/Image/ImageBackground.js +2 -5
  97. package/Libraries/Image/ImageProps.js +7 -6
  98. package/Libraries/Image/ImageResizeMode.d.ts +8 -1
  99. package/Libraries/Image/ImageResizeMode.js +4 -1
  100. package/Libraries/Image/ImageSource.d.ts +0 -2
  101. package/Libraries/Image/ImageSource.js +0 -2
  102. package/Libraries/Image/ImageTypes.flow.js +11 -9
  103. package/Libraries/Image/ImageUtils.js +6 -3
  104. package/Libraries/Image/ImageViewNativeComponent.js +5 -3
  105. package/Libraries/Inspector/Inspector.js +1 -0
  106. package/Libraries/Inspector/NetworkOverlay.js +4 -0
  107. package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -14
  108. package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
  109. package/Libraries/Interaction/InteractionManager.js +6 -1
  110. package/Libraries/Interaction/InteractionManagerStub.js +176 -0
  111. package/Libraries/Interaction/TouchHistoryMath.js +22 -19
  112. package/Libraries/JSInspector/NetworkAgent.js +1 -1
  113. package/Libraries/Lists/FlatList.d.ts +1 -2
  114. package/Libraries/Lists/FlatList.js +2 -2
  115. package/Libraries/Lists/SectionListModern.js +7 -7
  116. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
  117. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
  118. package/Libraries/LogBox/Data/LogBoxData.js +3 -3
  119. package/Libraries/LogBox/LogBox.js +18 -5
  120. package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
  121. package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
  122. package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
  123. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
  124. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.windows.js +6 -1
  125. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  126. package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +1 -1
  127. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
  128. package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
  129. package/Libraries/Modal/Modal.d.ts +12 -0
  130. package/Libraries/Modal/Modal.js +31 -4
  131. package/Libraries/Modal/Modal.windows.js +18 -0
  132. package/Libraries/NativeComponent/BaseViewConfig.android.js +72 -1
  133. package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -1
  134. package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -11
  135. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
  136. package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -1
  137. package/Libraries/Network/FormData.js +11 -3
  138. package/Libraries/Network/XHRInterceptor.js +63 -14
  139. package/Libraries/Network/XMLHttpRequest.js +26 -1
  140. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
  141. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
  142. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
  143. package/Libraries/Pressability/HoverState.js +2 -0
  144. package/Libraries/Pressability/Pressability.js +2 -3
  145. package/Libraries/Pressability/Pressability.windows.js +2 -3
  146. package/Libraries/Pressability/usePressability.js +4 -1
  147. package/Libraries/ReactNative/AppContainer.js +1 -1
  148. package/Libraries/ReactNative/AppRegistry.js +1 -11
  149. package/Libraries/ReactNative/DisplayMode.js +1 -1
  150. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
  151. package/Libraries/ReactNative/RendererImplementation.js +18 -17
  152. package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
  153. package/Libraries/ReactNative/renderApplication.js +9 -8
  154. package/Libraries/ReactNative/requireNativeComponent.js +5 -2
  155. package/Libraries/Renderer/shims/ReactFabric.js +3 -3
  156. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  157. package/Libraries/Renderer/shims/ReactNative.js +3 -3
  158. package/Libraries/Renderer/shims/ReactNativeTypes.js +22 -35
  159. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +5 -6
  160. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  161. package/Libraries/StyleSheet/StyleSheet.js +7 -1
  162. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +13 -2
  163. package/Libraries/StyleSheet/StyleSheetTypes.js +24 -6
  164. package/Libraries/StyleSheet/processBackgroundImage.js +87 -110
  165. package/Libraries/StyleSheet/processTransform.js +3 -34
  166. package/Libraries/Text/Text.js +248 -249
  167. package/Libraries/Text/Text.windows.js +298 -292
  168. package/Libraries/Text/TextNativeComponent.js +0 -1
  169. package/Libraries/Text/TextProps.windows.js +2 -0
  170. package/Libraries/TurboModule/TurboModuleRegistry.js +5 -5
  171. package/Libraries/Types/CoreEventTypes.d.ts +3 -10
  172. package/Libraries/Types/CoreEventTypes.js +4 -6
  173. package/Libraries/Types/CoreEventTypes.windows.js +4 -6
  174. package/Libraries/Utilities/Appearance.js +3 -1
  175. package/Libraries/Utilities/BackHandler.android.js +6 -18
  176. package/Libraries/Utilities/BackHandler.d.ts +0 -4
  177. package/Libraries/Utilities/BackHandler.ios.js +0 -7
  178. package/Libraries/Utilities/BackHandler.windows.js +6 -18
  179. package/Libraries/Utilities/HMRClient.js +3 -4
  180. package/Libraries/Utilities/Platform.flow.js +2 -2
  181. package/Libraries/Utilities/Platform.flow.windows.js +3 -2
  182. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
  183. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  184. package/Libraries/Utilities/useMergeRefs.js +26 -7
  185. package/Libraries/WebSocket/WebSocketEvent.js +4 -1
  186. package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
  187. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +6 -5
  188. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  189. package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +9 -8
  190. package/Microsoft.ReactNative/AsynchronousEventBeat.h +5 -5
  191. package/Microsoft.ReactNative/FBReactNativeSpec/FBReactNativeSpecJSI.h +5 -0
  192. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +2 -2
  193. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +197 -18
  194. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +19 -1
  195. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +13 -0
  196. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +1 -1
  197. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +6 -8
  198. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +2 -2
  199. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +3 -2
  200. package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +1 -1
  201. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +24 -0
  202. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +5 -0
  203. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +12 -12
  204. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +4 -4
  205. package/Microsoft.ReactNative/Fabric/ImageRequest.cpp +4 -8
  206. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +16 -15
  207. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +15 -0
  208. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +9 -0
  209. package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +20 -1
  210. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +11 -6
  211. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
  212. package/Microsoft.ReactNative/SynchronousEventBeat.cpp +14 -4
  213. package/Microsoft.ReactNative/SynchronousEventBeat.h +4 -2
  214. package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.cpp +78 -0
  215. package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.h +51 -0
  216. package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.inc +48 -0
  217. package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi.cpp +41 -0
  218. package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi.h +127 -0
  219. package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi.inc +125 -0
  220. package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_posix.cpp +16 -0
  221. package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_win.cpp +23 -0
  222. package/Microsoft.ReactNative.Cxx/JSI/decorator.h +834 -0
  223. package/Microsoft.ReactNative.Cxx/JSI/instrumentation.h +117 -0
  224. package/Microsoft.ReactNative.Cxx/JSI/jsi-inl.h +366 -0
  225. package/Microsoft.ReactNative.Cxx/JSI/jsi.cpp +560 -0
  226. package/Microsoft.ReactNative.Cxx/JSI/jsi.h +1611 -0
  227. package/Microsoft.ReactNative.Cxx/JSI/threadsafe.h +79 -0
  228. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +7 -11
  229. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +1 -1
  230. package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.cpp +2878 -0
  231. package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.h +36 -0
  232. package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +64 -0
  233. package/Microsoft.ReactNative.Cxx/ReactCommon/SchedulerPriority.h +22 -0
  234. package/{ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core → Microsoft.ReactNative.Cxx}/ReactCommon/TurboModule.cpp +63 -63
  235. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +165 -0
  236. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.cpp +105 -0
  237. package/{ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core → Microsoft.ReactNative.Cxx}/ReactCommon/TurboModuleUtils.h +57 -58
  238. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +42 -0
  239. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +151 -0
  240. package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/Base.h +177 -154
  241. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +25 -0
  242. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bridging.h +21 -0
  243. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +67 -0
  244. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +90 -0
  245. package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/Convert.h +170 -172
  246. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +51 -0
  247. package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/EventEmitter.h +134 -136
  248. package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/Function.h +283 -283
  249. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.cpp +63 -0
  250. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +61 -0
  251. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +93 -0
  252. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +104 -0
  253. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +107 -0
  254. package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/flags.h +22 -0
  255. package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +72 -0
  256. package/Microsoft.ReactNative.Cxx/node-api/js_native_api.h +553 -0
  257. package/Microsoft.ReactNative.Cxx/node-api/js_native_api_types.h +167 -0
  258. package/Microsoft.ReactNative.Cxx/node-api/js_runtime_api.h +186 -0
  259. package/Microsoft.ReactNative.Cxx/stubs/glog/logging.h +82 -0
  260. package/PropertySheets/Bundle.Common.targets +1 -1
  261. package/PropertySheets/Bundle.props +3 -0
  262. package/PropertySheets/Generated/PackageVersion.g.props +4 -4
  263. package/PropertySheets/ManagedCodeGen/Microsoft.ReactNative.Managed.CodeGen.targets +1 -1
  264. package/PropertySheets/OutputMSBuildProperties.targets +3 -1
  265. package/PropertySheets/React.Cpp.props +6 -0
  266. package/ReactCommon/ReactCommon.vcxproj +5 -0
  267. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -3
  268. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +61 -0
  269. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +26 -23
  270. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +150 -0
  271. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +252 -0
  272. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +795 -0
  273. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +59 -0
  274. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +227 -74
  275. package/Scripts/Microsoft.ReactNative.Managed.CodeGen.targets +1 -1
  276. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +97 -62
  277. package/Shared/InspectorPackagerConnection.cpp +3 -6
  278. package/Shared/InspectorPackagerConnection.h +2 -2
  279. package/Shared/InstanceManager.h +1 -1
  280. package/Shared/OInstance.h +1 -1
  281. package/Shared/Shared.vcxitems +17 -2
  282. package/Shared/Shared.vcxitems.filters +3 -1
  283. package/Shared/TurboModuleManager.cpp +29 -4
  284. package/codegen/NativeAccessibilityInfoSpec.g.h +27 -9
  285. package/codegen/NativeAccessibilityManagerSpec.g.h +19 -13
  286. package/codegen/NativeActionSheetManagerSpec.g.h +4 -0
  287. package/codegen/NativeExceptionsManagerSpec.g.h +1 -7
  288. package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
  289. package/codegen/NativePerformanceSpec.g.h +127 -3
  290. package/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h +67 -0
  291. package/codegen/NativeReactDevToolsSettingsManagerSpec.g.h +41 -0
  292. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +125 -137
  293. package/codegen/react/components/rnwcore/ComponentDescriptors.h +0 -1
  294. package/codegen/react/components/rnwcore/Props.cpp +1 -0
  295. package/codegen/react/components/rnwcore/Props.h +1 -0
  296. package/codegen/react/components/rnwcore/ShadowNodes.cpp +0 -1
  297. package/codegen/react/components/rnwcore/ShadowNodes.h +0 -11
  298. package/codegen/react/components/rnwcore/States.h +0 -12
  299. package/codegen/rnwcoreJSI-generated.cpp +219 -186
  300. package/codegen/rnwcoreJSI.h +942 -511
  301. package/index.js +10 -3
  302. package/index.windows.js +10 -3
  303. package/jest/setup.js +36 -1
  304. package/just-task.js +15 -0
  305. package/package.json +22 -22
  306. package/src/private/animated/NativeAnimatedHelper.js +18 -16
  307. package/src/private/animated/useAnimatedPropsMemo.js +356 -0
  308. package/src/private/components/HScrollViewNativeComponents.js +1 -27
  309. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +11 -8
  310. package/src/private/components/VScrollViewNativeComponents.js +2 -25
  311. package/src/private/debugging/ReactDevToolsSettingsManager.android.js +20 -0
  312. package/src/private/debugging/ReactDevToolsSettingsManager.ios.js +30 -0
  313. package/src/private/debugging/ReactDevToolsSettingsManager.windows.js +20 -0
  314. package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
  315. package/src/private/devmenu/DevMenu.d.ts +20 -0
  316. package/src/private/devmenu/DevMenu.js +31 -0
  317. package/src/private/featureflags/ReactNativeFeatureFlags.js +95 -86
  318. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +8 -2
  319. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -19
  320. package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
  321. package/src/private/setup/setUpDOM.js +14 -6
  322. package/src/private/setup/setUpMutationObserver.js +5 -0
  323. package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
  324. package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
  325. package/src/private/specs/modules/NativeAccessibilityInfo.js +9 -0
  326. package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
  327. package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
  328. package/src/private/specs/modules/NativeAppearance.js +4 -10
  329. package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
  330. package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
  331. package/src/private/webapis/dom/geometry/DOMRect.js +2 -2
  332. package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +2 -2
  333. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
  334. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +102 -11
  335. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +26 -0
  336. package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -0
  337. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  338. package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +9 -0
  339. package/src/private/webapis/performance/EventTiming.js +13 -8
  340. package/src/private/webapis/performance/Performance.js +66 -73
  341. package/src/private/webapis/performance/PerformanceEntry.js +2 -5
  342. package/src/private/webapis/performance/PerformanceObserver.js +65 -164
  343. package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
  344. package/src/private/webapis/performance/UserTiming.js +11 -7
  345. package/src/private/webapis/performance/Utilities.js +18 -0
  346. package/src/private/webapis/performance/specs/NativePerformance.js +71 -2
  347. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +267 -0
  348. package/templates/cpp-lib/template.config.js +13 -7
  349. package/templates/templateUtils.js +10 -0
  350. package/types/index.d.ts +1 -1
  351. package/types/public/ReactNativeTypes.d.ts +4 -8
  352. package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
  353. package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
  354. package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
  355. package/Libraries/DevToolsSettings/DevToolsSettingsManager.windows.js +0 -35
  356. package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
  357. package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
  358. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +0 -101
  359. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +0 -569
  360. package/codegen/NativeDevToolsSettingsManagerSpec.g.h +0 -53
  361. package/codegen/NativePerformanceObserverSpec.g.h +0 -131
  362. package/src/private/components/useSyncOnScroll.js +0 -48
  363. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -61
  364. package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -67
  365. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -127
  366. package/types/experimental.d.ts +0 -59
  367. /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
@@ -3,20 +3,21 @@
3
3
  namespace Microsoft::ReactNative {
4
4
 
5
5
  AsynchronousEventBeat::AsynchronousEventBeat(
6
- facebook::react::EventBeat::SharedOwnerBox const &ownerBox,
6
+ std::shared_ptr<facebook::react::EventBeat::OwnerBox> const ownerBox,
7
7
  const winrt::Microsoft::ReactNative::ReactContext &context,
8
- facebook::react::RuntimeExecutor runtimeExecutor)
9
- : EventBeat(ownerBox), m_context(context), m_runtimeExecutor(runtimeExecutor) {}
8
+ std::shared_ptr<facebook::react::RuntimeScheduler> runtimeScheduler)
9
+ : EventBeat(ownerBox, *runtimeScheduler), m_context(context), m_runtimeScheduler(std::move(runtimeScheduler)) {}
10
10
 
11
11
  void AsynchronousEventBeat::induce() const {
12
- if (!isRequested_ || m_isBeatCallbackScheduled) {
13
- isRequested_ = false;
12
+ if (!isEventBeatRequested_ || m_isBeatCallbackScheduled) {
13
+ isEventBeatRequested_ = false;
14
14
  return;
15
15
  }
16
- isRequested_ = false;
16
+ isEventBeatRequested_ = false;
17
17
  m_isBeatCallbackScheduled = true;
18
18
 
19
- m_runtimeExecutor([this, ownerBox = ownerBox_](facebook::jsi::Runtime &runtime) {
19
+ facebook::react::RuntimeScheduler &schedulerRef = *m_runtimeScheduler.get();
20
+ schedulerRef.scheduleWork([this, ownerBox = ownerBox_](facebook::jsi::Runtime &runtime) {
20
21
  auto owner = ownerBox->owner.lock();
21
22
  if (!owner) {
22
23
  return;
@@ -30,7 +31,7 @@ void AsynchronousEventBeat::induce() const {
30
31
  }
31
32
 
32
33
  void AsynchronousEventBeat::request() const {
33
- bool alreadyRequested = isRequested_.exchange(true);
34
+ bool alreadyRequested = isEventBeatRequested_.exchange(true);
34
35
  if (!alreadyRequested) {
35
36
  if (m_context.UIDispatcher().HasThreadAccess()) {
36
37
  induce();
@@ -1,23 +1,23 @@
1
1
  #include <NativeModules.h>
2
- #include <ReactCommon/RuntimeExecutor.h>
3
2
  #include <react/renderer/core/EventBeat.h>
3
+ #include <react/renderer/runtimescheduler/RuntimeScheduler.h>
4
4
 
5
5
  namespace Microsoft::ReactNative {
6
6
 
7
7
  class AsynchronousEventBeat final : public facebook::react::EventBeat {
8
8
  public:
9
9
  AsynchronousEventBeat(
10
- facebook::react::EventBeat::SharedOwnerBox const &ownerBox,
10
+ std::shared_ptr<facebook::react::EventBeat::OwnerBox> const ownerBox,
11
11
  const winrt::Microsoft::ReactNative::ReactContext &context,
12
- facebook::react::RuntimeExecutor runtimeExecutor);
12
+ std::shared_ptr<facebook::react::RuntimeScheduler> runtimeScheduler);
13
13
 
14
- void induce() const override;
14
+ void induce() const;
15
15
  void request() const override;
16
16
 
17
17
  private:
18
18
  mutable std::atomic<bool> m_isBeatCallbackScheduled{false};
19
19
  winrt::Microsoft::ReactNative::ReactContext m_context;
20
- facebook::react::RuntimeExecutor m_runtimeExecutor;
20
+ std::shared_ptr<facebook::react::RuntimeScheduler> m_runtimeScheduler;
21
21
  };
22
22
 
23
23
  } // namespace Microsoft::ReactNative
@@ -0,0 +1,5 @@
1
+ // Core RN code expects to be able to use #include <FBReactNativeSpec/FBReactNativeSpecJSI.h> to import the generated
2
+ // headers. We should look into moving the codegen output into a FBReactNativeSpec folder, and running codegen using
3
+ // FBReactNative as the library name But for now this redirection header will suffice
4
+ // https://github.com/microsoft/react-native-windows/issues/14129 tracks removing this file
5
+ #include <codegen/rnwcoreJSI.h>
@@ -7,10 +7,10 @@
7
7
 
8
8
  #include <Fabric/WindowsComponentDescriptorRegistry.h>
9
9
  #include <ReactContext.h>
10
- #include <react/utils/CoreFeatures.h>
11
10
  #include <type_traits>
12
11
  #include "DynamicReader.h"
13
12
 
13
+ #include <react/featureflags/ReactNativeFeatureFlags.h>
14
14
  namespace Microsoft::ReactNative {
15
15
 
16
16
  AbiComponentDescriptor::AbiComponentDescriptor(facebook::react::ComponentDescriptorParameters const &parameters)
@@ -90,7 +90,7 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps(
90
90
  }
91
91
 
92
92
  if constexpr (std::is_base_of_v<facebook::react::YogaLayoutableShadowNode, ShadowNodeT>) {
93
- if (facebook::react::CoreFeatures::excludeYogaFromRawProps) {
93
+ if (facebook::react::ReactNativeFeatureFlags::excludeYogaFromRawProps()) {
94
94
  rawProps.filterYogaStylePropsInDynamicConversion();
95
95
  }
96
96
  }
@@ -11,7 +11,21 @@ namespace winrt::Microsoft::ReactNative::implementation {
11
11
 
12
12
  CompositionDynamicAutomationProvider::CompositionDynamicAutomationProvider(
13
13
  const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView) noexcept
14
- : m_view{componentView} {}
14
+ : m_view{componentView} {
15
+ auto strongView = m_view.view();
16
+
17
+ if (!strongView)
18
+ return;
19
+
20
+ auto props = std::static_pointer_cast<const facebook::react::ViewProps>(
21
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(strongView)->props());
22
+ if (!props)
23
+ return;
24
+
25
+ if (props->accessibilityState.has_value() && props->accessibilityState->selected.has_value()) {
26
+ AddSelectionItemsToContainer(this);
27
+ }
28
+ }
15
29
 
16
30
  HRESULT __stdcall CompositionDynamicAutomationProvider::Navigate(
17
31
  NavigateDirection direction,
@@ -178,10 +192,7 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
178
192
  props->accessibilityRole.empty() ? compositionView->DefaultControlType() : props->accessibilityRole;
179
193
  // Invoke control pattern is used to support controls that do not maintain state
180
194
  // when activated but rather initiate or perform a single, unambiguous action.
181
- if (patternId == UIA_InvokePatternId &&
182
- (accessibilityRole == "button" || accessibilityRole == "imagebutton" || accessibilityRole == "link" ||
183
- accessibilityRole == "splitbutton" || (accessibilityRole == "menuitem" && props->onAccessibilityTap) ||
184
- (accessibilityRole == "treeitem" && props->onAccessibilityTap))) {
195
+ if (patternId == UIA_InvokePatternId && (props->onAccessibilityTap)) {
185
196
  *pRetVal = static_cast<IInvokeProvider *>(this);
186
197
  AddRef();
187
198
  }
@@ -192,14 +203,8 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
192
203
  }
193
204
 
194
205
  if (patternId == UIA_ValuePatternId &&
195
- (accessibilityRole == "textinput" || accessibilityRole == "searchbox" ||
196
- (accessibilityRole == "button" && accessibilityValueHasValue(props->accessibilityValue)) ||
197
- (accessibilityRole == "combobox" && accessibilityValueHasValue(props->accessibilityValue)) ||
198
- (accessibilityRole == "link" && accessibilityValueHasValue(props->accessibilityValue)) ||
199
- (accessibilityRole == "listitem" && accessibilityValueHasValue(props->accessibilityValue)) ||
200
- (accessibilityRole == "progressbar" && accessibilityValueHasValue(props->accessibilityValue)) ||
201
- (accessibilityRole == "adjustable" && accessibilityValueHasValue(props->accessibilityValue)) ||
202
- (accessibilityRole == "spinbutton" && accessibilityValueHasValue(props->accessibilityValue)))) {
206
+ (strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::WindowsTextInputComponentView>() ||
207
+ accessibilityValueHasValue(props->accessibilityValue))) {
203
208
  *pRetVal = static_cast<IValueProvider *>(this);
204
209
  AddRef();
205
210
  }
@@ -211,15 +216,23 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
211
216
  AddRef();
212
217
  }
213
218
 
214
- if (patternId == UIA_ExpandCollapsePatternId &&
215
- (accessibilityRole == "combobox" || accessibilityRole == "splitbutton" || accessibilityRole == "treeitem" ||
216
- (expandableControl(props) &&
217
- (accessibilityRole == "toolbar" || accessibilityRole == "menuitem" || accessibilityRole == "menubar" ||
218
- accessibilityRole == "listitem" || accessibilityRole == "group" || accessibilityRole == "button")))) {
219
+ if (patternId == UIA_ExpandCollapsePatternId && expandableControl(props)) {
219
220
  *pRetVal = static_cast<IExpandCollapseProvider *>(this);
220
221
  AddRef();
221
222
  }
222
223
 
224
+ if (patternId == UIA_SelectionPatternId && props->accessibilityState.has_value() &&
225
+ props->accessibilityState->multiselectable.has_value() && props->accessibilityState->required.has_value()) {
226
+ *pRetVal = static_cast<ISelectionProvider *>(this);
227
+ AddRef();
228
+ }
229
+
230
+ if (patternId == UIA_SelectionItemPatternId && props->accessibilityState.has_value() &&
231
+ props->accessibilityState->selected.has_value()) {
232
+ *pRetVal = static_cast<ISelectionItemProvider *>(this);
233
+ AddRef();
234
+ }
235
+
223
236
  return S_OK;
224
237
  }
225
238
 
@@ -363,6 +376,7 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
363
376
  case UIA_IsOffscreenPropertyId: {
364
377
  pRetVal->vt = VT_BOOL;
365
378
  pRetVal->boolVal = (compositionView->getClipState() == ClipState::FullyClipped) ? VARIANT_TRUE : VARIANT_FALSE;
379
+ break;
366
380
  }
367
381
  case UIA_HelpTextPropertyId: {
368
382
  pRetVal->vt = VT_BSTR;
@@ -585,4 +599,169 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::Collapse() {
585
599
  return S_OK;
586
600
  }
587
601
 
602
+ HRESULT __stdcall CompositionDynamicAutomationProvider::get_CanSelectMultiple(BOOL *pRetVal) {
603
+ if (pRetVal == nullptr)
604
+ return E_POINTER;
605
+ auto strongView = m_view.view();
606
+
607
+ if (!strongView)
608
+ return UIA_E_ELEMENTNOTAVAILABLE;
609
+
610
+ auto props =
611
+ std::static_pointer_cast<const facebook::react::ViewProps>(winrt::get_self<ComponentView>(strongView)->props());
612
+
613
+ if (props == nullptr)
614
+ return UIA_E_ELEMENTNOTAVAILABLE;
615
+
616
+ *pRetVal = (props->accessibilityState.has_value() && props->accessibilityState->multiselectable.has_value())
617
+ ? props->accessibilityState->multiselectable.value()
618
+ : false;
619
+
620
+ return S_OK;
621
+ }
622
+
623
+ HRESULT __stdcall CompositionDynamicAutomationProvider::get_IsSelectionRequired(BOOL *pRetVal) {
624
+ if (pRetVal == nullptr)
625
+ return E_POINTER;
626
+ auto strongView = m_view.view();
627
+
628
+ if (!strongView)
629
+ return UIA_E_ELEMENTNOTAVAILABLE;
630
+
631
+ auto props = std::static_pointer_cast<const facebook::react::ViewProps>(
632
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(strongView)->props());
633
+
634
+ if (props == nullptr)
635
+ return UIA_E_ELEMENTNOTAVAILABLE;
636
+
637
+ *pRetVal = (props->accessibilityState.has_value() && props->accessibilityState->required.has_value())
638
+ ? props->accessibilityState->required.value()
639
+ : false;
640
+
641
+ return S_OK;
642
+ }
643
+
644
+ HRESULT __stdcall CompositionDynamicAutomationProvider::GetSelection(SAFEARRAY **pRetVal) {
645
+ auto strongView = m_view.view();
646
+
647
+ if (!strongView)
648
+ return UIA_E_ELEMENTNOTAVAILABLE;
649
+
650
+ std::vector<int> selectedItems;
651
+ for (size_t i = 0; i < m_selectionItems.size(); i++) {
652
+ auto selectionItem = m_selectionItems.at(i);
653
+ auto provider = selectionItem.as<CompositionDynamicAutomationProvider>();
654
+ BOOL selected;
655
+ auto hr = provider->get_IsSelected(&selected);
656
+ if (hr == S_OK && selected) {
657
+ selectedItems.push_back(int(i));
658
+ }
659
+ }
660
+
661
+ *pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, ULONG(selectedItems.size()));
662
+ if (*pRetVal == nullptr)
663
+ return E_OUTOFMEMORY;
664
+
665
+ for (size_t i = 0; i < selectedItems.size(); i++) {
666
+ auto pos = static_cast<long>(i);
667
+ SafeArrayPutElement(*pRetVal, &pos, m_selectionItems.at(selectedItems.at(i)).get());
668
+ }
669
+ return S_OK;
670
+ }
671
+
672
+ void CompositionDynamicAutomationProvider::AddToSelectionItems(winrt::com_ptr<IRawElementProviderSimple> &item) {
673
+ if (std::find(m_selectionItems.begin(), m_selectionItems.end(), item) != m_selectionItems.end()) {
674
+ return;
675
+ }
676
+ m_selectionItems.push_back(item);
677
+ }
678
+
679
+ void CompositionDynamicAutomationProvider::RemoveFromSelectionItems(winrt::com_ptr<IRawElementProviderSimple> &item) {
680
+ std::erase(m_selectionItems, item);
681
+ }
682
+
683
+ HRESULT __stdcall CompositionDynamicAutomationProvider::AddToSelection() {
684
+ auto strongView = m_view.view();
685
+
686
+ if (!strongView)
687
+ return UIA_E_ELEMENTNOTAVAILABLE;
688
+
689
+ DispatchAccessibilityAction(m_view, "addToSelection");
690
+ return S_OK;
691
+ }
692
+
693
+ HRESULT __stdcall CompositionDynamicAutomationProvider::get_IsSelected(BOOL *pRetVal) {
694
+ if (pRetVal == nullptr)
695
+ return E_POINTER;
696
+ auto strongView = m_view.view();
697
+
698
+ if (!strongView)
699
+ return UIA_E_ELEMENTNOTAVAILABLE;
700
+
701
+ auto props = std::static_pointer_cast<const facebook::react::ViewProps>(
702
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(strongView)->props());
703
+
704
+ if (props == nullptr)
705
+ return UIA_E_ELEMENTNOTAVAILABLE;
706
+
707
+ *pRetVal = (props->accessibilityState.has_value() && props->accessibilityState->selected.has_value())
708
+ ? props->accessibilityState->selected.value()
709
+ : false;
710
+
711
+ return S_OK;
712
+ }
713
+
714
+ IRawElementProviderSimple *findSelectionContainer(winrt::Microsoft::ReactNative::ComponentView current) {
715
+ if (!current)
716
+ return nullptr;
717
+
718
+ auto props = std::static_pointer_cast<const facebook::react::ViewProps>(
719
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(current)->props());
720
+ if (props->accessibilityState.has_value() && props->accessibilityState->multiselectable.has_value() &&
721
+ props->accessibilityState->required.has_value()) {
722
+ auto uiaProvider =
723
+ current.as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>()->EnsureUiaProvider();
724
+ if (uiaProvider != nullptr) {
725
+ auto spProviderSimple = uiaProvider.try_as<IRawElementProviderSimple>();
726
+ if (spProviderSimple != nullptr) {
727
+ spProviderSimple->AddRef();
728
+ return spProviderSimple.get();
729
+ }
730
+ }
731
+ } else {
732
+ return findSelectionContainer(current.Parent());
733
+ }
734
+ return nullptr;
735
+ }
736
+
737
+ HRESULT __stdcall CompositionDynamicAutomationProvider::get_SelectionContainer(IRawElementProviderSimple **pRetVal) {
738
+ if (pRetVal == nullptr)
739
+ return E_POINTER;
740
+ auto strongView = m_view.view();
741
+
742
+ if (!strongView)
743
+ return UIA_E_ELEMENTNOTAVAILABLE;
744
+
745
+ *pRetVal = findSelectionContainer(strongView.Parent());
746
+ return S_OK;
747
+ }
748
+
749
+ HRESULT __stdcall CompositionDynamicAutomationProvider::RemoveFromSelection() {
750
+ auto strongView = m_view.view();
751
+
752
+ if (!strongView)
753
+ return UIA_E_ELEMENTNOTAVAILABLE;
754
+ DispatchAccessibilityAction(m_view, "removeFromSelection");
755
+ return S_OK;
756
+ }
757
+
758
+ HRESULT __stdcall CompositionDynamicAutomationProvider::Select() {
759
+ auto strongView = m_view.view();
760
+
761
+ if (!strongView)
762
+ return UIA_E_ELEMENTNOTAVAILABLE;
763
+ DispatchAccessibilityAction(m_view, "select");
764
+ return S_OK;
765
+ }
766
+
588
767
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -17,7 +17,9 @@ class CompositionDynamicAutomationProvider : public winrt::implements<
17
17
  IScrollItemProvider,
18
18
  IValueProvider,
19
19
  IToggleProvider,
20
- IExpandCollapseProvider> {
20
+ IExpandCollapseProvider,
21
+ ISelectionProvider,
22
+ ISelectionItemProvider> {
21
23
  public:
22
24
  CompositionDynamicAutomationProvider(
23
25
  const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView) noexcept;
@@ -57,8 +59,24 @@ class CompositionDynamicAutomationProvider : public winrt::implements<
57
59
  virtual HRESULT __stdcall Expand() override;
58
60
  virtual HRESULT __stdcall Collapse() override;
59
61
 
62
+ // inherited via ISelectionProvider
63
+ virtual HRESULT __stdcall get_CanSelectMultiple(BOOL *pRetVal) override;
64
+ virtual HRESULT __stdcall get_IsSelectionRequired(BOOL *pRetVal) override;
65
+ virtual HRESULT __stdcall GetSelection(SAFEARRAY **pRetVal) override;
66
+
67
+ // inherited via ISelectionItemProvider
68
+ virtual HRESULT __stdcall AddToSelection() override;
69
+ virtual HRESULT __stdcall get_IsSelected(BOOL *pRetVal) override;
70
+ virtual HRESULT __stdcall get_SelectionContainer(IRawElementProviderSimple **pRetVal) override;
71
+ virtual HRESULT __stdcall RemoveFromSelection() override;
72
+ virtual HRESULT __stdcall Select() override;
73
+
74
+ void AddToSelectionItems(winrt::com_ptr<IRawElementProviderSimple> &item);
75
+ void RemoveFromSelectionItems(winrt::com_ptr<IRawElementProviderSimple> &item);
76
+
60
77
  private:
61
78
  ::Microsoft::ReactNative::ReactTaggedView m_view;
79
+ std::vector<winrt::com_ptr<IRawElementProviderSimple>> m_selectionItems;
62
80
  };
63
81
 
64
82
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -761,6 +761,19 @@ void ComponentView::updateAccessibilityProps(
761
761
  UIA_LiveSettingPropertyId,
762
762
  oldViewProps.accessibilityLiveRegion,
763
763
  newViewProps.accessibilityLiveRegion);
764
+
765
+ if ((oldViewProps.accessibilityState.has_value() && oldViewProps.accessibilityState->selected.has_value()) !=
766
+ ((newViewProps.accessibilityState.has_value() && newViewProps.accessibilityState->selected.has_value()))) {
767
+ auto compProvider =
768
+ m_uiaProvider.try_as<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>();
769
+ if (compProvider) {
770
+ if ((newViewProps.accessibilityState.has_value() && newViewProps.accessibilityState->selected.has_value())) {
771
+ winrt::Microsoft::ReactNative::implementation::AddSelectionItemsToContainer(compProvider.get());
772
+ } else {
773
+ winrt::Microsoft::ReactNative::implementation::RemoveSelectionItemsFromContainer(compProvider.get());
774
+ }
775
+ }
776
+ }
764
777
  }
765
778
 
766
779
  std::optional<std::string> ComponentView::getAccessiblityValue() noexcept {
@@ -577,7 +577,7 @@ facebook::react::AttributedStringBox CreateLoadingAttributedString() noexcept {
577
577
  auto fragment = facebook::react::AttributedString::Fragment{};
578
578
  fragment.string = "Loading";
579
579
  fragment.textAttributes.fontSize = loadingBarFontSize;
580
- attributedString.appendFragment(fragment);
580
+ attributedString.appendFragment(std::move(fragment));
581
581
  return facebook::react::AttributedStringBox{attributedString};
582
582
  }
583
583
 
@@ -97,26 +97,24 @@ virtual State::Shared createInitialState(
97
97
  !textInputProps.hasPaddingHorizontal) {
98
98
  changedPadding = true;
99
99
  style.setPadding(
100
- YGEdgeStart, yoga::CompactValue::of<YGUnitPoint>(theme.start));
100
+ yoga::Edge::Start, yoga::StyleLength::points(theme.start));
101
101
  }
102
102
  if (!textInputProps.hasPadding && !textInputProps.hasPaddingEnd &&
103
103
  !textInputProps.hasPaddingRight &&
104
104
  !textInputProps.hasPaddingHorizontal) {
105
105
  changedPadding = true;
106
- style.setPadding(
107
- YGEdgeEnd, yoga::CompactValue::of<YGUnitPoint>(theme.end));
106
+ style.setPadding(yoga::Edge::End, yoga::StyleLength::points(theme.end));
108
107
  }
109
108
  if (!textInputProps.hasPadding && !textInputProps.hasPaddingTop &&
110
109
  !textInputProps.hasPaddingVertical) {
111
110
  changedPadding = true;
112
- style.setPadding(
113
- YGEdgeTop, yoga::CompactValue::of<YGUnitPoint>(theme.top));
111
+ style.setPadding(yoga::Edge::Top, yoga::StyleLength::points(theme.top));
114
112
  }
115
113
  if (!textInputProps.hasPadding && !textInputProps.hasPaddingBottom &&
116
114
  !textInputProps.hasPaddingVertical) {
117
115
  changedPadding = true;
118
116
  style.setPadding(
119
- YGEdgeBottom, yoga::CompactValue::of<YGUnitPoint>(theme.bottom));
117
+ yoga::Edge::Bottom, yoga::StyleLength::points(theme.bottom));
120
118
  }
121
119
 
122
120
  // If the TextInput initially does not have paddingLeft or paddingStart, a
@@ -127,12 +125,12 @@ virtual State::Shared createInitialState(
127
125
  if ((textInputProps.hasPadding || textInputProps.hasPaddingLeft ||
128
126
  textInputProps.hasPaddingHorizontal) &&
129
127
  !textInputProps.hasPaddingStart) {
130
- style.setPadding(YGEdgeStart, yoga::CompactValue::ofUndefined());
128
+ style.setPadding(yoga::Edge::Start, yoga::StyleLength::undefined());
131
129
  }
132
130
  if ((textInputProps.hasPadding || textInputProps.hasPaddingRight ||
133
131
  textInputProps.hasPaddingHorizontal) &&
134
132
  !textInputProps.hasPaddingEnd) {
135
- style.setPadding(YGEdgeEnd, yoga::CompactValue::ofUndefined());
133
+ style.setPadding(yoga::Edge::End, yoga::StyleLength::undefined());
136
134
  }
137
135
 
138
136
  // Note that this is expensive: on every adopt, we need to set the Yoga
@@ -487,7 +487,7 @@ facebook::react::AttributedString WindowsTextInputComponentView::getAttributedSt
487
487
  // that effect.
488
488
  fragment.textAttributes.backgroundColor = facebook::react::clearColor();
489
489
  // fragment.parentShadowView = facebook::react::ShadowView(*this);
490
- attributedString.prependFragment(fragment);
490
+ attributedString.prependFragment(std::move(fragment));
491
491
  }
492
492
 
493
493
  return attributedString;
@@ -1366,7 +1366,7 @@ winrt::com_ptr<::IDWriteTextLayout> WindowsTextInputComponentView::CreatePlaceho
1366
1366
  textAttributes.fontSizeMultiplier = m_fontSizeMultiplier;
1367
1367
  fragment1.string = props.placeholder;
1368
1368
  fragment1.textAttributes = textAttributes;
1369
- attributedString.appendFragment(fragment1);
1369
+ attributedString.appendFragment(std::move(fragment1));
1370
1370
 
1371
1371
  facebook::react::LayoutConstraints constraints;
1372
1372
  constraints.maximumSize.width = static_cast<FLOAT>(m_imgWidth);
@@ -38,6 +38,7 @@ AttributedString WindowsTextInputShadowNode::getAttributedString(const LayoutCon
38
38
  auto attributedString = AttributedString{};
39
39
  auto attachments = BaseTextShadowNode::Attachments{};
40
40
  BaseTextShadowNode::buildAttributedString(childTextAttributes, *this, attributedString, attachments);
41
+ attributedString.setBaseTextAttributes(childTextAttributes);
41
42
 
42
43
  // BaseTextShadowNode only gets children. We must detect and prepend text
43
44
  // value attributes manually.
@@ -53,7 +54,7 @@ AttributedString WindowsTextInputShadowNode::getAttributedString(const LayoutCon
53
54
  // that effect.
54
55
  fragment.textAttributes.backgroundColor = clearColor();
55
56
  fragment.parentShadowView = ShadowView(*this);
56
- attributedString.prependFragment(fragment);
57
+ attributedString.prependFragment(std::move(fragment));
57
58
  }
58
59
 
59
60
  return attributedString;
@@ -83,7 +84,7 @@ AttributedString WindowsTextInputShadowNode::getPlaceholderAttributedString(cons
83
84
  // appended to the AttributedString (see implementation of appendFragment)
84
85
  fragment.textAttributes = textAttributes;
85
86
  fragment.parentShadowView = ShadowView(*this);
86
- textAttributedString.appendFragment(fragment);
87
+ textAttributedString.appendFragment(std::move(fragment));
87
88
 
88
89
  return textAttributedString;
89
90
  }
@@ -49,7 +49,7 @@ facebook::react::AttributedStringBox CreateTooltipAttributedString(const std::st
49
49
  auto fragment = facebook::react::AttributedString::Fragment{};
50
50
  fragment.string = tooltip;
51
51
  fragment.textAttributes.fontSize = tooltipFontSize;
52
- attributedString.appendFragment(fragment);
52
+ attributedString.appendFragment(std::move(fragment));
53
53
  return facebook::react::AttributedStringBox{attributedString};
54
54
  }
55
55
 
@@ -214,6 +214,30 @@ ExpandCollapseState GetExpandCollapseState(const bool &expanded) noexcept {
214
214
  }
215
215
  }
216
216
 
217
+ void AddSelectionItemsToContainer(CompositionDynamicAutomationProvider *provider) noexcept {
218
+ winrt::com_ptr<IRawElementProviderSimple> selectionContainer;
219
+ provider->get_SelectionContainer(selectionContainer.put());
220
+ if (!selectionContainer)
221
+ return;
222
+ auto selectionContainerProvider = selectionContainer.as<CompositionDynamicAutomationProvider>();
223
+ auto simpleProvider = static_cast<IRawElementProviderSimple *>(provider);
224
+ winrt::com_ptr<IRawElementProviderSimple> simpleProviderPtr;
225
+ simpleProviderPtr.copy_from(simpleProvider);
226
+ selectionContainerProvider->AddToSelectionItems(simpleProviderPtr);
227
+ }
228
+
229
+ void RemoveSelectionItemsFromContainer(CompositionDynamicAutomationProvider *provider) noexcept {
230
+ winrt::com_ptr<IRawElementProviderSimple> selectionContainer;
231
+ provider->get_SelectionContainer(selectionContainer.put());
232
+ if (!selectionContainer)
233
+ return;
234
+ auto selectionContainerProvider = selectionContainer.as<CompositionDynamicAutomationProvider>();
235
+ auto simpleProvider = static_cast<IRawElementProviderSimple *>(provider);
236
+ winrt::com_ptr<IRawElementProviderSimple> simpleProviderPtr;
237
+ simpleProviderPtr.copy_from(simpleProvider);
238
+ selectionContainerProvider->RemoveFromSelectionItems(simpleProviderPtr);
239
+ }
240
+
217
241
  ToggleState GetToggleState(const std::optional<facebook::react::AccessibilityState> &state) noexcept {
218
242
  if (state.has_value()) {
219
243
  if (state->checked == facebook::react::AccessibilityState::Checked) {
@@ -1,6 +1,7 @@
1
1
  #pragma once
2
2
 
3
3
  #include <Fabric/ComponentView.h>
4
+ #include <Fabric/Composition/CompositionDynamicAutomationProvider.h>
4
5
  #include <Fabric/ReactTaggedView.h>
5
6
  #include <UIAutomation.h>
6
7
 
@@ -37,5 +38,9 @@ void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view
37
38
 
38
39
  ExpandCollapseState GetExpandCollapseState(const bool &expanded) noexcept;
39
40
 
41
+ void AddSelectionItemsToContainer(CompositionDynamicAutomationProvider *provider) noexcept;
42
+
43
+ void RemoveSelectionItemsFromContainer(CompositionDynamicAutomationProvider *provider) noexcept;
44
+
40
45
  ToggleState GetToggleState(const std::optional<facebook::react::AccessibilityState> &state) noexcept;
41
46
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -30,7 +30,6 @@
30
30
  #include <react/renderer/scheduler/Scheduler.h>
31
31
  #include <react/renderer/scheduler/SchedulerToolbox.h>
32
32
  #include <react/utils/ContextContainer.h>
33
- #include <react/utils/CoreFeatures.h>
34
33
  #include <winrt/Windows.Graphics.Display.h>
35
34
  #include <winrt/Windows.UI.Composition.Desktop.h>
36
35
  #include "DynamicReader.h"
@@ -52,9 +51,7 @@ FabicUIManagerProperty() noexcept {
52
51
  return props.Get(FabicUIManagerProperty()).Value();
53
52
  }
54
53
 
55
- FabricUIManager::FabricUIManager() {
56
- facebook::react::CoreFeatures::enablePropIteratorSetter = true;
57
- }
54
+ FabricUIManager::FabricUIManager() {}
58
55
 
59
56
  FabricUIManager::~FabricUIManager() {
60
57
  // Make sure that we destroy UI components on UI thread.
@@ -76,8 +73,9 @@ void FabricUIManager::installFabricUIManager() noexcept {
76
73
 
77
74
  facebook::react::RuntimeExecutor runtimeExecutor;
78
75
  auto toolbox = facebook::react::SchedulerToolbox{};
76
+ auto runtimeScheduler = SchedulerSettings::RuntimeSchedulerFromProperties(m_context.Properties());
79
77
 
80
- if (auto runtimeScheduler = SchedulerSettings::RuntimeSchedulerFromProperties(m_context.Properties())) {
78
+ if (runtimeScheduler) {
81
79
  contextContainer->insert("RuntimeScheduler", runtimeScheduler);
82
80
  runtimeExecutor = [runtimeScheduler](std::function<void(facebook::jsi::Runtime & runtime)> &&callback) {
83
81
  runtimeScheduler->scheduleWork(std::move(callback));
@@ -87,8 +85,8 @@ void FabricUIManager::installFabricUIManager() noexcept {
87
85
  }
88
86
 
89
87
  facebook::react::EventBeat::Factory asynchronousBeatFactory =
90
- [runtimeExecutor, context = m_context](facebook::react::EventBeat::SharedOwnerBox const &ownerBox) {
91
- return std::make_unique<AsynchronousEventBeat>(ownerBox, context, runtimeExecutor);
88
+ [runtimeScheduler, context = m_context](std::shared_ptr<facebook::react::EventBeat::OwnerBox> const &ownerBox) {
89
+ return std::make_unique<AsynchronousEventBeat>(ownerBox, context, runtimeScheduler);
92
90
  };
93
91
 
94
92
  contextContainer->insert("ReactNativeConfig", config);
@@ -111,7 +109,7 @@ void FabricUIManager::installFabricUIManager() noexcept {
111
109
  return registry;
112
110
  };
113
111
  toolbox.runtimeExecutor = runtimeExecutor;
114
- toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
112
+ toolbox.eventBeatFactory = asynchronousBeatFactory;
115
113
 
116
114
  m_scheduler = std::make_shared<facebook::react::Scheduler>(
117
115
  toolbox, (/*animationDriver_ ? animationDriver_.get() :*/ nullptr), this);
@@ -299,7 +297,8 @@ void FabricUIManager::RCTPerformMountInstructions(
299
297
  }
300
298
  }
301
299
 
302
- void FabricUIManager::performTransaction(facebook::react::MountingCoordinator::Shared const &mountingCoordinator) {
300
+ void FabricUIManager::performTransaction(
301
+ std::shared_ptr<const facebook::react::MountingCoordinator> const &mountingCoordinator) {
303
302
  auto surfaceId = mountingCoordinator->getSurfaceId();
304
303
 
305
304
  mountingCoordinator->getTelemetryController().pullTransaction(
@@ -321,7 +320,8 @@ void FabricUIManager::performTransaction(facebook::react::MountingCoordinator::S
321
320
  });
322
321
  }
323
322
 
324
- void FabricUIManager::initiateTransaction(facebook::react::MountingCoordinator::Shared mountingCoordinator) {
323
+ void FabricUIManager::initiateTransaction(
324
+ std::shared_ptr<const facebook::react::MountingCoordinator> mountingCoordinator) {
325
325
  if (m_transactionInFlight) {
326
326
  m_followUpTransactionRequired = true;
327
327
  return;
@@ -336,7 +336,7 @@ void FabricUIManager::initiateTransaction(facebook::react::MountingCoordinator::
336
336
  }
337
337
 
338
338
  void FabricUIManager::schedulerDidFinishTransaction(
339
- const facebook::react::MountingCoordinator::Shared &mountingCoordinator) {
339
+ const std::shared_ptr<const facebook::react::MountingCoordinator> &mountingCoordinator) {
340
340
  // Should cache this locally
341
341
 
342
342
  if (m_context.UIDispatcher().HasThreadAccess()) {
@@ -348,7 +348,7 @@ void FabricUIManager::schedulerDidFinishTransaction(
348
348
  }
349
349
 
350
350
  void FabricUIManager::schedulerShouldRenderTransactions(
351
- const facebook::react::MountingCoordinator::Shared &mountingCoordinator) {
351
+ const std::shared_ptr<const facebook::react::MountingCoordinator> &mountingCoordinator) {
352
352
  if (m_context.UIDispatcher().HasThreadAccess()) {
353
353
  initiateTransaction(mountingCoordinator);
354
354
  } else {