@depup/react-native 0.86.2-depup.0 → 0.87.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1284) hide show
  1. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +19 -24
  2. package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +1 -1
  3. package/Libraries/Alert/Alert.js +38 -1
  4. package/Libraries/Animated/AnimatedExports.js +22 -0
  5. package/Libraries/Animated/AnimatedExports.js.flow +1 -1
  6. package/Libraries/Animated/AnimatedImplementation.js +120 -3
  7. package/Libraries/Animated/Easing.js +4 -3
  8. package/Libraries/Animated/NativeAnimatedAllowlist.js +37 -0
  9. package/Libraries/Animated/animations/Animation.js +14 -5
  10. package/Libraries/Animated/animations/DecayAnimation.js +1 -0
  11. package/Libraries/Animated/animations/SpringAnimation.js +1 -0
  12. package/Libraries/Animated/animations/TimingAnimation.js +9 -0
  13. package/Libraries/Animated/components/AnimatedScrollView.js +1 -1
  14. package/Libraries/Animated/createAnimatedComponent.js +3 -3
  15. package/Libraries/Animated/nodes/AnimatedColor.js +8 -8
  16. package/Libraries/Animated/nodes/AnimatedInterpolation.js +106 -0
  17. package/Libraries/Animated/nodes/AnimatedProps.js +27 -3
  18. package/Libraries/Animated/nodes/AnimatedValue.js +8 -0
  19. package/Libraries/Animated/nodes/AnimatedValueXY.js +2 -2
  20. package/Libraries/AppDelegate/RCTAppDelegate.h +5 -9
  21. package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -20
  22. package/Libraries/AppDelegate/RCTAppSetupUtils.h +0 -18
  23. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +0 -78
  24. package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +18 -21
  25. package/Libraries/AppDelegate/RCTReactNativeFactory.h +5 -41
  26. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -82
  27. package/Libraries/AppDelegate/RCTRootViewFactory.h +4 -1
  28. package/Libraries/AppDelegate/RCTRootViewFactory.mm +3 -101
  29. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +2 -1
  30. package/Libraries/AppState/AppState.d.ts +4 -1
  31. package/Libraries/AppState/AppState.js +32 -17
  32. package/Libraries/BatchedBridge/MessageQueue.js +42 -51
  33. package/Libraries/BatchedBridge/NativeModules.js +7 -0
  34. package/Libraries/Blob/Blob.js +7 -1
  35. package/Libraries/Blob/FileReader.js +6 -0
  36. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  37. package/Libraries/Blob/URLSearchParams.js.flow +1 -1
  38. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +20 -9
  39. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +30 -43
  40. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +59 -49
  41. package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -2
  42. package/Libraries/Components/Button.js +98 -183
  43. package/Libraries/Components/Clipboard/Clipboard.js +5 -0
  44. package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
  45. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +8 -69
  46. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +10 -1
  47. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +2 -0
  48. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +26 -31
  49. package/Libraries/Components/Keyboard/Keyboard.js +23 -60
  50. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +15 -7
  51. package/Libraries/Components/Pressable/Pressable.js +39 -17
  52. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +5 -6
  53. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +4 -4
  54. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -2
  55. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +17 -0
  56. package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
  57. package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -2
  58. package/Libraries/Components/RefreshControl/RefreshControl.js +40 -50
  59. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -2
  60. package/Libraries/Components/SafeAreaView/SafeAreaView.js +8 -8
  61. package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
  62. package/Libraries/Components/ScrollView/ScrollView.d.ts +55 -43
  63. package/Libraries/Components/ScrollView/ScrollView.js +205 -118
  64. package/Libraries/Components/ScrollView/ScrollViewCommands.js +4 -4
  65. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  66. package/Libraries/Components/StatusBar/StatusBar.d.ts +7 -54
  67. package/Libraries/Components/StatusBar/StatusBar.js +84 -160
  68. package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -2
  69. package/Libraries/Components/Switch/Switch.js +76 -75
  70. package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -2
  71. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -1
  72. package/Libraries/Components/TextInput/InputAccessoryView.js +13 -61
  73. package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -2
  74. package/Libraries/Components/TextInput/TextInput.d.ts +9 -2
  75. package/Libraries/Components/TextInput/TextInput.flow.js +20 -3
  76. package/Libraries/Components/TextInput/TextInput.js +116 -111
  77. package/Libraries/Components/TextInput/TextInputNativeCommands.js +3 -3
  78. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +25 -19
  79. package/Libraries/Components/Touchable/Touchable.d.ts +1 -1
  80. package/Libraries/Components/Touchable/Touchable.js +94 -95
  81. package/Libraries/Components/Touchable/TouchableHighlight.js +45 -112
  82. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +13 -25
  83. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -84
  84. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +4 -3
  85. package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -2
  86. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  87. package/Libraries/Components/View/View.js +83 -86
  88. package/Libraries/Components/View/ViewAccessibility.d.ts +12 -2
  89. package/Libraries/Components/View/ViewAccessibility.js +17 -6
  90. package/Libraries/Components/View/ViewNativeComponent.js +4 -6
  91. package/Libraries/Components/View/ViewPropTypes.js +65 -13
  92. package/Libraries/Core/InitializeCore.js +9 -1
  93. package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
  94. package/Libraries/Core/ReactNativeVersion.js +2 -2
  95. package/Libraries/Core/Timers/JSTimers.js +53 -52
  96. package/Libraries/Core/setUpGlobals.js +9 -4
  97. package/Libraries/Core/setUpNavigator.js +7 -2
  98. package/Libraries/Core/setUpReactDevTools.js +0 -118
  99. package/Libraries/Core/setUpXHR.js +6 -2
  100. package/Libraries/Debugging/DebuggingOverlay.js +2 -2
  101. package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -2
  102. package/Libraries/EventEmitter/NativeEventEmitter.js +29 -0
  103. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +7 -7
  104. package/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +1 -1
  105. package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +3 -0
  106. package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
  107. package/Libraries/Image/AssetSourceResolver.js +18 -27
  108. package/Libraries/Image/Image.android.js +13 -2
  109. package/Libraries/Image/Image.ios.js +3 -1
  110. package/Libraries/Image/ImageBackground.js +30 -18
  111. package/Libraries/Image/ImageProps.js +116 -117
  112. package/Libraries/Image/ImageSource.d.ts +1 -1
  113. package/Libraries/Image/ImageSource.js +9 -9
  114. package/Libraries/Image/ImageSourceUtils.js +10 -7
  115. package/Libraries/Image/ImageTypes.flow.js +2 -0
  116. package/Libraries/Image/ImageViewNativeComponent.js +1 -1
  117. package/Libraries/Image/RCTImageLoader.mm +61 -64
  118. package/Libraries/Image/RCTImageStoreManager.h +0 -2
  119. package/Libraries/Image/React-RCTImage.podspec +1 -1
  120. package/Libraries/Image/RelativeImageStub.js +1 -1
  121. package/Libraries/Image/resolveAssetSource.js +1 -1
  122. package/Libraries/Interaction/PanResponder.js +102 -97
  123. package/Libraries/LayoutAnimation/LayoutAnimation.js +22 -6
  124. package/Libraries/Linking/Linking.js +24 -23
  125. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  126. package/Libraries/Lists/FlatList.d.ts +6 -17
  127. package/Libraries/Lists/FlatList.js +7 -8
  128. package/Libraries/Lists/SectionList.js +7 -0
  129. package/Libraries/Lists/VirtualizedList.js +3 -0
  130. package/Libraries/Lists/VirtualizedSectionList.js +4 -0
  131. package/Libraries/LogBox/LogBox.js +3 -3
  132. package/Libraries/LogBox/UI/AnsiHighlight.js +2 -1
  133. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -2
  134. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +4 -1
  135. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +3 -1
  136. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
  137. package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +9 -2
  138. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +17 -4
  139. package/Libraries/LogBox/UI/LogBoxInspectorSection.js +3 -1
  140. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -1
  141. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -0
  142. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -2
  143. package/Libraries/LogBox/UI/LogBoxMessage.js +18 -5
  144. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +4 -1
  145. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +1 -0
  146. package/Libraries/LogBox/UI/LogBoxStyle.js +0 -4
  147. package/Libraries/Modal/Modal.d.ts +5 -4
  148. package/Libraries/Modal/Modal.js +71 -37
  149. package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -2
  150. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -1
  151. package/Libraries/NativeComponent/BaseViewConfig.android.js +17 -0
  152. package/Libraries/NativeComponent/ViewConfig.js +3 -3
  153. package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
  154. package/Libraries/Network/RCTHTTPRequestHandler.h +1 -1
  155. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  156. package/Libraries/Performance/Systrace.js +36 -0
  157. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -2
  158. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +29 -17
  159. package/Libraries/Pressability/Pressability.js +1 -1
  160. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +4 -0
  161. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  162. package/Libraries/ReactNative/AppContainer-dev.js +3 -1
  163. package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
  164. package/Libraries/ReactNative/AppRegistry.js +15 -11
  165. package/Libraries/ReactNative/AppRegistryImpl.js +57 -11
  166. package/Libraries/ReactNative/DisplayMode.js +1 -1
  167. package/Libraries/ReactNative/FabricUIManager.js +29 -26
  168. package/Libraries/ReactNative/I18nManager.js +20 -0
  169. package/Libraries/ReactNative/UIManager.js +53 -0
  170. package/Libraries/ReactNative/renderApplication.js +1 -1
  171. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -126
  172. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -41
  173. package/Libraries/Renderer/README.md +2 -2
  174. package/Libraries/Renderer/shims/ReactNativeTypes.js +36 -36
  175. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +4 -4
  176. package/Libraries/Required/RCTRequired.podspec +1 -1
  177. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  178. package/Libraries/Settings/Settings.ios.js +22 -0
  179. package/Libraries/Share/Share.js +25 -28
  180. package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +6 -0
  181. package/Libraries/StyleSheet/StyleSheet.js +42 -2
  182. package/Libraries/StyleSheet/StyleSheet.js.flow +1 -1
  183. package/Libraries/StyleSheet/StyleSheetExports.js +7 -5
  184. package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
  185. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +24 -3
  186. package/Libraries/StyleSheet/StyleSheetTypes.js +34 -6
  187. package/Libraries/StyleSheet/flattenStyle.js +28 -13
  188. package/Libraries/StyleSheet/private/_TransformStyle.js +16 -14
  189. package/Libraries/Text/React-RCTText.podspec +1 -1
  190. package/Libraries/Text/Text.js +12 -9
  191. package/Libraries/Text/TextEffectNativeComponent.js +31 -0
  192. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +0 -1
  193. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +0 -1
  194. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +0 -1
  195. package/Libraries/Text/TextProps.js +59 -93
  196. package/Libraries/Text/requireNativeTextEffect.js +28 -0
  197. package/Libraries/TurboModule/RCTExport.js +1 -1
  198. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  199. package/Libraries/Types/CoreEventTypes.d.ts +8 -0
  200. package/Libraries/Types/CoreEventTypes.js +32 -29
  201. package/Libraries/Types/UIManagerJSInterface.js +2 -2
  202. package/Libraries/Utilities/Appearance.d.ts +32 -17
  203. package/Libraries/Utilities/Appearance.js +35 -18
  204. package/Libraries/Utilities/BackHandler.android.js +13 -28
  205. package/Libraries/Utilities/BackHandler.js.flow +18 -2
  206. package/Libraries/Utilities/DevSettings.js +8 -1
  207. package/Libraries/Utilities/Dimensions.js +18 -12
  208. package/Libraries/Utilities/PixelRatio.js +5 -2
  209. package/Libraries/Utilities/Platform.js.flow +4 -0
  210. package/Libraries/Utilities/PlatformTypes.js +77 -0
  211. package/Libraries/Utilities/PolyfillFunctions.js +1 -1
  212. package/Libraries/Utilities/differ/deepDiffer.js +5 -2
  213. package/Libraries/Utilities/useColorScheme.js +11 -1
  214. package/Libraries/Utilities/useWindowDimensions.js +6 -0
  215. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  216. package/Libraries/Vibration/Vibration.js +14 -11
  217. package/Libraries/vendor/emitter/EventEmitter.js +3 -3
  218. package/README.md +6 -8
  219. package/React/Base/RCTBridge+Private.h +0 -22
  220. package/React/Base/RCTBridge.h +10 -8
  221. package/React/Base/RCTBridge.mm +5 -447
  222. package/React/Base/RCTBridgeDelegate.h +1 -56
  223. package/React/Base/RCTBridgeModule.h +0 -9
  224. package/React/Base/RCTBridgeProxy.h +8 -0
  225. package/React/Base/RCTBridgeProxy.mm +3 -20
  226. package/React/Base/RCTBundleManager.h +0 -3
  227. package/React/Base/RCTBundleManager.m +0 -31
  228. package/React/Base/RCTBundleURLProvider.mm +4 -4
  229. package/React/Base/RCTCallableJSModules.m +0 -18
  230. package/React/Base/RCTConstants.h +1 -0
  231. package/React/Base/RCTConstants.m +1 -0
  232. package/React/Base/RCTConvert.mm +3 -0
  233. package/React/Base/RCTDisplayLink.h +3 -1
  234. package/React/Base/RCTJavaScriptExecutor.h +0 -69
  235. package/React/Base/RCTModuleData.mm +2 -483
  236. package/React/Base/RCTModuleRegistry.m +0 -25
  237. package/React/Base/RCTRootView.m +3 -374
  238. package/React/Base/RCTUtils.h +0 -3
  239. package/React/Base/RCTUtils.mm +17 -27
  240. package/React/Base/RCTVersion.m +2 -2
  241. package/React/Base/RCTViewRegistry.m +1 -29
  242. package/React/Base/Surface/RCTSurface.mm +1 -582
  243. package/React/Base/Surface/RCTSurfaceRootShadowView.m +0 -89
  244. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -1
  245. package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +0 -2
  246. package/React/CoreModules/RCTAlertController.mm +1 -0
  247. package/React/CoreModules/RCTAlertManager.mm +0 -5
  248. package/React/CoreModules/RCTLogBox.mm +0 -11
  249. package/React/CoreModules/RCTLogBoxView.h +0 -3
  250. package/React/CoreModules/RCTLogBoxView.mm +0 -31
  251. package/React/CoreModules/RCTPerfMonitor.mm +0 -2
  252. package/React/CoreModules/RCTStatusBarManager.mm +0 -11
  253. package/React/CoreModules/React-CoreModules.podspec +1 -1
  254. package/React/CxxModule/RCTCxxUtils.h +0 -8
  255. package/React/CxxModule/RCTCxxUtils.mm +0 -17
  256. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +179 -7
  257. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +100 -2
  258. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +373 -119
  259. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +1 -1
  260. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +1 -1
  261. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +71 -71
  262. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +96 -96
  263. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +357 -363
  264. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +211 -212
  265. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +107 -107
  266. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +1 -1
  267. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +11 -11
  268. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +2 -2
  269. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +4 -0
  270. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +4 -0
  271. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +4 -0
  272. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +5 -0
  273. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +0 -1
  274. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +14 -0
  275. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +13 -4
  276. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +12 -26
  277. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +39 -4
  278. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -1
  279. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +5 -5
  280. package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +0 -18
  281. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +9 -5
  282. package/React/Fabric/RCTSurfacePresenter.mm +86 -5
  283. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +2 -0
  284. package/React/I18n/RCTLocalizedString.mm +38 -2
  285. package/React/Modules/RCTEventEmitter.m +30 -10
  286. package/React/Modules/RCTI18nUtil.m +3 -1
  287. package/React/Modules/RCTUIManager.mm +0 -1501
  288. package/React/React-RCTFBReactNativeSpec.podspec +2 -2
  289. package/React/React-RCTFabric.podspec +1 -1
  290. package/React/Runtime/React-RCTRuntime.podspec +1 -1
  291. package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +27 -0
  292. package/React/Views/RCTModalHostViewController.h +0 -15
  293. package/React/Views/RCTModalHostViewManager.h +0 -24
  294. package/React/Views/RCTShadowView.h +0 -2
  295. package/React/Views/RCTShadowView.m +0 -723
  296. package/React/Views/ScrollView/RCTScrollView.h +0 -81
  297. package/React/Views/ScrollView/RCTScrollableProtocol.h +0 -4
  298. package/React-Core-prebuilt.podspec +45 -17
  299. package/React-Core.podspec +10 -3
  300. package/React.podspec +1 -1
  301. package/ReactAndroid/api/ReactAndroid.api +128 -142
  302. package/ReactAndroid/build.gradle.kts +27 -22
  303. package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
  304. package/ReactAndroid/gradle.properties +1 -1
  305. package/ReactAndroid/hermes-engine/build.gradle.kts +14 -14
  306. package/ReactAndroid/publish.gradle +5 -5
  307. package/ReactAndroid/src/debug/AndroidManifest.xml +6 -0
  308. package/ReactAndroid/src/debugOptimized/AndroidManifest.xml +22 -0
  309. package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +3 -7
  310. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +4 -2
  311. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +4 -6
  312. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +0 -3
  313. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.kt +212 -0
  314. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +0 -16
  315. package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +6 -1
  316. package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.kt +1 -0
  317. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.kt +287 -0
  318. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt +16 -0
  319. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +15 -2
  320. package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.kt +1 -3
  321. package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +4 -0
  322. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +50 -2
  323. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +63 -22
  324. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +33 -0
  325. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +4 -12
  326. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +14 -10
  327. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +6 -6
  328. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +50 -47
  329. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +1 -1
  330. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +0 -4
  331. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.kt +10 -10
  332. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LocalNetworkPermissionUtil.kt +49 -0
  333. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.kt +101 -26
  334. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +40 -38
  335. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +1 -10
  336. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerProviderImpl.kt +0 -3
  337. package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +15 -11
  338. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +4 -4
  339. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +7 -13
  340. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +160 -187
  341. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +12 -8
  342. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +30 -66
  343. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -111
  344. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -23
  345. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +12 -24
  346. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +57 -123
  347. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +7 -5
  348. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +3 -5
  349. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -23
  350. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlags.kt +0 -24
  351. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +0 -4
  352. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +1 -0
  353. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +2 -2
  354. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +3 -0
  355. package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +50 -0
  356. package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +1 -1
  357. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +53 -3
  358. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +2 -2
  359. package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +2 -77
  360. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
  361. package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +2 -2
  362. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +1 -1
  363. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +9 -4
  364. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +4 -19
  365. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +2 -6
  366. package/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt +4 -4
  367. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +47 -10
  368. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +1 -49
  369. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/HasChildPressedStateDelay.kt +29 -0
  370. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt +796 -0
  371. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +2 -4
  372. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +27 -27
  373. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.kt +184 -0
  374. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.kt +486 -0
  375. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +8 -8
  376. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +2 -2
  377. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/SkewMatrixHelper.kt +200 -0
  378. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +3 -0
  379. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +6 -1
  380. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +2 -2
  381. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +7 -1
  382. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.kt +645 -0
  383. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +2 -3
  384. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.kt +142 -0
  385. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +0 -10
  386. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -3
  387. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.kt +527 -0
  388. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +3 -1
  389. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +6 -6
  390. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +6 -0
  391. package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +7 -0
  392. package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt +8 -1
  393. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +0 -3
  394. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +2 -0
  395. package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +4 -4
  396. package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaView.kt +2 -0
  397. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +1640 -0
  398. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +6 -6
  399. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +1317 -0
  400. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +8 -8
  401. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +1309 -0
  402. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +7 -7
  403. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +19 -33
  404. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +8 -6
  405. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +4 -4
  406. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +13 -20
  407. package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +7 -1
  408. package/ReactAndroid/src/main/java/com/facebook/react/views/text/MutableSpannableLayout.kt +107 -0
  409. package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +122 -10
  410. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +92 -2
  411. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +3 -0
  412. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +41 -0
  413. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +48 -2
  414. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +200 -0
  415. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectRegistry.kt +45 -0
  416. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectSpanFactory.kt +17 -0
  417. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +361 -15
  418. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/AnimatedEffectSpan.kt +37 -0
  419. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/{DrawCommandSpan.kt → CanvasEffectSpan.kt} +3 -4
  420. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +23 -3
  421. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactStrikethroughSpan.kt +30 -3
  422. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactUnderlineSpan.kt +25 -3
  423. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt +1 -1
  424. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/StatefulSpan.kt +21 -0
  425. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextEffectSpan.kt +19 -0
  426. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TouchableSpan.kt +29 -0
  427. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +83 -11
  428. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +6 -2
  429. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextSelectionWatcher.kt +1 -1
  430. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +3 -17
  431. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +8 -0
  432. package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +2 -0
  433. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewRenderState.kt +1 -1
  434. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +7 -8
  435. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt +45 -0
  436. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
  437. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +15 -0
  438. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +6 -0
  439. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt +27 -0
  440. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt +31 -0
  441. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt +41 -0
  442. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt +37 -0
  443. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
  444. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
  445. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
  446. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt +29 -0
  447. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt +43 -0
  448. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
  449. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
  450. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +16 -0
  451. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +12 -2
  452. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
  453. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +4 -4
  454. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.kt +27 -0
  455. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +29 -0
  456. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.kt +29 -0
  457. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +24 -2
  458. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.kt +37 -0
  459. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.kt +29 -0
  460. package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -2
  461. package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +94 -0
  462. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionDelegateImpl.cpp +3 -0
  463. package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +10 -10
  464. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +3 -0
  465. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +12 -15
  466. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +1 -3
  467. package/ReactAndroid/src/main/jni/react/fabric/test/FabricMountingManagerTest.cpp +159 -0
  468. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +69 -153
  469. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +15 -33
  470. package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +10 -24
  471. package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +0 -2
  472. package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JWritableMapBuffer.cpp +13 -0
  473. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +4 -1
  474. package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +8 -0
  475. package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +4 -0
  476. package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +5 -0
  477. package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +3 -0
  478. package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
  479. package/ReactApple/RCTAnimatedModuleProvider/React-RCTAnimatedModuleProvider.podspec +63 -0
  480. package/ReactApple/RCTSwiftUI/RCTSwiftUI.podspec +1 -1
  481. package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIWrapper.podspec +1 -1
  482. package/ReactCommon/React-Fabric.podspec +3 -1
  483. package/ReactCommon/React-FabricComponents.podspec +1 -1
  484. package/ReactCommon/React-FabricImage.podspec +1 -1
  485. package/ReactCommon/React-Mapbuffer.podspec +1 -1
  486. package/ReactCommon/ReactCommon.podspec +3 -13
  487. package/ReactCommon/callinvoker/React-callinvoker.podspec +1 -1
  488. package/ReactCommon/cmake-utils/react-native-flags.cmake +1 -3
  489. package/ReactCommon/cxxreact/CMakeLists.txt +1 -0
  490. package/ReactCommon/cxxreact/ErrorUtils.h +2 -32
  491. package/ReactCommon/cxxreact/Instance.cpp +1 -26
  492. package/ReactCommon/cxxreact/Instance.h +0 -2
  493. package/ReactCommon/cxxreact/NativeToJsBridge.cpp +3 -2
  494. package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +0 -12
  495. package/ReactCommon/cxxreact/RAMBundleRegistry.h +0 -5
  496. package/ReactCommon/cxxreact/React-cxxreact.podspec +3 -2
  497. package/ReactCommon/cxxreact/ReactMarker.cpp +4 -30
  498. package/ReactCommon/cxxreact/ReactMarker.h +38 -21
  499. package/ReactCommon/cxxreact/ReactNativeVersion.h +4 -4
  500. package/ReactCommon/cxxreact/TraceSection.h +1 -1
  501. package/ReactCommon/cxxreact/tests/methodcall.cpp +4 -0
  502. package/ReactCommon/hermes/React-hermes.podspec +1 -1
  503. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +6 -79
  504. package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
  505. package/ReactCommon/jserrorhandler/ErrorUtils.cpp +42 -0
  506. package/{React/CxxLogUtils/RCTDefaultCxxLogFunction.h → ReactCommon/jserrorhandler/ErrorUtils.h} +2 -2
  507. package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -1
  508. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +3 -4
  509. package/ReactCommon/jsi/React-jsi.podspec +1 -1
  510. package/ReactCommon/jsi/jsi/hermes-interfaces.h +53 -0
  511. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +3 -2
  512. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +3 -14
  513. package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +4 -13
  514. package/ReactCommon/jsinspector-modern/HostAgent.cpp +54 -0
  515. package/ReactCommon/jsinspector-modern/HostTarget.h +0 -7
  516. package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +10 -7
  517. package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +4 -1
  518. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
  519. package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +7 -0
  520. package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +20 -0
  521. package/ReactCommon/jsinspector-modern/RuntimeTarget.h +16 -0
  522. package/ReactCommon/jsinspector-modern/SessionState.h +31 -0
  523. package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +1 -1
  524. package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +1 -1
  525. package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +53 -0
  526. package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +14 -1
  527. package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -1
  528. package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +11 -0
  529. package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -1
  530. package/ReactCommon/logger/React-logger.podspec +1 -1
  531. package/ReactCommon/oscompat/React-oscompat.podspec +1 -1
  532. package/ReactCommon/react/bridging/ArrayBuffer.h +180 -0
  533. package/ReactCommon/react/bridging/Bridging.h +1 -0
  534. package/ReactCommon/react/bridging/Convert.h +12 -0
  535. package/ReactCommon/react/bridging/React-bridging.podspec +44 -0
  536. package/ReactCommon/react/bridging/tests/BridgingTest.cpp +185 -11
  537. package/ReactCommon/react/bridging/tests/ClassTest.cpp +22 -0
  538. package/ReactCommon/react/cxxstableapi/CMakeLists.txt +18 -0
  539. package/ReactCommon/react/cxxstableapi/FrameworksGuard.h +35 -0
  540. package/ReactCommon/react/cxxstableapi/PrivateGuard.h +34 -0
  541. package/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec +34 -0
  542. package/ReactCommon/react/cxxstableapi/UmbrellaGuard.h +53 -0
  543. package/ReactCommon/react/debug/React-debug.podspec +1 -1
  544. package/ReactCommon/react/debug/redbox/JscSafeUrl.h +1 -1
  545. package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -1
  546. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -45
  547. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -56
  548. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +134 -242
  549. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +14 -26
  550. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +20 -44
  551. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +43 -97
  552. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +10 -6
  553. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +3 -7
  554. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -8
  555. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +7 -13
  556. package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +1 -0
  557. package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +49 -0
  558. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +4 -0
  559. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +4 -0
  560. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +2 -2
  561. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +2 -2
  562. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +4 -0
  563. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +5 -1
  564. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +61 -4
  565. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +0 -9
  566. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +37 -139
  567. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleWithJSIBindings.h +0 -3
  568. package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +6 -0
  569. package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -1
  570. package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
  571. package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +2 -1
  572. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +25 -55
  573. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -23
  574. package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -1
  575. package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +2 -1
  576. package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +2 -1
  577. package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -1
  578. package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +4 -0
  579. package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +2 -1
  580. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
  581. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.h +1 -1
  582. package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +1 -1
  583. package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +2 -1
  584. package/ReactCommon/react/networking/React-networking.podspec +1 -1
  585. package/ReactCommon/react/performance/cdpmetrics/React-performancecdpmetrics.podspec +1 -1
  586. package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -1
  587. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +95 -63
  588. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +20 -1
  589. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +7 -10
  590. package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.cpp +20 -1
  591. package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.h +1 -0
  592. package/ReactCommon/react/renderer/animated/internal/primitives.h +1 -1
  593. package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.cpp +67 -6
  594. package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.h +12 -0
  595. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +25 -13
  596. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +7 -0
  597. package/ReactCommon/react/renderer/animated/tests/AnimationDriverTests.cpp +48 -0
  598. package/ReactCommon/react/renderer/animated/tests/DecayAnimationDriverTest.cpp +245 -0
  599. package/ReactCommon/react/renderer/animated/tests/ManagedPropsMountingOverrideTests.cpp +204 -0
  600. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -1
  601. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
  602. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +17 -0
  603. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +0 -2
  604. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +6 -2
  605. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +25 -1
  606. package/ReactCommon/react/renderer/attributedstring/conversions.h +29 -1
  607. package/ReactCommon/react/renderer/attributedstring/primitives.h +4 -2
  608. package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +73 -0
  609. package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +6 -0
  610. package/ReactCommon/react/renderer/components/image/ImageProps.cpp +79 -126
  611. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +4 -0
  612. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +4 -0
  613. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +4 -0
  614. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -0
  615. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +4 -0
  616. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.cpp +5 -0
  617. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h +4 -0
  618. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.cpp +4 -0
  619. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h +4 -0
  620. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -0
  621. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +4 -0
  622. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  623. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -0
  624. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +5 -0
  625. package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +235 -352
  626. package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +30 -46
  627. package/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +17 -27
  628. package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +8 -10
  629. package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +19 -0
  630. package/ReactCommon/react/renderer/components/text/TextEffectComponentDescriptor.h +17 -0
  631. package/ReactCommon/react/renderer/components/text/TextEffectProps.cpp +59 -0
  632. package/ReactCommon/react/renderer/components/text/TextEffectProps.h +30 -0
  633. package/{Libraries/Text/VirtualText/RCTVirtualTextView.mm → ReactCommon/react/renderer/components/text/TextEffectShadowNode.cpp} +4 -6
  634. package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.h +26 -0
  635. package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +18 -28
  636. package/ReactCommon/react/renderer/components/text/tests/BaseTextShadowNodeTest.cpp +15 -0
  637. package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +42 -50
  638. package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +168 -754
  639. package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +0 -9
  640. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +248 -312
  641. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +0 -6
  642. package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +2 -12
  643. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +73 -27
  644. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +7 -9
  645. package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +3 -11
  646. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +82 -162
  647. package/ReactCommon/react/renderer/components/view/primitives.h +5 -0
  648. package/ReactCommon/react/renderer/components/view/propsConversions.h +74 -42
  649. package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +5 -5
  650. package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +353 -6
  651. package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +1 -1
  652. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +41 -16
  653. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +19 -0
  654. package/ReactCommon/react/renderer/core/EventEmitter.cpp +20 -4
  655. package/ReactCommon/react/renderer/core/LayoutMetrics.h +3 -0
  656. package/ReactCommon/react/renderer/core/Props.cpp +8 -39
  657. package/ReactCommon/react/renderer/core/Props.h +63 -13
  658. package/ReactCommon/react/renderer/core/RawProps.cpp +20 -3
  659. package/ReactCommon/react/renderer/core/RawProps.h +44 -0
  660. package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +11 -27
  661. package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +3 -3
  662. package/ReactCommon/react/renderer/core/RawPropsParser.cpp +4 -6
  663. package/ReactCommon/react/renderer/core/RawPropsParser.h +3 -3
  664. package/ReactCommon/react/renderer/core/StateData.h +4 -4
  665. package/ReactCommon/react/renderer/core/propsConversions.h +3 -7
  666. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +8 -0
  667. package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +7 -7
  668. package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +19 -19
  669. package/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +135 -0
  670. package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +43 -53
  671. package/ReactCommon/react/renderer/css/React-renderercss.podspec +1 -1
  672. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -1
  673. package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +3 -3
  674. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  675. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +17 -0
  676. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
  677. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +1 -1
  678. package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +123 -33
  679. package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +26 -14
  680. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +96 -53
  681. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +4 -0
  682. package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +96 -1
  683. package/ReactCommon/react/renderer/mounting/Differentiator.cpp +29 -318
  684. package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +105 -33
  685. package/ReactCommon/react/renderer/mounting/ShadowTree.h +2 -0
  686. package/ReactCommon/react/renderer/mounting/internal/CullingContext.cpp +1 -1
  687. package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +11 -3
  688. package/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +1 -1
  689. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +15 -250
  690. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeReactBranchingTest.cpp +141 -0
  691. package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +1 -1
  692. package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -0
  693. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +2 -1
  694. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +22 -2
  695. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +13 -2
  696. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +13 -0
  697. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +9 -0
  698. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +43 -5
  699. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +17 -1
  700. package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -0
  701. package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +113 -8
  702. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +14 -6
  703. package/ReactCommon/react/renderer/scheduler/Scheduler.h +3 -2
  704. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +1 -85
  705. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +0 -6
  706. package/ReactCommon/react/renderer/scheduler/tests/SchedulerDelegateInvalidationTest.cpp +671 -0
  707. package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +22 -5
  708. package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +4 -2
  709. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +11 -0
  710. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +65 -26
  711. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +193 -1
  712. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +14 -2
  713. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +2 -1
  714. package/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +86 -5
  715. package/ReactCommon/react/renderer/uimanager/UIManager.cpp +31 -41
  716. package/ReactCommon/react/renderer/uimanager/UIManager.h +2 -2
  717. package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +1 -1
  718. package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +1 -52
  719. package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +4 -4
  720. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +88 -39
  721. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +12 -2
  722. package/ReactCommon/react/runtime/PlatformTimerRegistry.h +10 -0
  723. package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
  724. package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -1
  725. package/ReactCommon/react/runtime/ReactInstance.cpp +79 -64
  726. package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +0 -89
  727. package/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +99 -0
  728. package/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +244 -0
  729. package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +1 -1
  730. package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +1 -1
  731. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +47 -30
  732. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +3 -2
  733. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +3 -2
  734. package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +27 -3
  735. package/ReactCommon/react/runtime/tests/cxx/RuntimeExecutorShutdownTest.cpp +155 -0
  736. package/ReactCommon/react/timing/React-timing.podspec +1 -1
  737. package/ReactCommon/react/utils/React-utils.podspec +1 -1
  738. package/ReactCommon/react/utils/Telemetry.h +0 -13
  739. package/ReactCommon/react/utils/tests/Base64Tests.cpp +36 -0
  740. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -1
  741. package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +0 -1
  742. package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +1 -1
  743. package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +21 -38
  744. package/ReactCommon/yoga/Yoga.podspec +2 -2
  745. package/ReactCommon/yoga/yoga/YGEnums.cpp +2 -0
  746. package/ReactCommon/yoga/yoga/YGEnums.h +1 -0
  747. package/ReactCommon/yoga/yoga/YGNode.cpp +27 -0
  748. package/ReactCommon/yoga/yoga/YGNode.h +69 -0
  749. package/ReactCommon/yoga/yoga/YGNodeLayout.h +0 -2
  750. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +283 -10
  751. package/ReactCommon/yoga/yoga/config/Config.h +1 -1
  752. package/ReactCommon/yoga/yoga/enums/Errata.h +1 -0
  753. package/ReactCommon/yoga/yoga/node/LayoutResults.h +8 -0
  754. package/ReactCommon/yoga/yoga/node/Node.cpp +32 -0
  755. package/ReactCommon/yoga/yoga/node/Node.h +33 -0
  756. package/changes.json +5 -13
  757. package/cli.js +3 -182
  758. package/flow/bom.js.flow +42 -42
  759. package/flow/cssom.js.flow +21 -21
  760. package/flow/dom.js.flow +128 -128
  761. package/flow/global.js +6 -0
  762. package/gradle/libs.versions.toml +7 -5
  763. package/index.js +53 -86
  764. package/index.js.flow +53 -23
  765. package/package.json +44 -63
  766. package/react-native.config.js +82 -1
  767. package/scripts/cocoapods/fabric.rb +1 -1
  768. package/scripts/cocoapods/jsengine.rb +1 -1
  769. package/scripts/cocoapods/new_architecture.rb +1 -1
  770. package/scripts/cocoapods/rncore.rb +36 -78
  771. package/scripts/cocoapods/rncore_facades.rb +232 -0
  772. package/scripts/cocoapods/rndependencies.rb +64 -3
  773. package/scripts/cocoapods/rndeps_facades.rb +193 -0
  774. package/scripts/cocoapods/spm.rb +79 -12
  775. package/scripts/cocoapods/utils.rb +7 -9
  776. package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +0 -1
  777. package/scripts/codegen/templates/Package.swift.spm-template +97 -0
  778. package/scripts/codegen/templates/ReactAppDependencyProvider.podspec.template +1 -1
  779. package/scripts/codegen/templates/ReactCodegen.podspec.template +2 -2
  780. package/scripts/hermes/hermes-utils.js +27 -58
  781. package/scripts/ios-configure-glog.sh +1 -1
  782. package/scripts/react-native-xcode.sh +20 -0
  783. package/scripts/react_native_pods.rb +71 -21
  784. package/scripts/react_native_pods_utils/script_phases.sh +4 -3
  785. package/scripts/replace-rncore-version.js +57 -86
  786. package/scripts/setup-apple-spm.js +1267 -0
  787. package/scripts/spm/__doc__/rfc-spm-xcframework.md +707 -0
  788. package/scripts/spm/__doc__/spm-autolinking-plugins.md +244 -0
  789. package/scripts/spm/__doc__/spm-header-paths-contract.md +97 -0
  790. package/scripts/spm/__doc__/spm-plugins-assessment.md +128 -0
  791. package/scripts/spm/__doc__/spm-scripts.md +486 -0
  792. package/scripts/spm/autolinking-plugins.js +331 -0
  793. package/scripts/spm/download-spm-artifacts.js +1409 -0
  794. package/scripts/spm/expand-spm-dependencies.js +216 -0
  795. package/scripts/spm/flavored-frameworks.js +1008 -0
  796. package/scripts/spm/generate-spm-autolinking-config.js +221 -0
  797. package/scripts/spm/generate-spm-autolinking.js +1888 -0
  798. package/scripts/spm/generate-spm-package.js +302 -0
  799. package/scripts/spm/generate-spm-xcodeproj.js +2266 -0
  800. package/scripts/spm/read-podspec.js +695 -0
  801. package/scripts/spm/scaffold-package-swift.js +1206 -0
  802. package/scripts/spm/spm-pbxproj.js +654 -0
  803. package/scripts/spm/spm-types.js +520 -0
  804. package/scripts/spm/spm-utils.js +645 -0
  805. package/scripts/spm/sync-spm-autolinking.js +160 -0
  806. package/sdks/.hermesv1version +1 -1
  807. package/sdks/hermes-engine/hermes-engine.podspec +9 -39
  808. package/sdks/hermes-engine/hermes-utils.rb +19 -73
  809. package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
  810. package/sdks/hermes-engine/version.properties +1 -2
  811. package/settings.gradle.kts +0 -43
  812. package/src/asset-registry.js +29 -0
  813. package/src/private/animated/NativeAnimatedHelper.js +45 -21
  814. package/src/private/assets/AssetRegistry.js +52 -0
  815. package/src/private/{specs_DEPRECATED/components → components/activityindicator/specs}/ActivityIndicatorViewNativeComponent.js +5 -5
  816. package/src/private/{specs_DEPRECATED/components → components/debuggingoverlay/specs}/DebuggingOverlayNativeComponent.js +8 -8
  817. package/src/private/{specs_DEPRECATED/components → components/drawerlayoutandroid/specs}/AndroidDrawerLayoutNativeComponent.js +8 -8
  818. package/src/private/{specs_DEPRECATED/components → components/inputaccessoryview/specs}/RCTInputAccessoryViewNativeComponent.js +4 -4
  819. package/src/private/{specs_DEPRECATED/components → components/modal/specs}/RCTModalHostViewNativeComponent.js +4 -9
  820. package/src/private/{specs_DEPRECATED/components → components/progressbarandroid/specs}/ProgressBarAndroidNativeComponent.js +5 -5
  821. package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/AndroidSwipeRefreshLayoutNativeComponent.js +7 -7
  822. package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/PullToRefreshViewNativeComponent.js +7 -7
  823. package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -2
  824. package/src/private/{specs_DEPRECATED/components → components/safeareaview/specs}/RCTSafeAreaViewNativeComponent.js +3 -3
  825. package/src/private/components/scrollview/HScrollViewNativeComponents.js +1 -1
  826. package/src/private/{specs_DEPRECATED/components → components/scrollview/specs}/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
  827. package/src/private/{specs_DEPRECATED/components → components/switch/specs}/AndroidSwitchNativeComponent.js +7 -7
  828. package/src/private/{specs_DEPRECATED/components → components/switch/specs}/SwitchNativeComponent.js +10 -7
  829. package/src/private/{specs_DEPRECATED/components → components/unimplementedview/specs}/UnimplementedNativeViewNativeComponent.js +4 -4
  830. package/src/private/components/virtualcollection/Virtual.js +5 -5
  831. package/src/private/components/virtualcollection/VirtualCollectionView.js +2 -6
  832. package/src/private/components/virtualcollection/column/VirtualColumn.js +1 -1
  833. package/src/private/components/virtualcollection/row/VirtualRow.js +1 -1
  834. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +3 -1
  835. package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +4 -4
  836. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +4 -2
  837. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
  838. package/src/private/featureflags/ReactNativeFeatureFlags.js +46 -70
  839. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +88 -94
  840. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
  841. package/src/private/renderer/events/ReactNativeResponder.js +49 -4
  842. package/src/private/renderer/events/ResponderTouchHistoryStore.js +11 -2
  843. package/src/private/renderer/events/dispatchNativeEvent.js +71 -36
  844. package/src/private/setup/setUpDOM.js +19 -9
  845. package/src/private/setup/setUpIntersectionObserver.js +7 -0
  846. package/src/private/setup/setUpMutationObserver.js +3 -1
  847. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +9 -9
  848. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +24 -24
  849. package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +28 -28
  850. package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
  851. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +45 -25
  852. package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +44 -24
  853. package/src/private/specs_DEPRECATED/modules/NativeAppState.js +4 -4
  854. package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +8 -6
  855. package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +7 -7
  856. package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +3 -3
  857. package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +2 -2
  858. package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +11 -11
  859. package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
  860. package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +4 -4
  861. package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +7 -7
  862. package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +4 -4
  863. package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
  864. package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +4 -4
  865. package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +2 -2
  866. package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
  867. package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +13 -13
  868. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +9 -6
  869. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +6 -6
  870. package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
  871. package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +8 -5
  872. package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +5 -5
  873. package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
  874. package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +2 -2
  875. package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +6 -6
  876. package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +2 -2
  877. package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +2 -2
  878. package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +5 -5
  879. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +6 -6
  880. package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +6 -4
  881. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
  882. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +1 -1
  883. package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +35 -31
  884. package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +2 -2
  885. package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +24 -24
  886. package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +2 -2
  887. package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +3 -3
  888. package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +2 -2
  889. package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
  890. package/src/private/specs_DEPRECATED/modules/NativeSourceCode.js +1 -1
  891. package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerAndroid.js +5 -17
  892. package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerIOS.js +10 -15
  893. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +3 -3
  894. package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +4 -4
  895. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +35 -22
  896. package/src/private/specs_DEPRECATED/modules/NativeVibration.js +4 -4
  897. package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +7 -7
  898. package/src/private/types/HostInstance.js +38 -80
  899. package/src/private/viewtransition/specs/NativeViewTransition.js +6 -4
  900. package/src/private/webapis/dom/abort-api/AbortController.js +92 -0
  901. package/src/private/webapis/dom/abort-api/AbortSignal.js +243 -0
  902. package/src/private/webapis/dom/events/CustomEvent.js +1 -1
  903. package/src/private/webapis/dom/events/Event.js +12 -12
  904. package/src/private/webapis/dom/events/EventTarget.js +146 -37
  905. package/src/private/webapis/dom/events/internals/EventInternals.js +36 -0
  906. package/src/private/webapis/dom/events/internals/EventTargetInternals.js +38 -3
  907. package/src/private/webapis/dom/nodes/ReactNativeDocument.js +11 -0
  908. package/src/private/webapis/dom/nodes/ReactNativeElement.js +105 -4
  909. package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +11 -0
  910. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +9 -0
  911. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +34 -7
  912. package/src/private/webapis/dom/nodes/ReadOnlyText.js +33 -0
  913. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +46 -42
  914. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +12 -0
  915. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +4 -2
  916. package/src/private/webapis/dom/oldstylecollections/NodeList.js +10 -0
  917. package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +4 -3
  918. package/src/private/webapis/errors/DOMException.js +50 -50
  919. package/src/private/webapis/geometry/DOMRectList.js +12 -0
  920. package/src/private/webapis/geometry/DOMRectList.js.flow +3 -1
  921. package/src/private/webapis/html/events/MessageEvent.js +3 -3
  922. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
  923. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +13 -0
  924. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +3 -7
  925. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +5 -5
  926. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
  927. package/src/private/webapis/mutationobserver/MutationObserver.js +7 -7
  928. package/src/private/webapis/mutationobserver/MutationRecord.js +12 -0
  929. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +5 -7
  930. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +5 -5
  931. package/src/private/webapis/performance/EventTiming.js +3 -3
  932. package/src/private/webapis/performance/PerformanceEntry.js +3 -3
  933. package/src/private/webapis/performance/PerformanceObserver.js +4 -4
  934. package/src/private/webapis/performance/ResourceTiming.js +13 -13
  935. package/src/private/webapis/performance/UserTiming.js +3 -3
  936. package/src/private/webapis/performance/internals/Utilities.js +1 -1
  937. package/src/private/webapis/performance/specs/NativePerformance.js +26 -20
  938. package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
  939. package/src/private/webapis/websockets/events/CloseEvent.js +3 -3
  940. package/src/private/webapis/xhr/events/ProgressEvent.js +3 -3
  941. package/src/react-private-interface.js +145 -0
  942. package/src/react-private-interface.js.flow +48 -0
  943. package/src/setup-env.js +22 -0
  944. package/src/types/globals.d.ts +35 -3
  945. package/src/unstable-internals-do-not-use.d.ts +214 -0
  946. package/src/unstable-internals-do-not-use.js +76 -0
  947. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  948. package/third-party-podspecs/ReactNativeDependencies.podspec +3 -3
  949. package/third-party-podspecs/glog.podspec +1 -1
  950. package/types/index.d.ts +0 -1
  951. package/types/public/DeprecatedPropertiesAlias.d.ts +0 -4
  952. package/types/public/ReactNativeTypes.d.ts +6 -4
  953. package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +26 -31
  954. package/types_generated/Libraries/Alert/Alert.d.ts +44 -7
  955. package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +2 -2
  956. package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
  957. package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +107 -3
  958. package/types_generated/Libraries/Animated/Easing.d.ts +5 -4
  959. package/types_generated/Libraries/Animated/animations/Animation.d.ts +7 -7
  960. package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +5 -5
  961. package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +49 -49
  962. package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +13 -13
  963. package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +3 -3
  964. package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +2 -2
  965. package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +3 -3
  966. package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +4 -4
  967. package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +2 -2
  968. package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +9 -9
  969. package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +3 -3
  970. package/types_generated/Libraries/AppState/AppState.d.ts +41 -22
  971. package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +8 -1
  972. package/types_generated/Libraries/Blob/BlobTypes.d.ts +4 -4
  973. package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +37 -46
  974. package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +92 -43
  975. package/types_generated/Libraries/Components/Button.d.ts +118 -197
  976. package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +6 -1
  977. package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +44 -63
  978. package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +30 -61
  979. package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +30 -21
  980. package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +41 -17
  981. package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +6 -6
  982. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +5 -5
  983. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +18 -1
  984. package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +35 -52
  985. package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -11
  986. package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +212 -88
  987. package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
  988. package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +29 -62
  989. package/types_generated/Libraries/Components/Switch/Switch.d.ts +75 -70
  990. package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +16 -65
  991. package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +118 -3
  992. package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +24 -9
  993. package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +18 -18
  994. package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +24 -13
  995. package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +27 -64
  996. package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +18 -6
  997. package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +28 -28
  998. package/types_generated/Libraries/Components/View/View.d.ts +13 -9
  999. package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +31 -20
  1000. package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +1 -2
  1001. package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +75 -24
  1002. package/types_generated/Libraries/Core/ExtendedError.d.ts +10 -10
  1003. package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +34 -1
  1004. package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +4 -1
  1005. package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +2 -13
  1006. package/types_generated/Libraries/Image/ImageBackground.d.ts +33 -22
  1007. package/types_generated/Libraries/Image/ImageProps.d.ts +201 -251
  1008. package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +6 -5
  1009. package/types_generated/Libraries/Interaction/PanResponder.d.ts +103 -97
  1010. package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +18 -7
  1011. package/types_generated/Libraries/Linking/Linking.d.ts +28 -20
  1012. package/types_generated/Libraries/Lists/FlatList.d.ts +17 -18
  1013. package/types_generated/Libraries/Lists/SectionList.d.ts +10 -5
  1014. package/types_generated/Libraries/Lists/VirtualizedList.d.ts +3 -1
  1015. package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +3 -1
  1016. package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +2 -2
  1017. package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +2 -2
  1018. package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +2 -2
  1019. package/types_generated/Libraries/LogBox/LogBox.d.ts +4 -1
  1020. package/types_generated/Libraries/Modal/Modal.d.ts +70 -35
  1021. package/types_generated/Libraries/Network/FormData.d.ts +5 -5
  1022. package/types_generated/Libraries/Performance/Systrace.d.ts +11 -1
  1023. package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +31 -21
  1024. package/types_generated/Libraries/Pressability/Pressability.d.ts +5 -5
  1025. package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +15 -11
  1026. package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +5 -5
  1027. package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +56 -9
  1028. package/types_generated/Libraries/ReactNative/I18nManager.d.ts +20 -1
  1029. package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +5 -5
  1030. package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +6 -22
  1031. package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +34 -34
  1032. package/types_generated/Libraries/Share/Share.d.ts +36 -39
  1033. package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +7 -1
  1034. package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +3 -3
  1035. package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +202 -181
  1036. package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +3 -3
  1037. package/types_generated/Libraries/Text/Text.d.ts +10 -6
  1038. package/types_generated/Libraries/Text/TextProps.d.ts +57 -102
  1039. package/types_generated/Libraries/TurboModule/RCTExport.d.ts +2 -2
  1040. package/types_generated/Libraries/Types/CoreEventTypes.d.ts +14 -8
  1041. package/types_generated/Libraries/Utilities/Appearance.d.ts +25 -13
  1042. package/types_generated/Libraries/Utilities/BackHandler.d.ts +17 -1
  1043. package/types_generated/Libraries/Utilities/DevSettings.d.ts +9 -2
  1044. package/types_generated/Libraries/Utilities/Dimensions.d.ts +19 -13
  1045. package/types_generated/Libraries/Utilities/PixelRatio.d.ts +6 -3
  1046. package/types_generated/Libraries/Utilities/Platform.d.ts +5 -1
  1047. package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +65 -6
  1048. package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +5 -5
  1049. package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +2 -2
  1050. package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +2 -2
  1051. package/types_generated/Libraries/Utilities/useColorScheme.d.ts +12 -2
  1052. package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +7 -1
  1053. package/types_generated/Libraries/Vibration/Vibration.d.ts +14 -6
  1054. package/types_generated/index.d.ts +31 -25
  1055. package/types_generated/src/private/assets/AssetRegistry.d.ts +42 -0
  1056. package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +5 -5
  1057. package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +3 -3
  1058. package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +3 -3
  1059. package/types_generated/src/private/components/virtualview/VirtualView.d.ts +7 -7
  1060. package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +5 -5
  1061. package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +5 -5
  1062. package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
  1063. package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +6 -5
  1064. package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +7 -7
  1065. package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +5 -5
  1066. package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +8 -8
  1067. package/types_generated/src/private/types/HostComponent.d.ts +3 -3
  1068. package/types_generated/src/private/types/HostInstance.d.ts +39 -74
  1069. package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +2 -2
  1070. package/types_generated/src/private/webapis/dom/events/Event.d.ts +4 -4
  1071. package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +8 -8
  1072. package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +3 -1
  1073. package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +57 -4
  1074. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +3 -1
  1075. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +3 -1
  1076. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +4 -2
  1077. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +3 -1
  1078. package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +3 -3
  1079. package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +3 -1
  1080. package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +3 -1
  1081. package/types_generated/src/react-private-interface.d.ts +33 -0
  1082. package/Libraries/AppDelegate/RCTArchConfiguratorProtocol.h +0 -38
  1083. package/Libraries/Image/AssetRegistry.js +0 -14
  1084. package/Libraries/Image/RCTImageShadowView.h +0 -17
  1085. package/Libraries/Image/RCTImageShadowView.mm +0 -28
  1086. package/Libraries/Image/RCTImageView.h +0 -32
  1087. package/Libraries/Image/RCTImageView.mm +0 -508
  1088. package/Libraries/Image/RCTImageViewManager.h +0 -17
  1089. package/Libraries/Image/RCTImageViewManager.mm +0 -115
  1090. package/Libraries/Interaction/InteractionManager.d.ts +0 -87
  1091. package/Libraries/Interaction/InteractionManager.js +0 -189
  1092. package/Libraries/Text/BaseText/RCTBaseTextShadowView.h +0 -35
  1093. package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +0 -162
  1094. package/Libraries/Text/BaseText/RCTBaseTextViewManager.h +0 -21
  1095. package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +0 -64
  1096. package/Libraries/Text/RCTTextAttributes.h +0 -107
  1097. package/Libraries/Text/RCTTextAttributes.mm +0 -358
  1098. package/Libraries/Text/RawText/RCTRawTextShadowView.h +0 -23
  1099. package/Libraries/Text/RawText/RCTRawTextShadowView.mm +0 -38
  1100. package/Libraries/Text/RawText/RCTRawTextViewManager.h +0 -21
  1101. package/Libraries/Text/RawText/RCTRawTextViewManager.mm +0 -32
  1102. package/Libraries/Text/Text/RCTTextShadowView.h +0 -33
  1103. package/Libraries/Text/Text/RCTTextShadowView.mm +0 -469
  1104. package/Libraries/Text/Text/RCTTextView.h +0 -34
  1105. package/Libraries/Text/Text/RCTTextView.mm +0 -298
  1106. package/Libraries/Text/Text/RCTTextViewManager.h +0 -19
  1107. package/Libraries/Text/Text/RCTTextViewManager.mm +0 -97
  1108. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +0 -21
  1109. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +0 -67
  1110. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h +0 -21
  1111. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +0 -28
  1112. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.h +0 -30
  1113. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +0 -367
  1114. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +0 -68
  1115. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -849
  1116. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.h +0 -17
  1117. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +0 -181
  1118. package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.h +0 -17
  1119. package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +0 -24
  1120. package/Libraries/Text/TextInput/RCTInputAccessoryView.h +0 -22
  1121. package/Libraries/Text/TextInput/RCTInputAccessoryView.mm +0 -82
  1122. package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.h +0 -17
  1123. package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm +0 -78
  1124. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.h +0 -17
  1125. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +0 -33
  1126. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h +0 -21
  1127. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.mm +0 -43
  1128. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h +0 -21
  1129. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +0 -35
  1130. package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.h +0 -17
  1131. package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.mm +0 -42
  1132. package/Libraries/Text/VirtualText/RCTVirtualTextView.h +0 -28
  1133. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.h +0 -17
  1134. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +0 -30
  1135. package/Libraries/Utilities/SceneTracker.js +0 -42
  1136. package/Libraries/Wrapper/Example/RCTWrapperExampleView.h +0 -21
  1137. package/Libraries/Wrapper/Example/RCTWrapperExampleView.m +0 -57
  1138. package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h +0 -21
  1139. package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m +0 -27
  1140. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h +0 -25
  1141. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m +0 -50
  1142. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h +0 -23
  1143. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m +0 -35
  1144. package/Libraries/Wrapper/RCTWrapper.h +0 -73
  1145. package/Libraries/Wrapper/RCTWrapperShadowView.h +0 -27
  1146. package/Libraries/Wrapper/RCTWrapperShadowView.m +0 -138
  1147. package/Libraries/Wrapper/RCTWrapperView.h +0 -42
  1148. package/Libraries/Wrapper/RCTWrapperView.m +0 -99
  1149. package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.h +0 -30
  1150. package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.m +0 -137
  1151. package/Libraries/Wrapper/RCTWrapperViewManager.h +0 -25
  1152. package/Libraries/Wrapper/RCTWrapperViewManager.m +0 -31
  1153. package/React/Base/RCTRootContentView.h +0 -43
  1154. package/React/Base/RCTRootContentView.m +0 -111
  1155. package/React/Base/RCTRootViewInternal.h +0 -28
  1156. package/React/CxxBridge/RCTCxxBridge.mm +0 -1572
  1157. package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +0 -25
  1158. package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +0 -34
  1159. package/React/CxxBridge/RCTObjcExecutor.h +0 -34
  1160. package/React/CxxBridge/RCTObjcExecutor.mm +0 -150
  1161. package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -34
  1162. package/React/CxxModule/DispatchMessageQueueThread.h +0 -50
  1163. package/React/CxxModule/RCTCxxMethod.h +0 -17
  1164. package/React/CxxModule/RCTCxxMethod.mm +0 -147
  1165. package/React/CxxModule/RCTNativeModule.h +0 -34
  1166. package/React/CxxModule/RCTNativeModule.mm +0 -241
  1167. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +0 -205
  1168. package/React/Tests/Text/RCTTextAttributesTest.mm +0 -49
  1169. package/React/Views/RCTActivityIndicatorView.h +0 -16
  1170. package/React/Views/RCTActivityIndicatorView.m +0 -26
  1171. package/React/Views/RCTActivityIndicatorViewManager.h +0 -23
  1172. package/React/Views/RCTActivityIndicatorViewManager.m +0 -65
  1173. package/React/Views/RCTDebuggingOverlayManager.h +0 -17
  1174. package/React/Views/RCTDebuggingOverlayManager.m +0 -68
  1175. package/React/Views/RCTModalHostView.h +0 -64
  1176. package/React/Views/RCTModalHostView.m +0 -264
  1177. package/React/Views/RCTModalHostViewController.m +0 -74
  1178. package/React/Views/RCTModalHostViewManager.m +0 -131
  1179. package/React/Views/RCTModalManager.h +0 -22
  1180. package/React/Views/RCTModalManager.m +0 -46
  1181. package/React/Views/RCTRootShadowView.h +0 -35
  1182. package/React/Views/RCTRootShadowView.m +0 -53
  1183. package/React/Views/RCTShadowView+Internal.h +0 -18
  1184. package/React/Views/RCTShadowView+Internal.m +0 -23
  1185. package/React/Views/RCTSwitch.h +0 -22
  1186. package/React/Views/RCTSwitch.m +0 -24
  1187. package/React/Views/RCTSwitchManager.h +0 -17
  1188. package/React/Views/RCTSwitchManager.m +0 -70
  1189. package/React/Views/RefreshControl/RCTRefreshControl.h +0 -24
  1190. package/React/Views/RefreshControl/RCTRefreshControl.m +0 -230
  1191. package/React/Views/RefreshControl/RCTRefreshControlManager.h +0 -17
  1192. package/React/Views/RefreshControl/RCTRefreshControlManager.m +0 -47
  1193. package/React/Views/SafeAreaView/RCTSafeAreaShadowView.h +0 -21
  1194. package/React/Views/SafeAreaView/RCTSafeAreaShadowView.m +0 -57
  1195. package/React/Views/SafeAreaView/RCTSafeAreaView.h +0 -27
  1196. package/React/Views/SafeAreaView/RCTSafeAreaView.m +0 -79
  1197. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +0 -25
  1198. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m +0 -25
  1199. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.h +0 -21
  1200. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +0 -32
  1201. package/React/Views/ScrollView/RCTScrollContentShadowView.h +0 -19
  1202. package/React/Views/ScrollView/RCTScrollContentShadowView.m +0 -35
  1203. package/React/Views/ScrollView/RCTScrollContentView.h +0 -19
  1204. package/React/Views/ScrollView/RCTScrollContentView.m +0 -36
  1205. package/React/Views/ScrollView/RCTScrollContentViewManager.h +0 -17
  1206. package/React/Views/ScrollView/RCTScrollContentViewManager.m +0 -31
  1207. package/React/Views/ScrollView/RCTScrollView.m +0 -1168
  1208. package/React/Views/ScrollView/RCTScrollViewManager.h +0 -25
  1209. package/React/Views/ScrollView/RCTScrollViewManager.m +0 -202
  1210. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +0 -251
  1211. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +0 -315
  1212. package/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +0 -51
  1213. package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +0 -89
  1214. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +0 -736
  1215. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -221
  1216. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -399
  1217. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +0 -35
  1218. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -346
  1219. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -666
  1220. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -147
  1221. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +0 -113
  1222. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +0 -614
  1223. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +0 -1838
  1224. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +0 -1646
  1225. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +0 -1638
  1226. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +0 -51
  1227. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +0 -33
  1228. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +0 -33
  1229. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +0 -37
  1230. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +0 -47
  1231. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +0 -41
  1232. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +0 -33
  1233. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +0 -37
  1234. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +0 -39
  1235. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +0 -35
  1236. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +0 -49
  1237. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +0 -45
  1238. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java +0 -35
  1239. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +0 -928
  1240. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java +0 -33
  1241. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java +0 -35
  1242. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java +0 -35
  1243. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java +0 -43
  1244. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java +0 -35
  1245. package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.cpp +0 -23
  1246. package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.h +0 -37
  1247. package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +0 -135
  1248. package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +0 -72
  1249. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +0 -143
  1250. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +0 -55
  1251. package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +0 -78
  1252. package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +0 -39
  1253. package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +0 -148
  1254. package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +0 -168
  1255. package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +0 -416
  1256. package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +0 -31
  1257. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +0 -134
  1258. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +0 -290
  1259. package/ReactCommon/react/renderer/core/RawPropsKey.cpp +0 -62
  1260. package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -39
  1261. package/ReactCommon/react/renderer/mounting/internal/DiffMap.h +0 -170
  1262. package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +0 -95
  1263. package/ReactCommon/react/renderer/mounting/internal/TinyMap.h +0 -147
  1264. package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +0 -154
  1265. package/interface.js +0 -21
  1266. package/jest-preset.js +0 -26
  1267. package/rn-get-polyfills.js +0 -13
  1268. package/sdks/.hermesversion +0 -1
  1269. package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +0 -13
  1270. package/types/tsconfig.json +0 -15
  1271. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +0 -14
  1272. package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +0 -21
  1273. package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponentType.d.ts +0 -134
  1274. package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +0 -14
  1275. package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +0 -14
  1276. package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +0 -262
  1277. package/types_generated/Libraries/Interaction/InteractionManager.d.ts +0 -117
  1278. package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +0 -17
  1279. package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +0 -53
  1280. package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +0 -36
  1281. package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +0 -51
  1282. package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +0 -37
  1283. package/types_generated/tsconfig.test.json +0 -16
  1284. /package/ReactCommon/{cxxreact → react/utils}/MoveWrapper.h +0 -0
