react-native-tvos 0.86.0-2 → 0.87.0-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 (1076) hide show
  1. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +19 -24
  2. package/Libraries/Alert/Alert.js +38 -1
  3. package/Libraries/Animated/AnimatedExports.js +22 -0
  4. package/Libraries/Animated/AnimatedExports.js.flow +1 -1
  5. package/Libraries/Animated/AnimatedImplementation.js +120 -3
  6. package/Libraries/Animated/Easing.js +4 -3
  7. package/Libraries/Animated/NativeAnimatedAllowlist.js +37 -0
  8. package/Libraries/Animated/animations/Animation.js +14 -5
  9. package/Libraries/Animated/animations/DecayAnimation.js +1 -0
  10. package/Libraries/Animated/animations/SpringAnimation.js +1 -0
  11. package/Libraries/Animated/animations/TimingAnimation.js +9 -0
  12. package/Libraries/Animated/createAnimatedComponent.js +3 -3
  13. package/Libraries/Animated/nodes/AnimatedColor.js +8 -8
  14. package/Libraries/Animated/nodes/AnimatedInterpolation.js +106 -0
  15. package/Libraries/Animated/nodes/AnimatedProps.js +27 -3
  16. package/Libraries/Animated/nodes/AnimatedValue.js +8 -0
  17. package/Libraries/Animated/nodes/AnimatedValueXY.js +2 -2
  18. package/Libraries/AppDelegate/RCTAppDelegate.h +5 -9
  19. package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -20
  20. package/Libraries/AppDelegate/RCTAppSetupUtils.h +0 -18
  21. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +0 -78
  22. package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +18 -17
  23. package/Libraries/AppDelegate/RCTReactNativeFactory.h +5 -41
  24. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -82
  25. package/Libraries/AppDelegate/RCTRootViewFactory.h +4 -1
  26. package/Libraries/AppDelegate/RCTRootViewFactory.mm +3 -98
  27. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  28. package/Libraries/AppState/AppState.d.ts +4 -1
  29. package/Libraries/AppState/AppState.js +32 -17
  30. package/Libraries/BatchedBridge/MessageQueue.js +42 -51
  31. package/Libraries/BatchedBridge/NativeModules.js +7 -0
  32. package/Libraries/Blob/Blob.js +7 -1
  33. package/Libraries/Blob/FileReader.js +6 -0
  34. package/Libraries/Blob/URLSearchParams.js.flow +1 -1
  35. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +20 -9
  36. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +30 -43
  37. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +59 -49
  38. package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -2
  39. package/Libraries/Components/Button.js +96 -182
  40. package/Libraries/Components/Clipboard/Clipboard.js +5 -0
  41. package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
  42. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +8 -69
  43. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +10 -1
  44. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +2 -0
  45. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +26 -31
  46. package/Libraries/Components/Keyboard/Keyboard.js +23 -60
  47. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +15 -7
  48. package/Libraries/Components/Pressable/Pressable.js +39 -17
  49. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +5 -6
  50. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +4 -4
  51. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -2
  52. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +17 -0
  53. package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
  54. package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -2
  55. package/Libraries/Components/RefreshControl/RefreshControl.js +40 -50
  56. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -2
  57. package/Libraries/Components/SafeAreaView/SafeAreaView.js +8 -8
  58. package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
  59. package/Libraries/Components/ScrollView/ScrollView.d.ts +55 -43
  60. package/Libraries/Components/ScrollView/ScrollView.js +202 -115
  61. package/Libraries/Components/ScrollView/ScrollViewCommands.js +4 -4
  62. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  63. package/Libraries/Components/StatusBar/StatusBar.d.ts +7 -54
  64. package/Libraries/Components/StatusBar/StatusBar.js +85 -161
  65. package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -2
  66. package/Libraries/Components/Switch/Switch.js +76 -75
  67. package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -2
  68. package/Libraries/Components/TV/TVEventHandler.js +16 -1
  69. package/Libraries/Components/TextInput/InputAccessoryView.js +13 -61
  70. package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -2
  71. package/Libraries/Components/TextInput/TextInput.d.ts +9 -2
  72. package/Libraries/Components/TextInput/TextInput.flow.js +19 -2
  73. package/Libraries/Components/TextInput/TextInput.js +116 -111
  74. package/Libraries/Components/TextInput/TextInputNativeCommands.js +3 -3
  75. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +25 -19
  76. package/Libraries/Components/Touchable/Touchable.js +94 -95
  77. package/Libraries/Components/Touchable/TouchableHighlight.js +46 -114
  78. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +13 -25
  79. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -84
  80. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +4 -3
  81. package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -2
  82. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  83. package/Libraries/Components/View/View.js +85 -64
  84. package/Libraries/Components/View/ViewAccessibility.d.ts +11 -1
  85. package/Libraries/Components/View/ViewAccessibility.js +16 -5
  86. package/Libraries/Components/View/ViewNativeComponent.js +6 -8
  87. package/Libraries/Components/View/ViewPropTypes.js +55 -9
  88. package/Libraries/Core/InitializeCore.js +9 -1
  89. package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
  90. package/Libraries/Core/ReactNativeVersion.js +2 -2
  91. package/Libraries/Core/Timers/JSTimers.js +53 -52
  92. package/Libraries/Core/setUpGlobals.js +9 -4
  93. package/Libraries/Core/setUpNavigator.js +6 -1
  94. package/Libraries/Core/setUpReactDevTools.js +0 -118
  95. package/Libraries/Core/setUpXHR.js +6 -2
  96. package/Libraries/Debugging/DebuggingOverlay.js +2 -2
  97. package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -2
  98. package/Libraries/EventEmitter/NativeEventEmitter.js +29 -0
  99. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +7 -7
  100. package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +3 -0
  101. package/Libraries/Image/AssetSourceResolver.js +18 -27
  102. package/Libraries/Image/Image.android.js +13 -2
  103. package/Libraries/Image/Image.ios.js +3 -1
  104. package/Libraries/Image/ImageBackground.js +30 -18
  105. package/Libraries/Image/ImageProps.js +116 -117
  106. package/Libraries/Image/ImageSource.d.ts +1 -1
  107. package/Libraries/Image/ImageSource.js +9 -9
  108. package/Libraries/Image/ImageSourceUtils.js +10 -7
  109. package/Libraries/Image/ImageTypes.flow.js +2 -0
  110. package/Libraries/Image/ImageViewNativeComponent.js +1 -1
  111. package/Libraries/Image/RCTImageLoader.mm +60 -63
  112. package/Libraries/Image/RCTImageStoreManager.h +0 -2
  113. package/Libraries/Image/RelativeImageStub.js +1 -1
  114. package/Libraries/Image/resolveAssetSource.js +1 -1
  115. package/Libraries/Interaction/PanResponder.js +102 -97
  116. package/Libraries/LayoutAnimation/LayoutAnimation.js +22 -6
  117. package/Libraries/Linking/Linking.js +24 -23
  118. package/Libraries/Lists/FlatList.d.ts +6 -17
  119. package/Libraries/Lists/FlatList.js +7 -8
  120. package/Libraries/Lists/SectionList.js +7 -0
  121. package/Libraries/Lists/VirtualizedList.js +3 -0
  122. package/Libraries/Lists/VirtualizedSectionList.js +4 -0
  123. package/Libraries/LogBox/LogBox.js +3 -3
  124. package/Libraries/LogBox/UI/AnsiHighlight.js +2 -1
  125. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -2
  126. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +4 -1
  127. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +3 -1
  128. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
  129. package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +9 -2
  130. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +17 -4
  131. package/Libraries/LogBox/UI/LogBoxInspectorSection.js +3 -1
  132. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -1
  133. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -0
  134. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -2
  135. package/Libraries/LogBox/UI/LogBoxMessage.js +18 -5
  136. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +4 -1
  137. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +1 -0
  138. package/Libraries/LogBox/UI/LogBoxStyle.js +0 -4
  139. package/Libraries/Modal/Modal.d.ts +5 -4
  140. package/Libraries/Modal/Modal.js +71 -37
  141. package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -2
  142. package/Libraries/NativeComponent/BaseViewConfig.android.js +17 -0
  143. package/Libraries/NativeComponent/ViewConfig.js +3 -3
  144. package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
  145. package/Libraries/Network/RCTHTTPRequestHandler.h +1 -1
  146. package/Libraries/Performance/Systrace.js +36 -0
  147. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -2
  148. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +29 -17
  149. package/Libraries/Pressability/Pressability.js +1 -1
  150. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +4 -0
  151. package/Libraries/ReactNative/AppContainer-dev.js +3 -1
  152. package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
  153. package/Libraries/ReactNative/AppRegistry.js +15 -11
  154. package/Libraries/ReactNative/AppRegistryImpl.js +57 -11
  155. package/Libraries/ReactNative/DisplayMode.js +1 -1
  156. package/Libraries/ReactNative/FabricUIManager.js +29 -26
  157. package/Libraries/ReactNative/I18nManager.js +20 -0
  158. package/Libraries/ReactNative/UIManager.js +53 -0
  159. package/Libraries/ReactNative/renderApplication.js +1 -1
  160. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -126
  161. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -41
  162. package/Libraries/Renderer/shims/ReactNativeTypes.js +36 -36
  163. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +4 -4
  164. package/Libraries/Settings/Settings.ios.js +22 -0
  165. package/Libraries/Share/Share.js +25 -28
  166. package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +6 -0
  167. package/Libraries/StyleSheet/StyleSheet.js +42 -2
  168. package/Libraries/StyleSheet/StyleSheet.js.flow +1 -1
  169. package/Libraries/StyleSheet/StyleSheetExports.js +7 -5
  170. package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
  171. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +24 -3
  172. package/Libraries/StyleSheet/StyleSheetTypes.js +34 -6
  173. package/Libraries/StyleSheet/flattenStyle.js +28 -13
  174. package/Libraries/StyleSheet/private/_TransformStyle.js +16 -14
  175. package/Libraries/Text/Text.js +12 -9
  176. package/Libraries/Text/TextEffectNativeComponent.js +31 -0
  177. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +0 -1
  178. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +0 -1
  179. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +0 -1
  180. package/Libraries/Text/TextProps.js +59 -93
  181. package/Libraries/Text/requireNativeTextEffect.js +28 -0
  182. package/Libraries/TurboModule/RCTExport.js +1 -1
  183. package/Libraries/Types/CoreEventTypes.d.ts +8 -0
  184. package/Libraries/Types/CoreEventTypes.js +32 -29
  185. package/Libraries/Types/UIManagerJSInterface.js +2 -2
  186. package/Libraries/Utilities/Appearance.d.ts +32 -17
  187. package/Libraries/Utilities/Appearance.js +35 -18
  188. package/Libraries/Utilities/BackHandler.android.js +13 -33
  189. package/Libraries/Utilities/BackHandler.js.flow +18 -2
  190. package/Libraries/Utilities/DevSettings.js +8 -1
  191. package/Libraries/Utilities/Dimensions.js +18 -12
  192. package/Libraries/Utilities/PixelRatio.js +5 -2
  193. package/Libraries/Utilities/Platform.js.flow +4 -0
  194. package/Libraries/Utilities/PlatformTypes.js +77 -0
  195. package/Libraries/Utilities/differ/deepDiffer.js +5 -2
  196. package/Libraries/Utilities/useColorScheme.js +11 -1
  197. package/Libraries/Utilities/useWindowDimensions.js +6 -0
  198. package/Libraries/Vibration/Vibration.js +14 -11
  199. package/Libraries/vendor/emitter/EventEmitter.js +3 -3
  200. package/React/Base/RCTBridge+Private.h +0 -22
  201. package/React/Base/RCTBridge.h +10 -8
  202. package/React/Base/RCTBridge.mm +5 -447
  203. package/React/Base/RCTBridgeDelegate.h +1 -56
  204. package/React/Base/RCTBridgeModule.h +0 -9
  205. package/React/Base/RCTBridgeProxy.h +8 -0
  206. package/React/Base/RCTBridgeProxy.mm +3 -20
  207. package/React/Base/RCTBundleManager.h +0 -3
  208. package/React/Base/RCTBundleManager.m +0 -31
  209. package/React/Base/RCTBundleURLProvider.mm +4 -4
  210. package/React/Base/RCTCallableJSModules.m +0 -18
  211. package/React/Base/RCTConstants.h +1 -0
  212. package/React/Base/RCTConstants.m +1 -0
  213. package/React/Base/RCTConvert.mm +3 -0
  214. package/React/Base/RCTDisplayLink.h +3 -1
  215. package/React/Base/RCTJavaScriptExecutor.h +0 -69
  216. package/React/Base/RCTModuleData.mm +2 -483
  217. package/React/Base/RCTModuleRegistry.m +0 -25
  218. package/React/Base/RCTRootView.h +0 -11
  219. package/React/Base/RCTRootView.m +3 -461
  220. package/React/Base/RCTUtils.h +0 -3
  221. package/React/Base/RCTUtils.mm +17 -27
  222. package/React/Base/RCTVersion.m +2 -2
  223. package/React/Base/RCTViewRegistry.m +1 -29
  224. package/React/Base/Surface/RCTSurface.mm +1 -582
  225. package/React/Base/Surface/RCTSurfaceRootShadowView.m +0 -89
  226. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -1
  227. package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +0 -2
  228. package/React/CoreModules/RCTAlertController.mm +1 -0
  229. package/React/CoreModules/RCTAlertManager.mm +0 -5
  230. package/React/CoreModules/RCTLogBox.mm +0 -11
  231. package/React/CoreModules/RCTLogBoxView.h +0 -3
  232. package/React/CoreModules/RCTLogBoxView.mm +0 -31
  233. package/React/CoreModules/RCTPerfMonitor.mm +0 -2
  234. package/React/CoreModules/RCTStatusBarManager.mm +0 -11
  235. package/React/CxxModule/RCTCxxUtils.h +0 -8
  236. package/React/CxxModule/RCTCxxUtils.mm +0 -17
  237. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +179 -7
  238. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +100 -2
  239. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +373 -119
  240. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +1 -1
  241. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +1 -1
  242. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +71 -71
  243. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +96 -96
  244. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +357 -363
  245. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +211 -212
  246. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +107 -107
  247. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +1 -1
  248. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +11 -11
  249. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +2 -2
  250. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +4 -0
  251. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +4 -0
  252. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +4 -0
  253. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +5 -0
  254. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +0 -1
  255. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +14 -0
  256. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +12 -3
  257. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +12 -26
  258. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +39 -4
  259. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +18 -22
  260. package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +0 -18
  261. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +9 -5
  262. package/React/Fabric/RCTSurfacePresenter.mm +86 -5
  263. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +2 -0
  264. package/React/I18n/RCTLocalizedString.mm +38 -2
  265. package/React/Modules/RCTEventEmitter.m +30 -10
  266. package/React/Modules/RCTI18nUtil.m +3 -1
  267. package/React/Modules/RCTUIManager.mm +0 -1501
  268. package/React/React-RCTFBReactNativeSpec.podspec +1 -1
  269. package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +27 -0
  270. package/React/Views/RCTModalHostViewController.h +0 -18
  271. package/React/Views/RCTModalHostViewManager.h +0 -24
  272. package/React/Views/RCTShadowView.h +0 -2
  273. package/React/Views/RCTShadowView.m +0 -723
  274. package/React/Views/RCTView.h +0 -19
  275. package/React/Views/RCTViewManager.m +0 -53
  276. package/React/Views/ScrollView/RCTScrollView.h +0 -92
  277. package/React/Views/ScrollView/RCTScrollableProtocol.h +0 -4
  278. package/React-Core-prebuilt.podspec +45 -17
  279. package/React-Core.podspec +9 -2
  280. package/ReactAndroid/api/ReactAndroid.api +128 -142
  281. package/ReactAndroid/build.gradle.kts +26 -21
  282. package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
  283. package/ReactAndroid/gradle.properties +1 -1
  284. package/ReactAndroid/hermes-engine/build.gradle.kts +19 -20
  285. package/ReactAndroid/src/debug/AndroidManifest.xml +6 -0
  286. package/ReactAndroid/src/debugOptimized/AndroidManifest.xml +22 -0
  287. package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +3 -7
  288. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +4 -2
  289. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +4 -6
  290. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +5 -7
  291. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.kt +212 -0
  292. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +0 -16
  293. package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +6 -1
  294. package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.kt +1 -0
  295. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.kt +287 -0
  296. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt +16 -0
  297. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +15 -2
  298. package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.kt +1 -3
  299. package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +4 -0
  300. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +50 -2
  301. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +63 -22
  302. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +33 -0
  303. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +4 -12
  304. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +14 -10
  305. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +6 -6
  306. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +50 -47
  307. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +0 -4
  308. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.kt +10 -10
  309. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LocalNetworkPermissionUtil.kt +49 -0
  310. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.kt +101 -26
  311. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +40 -38
  312. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +1 -10
  313. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerProviderImpl.kt +0 -3
  314. package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +15 -11
  315. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +4 -4
  316. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +7 -13
  317. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +195 -194
  318. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +12 -8
  319. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +30 -66
  320. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -111
  321. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -23
  322. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +12 -24
  323. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +57 -123
  324. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +7 -5
  325. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +3 -5
  326. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -23
  327. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlags.kt +0 -24
  328. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +0 -4
  329. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +1 -0
  330. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +3 -0
  331. package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +50 -0
  332. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +53 -3
  333. package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +2 -77
  334. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
  335. package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +2 -2
  336. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +1 -1
  337. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +9 -4
  338. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +4 -19
  339. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +1 -5
  340. package/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt +4 -4
  341. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +46 -9
  342. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +1 -49
  343. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/HasChildPressedStateDelay.kt +29 -0
  344. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt +796 -0
  345. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +2 -4
  346. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +27 -27
  347. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.kt +184 -0
  348. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.kt +486 -0
  349. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +8 -8
  350. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +2 -2
  351. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/SkewMatrixHelper.kt +200 -0
  352. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +3 -0
  353. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +6 -1
  354. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +2 -2
  355. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +7 -1
  356. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.kt +645 -0
  357. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +2 -3
  358. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.kt +142 -0
  359. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +0 -10
  360. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -3
  361. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.kt +527 -0
  362. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +3 -1
  363. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +6 -6
  364. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +6 -0
  365. package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +7 -0
  366. package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt +8 -1
  367. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +0 -3
  368. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +2 -0
  369. package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +4 -4
  370. package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaView.kt +2 -0
  371. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +1729 -0
  372. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +15 -15
  373. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +1297 -0
  374. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +13 -13
  375. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +1392 -0
  376. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +14 -14
  377. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +19 -33
  378. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +8 -6
  379. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +4 -4
  380. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +13 -20
  381. package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +7 -1
  382. package/ReactAndroid/src/main/java/com/facebook/react/views/text/MutableSpannableLayout.kt +107 -0
  383. package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +122 -10
  384. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +91 -1
  385. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +3 -0
  386. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +41 -0
  387. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +48 -2
  388. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +200 -0
  389. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectRegistry.kt +45 -0
  390. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectSpanFactory.kt +17 -0
  391. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +361 -15
  392. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/AnimatedEffectSpan.kt +37 -0
  393. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/{DrawCommandSpan.kt → CanvasEffectSpan.kt} +3 -4
  394. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +23 -3
  395. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactStrikethroughSpan.kt +30 -3
  396. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactUnderlineSpan.kt +25 -3
  397. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt +1 -1
  398. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/StatefulSpan.kt +21 -0
  399. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextEffectSpan.kt +19 -0
  400. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TouchableSpan.kt +29 -0
  401. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +81 -9
  402. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +4 -0
  403. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +7 -21
  404. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +9 -1
  405. package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +2 -0
  406. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewRenderState.kt +1 -1
  407. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +7 -8
  408. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt +45 -0
  409. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
  410. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +15 -0
  411. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +6 -0
  412. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt +27 -0
  413. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt +31 -0
  414. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt +41 -0
  415. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt +37 -0
  416. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
  417. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
  418. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
  419. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt +29 -0
  420. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt +43 -0
  421. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
  422. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
  423. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +16 -0
  424. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +12 -2
  425. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
  426. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +4 -4
  427. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.kt +27 -0
  428. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +29 -0
  429. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.kt +29 -0
  430. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +24 -2
  431. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.kt +37 -0
  432. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.kt +29 -0
  433. package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -2
  434. package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +94 -0
  435. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionDelegateImpl.cpp +3 -0
  436. package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +10 -10
  437. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +3 -0
  438. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +12 -15
  439. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +1 -3
  440. package/ReactAndroid/src/main/jni/react/fabric/test/FabricMountingManagerTest.cpp +159 -0
  441. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +69 -153
  442. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +15 -33
  443. package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +10 -24
  444. package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +0 -2
  445. package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JWritableMapBuffer.cpp +13 -0
  446. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +4 -1
  447. package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +8 -0
  448. package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +4 -0
  449. package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +5 -0
  450. package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +3 -0
  451. package/ReactApple/RCTAnimatedModuleProvider/React-RCTAnimatedModuleProvider.podspec +63 -0
  452. package/ReactCommon/React-Fabric.podspec +2 -0
  453. package/ReactCommon/ReactCommon.podspec +2 -12
  454. package/ReactCommon/cmake-utils/react-native-flags.cmake +1 -3
  455. package/ReactCommon/cxxreact/CMakeLists.txt +1 -0
  456. package/ReactCommon/cxxreact/ErrorUtils.h +2 -32
  457. package/ReactCommon/cxxreact/Instance.cpp +1 -26
  458. package/ReactCommon/cxxreact/Instance.h +0 -2
  459. package/ReactCommon/cxxreact/NativeToJsBridge.cpp +3 -2
  460. package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +0 -12
  461. package/ReactCommon/cxxreact/RAMBundleRegistry.h +0 -5
  462. package/ReactCommon/cxxreact/React-cxxreact.podspec +2 -1
  463. package/ReactCommon/cxxreact/ReactMarker.cpp +4 -30
  464. package/ReactCommon/cxxreact/ReactMarker.h +38 -21
  465. package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
  466. package/ReactCommon/cxxreact/TraceSection.h +1 -1
  467. package/ReactCommon/cxxreact/tests/methodcall.cpp +4 -0
  468. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +6 -79
  469. package/ReactCommon/jserrorhandler/ErrorUtils.cpp +42 -0
  470. package/{React/CxxLogUtils/RCTDefaultCxxLogFunction.h → ReactCommon/jserrorhandler/ErrorUtils.h} +2 -2
  471. package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -1
  472. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +2 -3
  473. package/ReactCommon/jsi/jsi/hermes-interfaces.h +53 -0
  474. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +2 -1
  475. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +3 -14
  476. package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +4 -13
  477. package/ReactCommon/jsinspector-modern/HostAgent.cpp +54 -0
  478. package/ReactCommon/jsinspector-modern/HostTarget.h +0 -7
  479. package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +10 -7
  480. package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +4 -1
  481. package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +7 -0
  482. package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +20 -0
  483. package/ReactCommon/jsinspector-modern/RuntimeTarget.h +16 -0
  484. package/ReactCommon/jsinspector-modern/SessionState.h +31 -0
  485. package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +53 -0
  486. package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +14 -1
  487. package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +11 -0
  488. package/ReactCommon/react/bridging/ArrayBuffer.h +180 -0
  489. package/ReactCommon/react/bridging/Bridging.h +1 -0
  490. package/ReactCommon/react/bridging/Convert.h +12 -0
  491. package/ReactCommon/react/bridging/React-bridging.podspec +44 -0
  492. package/ReactCommon/react/bridging/tests/BridgingTest.cpp +185 -11
  493. package/ReactCommon/react/bridging/tests/ClassTest.cpp +22 -0
  494. package/ReactCommon/react/cxxstableapi/CMakeLists.txt +18 -0
  495. package/ReactCommon/react/cxxstableapi/FrameworksGuard.h +35 -0
  496. package/ReactCommon/react/cxxstableapi/PrivateGuard.h +34 -0
  497. package/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec +34 -0
  498. package/ReactCommon/react/cxxstableapi/UmbrellaGuard.h +53 -0
  499. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -45
  500. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -56
  501. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +134 -242
  502. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +14 -26
  503. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +20 -44
  504. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +43 -97
  505. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +10 -6
  506. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +3 -7
  507. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -8
  508. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +7 -13
  509. package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +1 -0
  510. package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +49 -0
  511. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +4 -0
  512. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +4 -0
  513. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +1 -1
  514. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  515. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +4 -0
  516. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +4 -0
  517. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +60 -3
  518. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +0 -9
  519. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +37 -139
  520. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleWithJSIBindings.h +0 -3
  521. package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +6 -0
  522. package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
  523. package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -0
  524. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +25 -55
  525. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -23
  526. package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -0
  527. package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +1 -0
  528. package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +4 -0
  529. package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +1 -0
  530. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.h +1 -1
  531. package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +1 -0
  532. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +95 -63
  533. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +20 -1
  534. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +7 -10
  535. package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.cpp +20 -1
  536. package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.h +1 -0
  537. package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.cpp +67 -6
  538. package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.h +12 -0
  539. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +25 -13
  540. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +7 -0
  541. package/ReactCommon/react/renderer/animated/tests/AnimationDriverTests.cpp +48 -0
  542. package/ReactCommon/react/renderer/animated/tests/DecayAnimationDriverTest.cpp +245 -0
  543. package/ReactCommon/react/renderer/animated/tests/ManagedPropsMountingOverrideTests.cpp +204 -0
  544. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -1
  545. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
  546. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +17 -0
  547. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +0 -2
  548. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +6 -2
  549. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +25 -1
  550. package/ReactCommon/react/renderer/attributedstring/conversions.h +29 -1
  551. package/ReactCommon/react/renderer/attributedstring/primitives.h +4 -2
  552. package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +73 -0
  553. package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +6 -0
  554. package/ReactCommon/react/renderer/components/image/ImageProps.cpp +79 -126
  555. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +4 -0
  556. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +4 -0
  557. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +4 -0
  558. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -0
  559. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +4 -0
  560. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.cpp +5 -0
  561. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h +4 -0
  562. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.cpp +4 -0
  563. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h +4 -0
  564. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -0
  565. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +4 -0
  566. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  567. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -0
  568. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +5 -0
  569. package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +253 -379
  570. package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +36 -55
  571. package/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +17 -27
  572. package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +8 -10
  573. package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +19 -0
  574. package/ReactCommon/react/renderer/components/text/TextEffectComponentDescriptor.h +17 -0
  575. package/ReactCommon/react/renderer/components/text/TextEffectProps.cpp +59 -0
  576. package/ReactCommon/react/renderer/components/text/TextEffectProps.h +30 -0
  577. package/{Libraries/Text/VirtualText/RCTVirtualTextView.mm → ReactCommon/react/renderer/components/text/TextEffectShadowNode.cpp} +4 -6
  578. package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.h +26 -0
  579. package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +18 -28
  580. package/ReactCommon/react/renderer/components/text/tests/BaseTextShadowNodeTest.cpp +15 -0
  581. package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +42 -50
  582. package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +168 -754
  583. package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +0 -9
  584. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +262 -326
  585. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +0 -6
  586. package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +2 -12
  587. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +73 -27
  588. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +7 -9
  589. package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +3 -11
  590. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +94 -180
  591. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.h +2 -2
  592. package/ReactCommon/react/renderer/components/view/primitives.h +5 -0
  593. package/ReactCommon/react/renderer/components/view/propsConversions.h +74 -42
  594. package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +5 -5
  595. package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +353 -6
  596. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +41 -16
  597. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +19 -0
  598. package/ReactCommon/react/renderer/core/EventEmitter.cpp +20 -4
  599. package/ReactCommon/react/renderer/core/LayoutMetrics.h +3 -0
  600. package/ReactCommon/react/renderer/core/Props.cpp +8 -39
  601. package/ReactCommon/react/renderer/core/Props.h +63 -13
  602. package/ReactCommon/react/renderer/core/RawProps.cpp +20 -3
  603. package/ReactCommon/react/renderer/core/RawProps.h +44 -0
  604. package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +11 -27
  605. package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +3 -3
  606. package/ReactCommon/react/renderer/core/RawPropsParser.cpp +4 -6
  607. package/ReactCommon/react/renderer/core/RawPropsParser.h +3 -3
  608. package/ReactCommon/react/renderer/core/ShadowNode.cpp +27 -19
  609. package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +2 -0
  610. package/ReactCommon/react/renderer/core/StateData.h +4 -4
  611. package/ReactCommon/react/renderer/core/propsConversions.h +3 -7
  612. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +8 -0
  613. package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +7 -7
  614. package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +19 -19
  615. package/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +135 -0
  616. package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +43 -53
  617. package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +3 -3
  618. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +17 -0
  619. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +1 -1
  620. package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +123 -33
  621. package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +26 -14
  622. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +96 -53
  623. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +4 -0
  624. package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +96 -1
  625. package/ReactCommon/react/renderer/mounting/Differentiator.cpp +29 -318
  626. package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +105 -33
  627. package/ReactCommon/react/renderer/mounting/ShadowTree.h +2 -0
  628. package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +11 -3
  629. package/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +1 -1
  630. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +15 -250
  631. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeReactBranchingTest.cpp +141 -0
  632. package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +1 -1
  633. package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -0
  634. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -0
  635. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +22 -2
  636. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +13 -2
  637. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +13 -0
  638. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +9 -0
  639. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +43 -5
  640. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +17 -1
  641. package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -0
  642. package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +113 -8
  643. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +14 -6
  644. package/ReactCommon/react/renderer/scheduler/Scheduler.h +3 -2
  645. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +1 -85
  646. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +0 -6
  647. package/ReactCommon/react/renderer/scheduler/tests/SchedulerDelegateInvalidationTest.cpp +671 -0
  648. package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +22 -5
  649. package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +4 -2
  650. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +11 -0
  651. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +65 -26
  652. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +193 -1
  653. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +14 -2
  654. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +2 -1
  655. package/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +86 -5
  656. package/ReactCommon/react/renderer/uimanager/UIManager.cpp +89 -94
  657. package/ReactCommon/react/renderer/uimanager/UIManager.h +2 -2
  658. package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +1 -1
  659. package/ReactCommon/react/renderer/uimanager/tests/FabricUIManagerTest.cpp +144 -3
  660. package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +1 -52
  661. package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +4 -4
  662. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +88 -39
  663. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +12 -2
  664. package/ReactCommon/react/runtime/PlatformTimerRegistry.h +10 -0
  665. package/ReactCommon/react/runtime/ReactInstance.cpp +79 -64
  666. package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +0 -89
  667. package/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +99 -0
  668. package/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +244 -0
  669. package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +1 -1
  670. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +47 -30
  671. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +3 -2
  672. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +3 -2
  673. package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +27 -3
  674. package/ReactCommon/react/runtime/tests/cxx/RuntimeExecutorShutdownTest.cpp +155 -0
  675. package/ReactCommon/react/utils/Telemetry.h +0 -13
  676. package/ReactCommon/react/utils/tests/Base64Tests.cpp +36 -0
  677. package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +0 -1
  678. package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +21 -38
  679. package/ReactCommon/yoga/Yoga.podspec +1 -1
  680. package/ReactCommon/yoga/yoga/YGEnums.cpp +2 -0
  681. package/ReactCommon/yoga/yoga/YGEnums.h +1 -0
  682. package/ReactCommon/yoga/yoga/YGNode.cpp +27 -0
  683. package/ReactCommon/yoga/yoga/YGNode.h +69 -0
  684. package/ReactCommon/yoga/yoga/YGNodeLayout.h +0 -2
  685. package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +2 -1
  686. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +294 -17
  687. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +1 -1
  688. package/ReactCommon/yoga/yoga/config/Config.h +1 -1
  689. package/ReactCommon/yoga/yoga/enums/Errata.h +1 -0
  690. package/ReactCommon/yoga/yoga/node/LayoutResults.h +8 -0
  691. package/ReactCommon/yoga/yoga/node/Node.cpp +32 -0
  692. package/ReactCommon/yoga/yoga/node/Node.h +33 -0
  693. package/cli.js +3 -182
  694. package/flow/bom.js.flow +42 -42
  695. package/flow/cssom.js.flow +21 -21
  696. package/flow/dom.js.flow +128 -128
  697. package/flow/global.js +6 -0
  698. package/gradle/libs.versions.toml +7 -5
  699. package/index.js +53 -86
  700. package/index.js.flow +53 -23
  701. package/package.json +41 -52
  702. package/react-native.config.js +82 -1
  703. package/scripts/cocoapods/fabric.rb +1 -1
  704. package/scripts/cocoapods/jsengine.rb +1 -1
  705. package/scripts/cocoapods/new_architecture.rb +1 -1
  706. package/scripts/cocoapods/rncore.rb +36 -78
  707. package/scripts/cocoapods/rncore_facades.rb +232 -0
  708. package/scripts/cocoapods/rndependencies.rb +64 -3
  709. package/scripts/cocoapods/rndeps_facades.rb +193 -0
  710. package/scripts/cocoapods/spm.rb +78 -11
  711. package/scripts/cocoapods/utils.rb +5 -7
  712. package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +0 -1
  713. package/scripts/codegen/templates/Package.swift.spm-template +97 -0
  714. package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -1
  715. package/scripts/hermes/hermes-utils.js +27 -58
  716. package/scripts/react-native-xcode.sh +20 -0
  717. package/scripts/react_native_pods.rb +71 -21
  718. package/scripts/react_native_pods_utils/script_phases.sh +4 -3
  719. package/scripts/replace-rncore-version.js +57 -86
  720. package/scripts/setup-apple-spm.js +1267 -0
  721. package/scripts/spm/__doc__/rfc-spm-xcframework.md +707 -0
  722. package/scripts/spm/__doc__/spm-autolinking-plugins.md +244 -0
  723. package/scripts/spm/__doc__/spm-header-paths-contract.md +97 -0
  724. package/scripts/spm/__doc__/spm-plugins-assessment.md +128 -0
  725. package/scripts/spm/__doc__/spm-scripts.md +486 -0
  726. package/scripts/spm/autolinking-plugins.js +331 -0
  727. package/scripts/spm/download-spm-artifacts.js +1409 -0
  728. package/scripts/spm/expand-spm-dependencies.js +216 -0
  729. package/scripts/spm/flavored-frameworks.js +1008 -0
  730. package/scripts/spm/generate-spm-autolinking-config.js +221 -0
  731. package/scripts/spm/generate-spm-autolinking.js +1888 -0
  732. package/scripts/spm/generate-spm-package.js +302 -0
  733. package/scripts/spm/generate-spm-xcodeproj.js +2266 -0
  734. package/scripts/spm/read-podspec.js +695 -0
  735. package/scripts/spm/scaffold-package-swift.js +1206 -0
  736. package/scripts/spm/spm-pbxproj.js +654 -0
  737. package/scripts/spm/spm-types.js +520 -0
  738. package/scripts/spm/spm-utils.js +645 -0
  739. package/scripts/spm/sync-spm-autolinking.js +160 -0
  740. package/sdks/.hermesv1version +1 -1
  741. package/sdks/hermes-engine/hermes-engine.podspec +9 -39
  742. package/sdks/hermes-engine/hermes-utils.rb +20 -74
  743. package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
  744. package/sdks/hermes-engine/version.properties +1 -2
  745. package/settings.gradle.kts +0 -43
  746. package/src/asset-registry.js +29 -0
  747. package/src/private/animated/NativeAnimatedHelper.js +45 -21
  748. package/src/private/assets/AssetRegistry.js +52 -0
  749. package/src/private/{specs_DEPRECATED/components → components/activityindicator/specs}/ActivityIndicatorViewNativeComponent.js +5 -5
  750. package/src/private/{specs_DEPRECATED/components → components/debuggingoverlay/specs}/DebuggingOverlayNativeComponent.js +8 -8
  751. package/src/private/{specs_DEPRECATED/components → components/drawerlayoutandroid/specs}/AndroidDrawerLayoutNativeComponent.js +8 -8
  752. package/src/private/{specs_DEPRECATED/components → components/inputaccessoryview/specs}/RCTInputAccessoryViewNativeComponent.js +4 -4
  753. package/src/private/{specs_DEPRECATED/components → components/modal/specs}/RCTModalHostViewNativeComponent.js +4 -9
  754. package/src/private/{specs_DEPRECATED/components → components/progressbarandroid/specs}/ProgressBarAndroidNativeComponent.js +5 -5
  755. package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/AndroidSwipeRefreshLayoutNativeComponent.js +7 -7
  756. package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/PullToRefreshViewNativeComponent.js +7 -7
  757. package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -2
  758. package/src/private/{specs_DEPRECATED/components → components/safeareaview/specs}/RCTSafeAreaViewNativeComponent.js +3 -3
  759. package/src/private/components/scrollview/HScrollViewNativeComponents.js +1 -1
  760. package/src/private/{specs_DEPRECATED/components → components/scrollview/specs}/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
  761. package/src/private/{specs_DEPRECATED/components → components/switch/specs}/AndroidSwitchNativeComponent.js +7 -7
  762. package/src/private/{specs_DEPRECATED/components → components/switch/specs}/SwitchNativeComponent.js +10 -7
  763. package/src/private/{specs_DEPRECATED/components → components/unimplementedview/specs}/UnimplementedNativeViewNativeComponent.js +4 -4
  764. package/src/private/components/virtualcollection/Virtual.js +5 -5
  765. package/src/private/components/virtualcollection/VirtualCollectionView.js +2 -6
  766. package/src/private/components/virtualcollection/column/VirtualColumn.js +1 -1
  767. package/src/private/components/virtualcollection/row/VirtualRow.js +1 -1
  768. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +3 -1
  769. package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +4 -4
  770. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +4 -2
  771. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
  772. package/src/private/featureflags/ReactNativeFeatureFlags.js +46 -70
  773. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +88 -94
  774. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
  775. package/src/private/renderer/events/ReactNativeResponder.js +49 -4
  776. package/src/private/renderer/events/ResponderTouchHistoryStore.js +11 -2
  777. package/src/private/renderer/events/dispatchNativeEvent.js +71 -36
  778. package/src/private/setup/setUpDOM.js +19 -9
  779. package/src/private/setup/setUpIntersectionObserver.js +7 -0
  780. package/src/private/setup/setUpMutationObserver.js +3 -1
  781. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +9 -9
  782. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +24 -24
  783. package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +28 -28
  784. package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
  785. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +45 -25
  786. package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +44 -24
  787. package/src/private/specs_DEPRECATED/modules/NativeAppState.js +4 -4
  788. package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +8 -6
  789. package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +7 -7
  790. package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +3 -3
  791. package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +2 -2
  792. package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +11 -11
  793. package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
  794. package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +4 -4
  795. package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +7 -7
  796. package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +4 -4
  797. package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
  798. package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +4 -4
  799. package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +2 -2
  800. package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
  801. package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +13 -13
  802. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +9 -6
  803. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +6 -6
  804. package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
  805. package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +8 -5
  806. package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +5 -5
  807. package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
  808. package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +2 -2
  809. package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +6 -6
  810. package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +2 -2
  811. package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +2 -2
  812. package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +5 -5
  813. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +6 -6
  814. package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +6 -4
  815. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
  816. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +1 -1
  817. package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +35 -31
  818. package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +2 -2
  819. package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +24 -24
  820. package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +2 -2
  821. package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +3 -3
  822. package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +2 -2
  823. package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
  824. package/src/private/specs_DEPRECATED/modules/NativeSourceCode.js +1 -1
  825. package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerAndroid.js +5 -17
  826. package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerIOS.js +10 -15
  827. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +3 -3
  828. package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +4 -4
  829. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +35 -22
  830. package/src/private/specs_DEPRECATED/modules/NativeVibration.js +4 -4
  831. package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +7 -7
  832. package/src/private/types/HostInstance.js +38 -80
  833. package/src/private/viewtransition/specs/NativeViewTransition.js +6 -4
  834. package/src/private/webapis/dom/abort-api/AbortController.js +92 -0
  835. package/src/private/webapis/dom/abort-api/AbortSignal.js +243 -0
  836. package/src/private/webapis/dom/events/CustomEvent.js +1 -1
  837. package/src/private/webapis/dom/events/Event.js +12 -12
  838. package/src/private/webapis/dom/events/EventTarget.js +146 -37
  839. package/src/private/webapis/dom/events/internals/EventInternals.js +36 -0
  840. package/src/private/webapis/dom/events/internals/EventTargetInternals.js +38 -3
  841. package/src/private/webapis/dom/nodes/ReactNativeDocument.js +11 -0
  842. package/src/private/webapis/dom/nodes/ReactNativeElement.js +105 -4
  843. package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +11 -0
  844. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +9 -0
  845. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +34 -7
  846. package/src/private/webapis/dom/nodes/ReadOnlyText.js +33 -0
  847. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +46 -42
  848. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +12 -0
  849. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +4 -2
  850. package/src/private/webapis/dom/oldstylecollections/NodeList.js +10 -0
  851. package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +4 -3
  852. package/src/private/webapis/errors/DOMException.js +50 -50
  853. package/src/private/webapis/geometry/DOMRectList.js +12 -0
  854. package/src/private/webapis/geometry/DOMRectList.js.flow +3 -1
  855. package/src/private/webapis/html/events/MessageEvent.js +3 -3
  856. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
  857. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +13 -0
  858. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +3 -7
  859. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +5 -5
  860. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
  861. package/src/private/webapis/mutationobserver/MutationObserver.js +7 -7
  862. package/src/private/webapis/mutationobserver/MutationRecord.js +12 -0
  863. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +5 -7
  864. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +5 -5
  865. package/src/private/webapis/performance/EventTiming.js +3 -3
  866. package/src/private/webapis/performance/PerformanceEntry.js +3 -3
  867. package/src/private/webapis/performance/PerformanceObserver.js +4 -4
  868. package/src/private/webapis/performance/ResourceTiming.js +13 -13
  869. package/src/private/webapis/performance/UserTiming.js +3 -3
  870. package/src/private/webapis/performance/internals/Utilities.js +1 -1
  871. package/src/private/webapis/performance/specs/NativePerformance.js +26 -20
  872. package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
  873. package/src/private/webapis/websockets/events/CloseEvent.js +3 -3
  874. package/src/private/webapis/xhr/events/ProgressEvent.js +3 -3
  875. package/src/react-private-interface.js +145 -0
  876. package/src/react-private-interface.js.flow +48 -0
  877. package/src/setup-env.js +22 -0
  878. package/src/types/globals.d.ts +33 -1
  879. package/src/unstable-internals-do-not-use.d.ts +214 -0
  880. package/src/unstable-internals-do-not-use.js +76 -0
  881. package/third-party-podspecs/ReactNativeDependencies.podspec +2 -2
  882. package/types/index.d.ts +0 -1
  883. package/types/public/DeprecatedPropertiesAlias.d.ts +0 -4
  884. package/types/public/ReactNativeTypes.d.ts +4 -2
  885. package/Libraries/AppDelegate/RCTArchConfiguratorProtocol.h +0 -38
  886. package/Libraries/Image/AssetRegistry.js +0 -14
  887. package/Libraries/Image/RCTImageShadowView.h +0 -17
  888. package/Libraries/Image/RCTImageShadowView.mm +0 -28
  889. package/Libraries/Image/RCTImageView.h +0 -32
  890. package/Libraries/Image/RCTImageView.mm +0 -507
  891. package/Libraries/Image/RCTImageViewManager.h +0 -17
  892. package/Libraries/Image/RCTImageViewManager.mm +0 -115
  893. package/Libraries/Interaction/InteractionManager.d.ts +0 -87
  894. package/Libraries/Interaction/InteractionManager.js +0 -189
  895. package/Libraries/Text/BaseText/RCTBaseTextShadowView.h +0 -35
  896. package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +0 -162
  897. package/Libraries/Text/BaseText/RCTBaseTextViewManager.h +0 -21
  898. package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +0 -64
  899. package/Libraries/Text/RCTTextAttributes.h +0 -107
  900. package/Libraries/Text/RCTTextAttributes.mm +0 -358
  901. package/Libraries/Text/RawText/RCTRawTextShadowView.h +0 -23
  902. package/Libraries/Text/RawText/RCTRawTextShadowView.mm +0 -38
  903. package/Libraries/Text/RawText/RCTRawTextViewManager.h +0 -21
  904. package/Libraries/Text/RawText/RCTRawTextViewManager.mm +0 -32
  905. package/Libraries/Text/Text/RCTTextShadowView.h +0 -33
  906. package/Libraries/Text/Text/RCTTextShadowView.mm +0 -469
  907. package/Libraries/Text/Text/RCTTextView.h +0 -34
  908. package/Libraries/Text/Text/RCTTextView.mm +0 -308
  909. package/Libraries/Text/Text/RCTTextViewManager.h +0 -19
  910. package/Libraries/Text/Text/RCTTextViewManager.mm +0 -97
  911. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +0 -21
  912. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +0 -67
  913. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h +0 -21
  914. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +0 -30
  915. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.h +0 -30
  916. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +0 -367
  917. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +0 -68
  918. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -858
  919. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.h +0 -17
  920. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +0 -181
  921. package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.h +0 -17
  922. package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +0 -24
  923. package/Libraries/Text/TextInput/RCTInputAccessoryView.h +0 -22
  924. package/Libraries/Text/TextInput/RCTInputAccessoryView.mm +0 -82
  925. package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.h +0 -17
  926. package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm +0 -78
  927. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.h +0 -17
  928. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +0 -33
  929. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h +0 -21
  930. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.mm +0 -43
  931. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h +0 -21
  932. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +0 -35
  933. package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.h +0 -17
  934. package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.mm +0 -42
  935. package/Libraries/Text/VirtualText/RCTVirtualTextView.h +0 -28
  936. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.h +0 -17
  937. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +0 -30
  938. package/Libraries/Utilities/SceneTracker.js +0 -42
  939. package/Libraries/Wrapper/Example/RCTWrapperExampleView.h +0 -21
  940. package/Libraries/Wrapper/Example/RCTWrapperExampleView.m +0 -57
  941. package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h +0 -21
  942. package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m +0 -27
  943. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h +0 -25
  944. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m +0 -50
  945. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h +0 -23
  946. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m +0 -35
  947. package/Libraries/Wrapper/RCTWrapper.h +0 -73
  948. package/Libraries/Wrapper/RCTWrapperShadowView.h +0 -27
  949. package/Libraries/Wrapper/RCTWrapperShadowView.m +0 -138
  950. package/Libraries/Wrapper/RCTWrapperView.h +0 -42
  951. package/Libraries/Wrapper/RCTWrapperView.m +0 -99
  952. package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.h +0 -30
  953. package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.m +0 -137
  954. package/Libraries/Wrapper/RCTWrapperViewManager.h +0 -25
  955. package/Libraries/Wrapper/RCTWrapperViewManager.m +0 -31
  956. package/React/Base/RCTRootContentView.h +0 -43
  957. package/React/Base/RCTRootContentView.m +0 -111
  958. package/React/Base/RCTRootViewInternal.h +0 -40
  959. package/React/CxxBridge/RCTCxxBridge.mm +0 -1572
  960. package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +0 -25
  961. package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +0 -34
  962. package/React/CxxBridge/RCTObjcExecutor.h +0 -34
  963. package/React/CxxBridge/RCTObjcExecutor.mm +0 -150
  964. package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -34
  965. package/React/CxxModule/DispatchMessageQueueThread.h +0 -50
  966. package/React/CxxModule/RCTCxxMethod.h +0 -17
  967. package/React/CxxModule/RCTCxxMethod.mm +0 -147
  968. package/React/CxxModule/RCTNativeModule.h +0 -34
  969. package/React/CxxModule/RCTNativeModule.mm +0 -241
  970. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +0 -205
  971. package/React/Tests/Text/RCTTextAttributesTest.mm +0 -49
  972. package/React/Views/RCTActivityIndicatorView.h +0 -16
  973. package/React/Views/RCTActivityIndicatorView.m +0 -26
  974. package/React/Views/RCTActivityIndicatorViewManager.h +0 -23
  975. package/React/Views/RCTActivityIndicatorViewManager.m +0 -65
  976. package/React/Views/RCTDebuggingOverlayManager.h +0 -17
  977. package/React/Views/RCTDebuggingOverlayManager.m +0 -68
  978. package/React/Views/RCTModalHostView.h +0 -72
  979. package/React/Views/RCTModalHostView.m +0 -302
  980. package/React/Views/RCTModalHostViewController.m +0 -107
  981. package/React/Views/RCTModalHostViewManager.m +0 -131
  982. package/React/Views/RCTModalManager.h +0 -22
  983. package/React/Views/RCTModalManager.m +0 -46
  984. package/React/Views/RCTRootShadowView.h +0 -35
  985. package/React/Views/RCTRootShadowView.m +0 -53
  986. package/React/Views/RCTShadowView+Internal.h +0 -18
  987. package/React/Views/RCTShadowView+Internal.m +0 -23
  988. package/React/Views/RCTSwitch.h +0 -24
  989. package/React/Views/RCTSwitch.m +0 -26
  990. package/React/Views/RCTSwitchManager.h +0 -19
  991. package/React/Views/RCTSwitchManager.m +0 -72
  992. package/React/Views/RCTTVView.h +0 -105
  993. package/React/Views/RCTTVView.m +0 -602
  994. package/React/Views/RefreshControl/RCTRefreshControl.h +0 -26
  995. package/React/Views/RefreshControl/RCTRefreshControl.m +0 -232
  996. package/React/Views/RefreshControl/RCTRefreshControlManager.h +0 -19
  997. package/React/Views/RefreshControl/RCTRefreshControlManager.m +0 -49
  998. package/React/Views/SafeAreaView/RCTSafeAreaShadowView.h +0 -21
  999. package/React/Views/SafeAreaView/RCTSafeAreaShadowView.m +0 -57
  1000. package/React/Views/SafeAreaView/RCTSafeAreaView.h +0 -27
  1001. package/React/Views/SafeAreaView/RCTSafeAreaView.m +0 -79
  1002. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +0 -25
  1003. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m +0 -25
  1004. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.h +0 -21
  1005. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +0 -32
  1006. package/React/Views/ScrollView/RCTScrollContentShadowView.h +0 -19
  1007. package/React/Views/ScrollView/RCTScrollContentShadowView.m +0 -35
  1008. package/React/Views/ScrollView/RCTScrollContentView.h +0 -19
  1009. package/React/Views/ScrollView/RCTScrollContentView.m +0 -36
  1010. package/React/Views/ScrollView/RCTScrollContentViewManager.h +0 -17
  1011. package/React/Views/ScrollView/RCTScrollContentViewManager.m +0 -31
  1012. package/React/Views/ScrollView/RCTScrollView.m +0 -1508
  1013. package/React/Views/ScrollView/RCTScrollViewManager.h +0 -25
  1014. package/React/Views/ScrollView/RCTScrollViewManager.m +0 -208
  1015. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +0 -251
  1016. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +0 -315
  1017. package/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +0 -51
  1018. package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +0 -89
  1019. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +0 -736
  1020. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -221
  1021. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -399
  1022. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +0 -35
  1023. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -346
  1024. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -666
  1025. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -147
  1026. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +0 -113
  1027. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +0 -614
  1028. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +0 -1949
  1029. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +0 -1646
  1030. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +0 -1744
  1031. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +0 -51
  1032. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +0 -33
  1033. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +0 -33
  1034. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +0 -37
  1035. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +0 -47
  1036. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +0 -41
  1037. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +0 -33
  1038. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +0 -37
  1039. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +0 -39
  1040. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +0 -35
  1041. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +0 -49
  1042. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +0 -45
  1043. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java +0 -35
  1044. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +0 -928
  1045. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java +0 -33
  1046. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java +0 -35
  1047. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java +0 -35
  1048. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java +0 -43
  1049. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java +0 -35
  1050. package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.cpp +0 -23
  1051. package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.h +0 -37
  1052. package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +0 -135
  1053. package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +0 -72
  1054. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +0 -143
  1055. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +0 -55
  1056. package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +0 -78
  1057. package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +0 -39
  1058. package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +0 -148
  1059. package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +0 -168
  1060. package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +0 -416
  1061. package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +0 -31
  1062. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +0 -134
  1063. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +0 -290
  1064. package/ReactCommon/react/renderer/core/RawPropsKey.cpp +0 -62
  1065. package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -39
  1066. package/ReactCommon/react/renderer/mounting/internal/DiffMap.h +0 -170
  1067. package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +0 -95
  1068. package/ReactCommon/react/renderer/mounting/internal/TinyMap.h +0 -147
  1069. package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +0 -154
  1070. package/interface.js +0 -21
  1071. package/jest-preset.js +0 -26
  1072. package/rn-get-polyfills.js +0 -13
  1073. package/sdks/.hermesversion +0 -1
  1074. package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +0 -13
  1075. package/types/tsconfig.json +0 -15
  1076. /package/ReactCommon/{cxxreact → react/utils}/MoveWrapper.h +0 -0
@@ -1,1508 +0,0 @@
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
- #import "RCTScrollView.h"
9
-
10
- #ifndef RCT_REMOVE_LEGACY_ARCH
11
-
12
- #import <UIKit/UIKit.h>
13
-
14
- #import "RCTConvert.h"
15
- #import "RCTLog.h"
16
- #import "RCTScrollEvent.h"
17
- #import "RCTUIManager.h"
18
- #import "RCTUIManagerObserverCoordinator.h"
19
- #import "RCTUIManagerUtils.h"
20
- #import "RCTUtils.h"
21
- #import "RCTViewUtils.h"
22
- #import "UIView+Private.h"
23
- #import "UIView+React.h"
24
-
25
- #if TARGET_OS_TV
26
- #import "RCTTVRemoteHandler.h"
27
- #import "RCTTVNavigationEventNotification.h"
28
- #import "React/RCTI18nUtil.h"
29
- #endif
30
-
31
- #if !TARGET_OS_TV
32
- #import "RCTRefreshControl.h"
33
- #endif
34
-
35
- #define TV_DEFAULT_SWIPE_DURATION 0.3
36
-
37
- /**
38
- * Include a custom scroll view subclass because we want to limit certain
39
- * default UIKit behaviors such as textFields automatically scrolling
40
- * scroll views that contain them.
41
- */
42
- @interface RCTCustomScrollView : UIScrollView <UIGestureRecognizerDelegate>
43
-
44
- @property (nonatomic, assign) BOOL centerContent;
45
- #if !TARGET_OS_TV
46
- @property (nonatomic, strong) UIView<RCTCustomRefreshControlProtocol> *customRefreshControl;
47
- @property (nonatomic, assign) BOOL pinchGestureEnabled;
48
- #endif
49
-
50
- @end
51
-
52
- @implementation RCTCustomScrollView
53
-
54
- - (instancetype)initWithFrame:(CGRect)frame
55
- {
56
- if ((self = [super initWithFrame:frame])) {
57
- [self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];
58
-
59
- if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) {
60
- // We intentionally force `UIScrollView`s `semanticContentAttribute` to `LTR` here
61
- // because this attribute affects a position of vertical scrollbar; we don't want this
62
- // scrollbar flip because we also flip it with whole `UIScrollView` flip.
63
- self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
64
- }
65
-
66
- #if !TARGET_OS_TV
67
- _pinchGestureEnabled = YES;
68
- #endif
69
- }
70
- return self;
71
- }
72
-
73
- - (UIView *)contentView
74
- {
75
- return ((RCTScrollView *)self.superview).contentView;
76
- }
77
-
78
- /**
79
- * @return Whether or not the scroll view interaction should be blocked because
80
- * JS was found to be the responder.
81
- */
82
- - (BOOL)_shouldDisableScrollInteraction
83
- {
84
- // Since this may be called on every pan, we need to make sure to only climb
85
- // the hierarchy on rare occasions.
86
- UIView *JSResponder = [RCTUIManager JSResponder];
87
- if (JSResponder && JSResponder != self.superview) {
88
- BOOL superviewHasResponder = [self isDescendantOfView:JSResponder];
89
- return superviewHasResponder;
90
- }
91
- return NO;
92
- }
93
-
94
- - (void)handleCustomPan:(__unused UIPanGestureRecognizer *)sender
95
- {
96
- if ([self _shouldDisableScrollInteraction] && ![[RCTUIManager JSResponder] isKindOfClass:[RCTScrollView class]]) {
97
- self.panGestureRecognizer.enabled = NO;
98
- self.panGestureRecognizer.enabled = YES;
99
- // TODO: If mid bounce, animate the scroll view to a non-bounced position
100
- // while disabling (but only if `stopScrollInteractionIfJSHasResponder` was
101
- // called *during* a `pan`). Currently, it will just snap into place which
102
- // is not so bad either.
103
- // Another approach:
104
- // self.scrollEnabled = NO;
105
- // self.scrollEnabled = YES;
106
- }
107
- }
108
-
109
- - (void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated
110
- {
111
- // Limiting scroll area to an area where we actually have content.
112
- CGSize contentSize = self.contentSize;
113
- UIEdgeInsets contentInset = self.contentInset;
114
- CGSize fullSize = CGSizeMake(
115
- contentSize.width + contentInset.left + contentInset.right,
116
- contentSize.height + contentInset.top + contentInset.bottom);
117
-
118
- rect = CGRectIntersection((CGRect){CGPointZero, fullSize}, rect);
119
- if (CGRectIsNull(rect)) {
120
- return;
121
- }
122
-
123
- [super scrollRectToVisible:rect animated:animated];
124
- }
125
-
126
- /**
127
- * Returning `YES` cancels touches for the "inner" `view` and causes a scroll.
128
- * Returning `NO` causes touches to be directed to that inner view and prevents
129
- * the scroll view from scrolling.
130
- *
131
- * `YES` -> Allows scrolling.
132
- * `NO` -> Doesn't allow scrolling.
133
- *
134
- * By default this returns NO for all views that are UIControls and YES for
135
- * everything else. What that does is allows scroll views to scroll even when a
136
- * touch started inside of a `UIControl` (`UIButton` etc). For React scroll
137
- * views, we want the default to be the same behavior as `UIControl`s so we
138
- * return `YES` by default. But there's one case where we want to block the
139
- * scrolling no matter what: When JS believes it has its own responder lock on
140
- * a view that is *above* the scroll view in the hierarchy. So we abuse this
141
- * `touchesShouldCancelInContentView` API in order to stop the scroll view from
142
- * scrolling in this case.
143
- *
144
- * We are not aware of *any* other solution to the problem because alternative
145
- * approaches require that we disable the scrollview *before* touches begin or
146
- * move. This approach (`touchesShouldCancelInContentView`) works even if the
147
- * JS responder is set after touches start/move because
148
- * `touchesShouldCancelInContentView` is called as soon as the scroll view has
149
- * been touched and dragged *just* far enough to decide to begin the "drag"
150
- * movement of the scroll interaction. Returning `NO`, will cause the drag
151
- * operation to fail.
152
- *
153
- * `touchesShouldCancelInContentView` will stop the *initialization* of a
154
- * scroll pan gesture and most of the time this is sufficient. On rare
155
- * occasion, the scroll gesture would have already initialized right before JS
156
- * notifies native of the JS responder being set. In order to recover from that
157
- * timing issue we have a fallback that kills any ongoing pan gesture that
158
- * occurs when native is notified of a JS responder.
159
- *
160
- * Note: Explicitly returning `YES`, instead of relying on the default fixes
161
- * (at least) one bug where if you have a UIControl inside a UIScrollView and
162
- * tap on the UIControl and then start dragging (to scroll), it won't scroll.
163
- * Chat with @andras for more details.
164
- *
165
- * In order to have this called, you must have delaysContentTouches set to NO
166
- * (which is the not the `UIKit` default).
167
- */
168
- - (BOOL)touchesShouldCancelInContentView:(__unused UIView *)view
169
- {
170
- BOOL shouldDisableScrollInteraction = [self _shouldDisableScrollInteraction];
171
-
172
- if (shouldDisableScrollInteraction == NO) {
173
- [super touchesShouldCancelInContentView:view];
174
- }
175
-
176
- return !shouldDisableScrollInteraction;
177
- }
178
-
179
- - (void)setContentOffset:(CGPoint)contentOffset
180
- {
181
- super.contentOffset = CGPointMake(
182
- RCTSanitizeNaNValue(contentOffset.x, @"scrollView.contentOffset.x"),
183
- RCTSanitizeNaNValue(contentOffset.y, @"scrollView.contentOffset.y"));
184
- }
185
-
186
- - (void)setFrame:(CGRect)frame
187
- {
188
- // Preserving and revalidating `contentOffset`.
189
- CGPoint originalOffset = self.contentOffset;
190
-
191
- [super setFrame:frame];
192
-
193
- UIEdgeInsets contentInset = self.contentInset;
194
- CGSize contentSize = self.contentSize;
195
-
196
- // If contentSize has not been measured yet we can't check bounds.
197
- if (CGSizeEqualToSize(contentSize, CGSizeZero)) {
198
- self.contentOffset = originalOffset;
199
- } else {
200
- if (!UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, self.adjustedContentInset)) {
201
- contentInset = self.adjustedContentInset;
202
- }
203
- CGSize boundsSize = self.bounds.size;
204
- CGFloat xMaxOffset = contentSize.width - boundsSize.width + contentInset.right;
205
- CGFloat yMaxOffset = contentSize.height - boundsSize.height + contentInset.bottom;
206
- // Make sure offset doesn't exceed bounds. This can happen on screen rotation.
207
- if ((originalOffset.x >= -contentInset.left) && (originalOffset.x <= xMaxOffset) &&
208
- (originalOffset.y >= -contentInset.top) && (originalOffset.y <= yMaxOffset)) {
209
- return;
210
- }
211
- self.contentOffset = CGPointMake(
212
- MAX(-contentInset.left, MIN(xMaxOffset, originalOffset.x)),
213
- MAX(-contentInset.top, MIN(yMaxOffset, originalOffset.y)));
214
- }
215
- }
216
-
217
- #if !TARGET_OS_TV
218
- - (void)setCustomRefreshControl:(UIView<RCTCustomRefreshControlProtocol> *)refreshControl
219
- {
220
- if (_customRefreshControl) {
221
- [_customRefreshControl removeFromSuperview];
222
- }
223
- _customRefreshControl = refreshControl;
224
- // We have to set this because we can't always guarantee the
225
- // `RCTCustomRefreshControlProtocol`'s superview will always be of class
226
- // `UIScrollView` like we were previously
227
- if ([_customRefreshControl respondsToSelector:@selector(setScrollView:)]) {
228
- _customRefreshControl.scrollView = self;
229
- }
230
- if ([refreshControl isKindOfClass:UIRefreshControl.class]) {
231
- self.refreshControl = (UIRefreshControl *)refreshControl;
232
- } else {
233
- [self addSubview:_customRefreshControl];
234
- }
235
- }
236
-
237
- - (void)setPinchGestureEnabled:(BOOL)pinchGestureEnabled
238
- {
239
- self.pinchGestureRecognizer.enabled = pinchGestureEnabled;
240
- _pinchGestureEnabled = pinchGestureEnabled;
241
- }
242
-
243
- - (void)didMoveToWindow
244
- {
245
- [super didMoveToWindow];
246
- // ScrollView enables pinch gesture late in its lifecycle. So simply setting it
247
- // in the setter gets overridden when the view loads.
248
- self.pinchGestureRecognizer.enabled = _pinchGestureEnabled;
249
- }
250
- #endif // TARGET_OS_TV
251
-
252
- - (BOOL)shouldGroupAccessibilityChildren
253
- {
254
- return YES;
255
- }
256
-
257
- @end
258
-
259
- @interface RCTScrollView () <RCTUIManagerObserver>
260
-
261
- @end
262
-
263
- @implementation RCTScrollView {
264
- id<RCTEventDispatcherProtocol> _eventDispatcher;
265
- CGRect _prevFirstVisibleFrame;
266
- __weak UIView *_firstVisibleView;
267
- RCTCustomScrollView *_scrollView;
268
- UIView *_contentView;
269
- NSTimeInterval _lastScrollDispatchTime;
270
- NSMutableArray<NSValue *> *_cachedChildFrames;
271
- BOOL _allowNextScrollNoMatterWhat;
272
- CGRect _lastClippedToRect;
273
- uint16_t _coalescingKey;
274
- NSString *_lastEmittedEventName;
275
- NSHashTable *_scrollListeners;
276
- NSMutableDictionary *_tvRemoteGestureRecognizers;
277
- BOOL _blockFirstTouch;
278
- }
279
-
280
- - (void)_registerKeyboardListener
281
- {
282
- #if !TARGET_OS_TV
283
- [[NSNotificationCenter defaultCenter] addObserver:self
284
- selector:@selector(_keyboardWillChangeFrame:)
285
- name:UIKeyboardWillChangeFrameNotification
286
- object:nil];
287
- #endif
288
- }
289
-
290
- - (void)_unregisterKeyboardListener
291
- {
292
- #if !TARGET_OS_TV
293
- [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil];
294
- #endif
295
- }
296
-
297
- #if !TARGET_OS_TV
298
- static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCurve curve)
299
- {
300
- // UIViewAnimationCurve #7 is used for keyboard and therefore private - so we can't use switch/case here.
301
- // source: https://stackoverflow.com/a/7327374/5281431
302
- RCTAssert(
303
- UIViewAnimationCurveLinear << 16 == UIViewAnimationOptionCurveLinear,
304
- @"Unexpected implementation of UIViewAnimationCurve");
305
- return curve << 16;
306
- }
307
-
308
- - (void)_keyboardWillChangeFrame:(NSNotification *)notification
309
- {
310
- if (![self automaticallyAdjustKeyboardInsets]) {
311
- return;
312
- }
313
- if ([self isHorizontal:_scrollView]) {
314
- return;
315
- }
316
-
317
- double duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
318
-
319
- UIViewAnimationCurve curve =
320
- (UIViewAnimationCurve)[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue];
321
- CGRect beginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
322
- CGRect endFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
323
-
324
- CGPoint absoluteViewOrigin = [self convertPoint:self.bounds.origin toView:nil];
325
- CGFloat scrollViewLowerY = self.inverted ? absoluteViewOrigin.y : absoluteViewOrigin.y + self.bounds.size.height;
326
-
327
- UIEdgeInsets newEdgeInsets = _scrollView.contentInset;
328
- CGFloat inset = MAX(scrollViewLowerY - endFrame.origin.y, 0);
329
- if (self.inverted) {
330
- newEdgeInsets.top = MAX(inset, _contentInset.top);
331
- } else {
332
- newEdgeInsets.bottom = MAX(inset, _contentInset.bottom);
333
- }
334
-
335
- CGPoint newContentOffset = _scrollView.contentOffset;
336
- self.firstResponderFocus = CGRectNull;
337
-
338
- CGFloat contentDiff = 0;
339
- if ([[UIApplication sharedApplication] sendAction:@selector(reactUpdateResponderOffsetForScrollView:)
340
- to:nil
341
- from:self
342
- forEvent:nil]) {
343
- // Inner text field focused
344
- CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
345
- BOOL didFocusExternalTextField = focusEnd == INFINITY;
346
- if (!didFocusExternalTextField && focusEnd > endFrame.origin.y) {
347
- // Text field active region is below visible area with keyboard - update diff to bring into view
348
- contentDiff = endFrame.origin.y - focusEnd;
349
- } else {
350
- UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
351
- if (inputAccessoryView) {
352
- // Text input view is within the inputAccessoryView.
353
- contentDiff = endFrame.origin.y - beginFrame.origin.y;
354
- }
355
- }
356
- } else if (endFrame.origin.y <= beginFrame.origin.y) {
357
- // Keyboard opened for other reason
358
- contentDiff = endFrame.origin.y - beginFrame.origin.y;
359
- }
360
- if (self.inverted) {
361
- newContentOffset.y += contentDiff;
362
- } else {
363
- newContentOffset.y -= contentDiff;
364
- }
365
-
366
- if (@available(iOS 14.0, *)) {
367
- // On iOS when Prefer Cross-Fade Transitions is enabled, the keyboard position
368
- // & height is reported differently (0 instead of Y position value matching height of frame)
369
- // Fixes similar issue we saw with https://github.com/facebook/react-native/pull/34503
370
- if (UIAccessibilityPrefersCrossFadeTransitions() && endFrame.size.height == 0) {
371
- newContentOffset.y = 0;
372
- newEdgeInsets.bottom = 0;
373
- }
374
- }
375
-
376
- [UIView animateWithDuration:duration
377
- delay:0.0
378
- options:animationOptionsWithCurve(curve)
379
- animations:^{
380
- self->_scrollView.contentInset = newEdgeInsets;
381
- self->_scrollView.verticalScrollIndicatorInsets = newEdgeInsets;
382
- [self scrollToOffset:newContentOffset animated:NO];
383
- }
384
- completion:nil];
385
- }
386
-
387
- #endif // TARGET_OS_TV
388
-
389
- - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher
390
- {
391
- RCTAssertParam(eventDispatcher);
392
-
393
- if ((self = [super initWithFrame:CGRectZero])) {
394
- [self _registerKeyboardListener];
395
- _eventDispatcher = eventDispatcher;
396
-
397
- _scrollView = [[RCTCustomScrollView alloc] initWithFrame:CGRectZero];
398
- _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
399
- _scrollView.delegate = self;
400
- _scrollView.delaysContentTouches = NO;
401
-
402
- // We set the default behavior to "never" so that iOS
403
- // doesn't do weird things to UIScrollView insets automatically
404
- // and keeps it as an opt-in behavior.
405
- if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
406
- _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
407
- }
408
-
409
- _automaticallyAdjustContentInsets = YES;
410
- _contentInset = UIEdgeInsetsZero;
411
- _lastClippedToRect = CGRectNull;
412
-
413
- _scrollEventThrottle = 0.0;
414
- _lastScrollDispatchTime = 0;
415
- _cachedChildFrames = [NSMutableArray new];
416
-
417
- _scrollListeners = [NSHashTable weakObjectsHashTable];
418
-
419
- _tvRemoteGestureRecognizers = [NSMutableDictionary new];
420
-
421
- [self addSubview:_scrollView];
422
- }
423
- return self;
424
- }
425
-
426
- RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
427
- RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
428
-
429
- static inline void RCTApplyTransformationAccordingLayoutDirection(
430
- UIView *view,
431
- UIUserInterfaceLayoutDirection layoutDirection)
432
- {
433
- view.transform = layoutDirection == UIUserInterfaceLayoutDirectionLeftToRight ? CGAffineTransformIdentity
434
- : CGAffineTransformMakeScale(-1, 1);
435
- }
436
-
437
- - (void)setReactLayoutDirection:(UIUserInterfaceLayoutDirection)layoutDirection
438
- {
439
- [super setReactLayoutDirection:layoutDirection];
440
-
441
- RCTApplyTransformationAccordingLayoutDirection(_scrollView, layoutDirection);
442
- RCTApplyTransformationAccordingLayoutDirection(_contentView, layoutDirection);
443
- }
444
-
445
- - (void)setRemoveClippedSubviews:(__unused BOOL)removeClippedSubviews
446
- {
447
- // Does nothing
448
- }
449
-
450
- - (void)setFrame:(CGRect)frame
451
- {
452
- [super setFrame:frame];
453
- [self centerContentIfNeeded];
454
- }
455
-
456
- - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex
457
- {
458
- [super insertReactSubview:view atIndex:atIndex];
459
- #if !TARGET_OS_TV
460
- if ([view conformsToProtocol:@protocol(RCTCustomRefreshControlProtocol)]) {
461
- [_scrollView setCustomRefreshControl:(UIView<RCTCustomRefreshControlProtocol> *)view];
462
- if (![view isKindOfClass:[UIRefreshControl class]] && [view conformsToProtocol:@protocol(UIScrollViewDelegate)]) {
463
- [self addScrollListener:(UIView<UIScrollViewDelegate> *)view];
464
- }
465
- } else
466
- #endif
467
- {
468
- RCTAssert(
469
- _contentView == nil,
470
- @"RCTScrollView may only contain a single subview, the already set subview looks like: %@",
471
- [_contentView react_recursiveDescription]);
472
- _contentView = view;
473
- RCTApplyTransformationAccordingLayoutDirection(_contentView, self.reactLayoutDirection);
474
- [_scrollView addSubview:view];
475
- }
476
-
477
- [self centerContentIfNeeded];
478
- }
479
-
480
- - (void)removeReactSubview:(UIView *)subview
481
- {
482
- [super removeReactSubview:subview];
483
- #if !TARGET_OS_TV
484
- if ([subview conformsToProtocol:@protocol(RCTCustomRefreshControlProtocol)]) {
485
- [_scrollView setCustomRefreshControl:nil];
486
- if (![subview isKindOfClass:[UIRefreshControl class]] &&
487
- [subview conformsToProtocol:@protocol(UIScrollViewDelegate)]) {
488
- [self removeScrollListener:(UIView<UIScrollViewDelegate> *)subview];
489
- }
490
- } else
491
- #endif
492
- {
493
- RCTAssert(_contentView == subview, @"Attempted to remove non-existent subview");
494
- _contentView = nil;
495
- }
496
- }
497
-
498
- - (void)didUpdateReactSubviews
499
- {
500
- // Do nothing, as subviews are managed by `insertReactSubview:atIndex:`
501
- }
502
-
503
- - (void)didSetProps:(NSArray<NSString *> *)changedProps
504
- {
505
- if ([changedProps containsObject:@"contentSize"]) {
506
- [self updateContentSizeIfNeeded];
507
- }
508
- if ([changedProps containsObject:@"showsScrollIndex"]) {
509
- [self updateScrollIndex];
510
- }
511
- }
512
-
513
- - (void)updateScrollIndex
514
- {
515
- #if TARGET_OS_TV
516
- if (self.showsScrollIndex) {
517
- self.scrollView.indexDisplayMode = UIScrollViewIndexDisplayModeAutomatic;
518
- } else {
519
- self.scrollView.indexDisplayMode = UIScrollViewIndexDisplayModeAlwaysHidden;
520
- }
521
- #endif
522
- }
523
-
524
- - (BOOL)centerContent
525
- {
526
- return _scrollView.centerContent;
527
- }
528
-
529
- - (void)setCenterContent:(BOOL)centerContent
530
- {
531
- _scrollView.centerContent = centerContent;
532
- }
533
-
534
- - (void)setClipsToBounds:(BOOL)clipsToBounds
535
- {
536
- super.clipsToBounds = clipsToBounds;
537
- _scrollView.clipsToBounds = clipsToBounds;
538
- }
539
-
540
- - (void)dealloc
541
- {
542
- _scrollView.delegate = nil;
543
- [_eventDispatcher.bridge.uiManager.observerCoordinator removeObserver:self];
544
- [self _unregisterKeyboardListener];
545
- }
546
-
547
- - (void)layoutSubviews
548
- {
549
- [super layoutSubviews];
550
- RCTAssert(self.subviews.count == 1, @"we should only have exactly one subview");
551
- RCTAssert([self.subviews lastObject] == _scrollView, @"our only subview should be a scrollview");
552
-
553
- #if !TARGET_OS_TV
554
- // Adjust the refresh control frame if the scrollview layout changes.
555
- UIView<RCTCustomRefreshControlProtocol> *refreshControl = _scrollView.customRefreshControl;
556
- if (refreshControl && refreshControl.isRefreshing && ![refreshControl isKindOfClass:UIRefreshControl.class]) {
557
- refreshControl.frame =
558
- (CGRect){_scrollView.contentOffset, {_scrollView.frame.size.width, refreshControl.frame.size.height}};
559
- }
560
- #endif
561
-
562
- [self updateClippedSubviews];
563
- }
564
-
565
- - (void)updateClippedSubviews
566
- {
567
- // Find a suitable view to use for clipping
568
- UIView *clipView = [self react_findClipView];
569
- if (!clipView) {
570
- return;
571
- }
572
-
573
- static const CGFloat leeway = 1.0;
574
-
575
- const CGSize contentSize = _scrollView.contentSize;
576
- const CGRect bounds = _scrollView.bounds;
577
- const BOOL scrollsHorizontally = contentSize.width > bounds.size.width;
578
- const BOOL scrollsVertically = contentSize.height > bounds.size.height;
579
-
580
- const BOOL shouldClipAgain = CGRectIsNull(_lastClippedToRect) || !CGRectEqualToRect(_lastClippedToRect, bounds) ||
581
- (scrollsHorizontally &&
582
- (bounds.size.width < leeway || fabs(_lastClippedToRect.origin.x - bounds.origin.x) >= leeway)) ||
583
- (scrollsVertically &&
584
- (bounds.size.height < leeway || fabs(_lastClippedToRect.origin.y - bounds.origin.y) >= leeway));
585
-
586
- if (shouldClipAgain) {
587
- const CGRect clipRect = CGRectInset(clipView.bounds, -leeway, -leeway);
588
- [self react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];
589
- _lastClippedToRect = bounds;
590
- }
591
- }
592
-
593
- - (void)setContentInset:(UIEdgeInsets)contentInset
594
- {
595
- if (UIEdgeInsetsEqualToEdgeInsets(contentInset, _contentInset)) {
596
- return;
597
- }
598
-
599
- CGPoint contentOffset = _scrollView.contentOffset;
600
-
601
- _contentInset = contentInset;
602
- [RCTView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:NO];
603
-
604
- _scrollView.contentOffset = contentOffset;
605
- }
606
-
607
- - (BOOL)isHorizontal:(UIScrollView *)scrollView
608
- {
609
- return scrollView.contentSize.width > self.frame.size.width;
610
- }
611
-
612
- - (void)scrollToOffset:(CGPoint)offset
613
- {
614
- [self scrollToOffset:offset animated:YES];
615
- }
616
-
617
- - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
618
- {
619
- if ([self reactLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
620
- offset.x = _scrollView.contentSize.width - _scrollView.frame.size.width - offset.x;
621
- }
622
-
623
- if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
624
- CGRect maxRect = CGRectMake(
625
- fmin(-_scrollView.contentInset.left, 0),
626
- fmin(-_scrollView.contentInset.top, 0),
627
- fmax(
628
- _scrollView.contentSize.width - _scrollView.bounds.size.width + _scrollView.contentInset.right +
629
- fmax(_scrollView.contentInset.left, 0),
630
- 0.01),
631
- fmax(
632
- _scrollView.contentSize.height - _scrollView.bounds.size.height + _scrollView.contentInset.bottom +
633
- fmax(_scrollView.contentInset.top, 0),
634
- 0.01)); // Make width and height greater than 0
635
- // Ensure at least one scroll event will fire
636
- _allowNextScrollNoMatterWhat = YES;
637
- if (!CGRectContainsPoint(maxRect, offset) && !self.scrollToOverflowEnabled) {
638
- CGFloat x = fmax(offset.x, CGRectGetMinX(maxRect));
639
- x = fmin(x, CGRectGetMaxX(maxRect));
640
- CGFloat y = fmax(offset.y, CGRectGetMinY(maxRect));
641
- y = fmin(y, CGRectGetMaxY(maxRect));
642
- offset = CGPointMake(x, y);
643
- }
644
- [_scrollView setContentOffset:offset animated:animated];
645
- }
646
- }
647
-
648
- /**
649
- * If this is a vertical scroll view, scrolls to the bottom.
650
- * If this is a horizontal scroll view, scrolls to the right.
651
- */
652
- - (void)scrollToEnd:(BOOL)animated
653
- {
654
- BOOL isHorizontal = [self isHorizontal:_scrollView];
655
- CGPoint offset;
656
- if (isHorizontal) {
657
- CGFloat offsetX = _scrollView.contentSize.width - _scrollView.bounds.size.width + _scrollView.contentInset.right;
658
- offset = CGPointMake(fmax(offsetX, 0), 0);
659
- } else {
660
- CGFloat offsetY = _scrollView.contentSize.height - _scrollView.bounds.size.height + _scrollView.contentInset.bottom;
661
- offset = CGPointMake(0, fmax(offsetY, 0));
662
- }
663
- if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
664
- // Ensure at least one scroll event will fire
665
- _allowNextScrollNoMatterWhat = YES;
666
- [_scrollView setContentOffset:offset animated:animated];
667
- }
668
- }
669
-
670
- - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated
671
- {
672
- [_scrollView zoomToRect:rect animated:animated];
673
- }
674
-
675
- - (void)refreshContentInset
676
- {
677
- [RCTView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:YES];
678
- }
679
-
680
- #pragma mark - ScrollView delegate
681
-
682
- #define RCT_SEND_SCROLL_EVENT(_eventName, _userData) \
683
- { \
684
- NSString *eventName = NSStringFromSelector(@selector(_eventName)); \
685
- [self sendScrollEventWithName:eventName scrollView:_scrollView userData:_userData]; \
686
- }
687
-
688
- #define RCT_FORWARD_SCROLL_EVENT(call) \
689
- for (NSObject<UIScrollViewDelegate> * scrollViewListener in _scrollListeners) { \
690
- if ([scrollViewListener respondsToSelector:_cmd]) { \
691
- [scrollViewListener call]; \
692
- } \
693
- }
694
-
695
- #define RCT_SCROLL_EVENT_HANDLER(delegateMethod, eventName) \
696
- -(void)delegateMethod : (UIScrollView *)scrollView \
697
- { \
698
- RCT_SEND_SCROLL_EVENT(eventName, nil); \
699
- RCT_FORWARD_SCROLL_EVENT(delegateMethod : scrollView); \
700
- }
701
-
702
- RCT_SCROLL_EVENT_HANDLER(scrollViewWillBeginDecelerating, onMomentumScrollBegin)
703
- RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
704
-
705
- - (void)scrollViewDidZoom:(UIScrollView *)scrollView
706
- {
707
- [self centerContentIfNeeded];
708
-
709
- RCT_SEND_SCROLL_EVENT(onScroll, nil);
710
- RCT_FORWARD_SCROLL_EVENT(scrollViewDidZoom : scrollView);
711
- }
712
-
713
- /*
714
- * Automatically centers the content such that if the content is smaller than the
715
- * ScrollView, we force it to be centered, but when you zoom or the content otherwise
716
- * becomes larger than the ScrollView, there is no padding around the content but it
717
- * can still fill the whole view.
718
- * This implementation is based on https://petersteinberger.com/blog/2013/how-to-center-uiscrollview/.
719
- */
720
- - (void)centerContentIfNeeded
721
- {
722
- if (!_scrollView.centerContent) {
723
- return;
724
- }
725
-
726
- CGSize contentSize = self.contentSize;
727
- CGSize boundsSize = self.bounds.size;
728
- if (CGSizeEqualToSize(contentSize, CGSizeZero) || CGSizeEqualToSize(boundsSize, CGSizeZero)) {
729
- return;
730
- }
731
-
732
- CGFloat top = 0;
733
- CGFloat left = 0;
734
- if (contentSize.width < boundsSize.width) {
735
- left = (boundsSize.width - contentSize.width) * 0.5f;
736
- }
737
- if (contentSize.height < boundsSize.height) {
738
- top = (boundsSize.height - contentSize.height) * 0.5f;
739
- }
740
- _scrollView.contentInset = UIEdgeInsetsMake(top, left, top, left);
741
- }
742
-
743
- - (void)addScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener
744
- {
745
- [_scrollListeners addObject:scrollListener];
746
- }
747
-
748
- - (void)removeScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener
749
- {
750
- [_scrollListeners removeObject:scrollListener];
751
- }
752
-
753
- - (void)scrollViewDidScroll:(UIScrollView *)scrollView
754
- {
755
- NSTimeInterval now = CACurrentMediaTime();
756
- [self updateClippedSubviews];
757
- /**
758
- * TODO: this logic looks wrong, and it may be because it is. Currently, if _scrollEventThrottle
759
- * is set to zero (the default), the "didScroll" event is only sent once per scroll, instead of repeatedly
760
- * while scrolling as expected. However, if you "fix" that bug, ScrollView will generate repeated
761
- * warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too!
762
- *
763
- * We limit the delta to 17ms so that small throttles intended to enable 60fps updates will not
764
- * inadvertently filter out any scroll events.
765
- */
766
- if (_allowNextScrollNoMatterWhat || (_scrollEventThrottle < MAX(0.017, now - _lastScrollDispatchTime))) {
767
- RCT_SEND_SCROLL_EVENT(onScroll, nil);
768
- // Update dispatch time
769
- _lastScrollDispatchTime = now;
770
- _allowNextScrollNoMatterWhat = NO;
771
- }
772
- RCT_FORWARD_SCROLL_EVENT(scrollViewDidScroll : scrollView);
773
- }
774
-
775
- - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
776
- {
777
- _allowNextScrollNoMatterWhat = YES; // Ensure next scroll event is recorded, regardless of throttle
778
- RCT_SEND_SCROLL_EVENT(onScrollBeginDrag, nil);
779
- RCT_FORWARD_SCROLL_EVENT(scrollViewWillBeginDragging : scrollView);
780
- }
781
-
782
- - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView
783
- withVelocity:(CGPoint)velocity
784
- targetContentOffset:(inout CGPoint *)targetContentOffset
785
- {
786
- if (self.snapToOffsets) {
787
- // An alternative to enablePaging and snapToInterval which allows setting custom
788
- // stopping points that don't have to be the same distance apart. Often seen in
789
- // apps which feature horizonally scrolling items. snapToInterval does not enforce
790
- // scrolling one interval at a time but guarantees that the scroll will stop at
791
- // a snap offset point.
792
-
793
- // Find which axis to snap
794
- BOOL isHorizontal = [self isHorizontal:scrollView];
795
- CGFloat velocityAlongAxis = isHorizontal ? velocity.x : velocity.y;
796
- CGFloat offsetAlongAxis = isHorizontal ? _scrollView.contentOffset.x : _scrollView.contentOffset.y;
797
-
798
- // Calculate maximum content offset
799
- CGSize viewportSize = [self _calculateViewportSize];
800
- CGFloat maximumOffset = isHorizontal ? MAX(0, _scrollView.contentSize.width - viewportSize.width)
801
- : MAX(0, _scrollView.contentSize.height - viewportSize.height);
802
-
803
- // Calculate the snap offsets adjacent to the initial offset target
804
- CGFloat targetOffset = isHorizontal ? targetContentOffset->x : targetContentOffset->y;
805
- CGFloat smallerOffset = 0.0;
806
- CGFloat largerOffset = maximumOffset;
807
-
808
- for (unsigned long i = 0; i < self.snapToOffsets.count; i++) {
809
- CGFloat offset = [[self.snapToOffsets objectAtIndex:i] floatValue];
810
-
811
- if (offset <= targetOffset) {
812
- if (targetOffset - offset < targetOffset - smallerOffset) {
813
- smallerOffset = offset;
814
- }
815
- }
816
-
817
- if (offset >= targetOffset) {
818
- if (offset - targetOffset < largerOffset - targetOffset) {
819
- largerOffset = offset;
820
- }
821
- }
822
- }
823
-
824
- // Calculate the nearest offset
825
- CGFloat nearestOffset = targetOffset - smallerOffset < largerOffset - targetOffset ? smallerOffset : largerOffset;
826
-
827
- CGFloat firstOffset = [[self.snapToOffsets firstObject] floatValue];
828
- CGFloat lastOffset = [[self.snapToOffsets lastObject] floatValue];
829
-
830
- // if scrolling after the last snap offset and snapping to the
831
- // end of the list is disabled, then we allow free scrolling
832
- if (!self.snapToEnd && targetOffset >= lastOffset) {
833
- if (offsetAlongAxis >= lastOffset) {
834
- // free scrolling
835
- } else {
836
- // snap to end
837
- targetOffset = lastOffset;
838
- }
839
- } else if (!self.snapToStart && targetOffset <= firstOffset) {
840
- if (offsetAlongAxis <= firstOffset) {
841
- // free scrolling
842
- } else {
843
- // snap to beginning
844
- targetOffset = firstOffset;
845
- }
846
- } else if (velocityAlongAxis > 0.0) {
847
- targetOffset = largerOffset;
848
- } else if (velocityAlongAxis < 0.0) {
849
- targetOffset = smallerOffset;
850
- } else {
851
- targetOffset = nearestOffset;
852
- }
853
-
854
- // Make sure the new offset isn't out of bounds
855
- targetOffset = MIN(MAX(0, targetOffset), maximumOffset);
856
-
857
- // Set new targetContentOffset
858
- if (isHorizontal) {
859
- targetContentOffset->x = targetOffset;
860
- } else {
861
- targetContentOffset->y = targetOffset;
862
- }
863
- } else if (self.snapToInterval) {
864
- // An alternative to enablePaging which allows setting custom stopping intervals,
865
- // smaller than a full page size. Often seen in apps which feature horizonally
866
- // scrolling items. snapToInterval does not enforce scrolling one interval at a time
867
- // but guarantees that the scroll will stop at an interval point.
868
- CGFloat snapToIntervalF = (CGFloat)self.snapToInterval;
869
-
870
- // Find which axis to snap
871
- BOOL isHorizontal = [self isHorizontal:scrollView];
872
-
873
- // What is the current offset?
874
- CGFloat velocityAlongAxis = isHorizontal ? velocity.x : velocity.y;
875
- CGFloat targetContentOffsetAlongAxis = targetContentOffset->y;
876
- if (isHorizontal) {
877
- // Use current scroll offset to determine the next index to snap to when momentum disabled
878
- targetContentOffsetAlongAxis = self.disableIntervalMomentum ? scrollView.contentOffset.x : targetContentOffset->x;
879
- } else {
880
- targetContentOffsetAlongAxis = self.disableIntervalMomentum ? scrollView.contentOffset.y : targetContentOffset->y;
881
- }
882
-
883
- // Offset based on desired alignment
884
- CGFloat frameLength = isHorizontal ? self.frame.size.width : self.frame.size.height;
885
- CGFloat alignmentOffset = 0.0f;
886
- if ([self.snapToAlignment isEqualToString:@"center"]) {
887
- alignmentOffset = (frameLength * 0.5f) + (snapToIntervalF * 0.5f);
888
- } else if ([self.snapToAlignment isEqualToString:@"end"]) {
889
- alignmentOffset = frameLength;
890
- }
891
-
892
- // Pick snap point based on direction and proximity
893
- CGFloat fractionalIndex = (targetContentOffsetAlongAxis + alignmentOffset) / snapToIntervalF;
894
-
895
- NSInteger snapIndex = velocityAlongAxis > 0.0 ? ceil(fractionalIndex)
896
- : velocityAlongAxis < 0.0 ? floor(fractionalIndex)
897
- : round(fractionalIndex);
898
- CGFloat newTargetContentOffset = (snapIndex * snapToIntervalF) - alignmentOffset;
899
-
900
- // Set new targetContentOffset
901
- if (isHorizontal) {
902
- targetContentOffset->x = newTargetContentOffset;
903
- } else {
904
- targetContentOffset->y = newTargetContentOffset;
905
- }
906
- }
907
-
908
- NSDictionary *userData = @{
909
- @"velocity" : @{@"x" : @(velocity.x), @"y" : @(velocity.y)},
910
- @"targetContentOffset" : @{@"x" : @(targetContentOffset->x), @"y" : @(targetContentOffset->y)}
911
- };
912
- RCT_SEND_SCROLL_EVENT(onScrollEndDrag, userData);
913
- RCT_FORWARD_SCROLL_EVENT(
914
- scrollViewWillEndDragging : scrollView withVelocity : velocity targetContentOffset : targetContentOffset);
915
- }
916
-
917
- - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
918
- {
919
- RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndDragging : scrollView willDecelerate : decelerate);
920
- }
921
-
922
- - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view
923
- {
924
- RCT_SEND_SCROLL_EVENT(onScrollBeginDrag, nil);
925
- RCT_FORWARD_SCROLL_EVENT(scrollViewWillBeginZooming : scrollView withView : view);
926
- }
927
-
928
- - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
929
- {
930
- RCT_SEND_SCROLL_EVENT(onScrollEndDrag, nil);
931
- RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndZooming : scrollView withView : view atScale : scale);
932
- }
933
-
934
- - (void)didMoveToWindow
935
- {
936
- [super didMoveToWindow];
937
- if (self.window == nil) {
938
- // Check if the ScrollView was in motion
939
- if (_scrollView.isDecelerating || !_scrollView.isTracking) {
940
- // Trigger the onMomentumScrollEnd event manually
941
- RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil);
942
- // We can't use the RCT_FORWARD_SCROLL_EVENT here beacuse the `_cmd` parameter passed
943
- // to `respondsToSelector` is the current method - so it will be `didMoveToWindow` - and not
944
- // `scrollViewDidEndDecelerating` that is passed.
945
- for (NSObject<UIScrollViewDelegate> *scrollViewListener in _scrollListeners) {
946
- if ([scrollViewListener respondsToSelector:@selector(scrollViewDidEndDecelerating:)]) {
947
- [scrollViewListener scrollViewDidEndDecelerating:_scrollView];
948
- }
949
- }
950
- }
951
- }
952
- }
953
-
954
- - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
955
- {
956
- // Fire a final scroll event
957
- _allowNextScrollNoMatterWhat = YES;
958
- [self scrollViewDidScroll:scrollView];
959
-
960
- // Fire the end deceleration event
961
- RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil);
962
- RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndDecelerating : scrollView);
963
- }
964
-
965
- - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
966
- {
967
- // Fire a final scroll event
968
- _allowNextScrollNoMatterWhat = YES;
969
- [self scrollViewDidScroll:scrollView];
970
-
971
- // Fire the end deceleration event
972
- RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil);
973
- RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndScrollingAnimation : scrollView);
974
- }
975
-
976
- - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
977
- {
978
- for (NSObject<UIScrollViewDelegate> *scrollListener in _scrollListeners) {
979
- if ([scrollListener respondsToSelector:_cmd] && ![scrollListener scrollViewShouldScrollToTop:scrollView]) {
980
- return NO;
981
- }
982
- }
983
-
984
- if (self.inverted) {
985
- [self scrollToEnd:YES];
986
- return NO;
987
- }
988
-
989
- return YES;
990
- }
991
-
992
- - (UIView *)viewForZoomingInScrollView:(__unused UIScrollView *)scrollView
993
- {
994
- return _contentView;
995
- }
996
-
997
- - (CGSize)_calculateViewportSize
998
- {
999
- CGSize viewportSize = self.bounds.size;
1000
- if (_automaticallyAdjustContentInsets) {
1001
- UIEdgeInsets contentInsets = RCTContentInsets(self);
1002
- viewportSize = CGSizeMake(
1003
- self.bounds.size.width - contentInsets.left - contentInsets.right,
1004
- self.bounds.size.height - contentInsets.top - contentInsets.bottom);
1005
- }
1006
- return viewportSize;
1007
- }
1008
-
1009
- - (CGSize)contentSize
1010
- {
1011
- return _contentView.frame.size;
1012
- }
1013
-
1014
- - (void)updateContentSizeIfNeeded
1015
- {
1016
- CGSize contentSize = self.contentSize;
1017
- if (!CGSizeEqualToSize(_scrollView.contentSize, contentSize)) {
1018
- _scrollView.contentSize = contentSize;
1019
- [self centerContentIfNeeded];
1020
- }
1021
- }
1022
-
1023
- // maintainVisibleContentPosition is used to allow seamless loading of content from both ends of
1024
- // the scrollview without the visible content jumping in position.
1025
- - (void)setMaintainVisibleContentPosition:(NSDictionary *)maintainVisibleContentPosition
1026
- {
1027
- if (maintainVisibleContentPosition != nil && _maintainVisibleContentPosition == nil) {
1028
- [_eventDispatcher.bridge.uiManager.observerCoordinator addObserver:self];
1029
- } else if (maintainVisibleContentPosition == nil && _maintainVisibleContentPosition != nil) {
1030
- [_eventDispatcher.bridge.uiManager.observerCoordinator removeObserver:self];
1031
- }
1032
- _maintainVisibleContentPosition = maintainVisibleContentPosition;
1033
- }
1034
-
1035
- #pragma mark -
1036
- #pragma mark Apple TV swipe and focus handling
1037
-
1038
- #if TARGET_OS_TV
1039
- - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
1040
- withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
1041
- {
1042
- if (context.previouslyFocusedView == context.nextFocusedView || !self.isTVSelectable) {
1043
- return;
1044
- }
1045
- if (context.nextFocusedView == self) {
1046
- [self becomeFirstResponder];
1047
- [self addSwipeGestureRecognizers];
1048
- [self sendFocusNotification];
1049
- // if we enter the scroll view from different view then block first touch event since it is the event that triggered the focus
1050
- _blockFirstTouch = (unsigned long)context.focusHeading != 0;
1051
- [self addArrowsListeners];
1052
- } else if (context.previouslyFocusedView == self) {
1053
- [self removeArrowsListeners];
1054
- [self sendBlurNotification];
1055
- [self removeSwipeGestureRecognizers];
1056
- [self resignFirstResponder];
1057
- // If scrolling is enabled:
1058
- // - Scroll to the top when moving up and to the bottom when moving down.
1059
- // - Similarly, scroll towards leading edge when moving towards leading edge and to the trailing edge when moving towards the trailing edge.
1060
- BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1061
- BOOL isMovingTowardsLeadingEdge = (isRTL ? context.focusHeading == UIFocusHeadingRight : context.focusHeading == UIFocusHeadingLeft);
1062
- BOOL isMovingTowardsTrailingEdge = (isRTL ? context.focusHeading == UIFocusHeadingLeft : context.focusHeading == UIFocusHeadingRight);
1063
- if (self.scrollView.isScrollEnabled) {
1064
- if (context.focusHeading == UIFocusHeadingUp && self.snapToStart) {
1065
- [self scrollToVerticalOffset:0.0];
1066
- } else if(context.focusHeading == UIFocusHeadingDown && self.snapToEnd) {
1067
- [self scrollToVerticalOffset:self.scrollView.contentSize.height];
1068
- } else if(isMovingTowardsLeadingEdge && self.snapToStart) {
1069
- [self scrollToHorizontalOffset:0.0];
1070
- } else if(isMovingTowardsLeadingEdge && self.snapToEnd) {
1071
- [self scrollToHorizontalOffset:self.scrollView.contentSize.width];
1072
- }
1073
- }
1074
- }
1075
- }
1076
-
1077
- - (void) addArrowsListeners {
1078
- [[NSNotificationCenter defaultCenter] addObserver:self
1079
- selector:@selector(handleTVNavigationEventNotification:)
1080
- name:RCTTVNavigationEventNotificationName
1081
- object:nil];
1082
- }
1083
-
1084
- - (void) removeArrowsListeners {
1085
- [[NSNotificationCenter defaultCenter] removeObserver:self
1086
- name:RCTTVNavigationEventNotificationName
1087
- object:nil];
1088
- }
1089
-
1090
-
1091
- - (void)handleTVNavigationEventNotification:(NSNotification *)notif
1092
- {
1093
- NSArray *supportedEvents = [NSArray arrayWithObjects:RCTTVRemoteEventUp, RCTTVRemoteEventDown, RCTTVRemoteEventLeft, RCTTVRemoteEventRight, nil];
1094
-
1095
- if (notif.object == nil || notif.object[RCTTVNavigationEventNotificationKeyEventType] == nil || ![supportedEvents containsObject:notif.object[RCTTVNavigationEventNotificationKeyEventType]]) {
1096
- return;
1097
- }
1098
-
1099
- if (_blockFirstTouch) {
1100
- _blockFirstTouch = NO;
1101
- return;
1102
- }
1103
-
1104
- if (![self isHorizontal:self.scrollView]) {
1105
- if ([notif.object[RCTTVNavigationEventNotificationKeyEventType] isEqual:RCTTVRemoteEventDown]) {
1106
- [self swipedDown];
1107
- return;
1108
- }
1109
-
1110
- if ([notif.object[RCTTVNavigationEventNotificationKeyEventType] isEqual:RCTTVRemoteEventUp]) {
1111
- [self swipedUp];
1112
- return;
1113
- }
1114
- }
1115
-
1116
- if ([notif.object[RCTTVNavigationEventNotificationKeyEventType] isEqual:RCTTVRemoteEventLeft]) {
1117
- [self swipedLeft];
1118
- return;
1119
- }
1120
-
1121
- if ([notif.object[RCTTVNavigationEventNotificationKeyEventType] isEqual:RCTTVRemoteEventRight]) {
1122
- [self swipedRight];
1123
- return;
1124
- }
1125
- }
1126
-
1127
- - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context
1128
- {
1129
- // If the previously focused item is this view and scrolling is disabled, defer to the superclass
1130
- if (context.previouslyFocusedItem == self && !self.scrollView.isScrollEnabled) {
1131
- return [super shouldUpdateFocusInContext:context];
1132
- }
1133
-
1134
- // Determine if the layout is Right-to-Left
1135
- BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1136
- // Adjust for horizontal scrolling with RTL support
1137
- if ([self isHorizontal:self.scrollView]) {
1138
- BOOL isMovingTowardsLeadingEdge = (isRTL ? context.focusHeading == UIFocusHeadingRight : context.focusHeading == UIFocusHeadingLeft);
1139
- BOOL isMovingTowardsTrailingEdge = (isRTL ? context.focusHeading == UIFocusHeadingLeft : context.focusHeading == UIFocusHeadingRight);
1140
-
1141
- BOOL isScrollingToLeading = (isMovingTowardsLeadingEdge && self.scrollView.contentOffset.x > 0);
1142
- BOOL isScrollingToTrailing = (isMovingTowardsTrailingEdge && self.scrollView.contentOffset.x < self.scrollView.contentSize.width - MAX(self.scrollView.visibleSize.width, 1));
1143
-
1144
- if (isScrollingToLeading || isScrollingToTrailing) {
1145
- return (context.nextFocusedItem && [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem]);
1146
- }
1147
- } else {
1148
- // Handle vertical scrolling as before
1149
- BOOL isMovingUp = (context.focusHeading == UIFocusHeadingUp && self.scrollView.contentOffset.y > 0);
1150
- BOOL isMovingDown = (context.focusHeading == UIFocusHeadingDown && self.scrollView.contentOffset.y < self.scrollView.contentSize.height - MAX(self.scrollView.visibleSize.height, 1));
1151
-
1152
- if (isMovingUp || isMovingDown) {
1153
- return (context.nextFocusedItem && [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem]);
1154
- }
1155
- }
1156
- return [super shouldUpdateFocusInContext:context];
1157
- }
1158
-
1159
- - (void)sendFocusNotification
1160
- {
1161
- [[NSNotificationCenter defaultCenter] postNavigationFocusEventWithTag:self.reactTag target:nil];
1162
- }
1163
-
1164
- - (void)sendBlurNotification
1165
- {
1166
- [[NSNotificationCenter defaultCenter] postNavigationBlurEventWithTag:self.reactTag target:nil];
1167
- }
1168
-
1169
- - (NSInteger)swipeVerticalInterval
1170
- {
1171
- if (self.snapToInterval) {
1172
- return self.snapToInterval;
1173
- }
1174
- return self.scrollView.visibleSize.height / 2;
1175
- }
1176
-
1177
- - (NSInteger)swipeHorizontalInterval
1178
- {
1179
- if (self.snapToInterval) {
1180
- return self.snapToInterval;
1181
- }
1182
- return self.scrollView.visibleSize.width / 2;
1183
- }
1184
-
1185
- - (NSTimeInterval)swipeDuration
1186
- {
1187
- float duration = [self.tvParallaxProperties[@"pressDuration"] floatValue];
1188
- if (duration == 0.0) {
1189
- duration = TV_DEFAULT_SWIPE_DURATION;
1190
- }
1191
- return duration;
1192
- }
1193
-
1194
- - (void)scrollToVerticalOffset:(CGFloat)yOffset
1195
- {
1196
- _blockFirstTouch = NO;
1197
- dispatch_async(dispatch_get_main_queue(), ^{
1198
- CGFloat limitedOffset = yOffset;
1199
-
1200
- // Ensure content size and visible size are non-negative
1201
- CGFloat contentHeight = MAX(self.scrollView.contentSize.height, 0.0);
1202
- CGFloat visibleHeight = MAX(self.scrollView.visibleSize.height, 0.0);
1203
-
1204
- // Compute the maximum offset, ensuring it's non-negative
1205
- CGFloat maxOffset = MAX(contentHeight - visibleHeight, 0.0);
1206
-
1207
- // Clamp the offset within valid bounds
1208
- limitedOffset = MAX(limitedOffset, 0.0);
1209
- limitedOffset = MIN(limitedOffset, maxOffset);
1210
-
1211
- [UIView animateWithDuration:[self swipeDuration] animations:^{
1212
- self.scrollView.contentOffset =
1213
- CGPointMake(self.scrollView.contentOffset.x, limitedOffset);
1214
- }];
1215
- });
1216
- }
1217
-
1218
- - (void)scrollToHorizontalOffset:(CGFloat)xOffset
1219
- {
1220
- _blockFirstTouch = NO;
1221
- dispatch_async(dispatch_get_main_queue(), ^{
1222
- CGFloat limitedOffset = xOffset;
1223
-
1224
- // Ensure content size and visible size are non-negative
1225
- CGFloat contentWidth = MAX(self.scrollView.contentSize.width, 0.0);
1226
- CGFloat visibleWidth = MAX(self.scrollView.visibleSize.width, 0.0);
1227
-
1228
- // Compute the maximum offset, ensuring it's non-negative
1229
- CGFloat maxOffset = MAX(contentWidth - visibleWidth, 0.0);
1230
-
1231
- // Clamp the offset within valid bounds
1232
- limitedOffset = MAX(limitedOffset, 0.0);
1233
- limitedOffset = MIN(limitedOffset, maxOffset);
1234
-
1235
- [UIView animateWithDuration:[self swipeDuration] animations:^{
1236
- self.scrollView.contentOffset =
1237
- CGPointMake(limitedOffset, self.scrollView.contentOffset.y);
1238
- }];
1239
- });
1240
- }
1241
-
1242
- - (void)swipedUp
1243
- {
1244
- if (!self.scrollView.scrollEnabled) {
1245
- return;
1246
- }
1247
-
1248
- CGFloat newOffset = self.scrollView.contentOffset.y - [self swipeVerticalInterval];
1249
- // NSLog(@"Swiped up to %f", newOffset);
1250
- [self scrollToVerticalOffset:newOffset];
1251
- }
1252
-
1253
- - (void)swipedDown
1254
- {
1255
- if (!self.scrollView.scrollEnabled) {
1256
- return;
1257
- }
1258
-
1259
- CGFloat newOffset = self.scrollView.contentOffset.y + [self swipeVerticalInterval];
1260
- // NSLog(@"Swiped down to %f", newOffset);
1261
- [self scrollToVerticalOffset:newOffset];
1262
- }
1263
-
1264
- - (void)swipedLeft
1265
- {
1266
- if (!self.scrollView.scrollEnabled) {
1267
- return;
1268
- }
1269
-
1270
- BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1271
- NSInteger horizontalInterval = [self swipeHorizontalInterval];
1272
- CGFloat newOffset = self.scrollView.contentOffset.x + (isRTL ? horizontalInterval : -horizontalInterval);
1273
- // NSLog(@"Swiped left to %f", newOffset);
1274
- [self scrollToHorizontalOffset:newOffset];
1275
- }
1276
-
1277
- - (void)swipedRight
1278
- {
1279
- if (!self.scrollView.scrollEnabled) {
1280
- return;
1281
- }
1282
-
1283
- BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1284
- NSInteger horizontalInterval = [self swipeHorizontalInterval];
1285
- CGFloat newOffset = self.scrollView.contentOffset.x + (isRTL ? -horizontalInterval : horizontalInterval);
1286
- // NSLog(@"Swiped right to %f", newOffset);
1287
- [self scrollToHorizontalOffset:newOffset];
1288
- }
1289
-
1290
- - (void)addSwipeGestureRecognizers
1291
- {
1292
- [self addSwipeGestureRecognizerWithSelector:@selector(swipedUp) direction:UISwipeGestureRecognizerDirectionUp name:RCTTVRemoteEventSwipeUp];
1293
- [self addSwipeGestureRecognizerWithSelector:@selector(swipedDown) direction:UISwipeGestureRecognizerDirectionDown name:RCTTVRemoteEventSwipeDown];
1294
- [self addSwipeGestureRecognizerWithSelector:@selector(swipedLeft) direction:UISwipeGestureRecognizerDirectionLeft name:RCTTVRemoteEventSwipeLeft];
1295
- [self addSwipeGestureRecognizerWithSelector:@selector(swipedRight) direction:UISwipeGestureRecognizerDirectionRight name:RCTTVRemoteEventSwipeRight];
1296
- }
1297
-
1298
- - (void)addSwipeGestureRecognizerWithSelector:(nonnull SEL)selector
1299
- direction:(UISwipeGestureRecognizerDirection)direction
1300
- name:(NSString *)name
1301
- {
1302
- UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:selector];
1303
- recognizer.direction = direction;
1304
-
1305
- _tvRemoteGestureRecognizers[name] = recognizer;
1306
- [self.scrollView addGestureRecognizer:recognizer];
1307
- }
1308
-
1309
- - (void)removeSwipeGestureRecognizers
1310
- {
1311
- NSArray *names = [self->_tvRemoteGestureRecognizers allKeys];
1312
- for (NSString *name in names) {
1313
- UIGestureRecognizer *r = self->_tvRemoteGestureRecognizers[name];
1314
- [self.scrollView removeGestureRecognizer:r];
1315
- [self->_tvRemoteGestureRecognizers removeObjectForKey:name];
1316
- }
1317
- }
1318
-
1319
- #endif // TARGET_OS_TV
1320
-
1321
-
1322
-
1323
- #pragma mark - RCTUIManagerObserver
1324
-
1325
- - (void)uiManagerWillPerformMounting:(RCTUIManager *)manager
1326
- {
1327
- RCTAssertUIManagerQueue();
1328
-
1329
- [manager prependUIBlock:^(
1330
- __unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
1331
- BOOL horz = [self isHorizontal:self->_scrollView];
1332
- NSUInteger minIdx = [self->_maintainVisibleContentPosition[@"minIndexForVisible"] integerValue];
1333
- for (NSUInteger ii = minIdx; ii < self->_contentView.subviews.count; ++ii) {
1334
- // Find the first partially or fully visible view. This must be done after we update the content offset
1335
- // or it will tend to grab rows that were made visible by the shift in position
1336
- UIView *subview = self->_contentView.subviews[ii];
1337
- BOOL hasNewView = NO;
1338
- if (horz) {
1339
- CGFloat leftInset = self.inverted ? self->_scrollView.contentInset.right : self->_scrollView.contentInset.left;
1340
- CGFloat x = self->_scrollView.contentOffset.x + leftInset;
1341
- hasNewView = subview.frame.origin.x + subview.frame.size.width > x;
1342
- } else {
1343
- CGFloat bottomInset =
1344
- self.inverted ? self->_scrollView.contentInset.top : self->_scrollView.contentInset.bottom;
1345
- CGFloat y = self->_scrollView.contentOffset.y + bottomInset;
1346
- hasNewView = subview.frame.origin.y + subview.frame.size.height > y;
1347
- }
1348
- if (hasNewView || ii == self->_contentView.subviews.count - 1) {
1349
- self->_prevFirstVisibleFrame = subview.frame;
1350
- self->_firstVisibleView = subview;
1351
- break;
1352
- }
1353
- }
1354
- }];
1355
- [manager addUIBlock:^(__unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
1356
- if (self->_maintainVisibleContentPosition == nil) {
1357
- return; // The prop might have changed in the previous UIBlocks, so need to abort here.
1358
- }
1359
- NSNumber *autoscrollThreshold = self->_maintainVisibleContentPosition[@"autoscrollToTopThreshold"];
1360
- // TODO: detect and handle/ignore re-ordering
1361
- if ([self isHorizontal:self->_scrollView]) {
1362
- CGFloat deltaX = self->_firstVisibleView.frame.origin.x - self->_prevFirstVisibleFrame.origin.x;
1363
- if (ABS(deltaX) > 0.1) {
1364
- CGFloat leftInset = self.inverted ? self->_scrollView.contentInset.right : self->_scrollView.contentInset.left;
1365
- CGFloat x = self->_scrollView.contentOffset.x + leftInset;
1366
- self->_scrollView.contentOffset =
1367
- CGPointMake(self->_scrollView.contentOffset.x + deltaX, self->_scrollView.contentOffset.y);
1368
- if (autoscrollThreshold != nil) {
1369
- // If the offset WAS within the threshold of the start, animate to the start.
1370
- if (x <= [autoscrollThreshold integerValue]) {
1371
- [self scrollToOffset:CGPointMake(-leftInset, self->_scrollView.contentOffset.y) animated:YES];
1372
- }
1373
- }
1374
- }
1375
- } else {
1376
- CGRect newFrame = self->_firstVisibleView.frame;
1377
- CGFloat deltaY = newFrame.origin.y - self->_prevFirstVisibleFrame.origin.y;
1378
- if (ABS(deltaY) > 0.1) {
1379
- CGFloat bottomInset =
1380
- self.inverted ? self->_scrollView.contentInset.top : self->_scrollView.contentInset.bottom;
1381
- CGFloat y = self->_scrollView.contentOffset.y + bottomInset;
1382
- self->_scrollView.contentOffset =
1383
- CGPointMake(self->_scrollView.contentOffset.x, self->_scrollView.contentOffset.y + deltaY);
1384
- if (autoscrollThreshold != nil) {
1385
- // If the offset WAS within the threshold of the start, animate to the start.
1386
- if (y <= [autoscrollThreshold integerValue]) {
1387
- [self scrollToOffset:CGPointMake(self->_scrollView.contentOffset.x, -bottomInset) animated:YES];
1388
- }
1389
- }
1390
- }
1391
- }
1392
- }];
1393
- }
1394
-
1395
- // Note: setting several properties of UIScrollView has the effect of
1396
- // resetting its contentOffset to {0, 0}. To prevent this, we generate
1397
- // setters here that will record the contentOffset beforehand, and
1398
- // restore it after the property has been set.
1399
-
1400
- #define RCT_SET_AND_PRESERVE_OFFSET(setter, getter, type) \
1401
- -(void)setter : (type)value \
1402
- { \
1403
- CGPoint contentOffset = _scrollView.contentOffset; \
1404
- [_scrollView setter:value]; \
1405
- _scrollView.contentOffset = contentOffset; \
1406
- } \
1407
- -(type)getter \
1408
- { \
1409
- return [_scrollView getter]; \
1410
- }
1411
-
1412
- RCT_SET_AND_PRESERVE_OFFSET(setAlwaysBounceHorizontal, alwaysBounceHorizontal, BOOL)
1413
- RCT_SET_AND_PRESERVE_OFFSET(setAlwaysBounceVertical, alwaysBounceVertical, BOOL)
1414
- RCT_SET_AND_PRESERVE_OFFSET(setBounces, bounces, BOOL)
1415
- RCT_SET_AND_PRESERVE_OFFSET(setBouncesZoom, bouncesZoom, BOOL)
1416
- RCT_SET_AND_PRESERVE_OFFSET(setCanCancelContentTouches, canCancelContentTouches, BOOL)
1417
- RCT_SET_AND_PRESERVE_OFFSET(setDecelerationRate, decelerationRate, CGFloat)
1418
- RCT_SET_AND_PRESERVE_OFFSET(setDirectionalLockEnabled, isDirectionalLockEnabled, BOOL)
1419
- RCT_SET_AND_PRESERVE_OFFSET(setIndicatorStyle, indicatorStyle, UIScrollViewIndicatorStyle)
1420
- RCT_SET_AND_PRESERVE_OFFSET(setKeyboardDismissMode, keyboardDismissMode, UIScrollViewKeyboardDismissMode)
1421
- RCT_SET_AND_PRESERVE_OFFSET(setMaximumZoomScale, maximumZoomScale, CGFloat)
1422
- RCT_SET_AND_PRESERVE_OFFSET(setMinimumZoomScale, minimumZoomScale, CGFloat)
1423
- RCT_SET_AND_PRESERVE_OFFSET(setScrollEnabled, isScrollEnabled, BOOL)
1424
- #if !TARGET_OS_TV
1425
- RCT_SET_AND_PRESERVE_OFFSET(setPagingEnabled, isPagingEnabled, BOOL)
1426
- RCT_SET_AND_PRESERVE_OFFSET(setScrollsToTop, scrollsToTop, BOOL)
1427
- #endif
1428
- RCT_SET_AND_PRESERVE_OFFSET(setShowsHorizontalScrollIndicator, showsHorizontalScrollIndicator, BOOL)
1429
- RCT_SET_AND_PRESERVE_OFFSET(setShowsVerticalScrollIndicator, showsVerticalScrollIndicator, BOOL)
1430
- RCT_SET_AND_PRESERVE_OFFSET(setZoomScale, zoomScale, CGFloat);
1431
-
1432
- - (void)setScrollIndicatorInsets:(UIEdgeInsets)value
1433
- {
1434
- [_scrollView setScrollIndicatorInsets:value];
1435
- }
1436
-
1437
- - (UIEdgeInsets)scrollIndicatorInsets
1438
- {
1439
- UIEdgeInsets verticalScrollIndicatorInsets = [_scrollView verticalScrollIndicatorInsets];
1440
- UIEdgeInsets horizontalScrollIndicatorInsets = [_scrollView horizontalScrollIndicatorInsets];
1441
-
1442
- return UIEdgeInsetsMake(
1443
- verticalScrollIndicatorInsets.top,
1444
- horizontalScrollIndicatorInsets.left,
1445
- verticalScrollIndicatorInsets.bottom,
1446
- horizontalScrollIndicatorInsets.right);
1447
- }
1448
-
1449
- - (void)setAutomaticallyAdjustsScrollIndicatorInsets:(BOOL)automaticallyAdjusts API_AVAILABLE(ios(13.0))
1450
- {
1451
- // `automaticallyAdjustsScrollIndicatorInsets` is available since iOS 13.
1452
- if ([_scrollView respondsToSelector:@selector(setAutomaticallyAdjustsScrollIndicatorInsets:)]) {
1453
- _scrollView.automaticallyAdjustsScrollIndicatorInsets = automaticallyAdjusts;
1454
- }
1455
- }
1456
-
1457
- - (void)setContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)behavior
1458
- {
1459
- CGPoint contentOffset = _scrollView.contentOffset;
1460
- _scrollView.contentInsetAdjustmentBehavior = behavior;
1461
- _scrollView.contentOffset = contentOffset;
1462
- }
1463
-
1464
- - (void)sendScrollEventWithName:(NSString *)eventName
1465
- scrollView:(UIScrollView *)scrollView
1466
- userData:(NSDictionary *)userData
1467
- {
1468
- if (![_lastEmittedEventName isEqualToString:eventName]) {
1469
- _coalescingKey++;
1470
- _lastEmittedEventName = [eventName copy];
1471
- }
1472
-
1473
- CGPoint offset = scrollView.contentOffset;
1474
- if ([self reactLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
1475
- offset.x = scrollView.contentSize.width - scrollView.frame.size.width - offset.x;
1476
- }
1477
-
1478
- RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:eventName
1479
- reactTag:self.reactTag
1480
- scrollViewContentOffset:offset
1481
- scrollViewContentInset:scrollView.contentInset
1482
- scrollViewContentSize:scrollView.contentSize
1483
- scrollViewFrame:scrollView.frame
1484
- scrollViewZoomScale:scrollView.zoomScale
1485
- userData:userData
1486
- coalescingKey:_coalescingKey];
1487
- [_eventDispatcher sendEvent:scrollEvent];
1488
- }
1489
-
1490
- @end
1491
-
1492
- void RCTSendFakeScrollEvent(id<RCTEventDispatcherProtocol> eventDispatcher, NSNumber *reactTag)
1493
- {
1494
- // Use the selector here in case the onScroll block property is ever renamed
1495
- NSString *eventName = NSStringFromSelector(@selector(onScroll));
1496
- RCTScrollEvent *fakeScrollEvent = [[RCTScrollEvent alloc] initWithEventName:eventName
1497
- reactTag:reactTag
1498
- scrollViewContentOffset:CGPointZero
1499
- scrollViewContentInset:UIEdgeInsetsZero
1500
- scrollViewContentSize:CGSizeZero
1501
- scrollViewFrame:CGRectZero
1502
- scrollViewZoomScale:0
1503
- userData:nil
1504
- coalescingKey:0];
1505
- [eventDispatcher sendEvent:fakeScrollEvent];
1506
- }
1507
-
1508
- #endif // RCT_REMOVE_LEGACY_ARCH