@@ -0,0 +1,1640 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ package com.facebook.react.views.scroll
9
+
10
+ import android.animation.ObjectAnimator
11
+ import android.animation.ValueAnimator
12
+ import android.content.Context
13
+ import android.graphics.Canvas
14
+ import android.graphics.Color
15
+ import android.graphics.Point
16
+ import android.graphics.Rect
17
+ import android.graphics.drawable.Drawable
18
+ import android.os.Build
19
+ import android.view.FocusFinder
20
+ import android.view.KeyEvent
21
+ import android.view.MotionEvent
22
+ import android.view.View
23
+ import android.view.ViewGroup
24
+ import android.view.ViewParent
25
+ import android.view.accessibility.AccessibilityNodeInfo
26
+ import android.widget.HorizontalScrollView
27
+ import android.widget.OverScroller
28
+ import androidx.core.graphics.drawable.toDrawable
29
+ import androidx.core.view.ViewCompat
30
+ import androidx.core.view.ViewCompat.FocusDirection
31
+ import androidx.core.view.isEmpty
32
+ import androidx.core.view.isNotEmpty
33
+ import com.facebook.common.logging.FLog
34
+ import com.facebook.react.R
35
+ import com.facebook.react.common.ReactConstants
36
+ import com.facebook.react.common.build.ReactBuildConfig
37
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
38
+ import com.facebook.react.uimanager.BackgroundStyleApplicator
39
+ import com.facebook.react.uimanager.HasChildPressedStateDelay
40
+ import com.facebook.react.uimanager.LengthPercentage
41
+ import com.facebook.react.uimanager.LengthPercentageType
42
+ import com.facebook.react.uimanager.MeasureSpecAssertions
43
+ import com.facebook.react.uimanager.PixelUtil
44
+ import com.facebook.react.uimanager.PointerEvents
45
+ import com.facebook.react.uimanager.ReactClippingViewGroup
46
+ import com.facebook.react.uimanager.ReactClippingViewGroupHelper
47
+ import com.facebook.react.uimanager.ReactOverflowViewWithInset
48
+ import com.facebook.react.uimanager.StateWrapper
49
+ import com.facebook.react.uimanager.events.NativeGestureUtil
50
+ import com.facebook.react.uimanager.style.BorderRadiusProp
51
+ import com.facebook.react.uimanager.style.BorderStyle
52
+ import com.facebook.react.uimanager.style.LogicalEdge
53
+ import com.facebook.react.uimanager.style.Overflow
54
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.HasFlingAnimator
55
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.HasScrollEventThrottle
56
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.HasScrollState
57
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.HasSmoothScroll
58
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.HasStateWrapper
59
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.ReactScrollViewScrollState
60
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_CENTER
61
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_DISABLED
62
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_END
63
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_START
64
+ import com.facebook.react.views.scroll.ReactScrollViewHelper.findNextFocusableView
65
+ import com.facebook.systrace.Systrace
66
+ import kotlin.math.abs
67
+ import kotlin.math.ceil
68
+ import kotlin.math.floor
69
+ import kotlin.math.max
70
+ import kotlin.math.round
71
+ import kotlin.math.sign
72
+
73
+ /** Similar to [ReactScrollView] but only supports horizontal scrolling. */
74
+ public open class ReactHorizontalScrollView
75
+ @JvmOverloads
76
+ constructor(context: Context, private val fpsListener: FpsListener? = null) :
77
+ HorizontalScrollView(context),
78
+ ReactClippingViewGroup,
79
+ ViewGroup.OnHierarchyChangeListener,
80
+ View.OnLayoutChangeListener,
81
+ ReactAccessibleScrollView,
82
+ ReactOverflowViewWithInset,
83
+ HasScrollState,
84
+ HasStateWrapper,
85
+ HasFlingAnimator,
86
+ HasScrollEventThrottle,
87
+ HasSmoothScroll,
88
+ VirtualViewContainer,
89
+ HasChildPressedStateDelay {
90
+
91
+ private companion object {
92
+ private val DEBUG_MODE = false && ReactBuildConfig.DEBUG
93
+ private val TAG = ReactHorizontalScrollView::class.java.simpleName
94
+
95
+ private const val NO_SCROLL_POSITION = Int.MIN_VALUE
96
+ private const val UNSET_CONTENT_OFFSET = -1
97
+
98
+ private var scrollerField: java.lang.reflect.Field? = null
99
+ private var triedToGetScrollerField = false
100
+
101
+ private fun findDeepestScrollViewForMotionEvent(
102
+ view: View,
103
+ ev: MotionEvent,
104
+ ): HorizontalScrollView? = findDeepestScrollViewForMotionEvent(view, ev, true)
105
+
106
+ private fun findDeepestScrollViewForMotionEvent(
107
+ view: View?,
108
+ ev: MotionEvent,
109
+ skipInitialView: Boolean,
110
+ ): HorizontalScrollView? {
111
+ if (view == null) return null
112
+
113
+ val rectOnScreen = Rect()
114
+ view.getGlobalVisibleRect(rectOnScreen)
115
+ if (!rectOnScreen.contains(ev.rawX.toInt(), ev.rawY.toInt())) {
116
+ return null
117
+ }
118
+
119
+ if (
120
+ !skipInitialView &&
121
+ view is HorizontalScrollView &&
122
+ ViewCompat.isNestedScrollingEnabled(view) &&
123
+ (view is ReactHorizontalScrollView && view.scrollEnabled)
124
+ ) {
125
+ return view
126
+ }
127
+
128
+ if (view is ViewGroup) {
129
+ for (i in 0 until view.childCount) {
130
+ val foundScrollView = findDeepestScrollViewForMotionEvent(view.getChildAt(i), ev, false)
131
+ if (foundScrollView != null) {
132
+ return foundScrollView
133
+ }
134
+ }
135
+ }
136
+
137
+ return null
138
+ }
139
+ }
140
+
141
+ private var scrollXAfterMeasure = NO_SCROLL_POSITION
142
+
143
+ private val onScrollDispatchHelper = OnScrollDispatchHelper()
144
+ private val scroller: OverScroller? = getOverScrollerFromParent()
145
+ private val velocityHelper = VelocityHelper()
146
+ private val tempRect = Rect()
147
+ private val defaultFlingAnimator: ValueAnimator = ObjectAnimator.ofInt(this, "scrollX", 0, 0)
148
+
149
+ // Backing fields for interface properties with custom logic
150
+ private var _overflowInset = Rect()
151
+ private var _virtualViewContainerState: VirtualViewContainerState? = null
152
+ private var _removeClippedSubviews = false
153
+ private var _reactScrollViewScrollState = ReactScrollViewScrollState()
154
+
155
+ // Private state
156
+ private var activelyScrolling = false
157
+ private var clippingRect: Rect? = null
158
+ private var _overflow: Overflow =
159
+ if (ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid()) Overflow.VISIBLE
160
+ else Overflow.SCROLL
161
+ private var dragging = false
162
+ private var pagingEnabled = false
163
+ private var postTouchRunnable: Runnable? = null
164
+ private var sendMomentumEvents = false
165
+ private var scrollPerfTag: String? = null
166
+ private var endBackground: Drawable? = null
167
+ private var endFillColor = Color.TRANSPARENT
168
+ private var disableIntervalMomentum = false
169
+ private var snapInterval = 0
170
+ private var snapOffsets: List<Int>? = null
171
+ private var snapToStart = true
172
+ private var snapToEnd = true
173
+ private var snapToAlignment = SNAP_ALIGNMENT_DISABLED
174
+ private var pagedArrowScrolling = false
175
+ private var pendingContentOffsetX = UNSET_CONTENT_OFFSET
176
+ private var pendingContentOffsetY = UNSET_CONTENT_OFFSET
177
+ public open var pointerEvents: PointerEvents = PointerEvents.AUTO
178
+ private var contentView: View? = null
179
+ private var maintainVisibleContentPositionHelper:
180
+ MaintainVisibleScrollPositionHelper<ReactHorizontalScrollView>? =
181
+ null
182
+ public open var fadingEdgeLengthStart: Int = 0
183
+ set(value) {
184
+ field = value
185
+ invalidate()
186
+ }
187
+
188
+ public open var fadingEdgeLengthEnd: Int = 0
189
+ set(value) {
190
+ field = value
191
+ invalidate()
192
+ }
193
+
194
+ private var emittedOverScrollSinceScrollBegin = false
195
+ private var scrollsChildToFocus = true
196
+
197
+ // Interface property overrides
198
+ override var scrollEnabled: Boolean = true
199
+ override var stateWrapper: StateWrapper? = null
200
+ override var scrollEventThrottle: Int = 0
201
+ override var lastScrollDispatchTime: Long = 0L
202
+ override var hasChildPressedStateDelay: Boolean? = null
203
+
204
+ override val virtualViewContainerState: VirtualViewContainerState
205
+ get() =
206
+ _virtualViewContainerState
207
+ ?: VirtualViewContainerState.create(this).also { _virtualViewContainerState = it }
208
+
209
+ override val overflowInset: Rect
210
+ get() = _overflowInset
211
+
212
+ override val overflow: String?
213
+ get() =
214
+ when (_overflow) {
215
+ Overflow.HIDDEN -> "hidden"
216
+ Overflow.SCROLL -> "scroll"
217
+ Overflow.VISIBLE -> "visible"
218
+ }
219
+
220
+ override var removeClippedSubviews: Boolean
221
+ get() = _removeClippedSubviews
222
+ set(value) {
223
+ if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) return
224
+ if (value && clippingRect == null) clippingRect = Rect()
225
+ _removeClippedSubviews = value
226
+ updateClippingRect()
227
+ }
228
+
229
+ override var reactScrollViewScrollState: ReactScrollViewScrollState
230
+ get() = _reactScrollViewScrollState
231
+ set(value) {
232
+ _reactScrollViewScrollState = value
233
+ if (
234
+ ReactNativeFeatureFlags.enableViewCulling() ||
235
+ ReactNativeFeatureFlags.useTraitHiddenOnAndroid()
236
+ ) {
237
+ val scrollPosition = value.lastStateUpdateScroll
238
+ restoreScrollTo(scrollPosition.x, scrollPosition.y)
239
+ }
240
+ }
241
+
242
+ init {
243
+ ViewCompat.setAccessibilityDelegate(this, ReactScrollViewAccessibilityDelegate())
244
+ setOnHierarchyChangeListener(this)
245
+ setClipChildren(false)
246
+ initView()
247
+ }
248
+
249
+ /**
250
+ * Set all default values here as opposed to in the constructor or field defaults. It is important
251
+ * that these properties are set during the constructor, but also on-demand whenever an existing
252
+ * ReactHorizontalScrollView is recycled.
253
+ */
254
+ private fun initView() {
255
+ _overflowInset = Rect()
256
+ _virtualViewContainerState = null
257
+ activelyScrolling = false
258
+ clippingRect = null
259
+ _overflow =
260
+ if (ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid()) Overflow.VISIBLE
261
+ else Overflow.SCROLL
262
+ dragging = false
263
+ pagingEnabled = false
264
+ postTouchRunnable = null
265
+ _removeClippedSubviews = false
266
+ scrollEnabled = true
267
+ sendMomentumEvents = false
268
+ scrollPerfTag = null
269
+ endBackground = null
270
+ endFillColor = Color.TRANSPARENT
271
+ disableIntervalMomentum = false
272
+ snapInterval = 0
273
+ snapOffsets = null
274
+ snapToStart = true
275
+ snapToEnd = true
276
+ snapToAlignment = SNAP_ALIGNMENT_DISABLED
277
+ pagedArrowScrolling = false
278
+ pendingContentOffsetX = UNSET_CONTENT_OFFSET
279
+ pendingContentOffsetY = UNSET_CONTENT_OFFSET
280
+ stateWrapper = null
281
+ _reactScrollViewScrollState = ReactScrollViewScrollState()
282
+ pointerEvents = PointerEvents.AUTO
283
+ lastScrollDispatchTime = 0
284
+ scrollEventThrottle = 0
285
+ contentView = null
286
+ maintainVisibleContentPositionHelper = null
287
+ fadingEdgeLengthStart = 0
288
+ fadingEdgeLengthEnd = 0
289
+ emittedOverScrollSinceScrollBegin = false
290
+ scrollsChildToFocus = true
291
+ }
292
+
293
+ internal fun recycleView() {
294
+ initView()
295
+ if (parent != null) {
296
+ (parent as ViewGroup).removeView(this)
297
+ }
298
+ updateView()
299
+ }
300
+
301
+ private fun updateView() {}
302
+
303
+ override fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo) {
304
+ super.onInitializeAccessibilityNodeInfo(info)
305
+ val testId = getTag(R.id.react_test_id) as? String
306
+ if (testId != null) {
307
+ info.viewIdResourceName = testId
308
+ }
309
+ }
310
+
311
+ override fun canScrollHorizontally(direction: Int): Boolean {
312
+ return scrollEnabled && super.canScrollHorizontally(direction)
313
+ }
314
+
315
+ private fun getOverScrollerFromParent(): OverScroller? {
316
+ if (!triedToGetScrollerField) {
317
+ triedToGetScrollerField = true
318
+ try {
319
+ scrollerField = HorizontalScrollView::class.java.getDeclaredField("mScroller")
320
+ scrollerField?.isAccessible = true
321
+ } catch (e: NoSuchFieldException) {
322
+ FLog.w(
323
+ TAG,
324
+ "Failed to get mScroller field for HorizontalScrollView! " +
325
+ "This app will exhibit the bounce-back scrolling bug :(",
326
+ )
327
+ }
328
+ }
329
+
330
+ val field = scrollerField ?: return null
331
+ return try {
332
+ val scrollerValue = field.get(this)
333
+ if (scrollerValue is OverScroller) {
334
+ scrollerValue
335
+ } else {
336
+ FLog.w(
337
+ TAG,
338
+ "Failed to cast mScroller field in HorizontalScrollView (probably due to OEM changes" +
339
+ " to AOSP)! This app will exhibit the bounce-back scrolling bug :(",
340
+ )
341
+ null
342
+ }
343
+ } catch (e: IllegalAccessException) {
344
+ throw RuntimeException("Failed to get mScroller from HorizontalScrollView!", e)
345
+ }
346
+ }
347
+
348
+ public open fun setScrollPerfTag(scrollPerfTag: String?) {
349
+ this.scrollPerfTag = scrollPerfTag
350
+ }
351
+
352
+ public open fun setDisableIntervalMomentum(disableIntervalMomentum: Boolean) {
353
+ this.disableIntervalMomentum = disableIntervalMomentum
354
+ }
355
+
356
+ public open fun setSendMomentumEvents(sendMomentumEvents: Boolean) {
357
+ this.sendMomentumEvents = sendMomentumEvents
358
+ }
359
+
360
+ public open fun setPagingEnabled(pagingEnabled: Boolean) {
361
+ this.pagingEnabled = pagingEnabled
362
+ }
363
+
364
+ public open fun setScrollsChildToFocus(scrollsChildToFocus: Boolean) {
365
+ this.scrollsChildToFocus = scrollsChildToFocus
366
+ }
367
+
368
+ public open fun setDecelerationRate(decelerationRate: Float) {
369
+ reactScrollViewScrollState.decelerationRate = decelerationRate
370
+ scroller?.setFriction(1.0f - decelerationRate)
371
+ }
372
+
373
+ public open fun abortAnimation() {
374
+ if (scroller != null && !scroller.isFinished) {
375
+ scroller.abortAnimation()
376
+ }
377
+ }
378
+
379
+ public open fun setSnapInterval(snapInterval: Int) {
380
+ this.snapInterval = snapInterval
381
+ }
382
+
383
+ public open fun setSnapOffsets(snapOffsets: List<Int>?) {
384
+ this.snapOffsets = snapOffsets
385
+ }
386
+
387
+ public open fun setSnapToStart(snapToStart: Boolean) {
388
+ this.snapToStart = snapToStart
389
+ }
390
+
391
+ public open fun setSnapToEnd(snapToEnd: Boolean) {
392
+ this.snapToEnd = snapToEnd
393
+ }
394
+
395
+ public open fun setSnapToAlignment(snapToAlignment: Int) {
396
+ this.snapToAlignment = snapToAlignment
397
+ }
398
+
399
+ public open fun flashScrollIndicators() {
400
+ awakenScrollBars()
401
+ }
402
+
403
+ override fun getLeftFadingEdgeStrength(): Float {
404
+ val max = max(fadingEdgeLengthStart.toFloat(), fadingEdgeLengthEnd.toFloat())
405
+ val value =
406
+ if (layoutDirection == LAYOUT_DIRECTION_RTL) fadingEdgeLengthEnd else fadingEdgeLengthStart
407
+ return value / max
408
+ }
409
+
410
+ override fun getRightFadingEdgeStrength(): Float {
411
+ val max = max(fadingEdgeLengthStart.toFloat(), fadingEdgeLengthEnd.toFloat())
412
+ val value =
413
+ if (layoutDirection == LAYOUT_DIRECTION_RTL) fadingEdgeLengthStart else fadingEdgeLengthEnd
414
+ return value / max
415
+ }
416
+
417
+ public open fun setOverflow(overflow: String?) {
418
+ _overflow =
419
+ if (overflow == null) {
420
+ Overflow.SCROLL
421
+ } else {
422
+ Overflow.fromString(overflow)
423
+ ?: if (ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid())
424
+ Overflow.VISIBLE
425
+ else Overflow.SCROLL
426
+ }
427
+ invalidate()
428
+ }
429
+
430
+ internal open fun setMaintainVisibleContentPosition(
431
+ config: MaintainVisibleScrollPositionHelper.Config?
432
+ ) {
433
+ if (config != null && maintainVisibleContentPositionHelper == null) {
434
+ val helper = MaintainVisibleScrollPositionHelper(this, true)
435
+ maintainVisibleContentPositionHelper = helper
436
+ helper.start()
437
+ } else if (config == null) {
438
+ maintainVisibleContentPositionHelper?.stop()
439
+ maintainVisibleContentPositionHelper = null
440
+ }
441
+ maintainVisibleContentPositionHelper?.let { it.config = config }
442
+ }
443
+
444
+ override fun setOverflowInset(left: Int, top: Int, right: Int, bottom: Int) {
445
+ _overflowInset.set(left, top, right, bottom)
446
+ }
447
+
448
+ public override fun onDraw(canvas: Canvas) {
449
+ if (_overflow != Overflow.VISIBLE) {
450
+ BackgroundStyleApplicator.clipToPaddingBox(this, canvas)
451
+ }
452
+ super.onDraw(canvas)
453
+ }
454
+
455
+ override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
456
+ MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec)
457
+
458
+ val measuredWidth = MeasureSpec.getSize(widthMeasureSpec)
459
+ val measuredHeight = MeasureSpec.getSize(heightMeasureSpec)
460
+
461
+ if (DEBUG_MODE) {
462
+ FLog.i(
463
+ TAG,
464
+ "onMeasure[%d] measured width: %d measured height: %d",
465
+ id,
466
+ measuredWidth,
467
+ measuredHeight,
468
+ )
469
+ }
470
+
471
+ val measuredHeightChanged = getMeasuredHeight() != measuredHeight
472
+
473
+ setMeasuredDimension(measuredWidth, measuredHeight)
474
+
475
+ // See how `scrollXAfterMeasure` is used in `onLayout`, and why we only enable the
476
+ // hack if the height has changed.
477
+ if (measuredHeightChanged && scroller != null) {
478
+ scrollXAfterMeasure = scroller.currX
479
+ }
480
+ }
481
+
482
+ override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
483
+ if (DEBUG_MODE) {
484
+ FLog.i(TAG, "onLayout[%d] l %d t %d r %d b %d", id, l, t, r, b)
485
+ }
486
+
487
+ // Has the scrollX changed between the last onMeasure and this layout?
488
+ // If so, cancel the animation.
489
+ // Essentially, if the height changes (due to keyboard popping up, for instance) the
490
+ // underlying View.layout method will in some cases scroll to an incorrect X position -
491
+ // see also the hacks in `fling`. The order of layout is called in the order of: onMeasure,
492
+ // layout, onLayout.
493
+ // We cannot override `layout` but we can detect the sequence of events between onMeasure
494
+ // and onLayout.
495
+ if (
496
+ scrollXAfterMeasure != NO_SCROLL_POSITION &&
497
+ scroller != null &&
498
+ scrollXAfterMeasure != scroller.finalX &&
499
+ !scroller.isFinished
500
+ ) {
501
+ if (DEBUG_MODE) {
502
+ FLog.i(
503
+ TAG,
504
+ "onLayout[%d] scroll hack enabled: reset to previous scrollX position of %d",
505
+ id,
506
+ scrollXAfterMeasure,
507
+ )
508
+ }
509
+ scroller.startScroll(scrollXAfterMeasure, scroller.finalY, 0, 0)
510
+ scroller.forceFinished(true)
511
+ scrollXAfterMeasure = NO_SCROLL_POSITION
512
+ }
513
+
514
+ // Apply pending contentOffset in case it was set before the view was laid out.
515
+ if (isContentReady()) {
516
+ val scrollToX =
517
+ if (pendingContentOffsetX != UNSET_CONTENT_OFFSET) pendingContentOffsetX else scrollX
518
+ val scrollToY =
519
+ if (pendingContentOffsetY != UNSET_CONTENT_OFFSET) pendingContentOffsetY else scrollY
520
+ scrollTo(scrollToX, scrollToY)
521
+ }
522
+
523
+ ReactScrollViewHelper.emitLayoutEvent(this)
524
+ _virtualViewContainerState?.updateState()
525
+ }
526
+
527
+ /**
528
+ * Since ReactHorizontalScrollView handles layout changes on JS side, it does not call
529
+ * super.onLayout due to which mIsLayoutDirty flag in HorizontalScrollView remains true and
530
+ * prevents scrolling to child when requestChildFocus is called. Overriding this method and
531
+ * scrolling to child without checking any layout dirty flag. This will fix focus navigation issue
532
+ * for KeyEvents which are not handled in HorizontalScrollView, for example: KEYCODE_TAB.
533
+ */
534
+ override fun requestChildFocus(child: View, focused: View?) {
535
+ if (focused != null && !pagingEnabled && scrollsChildToFocus) {
536
+ scrollToChild(focused)
537
+ }
538
+ requestChildFocusWithoutScroll(child, focused)
539
+ }
540
+
541
+ /**
542
+ * In rare cases where an app overrides the built-in ReactScrollView by overriding it, and also
543
+ * needs to customize scroll into view on focus behaviors, this protected method can be used to
544
+ * unblock such customization.
545
+ */
546
+ protected open fun requestChildFocusWithoutScroll(child: View, focused: View?) {
547
+ super.requestChildFocus(child, focused)
548
+ }
549
+
550
+ override fun requestChildRectangleOnScreen(
551
+ child: View,
552
+ rectangle: Rect,
553
+ immediate: Boolean,
554
+ ): Boolean {
555
+ if (!scrollsChildToFocus) return false
556
+ return super.requestChildRectangleOnScreen(child, rectangle, immediate)
557
+ }
558
+
559
+ override fun addFocusables(views: ArrayList<View>, direction: Int, focusableMode: Int) {
560
+ if (pagingEnabled && !pagedArrowScrolling) {
561
+ // Only add elements within the current page to list of focusables
562
+ val candidateViews = ArrayList<View>()
563
+ super.addFocusables(candidateViews, direction, focusableMode)
564
+ for (candidate in candidateViews) {
565
+ // We must also include the currently focused in the focusables list or focus search will
566
+ // always return the first element within the focusables list
567
+ if (
568
+ isScrolledInView(candidate) ||
569
+ isPartiallyScrolledInView(candidate) ||
570
+ candidate.isFocused
571
+ ) {
572
+ views.add(candidate)
573
+ }
574
+ }
575
+ } else {
576
+ super.addFocusables(views, direction, focusableMode)
577
+ }
578
+ }
579
+
580
+ /** Calculates the x delta required to scroll the given descendent into view */
581
+ private fun getScrollDelta(descendent: View): Int {
582
+ descendent.getDrawingRect(tempRect)
583
+ offsetDescendantRectToMyCoords(descendent, tempRect)
584
+ return computeScrollDeltaToGetChildRectOnScreen(tempRect)
585
+ }
586
+
587
+ /** Returns whether the given descendent is scrolled fully in view */
588
+ private fun isScrolledInView(descendent: View): Boolean {
589
+ return getScrollDelta(descendent) == 0
590
+ }
591
+
592
+ override fun isPartiallyScrolledInView(view: View): Boolean {
593
+ val scrollDelta = getScrollDelta(view)
594
+ view.getDrawingRect(tempRect)
595
+ return scrollDelta != 0 && abs(scrollDelta) < tempRect.width()
596
+ }
597
+
598
+ /** Returns whether the given descendent is "mostly" (>50%) scrolled in view */
599
+ private fun isMostlyScrolledInView(descendent: View): Boolean {
600
+ val scrollDelta = getScrollDelta(descendent)
601
+ descendent.getDrawingRect(tempRect)
602
+ return scrollDelta != 0 && abs(scrollDelta) < (tempRect.width() / 2)
603
+ }
604
+
605
+ private fun scrollToChild(child: View) {
606
+ val scrollDelta = getScrollDelta(child)
607
+ if (scrollDelta != 0) {
608
+ scrollBy(scrollDelta, 0)
609
+ }
610
+ }
611
+
612
+ override fun onScrollChanged(x: Int, y: Int, oldX: Int, oldY: Int) {
613
+ if (DEBUG_MODE) {
614
+ FLog.i(TAG, "onScrollChanged[%d] x %d y %d oldx %d oldy %d", id, x, y, oldX, oldY)
615
+ }
616
+
617
+ Systrace.beginSection(Systrace.TRACE_TAG_REACT, "ReactHorizontalScrollView.onScrollChanged")
618
+ try {
619
+ super.onScrollChanged(x, y, oldX, oldY)
620
+ activelyScrolling = true
621
+ if (onScrollDispatchHelper.onScrollChanged(x, y)) {
622
+ if (_removeClippedSubviews) {
623
+ updateClippingRect()
624
+ }
625
+ ReactScrollViewHelper.updateStateOnScrollChanged(
626
+ this,
627
+ onScrollDispatchHelper.xFlingVelocity,
628
+ onScrollDispatchHelper.yFlingVelocity,
629
+ )
630
+ _virtualViewContainerState?.updateState()
631
+ }
632
+ } finally {
633
+ Systrace.endSection(Systrace.TRACE_TAG_REACT)
634
+ }
635
+ }
636
+
637
+ override fun shouldDelayChildPressedState(): Boolean =
638
+ hasChildPressedStateDelay ?: super.shouldDelayChildPressedState()
639
+
640
+ override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
641
+ if (!scrollEnabled) return false
642
+
643
+ if (
644
+ ev.action == MotionEvent.ACTION_DOWN &&
645
+ findDeepestScrollViewForMotionEvent(this, ev) != null
646
+ ) {
647
+ return false
648
+ }
649
+
650
+ // We intercept the touch event if the children are not supposed to receive it.
651
+ if (!PointerEvents.canChildrenBeTouchTarget(pointerEvents)) return true
652
+
653
+ try {
654
+ if (super.onInterceptTouchEvent(ev)) {
655
+ handleInterceptedTouchEvent(ev)
656
+ return true
657
+ }
658
+ } catch (e: IllegalArgumentException) {
659
+ // Log and ignore the error. This seems to be a bug in the android SDK and
660
+ // this is the commonly accepted workaround.
661
+ // https://tinyurl.com/mw6qkod (Stack Overflow)
662
+ FLog.w(ReactConstants.TAG, "Error intercepting touch event.", e)
663
+ }
664
+
665
+ return false
666
+ }
667
+
668
+ protected open fun handleInterceptedTouchEvent(ev: MotionEvent) {
669
+ if (!ReactNativeFeatureFlags.shouldTriggerResponderTransferOnScrollAndroid()) {
670
+ NativeGestureUtil.notifyNativeGestureStarted(this, ev)
671
+ }
672
+ ReactScrollViewHelper.emitScrollBeginDragEvent(this)
673
+ dragging = true
674
+ emittedOverScrollSinceScrollBegin = false
675
+ enableFpsListener()
676
+ getFlingAnimator().cancel()
677
+ }
678
+
679
+ override fun pageScroll(direction: Int): Boolean {
680
+ val handled = super.pageScroll(direction)
681
+ if (pagingEnabled && handled) {
682
+ handlePostTouchScrolling(0, 0)
683
+ }
684
+ return handled
685
+ }
686
+
687
+ private fun isDescendantOf(parent: View?, view: View?): Boolean {
688
+ if (view == null || parent == null) return false
689
+ var p: ViewParent? = view.parent
690
+ while (p != null && p.parent != null) {
691
+ if (p === parent) return true
692
+ p = p.parent
693
+ }
694
+ return false
695
+ }
696
+
697
+ override fun arrowScroll(direction: Int): Boolean {
698
+ var handled = false
699
+
700
+ if (pagingEnabled) {
701
+ pagedArrowScrolling = true
702
+
703
+ if (isNotEmpty()) {
704
+ val currentFocused = findFocus()
705
+ val nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction)
706
+ val rootChild = getContentView()
707
+ if (nextFocused != null && isDescendantOf(rootChild, nextFocused)) {
708
+ if (!isScrolledInView(nextFocused) && !isMostlyScrolledInView(nextFocused)) {
709
+ smoothScrollToNextPage(direction)
710
+ }
711
+ nextFocused.requestFocus()
712
+ handled = true
713
+ } else {
714
+ smoothScrollToNextPage(direction)
715
+ handled = true
716
+ }
717
+ }
718
+
719
+ pagedArrowScrolling = false
720
+ } else {
721
+ handled = super.arrowScroll(direction)
722
+ }
723
+
724
+ return handled
725
+ }
726
+
727
+ override fun onTouchEvent(ev: MotionEvent): Boolean {
728
+ if (!scrollEnabled) return false
729
+
730
+ // We do not accept the touch event if this view is not supposed to receive it.
731
+ if (!PointerEvents.canBeTouchTarget(pointerEvents)) return false
732
+
733
+ velocityHelper.calculateVelocity(ev)
734
+ val action = ev.actionMasked
735
+ if (action == MotionEvent.ACTION_UP && dragging) {
736
+ ReactScrollViewHelper.updateFabricScrollState(this)
737
+
738
+ val velocityX = velocityHelper.xVelocity
739
+ val velocityY = velocityHelper.yVelocity
740
+ ReactScrollViewHelper.emitScrollEndDragEvent(this, velocityX, velocityY)
741
+ if (!ReactNativeFeatureFlags.shouldTriggerResponderTransferOnScrollAndroid()) {
742
+ NativeGestureUtil.notifyNativeGestureEnded(this, ev)
743
+ }
744
+ dragging = false
745
+ // After the touch finishes, we may need to do some scrolling afterwards either as a result
746
+ // of a fling or because we need to page align the content
747
+ handlePostTouchScrolling(Math.round(velocityX), Math.round(velocityY))
748
+ }
749
+
750
+ if (action == MotionEvent.ACTION_DOWN) {
751
+ cancelPostTouchScrolling()
752
+ }
753
+
754
+ return try {
755
+ super.onTouchEvent(ev)
756
+ } catch (e: IllegalArgumentException) {
757
+ // Log and ignore the error. This seems to be a bug in the android SDK and
758
+ // this is the commonly accepted workaround.
759
+ // https://tinyurl.com/mw6qkod (Stack Overflow)
760
+ FLog.w(ReactConstants.TAG, "Error handling touch event.", e)
761
+ false
762
+ }
763
+ }
764
+
765
+ override fun dispatchGenericMotionEvent(ev: MotionEvent): Boolean {
766
+ // Ignore generic motion events (joystick, mouse wheel, trackpad) if scrolling is disabled
767
+ if (!scrollEnabled) return false
768
+
769
+ // We do not dispatch the motion event if its children are not supposed to receive it
770
+ if (!PointerEvents.canChildrenBeTouchTarget(pointerEvents)) return false
771
+
772
+ // Handle ACTION_SCROLL events (mouse wheel, trackpad, joystick)
773
+ if (ev.actionMasked == MotionEvent.ACTION_SCROLL) {
774
+ val hScroll = ev.getAxisValue(MotionEvent.AXIS_HSCROLL)
775
+ if (hScroll != 0f) {
776
+ // Perform the scroll
777
+ enableFpsListener()
778
+ val result = super.dispatchGenericMotionEvent(ev)
779
+ // Schedule snap alignment to run after scrolling stops
780
+ if (
781
+ result &&
782
+ (pagingEnabled ||
783
+ snapInterval != 0 ||
784
+ snapOffsets != null ||
785
+ snapToAlignment != SNAP_ALIGNMENT_DISABLED)
786
+ ) {
787
+ // Cancel any pending post-touch runnable and reschedule
788
+ if (postTouchRunnable != null) {
789
+ removeCallbacks(postTouchRunnable)
790
+ postTouchRunnable = null
791
+ }
792
+ postTouchRunnable = Runnable {
793
+ postTouchRunnable = null
794
+ // +1/-1 velocity if scrolling right or left. This is to ensure that the
795
+ // next/previous page is picked rather than sliding backwards to the current page
796
+ var velocityX = hScroll.sign.toInt()
797
+ if (disableIntervalMomentum) {
798
+ velocityX = 0
799
+ }
800
+ flingAndSnap(velocityX)
801
+ handlePostTouchScrolling(velocityX, 0)
802
+ }
803
+ postOnAnimationDelayed(postTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY)
804
+ } else {
805
+ handlePostTouchScrolling(0, 0)
806
+ }
807
+ return result
808
+ }
809
+ }
810
+
811
+ return super.dispatchGenericMotionEvent(ev)
812
+ }
813
+
814
+ override fun executeKeyEvent(event: KeyEvent): Boolean {
815
+ val eventKeyCode = event.keyCode
816
+ if (
817
+ !scrollEnabled &&
818
+ (eventKeyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
819
+ eventKeyCode == KeyEvent.KEYCODE_DPAD_RIGHT)
820
+ ) {
821
+ return false
822
+ }
823
+ return super.executeKeyEvent(event)
824
+ }
825
+
826
+ override fun fling(velocityX: Int) {
827
+ if (DEBUG_MODE) {
828
+ FLog.i(TAG, "fling[%d] velocityX %d", id, velocityX)
829
+ }
830
+
831
+ // Workaround.
832
+ // On Android P if a ScrollView is inverted, we will get a wrong sign for
833
+ // velocityX (see https://issuetracker.google.com/issues/112385925).
834
+ // At the same time, onScrollDispatchHelper tracks the correct velocity direction.
835
+ //
836
+ // Hence, we can use the absolute value from whatever the OS gives
837
+ // us and use the sign of what onScrollDispatchHelper has tracked.
838
+ val correctedVelocityX =
839
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.P) {
840
+ (abs(velocityX) * onScrollDispatchHelper.xFlingVelocity.sign).toInt()
841
+ } else {
842
+ velocityX
843
+ }
844
+
845
+ if (pagingEnabled) {
846
+ flingAndSnap(correctedVelocityX)
847
+ } else if (scroller != null) {
848
+ // FB SCROLLVIEW CHANGE
849
+
850
+ // We provide our own version of fling that uses a different call to the standard OverScroller
851
+ // which takes into account the possibility of adding new content while the ScrollView is
852
+ // animating. Because we give essentially no max X for the fling, the fling will continue as
853
+ // long as there is content. See onOverScrolled() to see the second part of this change which
854
+ // properly aborts the scroller animation when we get to the bottom of the ScrollView content.
855
+
856
+ val scrollWindowWidth = width - paddingStart - paddingEnd
857
+
858
+ scroller.fling(
859
+ scrollX, // startX
860
+ scrollY, // startY
861
+ correctedVelocityX, // velocityX
862
+ 0, // velocityY
863
+ 0, // minX
864
+ Int.MAX_VALUE, // maxX
865
+ 0, // minY
866
+ 0, // maxY
867
+ scrollWindowWidth / 2, // overX
868
+ 0, // overY
869
+ )
870
+
871
+ postInvalidateOnAnimation()
872
+
873
+ // END FB SCROLLVIEW CHANGE
874
+ } else {
875
+ super.fling(correctedVelocityX)
876
+ }
877
+ handlePostTouchScrolling(correctedVelocityX, 0)
878
+ }
879
+
880
+ override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
881
+ super.onSizeChanged(w, h, oldw, oldh)
882
+ if (_removeClippedSubviews) {
883
+ updateClippingRect()
884
+ }
885
+ _virtualViewContainerState?.updateState()
886
+ }
887
+
888
+ override fun onAttachedToWindow() {
889
+ super.onAttachedToWindow()
890
+ if (_removeClippedSubviews) {
891
+ updateClippingRect()
892
+ }
893
+ maintainVisibleContentPositionHelper?.start()
894
+ }
895
+
896
+ override fun onDetachedFromWindow() {
897
+ super.onDetachedFromWindow()
898
+ maintainVisibleContentPositionHelper?.stop()
899
+ }
900
+
901
+ override fun focusSearch(focused: View, @FocusDirection direction: Int): View? {
902
+ val nextFocus = super.focusSearch(focused, direction)
903
+
904
+ if (ReactNativeFeatureFlags.enableCustomFocusSearchOnClippedElementsAndroid()) {
905
+ // If we can find the next focus and it is a child of this view, return it, else it means we
906
+ // are leaving the scroll view and we should try to find a clipped element
907
+ if (nextFocus != null && findViewById<View>(nextFocus.id) != null) {
908
+ return nextFocus
909
+ }
910
+ val nextFocusableView = findNextFocusableView(this, focused, direction)
911
+ if (nextFocusableView != null) {
912
+ return nextFocusableView
913
+ }
914
+ }
915
+
916
+ return nextFocus
917
+ }
918
+
919
+ override fun updateClippingRect() {
920
+ updateClippingRect(null)
921
+ }
922
+
923
+ override fun updateClippingRect(excludedViews: Set<Int>?) {
924
+ if (!_removeClippedSubviews) return
925
+
926
+ Systrace.beginSection(Systrace.TRACE_TAG_REACT, "ReactHorizontalScrollView.updateClippingRect")
927
+ try {
928
+ val rect = checkNotNull(clippingRect)
929
+ ReactClippingViewGroupHelper.calculateClippingRect(this, rect)
930
+ val cv = getContentView()
931
+ if (cv is ReactClippingViewGroup) {
932
+ cv.updateClippingRect(excludedViews)
933
+ }
934
+ } finally {
935
+ Systrace.endSection(Systrace.TRACE_TAG_REACT)
936
+ }
937
+ }
938
+
939
+ override fun getClippingRect(outClippingRect: Rect) {
940
+ outClippingRect.set(checkNotNull(clippingRect))
941
+ }
942
+
943
+ override fun getChildVisibleRect(child: View, r: Rect, offset: android.graphics.Point?): Boolean {
944
+ return super.getChildVisibleRect(child, r, offset)
945
+ }
946
+
947
+ private fun getSnapInterval(): Int = if (snapInterval != 0) snapInterval else width
948
+
949
+ private fun getContentView(): View? = getChildAt(0)
950
+
951
+ public open fun setEndFillColor(color: Int) {
952
+ if (color != endFillColor) {
953
+ endFillColor = color
954
+ endBackground = endFillColor.toDrawable()
955
+ }
956
+ }
957
+
958
+ override fun onOverScrolled(scrollX: Int, scrollY: Int, clampedX: Boolean, clampedY: Boolean) {
959
+ if (DEBUG_MODE) {
960
+ FLog.i(
961
+ TAG,
962
+ "onOverScrolled[%d] scrollX %d scrollY %d clampedX %b clampedY %b",
963
+ id,
964
+ scrollX,
965
+ scrollY,
966
+ clampedX,
967
+ clampedY,
968
+ )
969
+ }
970
+
971
+ @Suppress("NAME_SHADOWING") var scrollX = scrollX
972
+
973
+ if (scroller != null) {
974
+ // FB SCROLLVIEW CHANGE
975
+
976
+ // This is part two of the reimplementation of fling to fix the bounce-back bug. See fling()
977
+ // for more information.
978
+
979
+ if (!scroller.isFinished && scroller.currX != scroller.finalX) {
980
+ val scrollRange = max(computeHorizontalScrollRange() - width, 0)
981
+ if (scrollX >= scrollRange) {
982
+ scroller.abortAnimation()
983
+ scrollX = scrollRange
984
+ }
985
+ }
986
+
987
+ // END FB SCROLLVIEW CHANGE
988
+ }
989
+
990
+ if (
991
+ ReactNativeFeatureFlags.shouldTriggerResponderTransferOnScrollAndroid() &&
992
+ clampedX &&
993
+ !emittedOverScrollSinceScrollBegin
994
+ ) {
995
+ ReactScrollViewHelper.emitScrollEvent(this, 0f, 0f)
996
+ emittedOverScrollSinceScrollBegin = true
997
+ }
998
+
999
+ super.onOverScrolled(scrollX, scrollY, clampedX, clampedY)
1000
+ }
1001
+
1002
+ override fun onChildViewAdded(parent: View, child: View) {
1003
+ contentView = child
1004
+ child.addOnLayoutChangeListener(this)
1005
+ }
1006
+
1007
+ override fun onChildViewRemoved(parent: View, child: View) {
1008
+ contentView?.removeOnLayoutChangeListener(this)
1009
+ contentView = null
1010
+ }
1011
+
1012
+ private fun enableFpsListener() {
1013
+ if (isScrollPerfLoggingEnabled()) {
1014
+ val listener = fpsListener ?: return
1015
+ val perfTag = scrollPerfTag.takeUnless { it.isNullOrEmpty() } ?: return
1016
+ listener.enable(perfTag)
1017
+ }
1018
+ }
1019
+
1020
+ private fun disableFpsListener() {
1021
+ if (isScrollPerfLoggingEnabled()) {
1022
+ val listener = fpsListener ?: return
1023
+ val perfTag = scrollPerfTag.takeUnless { it.isNullOrEmpty() } ?: return
1024
+ listener.disable(perfTag)
1025
+ }
1026
+ }
1027
+
1028
+ private fun isScrollPerfLoggingEnabled(): Boolean {
1029
+ return fpsListener != null && !scrollPerfTag.isNullOrEmpty()
1030
+ }
1031
+
1032
+ override fun draw(canvas: Canvas) {
1033
+ if (endFillColor != Color.TRANSPARENT) {
1034
+ val content = getContentView()
1035
+ val bg = endBackground
1036
+ if (bg != null && content != null && content.right < width) {
1037
+ bg.setBounds(content.right, 0, width, height)
1038
+ bg.draw(canvas)
1039
+ }
1040
+ }
1041
+ super.draw(canvas)
1042
+ }
1043
+
1044
+ /**
1045
+ * This handles any sort of scrolling that may occur after a touch is finished. This may be
1046
+ * momentum scrolling (fling) or because you have pagingEnabled on the scroll view. Because we
1047
+ * don't get any events from Android about this lifecycle, we do all our detection by creating a
1048
+ * runnable that checks if we scrolled in the last frame and if so assumes we are still scrolling.
1049
+ */
1050
+ private fun handlePostTouchScrolling(velocityX: Int, velocityY: Int) {
1051
+ if (DEBUG_MODE) {
1052
+ FLog.i(
1053
+ TAG,
1054
+ "handlePostTouchScrolling[%d] velocityX %d velocityY %d",
1055
+ id,
1056
+ velocityX,
1057
+ velocityY,
1058
+ )
1059
+ }
1060
+
1061
+ // Check if we are already handling this which may occur if this is called by both the touch up
1062
+ // and a fling call
1063
+ if (postTouchRunnable != null) return
1064
+
1065
+ if (sendMomentumEvents) {
1066
+ ReactScrollViewHelper.emitScrollMomentumBeginEvent(this, velocityX, velocityY)
1067
+ }
1068
+
1069
+ activelyScrolling = false
1070
+ postTouchRunnable =
1071
+ object : Runnable {
1072
+ private var snappingToPage = false
1073
+ private var stableFrames = 0
1074
+
1075
+ override fun run() {
1076
+ if (activelyScrolling) {
1077
+ // We are still scrolling.
1078
+ activelyScrolling = false
1079
+ stableFrames = 0
1080
+ this@ReactHorizontalScrollView.postOnAnimationDelayed(
1081
+ this,
1082
+ ReactScrollViewHelper.MOMENTUM_DELAY,
1083
+ )
1084
+ } else {
1085
+ // There has not been a scroll update since the last time this Runnable executed.
1086
+ ReactScrollViewHelper.updateFabricScrollState(this@ReactHorizontalScrollView)
1087
+
1088
+ // We keep checking for updates until the ScrollView has "stabilized" and hasn't
1089
+ // scrolled for N consecutive frames. This number is arbitrary: big enough to catch
1090
+ // a number of race conditions, but small enough to not cause perf regressions, etc.
1091
+ // In anecdotal testing, it seemed like a decent number.
1092
+ // Without this check, sometimes this Runnable stops executing too soon - it will
1093
+ // fire before the first scroll event of an animated scroll/fling, and stop
1094
+ // immediately.
1095
+ stableFrames++
1096
+
1097
+ if (stableFrames >= 3) {
1098
+ postTouchRunnable = null
1099
+ if (sendMomentumEvents) {
1100
+ ReactScrollViewHelper.emitScrollMomentumEndEvent(this@ReactHorizontalScrollView)
1101
+ }
1102
+ // Kotlin name is notifyUserDrivenScrollEnded; the _internal suffix is
1103
+ // only a @JvmName alias for Java callers.
1104
+ ReactScrollViewHelper.notifyUserDrivenScrollEnded(this@ReactHorizontalScrollView)
1105
+ disableFpsListener()
1106
+ } else {
1107
+ if (pagingEnabled && !snappingToPage) {
1108
+ // If we have pagingEnabled and we have not snapped to the page
1109
+ // we need to cause that scroll by asking for it
1110
+ snappingToPage = true
1111
+ flingAndSnap(0)
1112
+ }
1113
+ // The scrollview has not "stabilized" so we just post to check again a frame later
1114
+ this@ReactHorizontalScrollView.postOnAnimationDelayed(
1115
+ this,
1116
+ ReactScrollViewHelper.MOMENTUM_DELAY,
1117
+ )
1118
+ }
1119
+ }
1120
+ }
1121
+ }
1122
+ postOnAnimationDelayed(postTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY)
1123
+ }
1124
+
1125
+ private fun cancelPostTouchScrolling() {
1126
+ if (postTouchRunnable != null) {
1127
+ removeCallbacks(postTouchRunnable)
1128
+ postTouchRunnable = null
1129
+ getFlingAnimator().cancel()
1130
+ }
1131
+ }
1132
+
1133
+ private fun predictFinalScrollPosition(velocityX: Int): Int {
1134
+ // predict where a fling would end up so we can scroll to the nearest snap offset
1135
+ val maximumOffset = max(0, computeHorizontalScrollRange() - width)
1136
+ // TODO(T106335409): Existing prediction still uses overscroller. Consider change this to use
1137
+ // fling animator instead.
1138
+ return if (getFlingAnimator() === defaultFlingAnimator) {
1139
+ ReactScrollViewHelper.predictFinalScrollPosition(this, velocityX, 0, maximumOffset, 0).x
1140
+ } else {
1141
+ ReactScrollViewHelper.getNextFlingStartValue(
1142
+ this,
1143
+ scrollX,
1144
+ reactScrollViewScrollState.finalAnimatedPositionScroll.x,
1145
+ velocityX,
1146
+ ) + getFlingExtrapolatedDistance(velocityX)
1147
+ }
1148
+ }
1149
+
1150
+ /**
1151
+ * This will smooth scroll us to the nearest snap offset point. It currently just looks at where
1152
+ * the content is and slides to the nearest point. It is intended to be run after we are done
1153
+ * scrolling, and handling any momentum scrolling.
1154
+ */
1155
+ private fun smoothScrollAndSnap(velocity: Int) {
1156
+ if (DEBUG_MODE) {
1157
+ FLog.i(TAG, "smoothScrollAndSnap[%d] velocity %d", id, velocity)
1158
+ }
1159
+
1160
+ val interval = getSnapInterval().toDouble()
1161
+ val currentOffset =
1162
+ ReactScrollViewHelper.getNextFlingStartValue(
1163
+ this,
1164
+ scrollX,
1165
+ reactScrollViewScrollState.finalAnimatedPositionScroll.x,
1166
+ velocity,
1167
+ )
1168
+ .toDouble()
1169
+ val targetOffset = predictFinalScrollPosition(velocity).toDouble()
1170
+
1171
+ var previousPage = floor(currentOffset / interval).toInt()
1172
+ var nextPage = ceil(currentOffset / interval).toInt()
1173
+ var currentPage = round(currentOffset / interval).toInt()
1174
+ val targetPage = round(targetOffset / interval).toInt()
1175
+
1176
+ if (velocity > 0 && nextPage == previousPage) {
1177
+ nextPage++
1178
+ } else if (velocity < 0 && previousPage == nextPage) {
1179
+ previousPage--
1180
+ }
1181
+
1182
+ if (velocity > 0 && currentPage < nextPage && targetPage > previousPage) {
1183
+ currentPage = nextPage
1184
+ } else if (velocity < 0 && currentPage > previousPage && targetPage < nextPage) {
1185
+ currentPage = previousPage
1186
+ }
1187
+
1188
+ val finalTargetOffset = currentPage * interval
1189
+ if (finalTargetOffset != currentOffset) {
1190
+ activelyScrolling = true
1191
+ reactSmoothScrollTo(finalTargetOffset.toInt(), scrollY)
1192
+ }
1193
+ }
1194
+
1195
+ private fun flingAndSnap(velocityX: Int) {
1196
+ if (DEBUG_MODE) {
1197
+ FLog.i(TAG, "smoothScrollAndSnap[%d] velocityX %d", id, velocityX)
1198
+ }
1199
+
1200
+ if (isEmpty()) return
1201
+
1202
+ // pagingEnabled only allows snapping one interval at a time
1203
+ if (snapInterval == 0 && snapOffsets == null && snapToAlignment == SNAP_ALIGNMENT_DISABLED) {
1204
+ smoothScrollAndSnap(velocityX)
1205
+ return
1206
+ }
1207
+
1208
+ @Suppress("NAME_SHADOWING") var velocityX = velocityX
1209
+ val hasCustomizedFlingAnimator = getFlingAnimator() !== defaultFlingAnimator
1210
+ val maximumOffset = max(0, computeHorizontalScrollRange() - width)
1211
+ var targetOffset = predictFinalScrollPosition(velocityX)
1212
+ if (disableIntervalMomentum) {
1213
+ targetOffset = scrollX
1214
+ }
1215
+
1216
+ var smallerOffset = 0
1217
+ var largerOffset = maximumOffset
1218
+ var firstOffset = 0
1219
+ var lastOffset = maximumOffset
1220
+ val viewportWidth = width - paddingStart - paddingEnd
1221
+
1222
+ // offsets are from the right edge in RTL layouts
1223
+ if (layoutDirection == LAYOUT_DIRECTION_RTL) {
1224
+ targetOffset = maximumOffset - targetOffset
1225
+ velocityX = -velocityX
1226
+ }
1227
+
1228
+ // get the nearest snap points to the target offset
1229
+ val offsets = snapOffsets
1230
+ if (!offsets.isNullOrEmpty()) {
1231
+ firstOffset = offsets[0]
1232
+ lastOffset = offsets[offsets.size - 1]
1233
+
1234
+ for (i in offsets.indices) {
1235
+ val offset = offsets[i]
1236
+ if (offset <= targetOffset) {
1237
+ if (targetOffset - offset < targetOffset - smallerOffset) {
1238
+ smallerOffset = offset
1239
+ }
1240
+ }
1241
+ if (offset >= targetOffset) {
1242
+ if (offset - targetOffset < largerOffset - targetOffset) {
1243
+ largerOffset = offset
1244
+ }
1245
+ }
1246
+ }
1247
+ } else if (snapToAlignment != SNAP_ALIGNMENT_DISABLED) {
1248
+ if (snapInterval > 0) {
1249
+ val ratio = targetOffset.toDouble() / snapInterval
1250
+ smallerOffset =
1251
+ max(
1252
+ getItemStartOffset(
1253
+ snapToAlignment,
1254
+ (floor(ratio) * snapInterval).toInt(),
1255
+ snapInterval,
1256
+ viewportWidth,
1257
+ ),
1258
+ 0,
1259
+ )
1260
+ largerOffset =
1261
+ kotlin.math.min(
1262
+ getItemStartOffset(
1263
+ snapToAlignment,
1264
+ (ceil(ratio) * snapInterval).toInt(),
1265
+ snapInterval,
1266
+ viewportWidth,
1267
+ ),
1268
+ maximumOffset,
1269
+ )
1270
+ } else {
1271
+ val cv = getContentView() as? ViewGroup ?: return
1272
+ var smallerChildOffset = largerOffset
1273
+ var largerChildOffset = smallerOffset
1274
+ for (i in 0 until cv.childCount) {
1275
+ val item = cv.getChildAt(i)
1276
+ val itemStartOffset =
1277
+ getItemStartOffset(snapToAlignment, item.left, item.width, viewportWidth)
1278
+ if (itemStartOffset <= targetOffset) {
1279
+ if (targetOffset - itemStartOffset < targetOffset - smallerOffset) {
1280
+ smallerOffset = itemStartOffset
1281
+ }
1282
+ }
1283
+ if (itemStartOffset >= targetOffset) {
1284
+ if (itemStartOffset - targetOffset < largerOffset - targetOffset) {
1285
+ largerOffset = itemStartOffset
1286
+ }
1287
+ }
1288
+ smallerChildOffset = kotlin.math.min(smallerChildOffset, itemStartOffset)
1289
+ largerChildOffset = max(largerChildOffset, itemStartOffset)
1290
+ }
1291
+
1292
+ // For Recycler ViewGroup, the maximumOffset can be much larger than the total heights of
1293
+ // items in the layout. In this case snapping is not possible beyond the currently rendered
1294
+ // children.
1295
+ smallerOffset = max(smallerOffset, smallerChildOffset)
1296
+ largerOffset = kotlin.math.min(largerOffset, largerChildOffset)
1297
+ }
1298
+ } else {
1299
+ val interval = getSnapInterval().toDouble()
1300
+ val ratio = targetOffset.toDouble() / interval
1301
+ smallerOffset = (floor(ratio) * interval).toInt()
1302
+ largerOffset = kotlin.math.min((ceil(ratio) * interval).toInt(), maximumOffset)
1303
+ }
1304
+
1305
+ // Calculate the nearest offset
1306
+ val nearestOffset =
1307
+ if (abs(targetOffset - smallerOffset) < abs(largerOffset - targetOffset)) smallerOffset
1308
+ else largerOffset
1309
+
1310
+ // if scrolling after the last snap offset and snapping to the
1311
+ // end of the list is disabled, then we allow free scrolling
1312
+ var currentOffset = scrollX
1313
+ if (layoutDirection == LAYOUT_DIRECTION_RTL) {
1314
+ currentOffset = maximumOffset - currentOffset
1315
+ }
1316
+ if (!snapToEnd && targetOffset >= lastOffset) {
1317
+ if (currentOffset >= lastOffset) {
1318
+ // free scrolling
1319
+ } else {
1320
+ // snap to end
1321
+ targetOffset = lastOffset
1322
+ }
1323
+ } else if (!snapToStart && targetOffset <= firstOffset) {
1324
+ if (currentOffset <= firstOffset) {
1325
+ // free scrolling
1326
+ } else {
1327
+ // snap to beginning
1328
+ targetOffset = firstOffset
1329
+ }
1330
+ } else if (velocityX > 0) {
1331
+ if (!hasCustomizedFlingAnimator) {
1332
+ // The default animator requires boost on initial velocity as when snapping velocity can
1333
+ // feel sluggish for slow swipes
1334
+ velocityX += ((largerOffset - targetOffset) * 10.0).toInt()
1335
+ }
1336
+ targetOffset = largerOffset
1337
+ } else if (velocityX < 0) {
1338
+ if (!hasCustomizedFlingAnimator) {
1339
+ // The default animator requires boost on initial velocity as when snapping velocity can
1340
+ // feel sluggish for slow swipes
1341
+ velocityX -= ((targetOffset - smallerOffset) * 10.0).toInt()
1342
+ }
1343
+ targetOffset = smallerOffset
1344
+ } else {
1345
+ targetOffset = nearestOffset
1346
+ }
1347
+
1348
+ // Make sure the new offset isn't out of bounds
1349
+ targetOffset = kotlin.math.min(max(0, targetOffset), maximumOffset)
1350
+
1351
+ if (layoutDirection == LAYOUT_DIRECTION_RTL) {
1352
+ targetOffset = maximumOffset - targetOffset
1353
+ velocityX = -velocityX
1354
+ }
1355
+
1356
+ if (hasCustomizedFlingAnimator || scroller == null) {
1357
+ reactSmoothScrollTo(targetOffset, scrollY)
1358
+ } else {
1359
+ // smoothScrollTo will always scroll over 250ms which is often *waaay*
1360
+ // too short and will cause the scrolling to feel almost instant
1361
+ // try to manually interact with OverScroller instead
1362
+ // if velocity is 0 however, fling() won't work, so we want to use smoothScrollTo
1363
+ activelyScrolling = true
1364
+
1365
+ scroller.fling(
1366
+ scrollX, // startX
1367
+ scrollY, // startY
1368
+ // velocity = 0 doesn't work with fling() so we pretend there's a reasonable
1369
+ // initial velocity going on when a touch is released without any movement
1370
+ if (velocityX != 0) velocityX else targetOffset - scrollX, // velocityX
1371
+ 0, // velocityY
1372
+ // setting both minX and maxX to the same value will guarantee that we scroll to it
1373
+ // but using the standard fling-style easing rather than smoothScrollTo's 250ms animation
1374
+ targetOffset, // minX
1375
+ targetOffset, // maxX
1376
+ 0, // minY
1377
+ 0, // maxY
1378
+ // we only want to allow overscrolling if the final offset is at the very edge of the view
1379
+ if (targetOffset == 0 || targetOffset == maximumOffset) viewportWidth / 2 else 0, // overX
1380
+ 0, // overY
1381
+ )
1382
+
1383
+ postInvalidateOnAnimation()
1384
+ }
1385
+ }
1386
+
1387
+ private fun getItemStartOffset(
1388
+ snapToAlignment: Int,
1389
+ itemStartPosition: Int,
1390
+ itemWidth: Int,
1391
+ viewPortWidth: Int,
1392
+ ): Int =
1393
+ when (snapToAlignment) {
1394
+ SNAP_ALIGNMENT_CENTER -> itemStartPosition - (viewPortWidth - itemWidth) / 2
1395
+ SNAP_ALIGNMENT_START -> itemStartPosition
1396
+ SNAP_ALIGNMENT_END -> itemStartPosition - (viewPortWidth - itemWidth)
1397
+ else ->
1398
+ throw IllegalStateException("Invalid SnapToAlignment value: ${this.snapToAlignment}")
1399
+ }
1400
+
1401
+ private fun smoothScrollToNextPage(direction: Int) {
1402
+ if (DEBUG_MODE) {
1403
+ FLog.i(TAG, "smoothScrollToNextPage[%d] direction %d", id, direction)
1404
+ }
1405
+
1406
+ val w = width
1407
+ val currentX = scrollX
1408
+
1409
+ var page = currentX / w
1410
+ if (currentX % w != 0) {
1411
+ page++
1412
+ }
1413
+
1414
+ if (direction == View.FOCUS_LEFT) {
1415
+ page -= 1
1416
+ } else {
1417
+ page += 1
1418
+ }
1419
+
1420
+ if (page < 0) {
1421
+ page = 0
1422
+ }
1423
+
1424
+ reactSmoothScrollTo(page * w, scrollY)
1425
+ handlePostTouchScrolling(0, 0)
1426
+ }
1427
+
1428
+ override fun setBackgroundColor(color: Int) {
1429
+ BackgroundStyleApplicator.setBackgroundColor(this, color)
1430
+ }
1431
+
1432
+ public open fun setBorderWidth(position: Int, width: Float) {
1433
+ BackgroundStyleApplicator.setBorderWidth(
1434
+ this,
1435
+ LogicalEdge.entries[position],
1436
+ PixelUtil.toDIPFromPixel(width),
1437
+ )
1438
+ }
1439
+
1440
+ public open fun setBorderColor(position: Int, color: Int?) {
1441
+ BackgroundStyleApplicator.setBorderColor(this, LogicalEdge.entries[position], color)
1442
+ }
1443
+
1444
+ public open fun setBorderRadius(borderRadius: Float) {
1445
+ setBorderRadius(borderRadius, BorderRadiusProp.BORDER_RADIUS.ordinal)
1446
+ }
1447
+
1448
+ public open fun setBorderRadius(borderRadius: Float, position: Int) {
1449
+ val radius =
1450
+ if (borderRadius.isNaN()) null
1451
+ else LengthPercentage(PixelUtil.toDIPFromPixel(borderRadius), LengthPercentageType.POINT)
1452
+ BackgroundStyleApplicator.setBorderRadius(this, BorderRadiusProp.entries[position], radius)
1453
+ }
1454
+
1455
+ public open fun setBorderStyle(style: String?) {
1456
+ BackgroundStyleApplicator.setBorderStyle(
1457
+ this,
1458
+ if (style == null) null else BorderStyle.fromString(style),
1459
+ )
1460
+ }
1461
+
1462
+ /**
1463
+ * Calls `smoothScrollTo` and updates state.
1464
+ *
1465
+ * `smoothScrollTo` changes `contentOffset` and we need to keep `contentOffset` in sync between
1466
+ * scroll view and state. Calling raw `smoothScrollTo` doesn't update state.
1467
+ */
1468
+ override fun reactSmoothScrollTo(x: Int, y: Int) {
1469
+ ReactScrollViewHelper.smoothScrollTo(this, x, y)
1470
+ setPendingContentOffsets(x, y)
1471
+ }
1472
+
1473
+ /**
1474
+ * Calls `super.scrollTo` and updates state.
1475
+ *
1476
+ * `super.scrollTo` changes `contentOffset` and we need to keep `contentOffset` in sync between
1477
+ * scroll view and state.
1478
+ *
1479
+ * Note that while we can override scrollTo, we *cannot* override `smoothScrollTo` because it is
1480
+ * final. See `reactSmoothScrollTo`.
1481
+ */
1482
+ override fun scrollTo(x: Int, y: Int) {
1483
+ if (DEBUG_MODE) {
1484
+ FLog.i(TAG, "scrollTo[%d] x %d y %d", id, x, y)
1485
+ }
1486
+
1487
+ super.scrollTo(x, y)
1488
+ ReactScrollViewHelper.updateFabricScrollState(this)
1489
+ setPendingContentOffsets(x, y)
1490
+ }
1491
+
1492
+ /** Scrolls to a new position preserving any momentum scrolling animation. */
1493
+ override fun scrollToPreservingMomentum(x: Int, y: Int) {
1494
+ scrollTo(x, y)
1495
+ recreateFlingAnimation(x, Int.MAX_VALUE)
1496
+ }
1497
+
1498
+ protected open fun restoreScrollTo(x: Int, y: Int) {
1499
+ scrollTo(x, y)
1500
+ }
1501
+
1502
+ private fun isContentReady(): Boolean {
1503
+ val child = getContentView()
1504
+ return child != null && child.width != 0 && child.height != 0
1505
+ }
1506
+
1507
+ private fun setPendingContentOffsets(x: Int, y: Int) {
1508
+ if (DEBUG_MODE) {
1509
+ FLog.i(TAG, "setPendingContentOffsets[%d] x %d y %d", id, x, y)
1510
+ }
1511
+
1512
+ if (isContentReady()) {
1513
+ pendingContentOffsetX = UNSET_CONTENT_OFFSET
1514
+ pendingContentOffsetY = UNSET_CONTENT_OFFSET
1515
+ } else {
1516
+ pendingContentOffsetX = x
1517
+ pendingContentOffsetY = y
1518
+ }
1519
+ }
1520
+
1521
+ override fun onLayoutChange(
1522
+ v: View,
1523
+ left: Int,
1524
+ top: Int,
1525
+ right: Int,
1526
+ bottom: Int,
1527
+ oldLeft: Int,
1528
+ oldTop: Int,
1529
+ oldRight: Int,
1530
+ oldBottom: Int,
1531
+ ) {
1532
+ if (contentView == null) return
1533
+
1534
+ // Adjust the scroll position to follow new content. In RTL, this means we keep a constant
1535
+ // offset from the right edge instead of the left edge, so content added to the end of the flow
1536
+ // does not shift layout. If `maintainVisibleContentPosition` is enabled, we try to adjust
1537
+ // position so that the viewport keeps the same insets to previously visible views. TODO: MVCP
1538
+ // does not work in RTL.
1539
+ if (v.layoutDirection == LAYOUT_DIRECTION_RTL) {
1540
+ adjustPositionForContentChangeRTL(left, right, oldLeft, oldRight)
1541
+ }
1542
+ ReactScrollViewHelper.emitLayoutChangeEvent(this)
1543
+ }
1544
+
1545
+ /**
1546
+ * If we are in the middle of a fling animation from the user removing their finger (OverScroller
1547
+ * is in `FLING_MODE`), recreate the existing fling animation since it was calculated against
1548
+ * outdated scroll offsets.
1549
+ */
1550
+ private fun recreateFlingAnimation(scrollX: Int, maxX: Int) {
1551
+ // If we have any pending custom flings (e.g. from animated `scrollTo`, or flinging to a snap
1552
+ // point), cancel them.
1553
+ // TODO: Can we be more graceful (like OverScroller flings)?
1554
+ if (getFlingAnimator().isRunning) {
1555
+ getFlingAnimator().cancel()
1556
+ }
1557
+
1558
+ if (scroller != null && !scroller.isFinished) {
1559
+ // Calculate the velocity and position of the fling animation at the time of this layout
1560
+ // event, which may be later than the last ScrollView tick. These values are not committed to
1561
+ // the underlying ScrollView, which will recalculate positions on its next tick.
1562
+ val scrollerXBeforeTick = scroller.currX
1563
+ val hasMoreTicks = scroller.computeScrollOffset()
1564
+
1565
+ // Stop the existing animation at the current state of the scroller. We will then recreate
1566
+ // it starting at the adjusted x offset.
1567
+ scroller.forceFinished(true)
1568
+
1569
+ if (hasMoreTicks) {
1570
+ // OverScroller.getCurrVelocity() returns an absolute value of the velocity a current fling
1571
+ // animation (only FLING_MODE animations). We derive direction along the X axis from the
1572
+ // start and end of the animation, assuming HorizontalScrollView never fires vertical fling
1573
+ // animations.
1574
+ // TODO: This does not fully handle overscroll.
1575
+ val direction = (scroller.finalX - scroller.startX).toFloat().sign
1576
+ val flingVelocityX = scroller.currVelocity * direction
1577
+
1578
+ scroller.fling(scrollX, scrollY, flingVelocityX.toInt(), 0, 0, maxX, 0, 0)
1579
+ } else {
1580
+ scrollTo(scrollX + (scroller.currX - scrollerXBeforeTick), scrollY)
1581
+ }
1582
+ }
1583
+ }
1584
+
1585
+ private fun adjustPositionForContentChangeRTL(
1586
+ left: Int,
1587
+ right: Int,
1588
+ oldLeft: Int,
1589
+ oldRight: Int,
1590
+ ) {
1591
+ // If we have any pending custom flings (e.g. from animated `scrollTo`, or flinging to a snap
1592
+ // point), finish them, committing the final `scrollX`.
1593
+ // TODO: Can we be more graceful (like OverScroller flings)?
1594
+ if (getFlingAnimator().isRunning) {
1595
+ getFlingAnimator().end()
1596
+ }
1597
+
1598
+ val distanceToRightEdge = oldRight - scrollX
1599
+ val newWidth = right - left
1600
+ val newScrollX = newWidth - distanceToRightEdge
1601
+ scrollTo(newScrollX, scrollY)
1602
+
1603
+ recreateFlingAnimation(newScrollX, newWidth - width)
1604
+ }
1605
+
1606
+ override fun startFlingAnimator(start: Int, end: Int) {
1607
+ // Always cancel existing animator before starting the new one. `smoothScrollTo` contains some
1608
+ // logic that, if called multiple times in a short amount of time, will treat all calls as part
1609
+ // of the same animation and will not lengthen the duration of the animation. This means that,
1610
+ // for example, if the user is scrolling rapidly, multiple pages could be considered part of one
1611
+ // animation, causing some page animations to be animated very rapidly - looking like they're
1612
+ // not animated at all.
1613
+ defaultFlingAnimator.cancel()
1614
+
1615
+ // Update the fling animator with new values
1616
+ val duration = ReactScrollViewHelper.getDefaultScrollAnimationDuration(context)
1617
+ defaultFlingAnimator.setDuration(duration.toLong()).setIntValues(start, end)
1618
+
1619
+ // Start the animator
1620
+ defaultFlingAnimator.start()
1621
+
1622
+ if (sendMomentumEvents) {
1623
+ val xVelocity = if (duration > 0) (end - start) / duration else 0
1624
+ ReactScrollViewHelper.emitScrollMomentumBeginEvent(this, xVelocity, 0)
1625
+ ReactScrollViewHelper.dispatchMomentumEndOnAnimationEnd(this)
1626
+ }
1627
+ }
1628
+
1629
+ override fun getFlingAnimator(): ValueAnimator = defaultFlingAnimator
1630
+
1631
+ override fun getFlingExtrapolatedDistance(velocity: Int): Int =
1632
+ ReactScrollViewHelper.predictFinalScrollPosition(
1633
+ this,
1634
+ velocity,
1635
+ 0,
1636
+ max(0, computeHorizontalScrollRange() - width),
1637
+ 0,
1638
+ )
1639
+ .x
1640
+ }