react-native-macos 0.0.0-ea192044d → 0.0.0-ea769f57f

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 (365) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +2 -3
  2. package/Libraries/Alert/Alert.js +2 -2
  3. package/Libraries/Alert/RCTAlertManager.android.js +1 -1
  4. package/Libraries/Animated/AnimatedImplementation.js +53 -53
  5. package/Libraries/Animated/AnimatedMock.js +8 -8
  6. package/Libraries/Animated/NativeAnimatedHelper.js +23 -20
  7. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  8. package/Libraries/Animated/nodes/AnimatedNode.js +10 -9
  9. package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
  10. package/Libraries/AppState/AppState.js +8 -7
  11. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +2 -2
  12. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  13. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -20
  14. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -2
  15. package/Libraries/Components/Button.js +1 -2
  16. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +6 -7
  17. package/Libraries/Components/Keyboard/Keyboard.js +8 -7
  18. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -10
  19. package/Libraries/Components/Pressable/Pressable.js +1 -2
  20. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +2 -1
  21. package/Libraries/Components/RefreshControl/RefreshControl.js +2 -7
  22. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -3
  23. package/Libraries/Components/SafeAreaView/SafeAreaView.js +2 -2
  24. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -5
  25. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +3 -5
  26. package/Libraries/Components/ScrollView/ScrollView.js +29 -67
  27. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -4
  28. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -2
  29. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +2 -8
  30. package/Libraries/Components/Sound/SoundManager.js +1 -1
  31. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -2
  32. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +3 -5
  33. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +3 -5
  34. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  35. package/Libraries/Components/TextInput/TextInput.js +130 -12
  36. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +3 -3
  37. package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +3 -3
  38. package/Libraries/Components/Touchable/BoundingDimensions.js +2 -2
  39. package/Libraries/Components/Touchable/PooledClass.js +6 -6
  40. package/Libraries/Components/Touchable/Position.js +1 -1
  41. package/Libraries/Components/Touchable/Touchable.js +26 -25
  42. package/Libraries/Components/Touchable/TouchableBounce.js +1 -2
  43. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -2
  44. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -11
  45. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -2
  46. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  47. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  48. package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -0
  49. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +3 -3
  50. package/Libraries/Components/View/View.js +0 -7
  51. package/Libraries/Components/View/ViewNativeComponent.js +3 -4
  52. package/Libraries/Components/View/ViewPropTypes.js +10 -6
  53. package/Libraries/Core/Devtools/parseHermesStack.js +2 -1
  54. package/Libraries/Core/ExceptionsManager.js +2 -2
  55. package/Libraries/Core/NativeExceptionsManager.js +2 -3
  56. package/Libraries/Core/ReactNativeVersion.js +1 -1
  57. package/Libraries/Core/Timers/JSTimers.js +17 -13
  58. package/Libraries/Core/setUpAlert.js +1 -1
  59. package/Libraries/Core/setUpDeveloperTools.js +1 -1
  60. package/Libraries/Core/setUpPerformance.js +1 -1
  61. package/Libraries/Core/setUpRegeneratorRuntime.js +1 -1
  62. package/Libraries/Core/setUpSegmentFetcher.js +4 -4
  63. package/Libraries/EventEmitter/NativeEventEmitter.js +2 -1
  64. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -1
  65. package/Libraries/HeapCapture/HeapCapture.js +1 -1
  66. package/Libraries/Image/AssetSourceResolver.js +2 -4
  67. package/Libraries/Image/Image.android.js +4 -4
  68. package/Libraries/Image/Image.ios.js +3 -3
  69. package/Libraries/Image/ImageAnalyticsTagContext.js +2 -3
  70. package/Libraries/Image/ImageBackground.js +1 -2
  71. package/Libraries/Image/ImagePickerIOS.js +6 -6
  72. package/Libraries/Image/ImageViewNativeComponent.js +2 -4
  73. package/Libraries/Image/NativeImageLoaderAndroid.js +1 -3
  74. package/Libraries/Image/RCTImageCache.m +1 -1
  75. package/Libraries/Image/RCTImageView.mm +14 -10
  76. package/Libraries/Image/React-RCTImage.podspec +1 -1
  77. package/Libraries/Image/TextInlineImageNativeComponent.js +3 -5
  78. package/Libraries/Inspector/ElementProperties.js +2 -4
  79. package/Libraries/Inspector/InspectorOverlay.js +1 -2
  80. package/Libraries/Inspector/InspectorPanel.js +1 -2
  81. package/Libraries/Inspector/NetworkOverlay.js +5 -11
  82. package/Libraries/Interaction/BridgeSpyStallHandler.js +1 -1
  83. package/Libraries/Interaction/FrameRateLogger.js +2 -2
  84. package/Libraries/Interaction/InteractionManager.js +2 -4
  85. package/Libraries/Interaction/JSEventLoopWatchdog.js +4 -4
  86. package/Libraries/Interaction/PanResponder.js +3 -4
  87. package/Libraries/Interaction/TouchHistoryMath.js +7 -7
  88. package/Libraries/JSInspector/NetworkAgent.js +1 -6
  89. package/Libraries/LayoutAnimation/LayoutAnimation.js +3 -3
  90. package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
  91. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  92. package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
  93. package/Libraries/Lists/FillRateHelper.js +1 -3
  94. package/Libraries/Lists/FlatList.js +28 -5
  95. package/Libraries/Lists/ViewabilityHelper.js +4 -10
  96. package/Libraries/Lists/VirtualizeUtils.js +2 -6
  97. package/Libraries/Lists/VirtualizedList.js +136 -148
  98. package/Libraries/Lists/VirtualizedListContext.js +3 -5
  99. package/Libraries/Lists/VirtualizedSectionList.js +63 -68
  100. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  101. package/Libraries/LogBox/Data/parseLogBoxLog.js +12 -23
  102. package/Libraries/LogBox/UI/LogBoxButton.js +2 -4
  103. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -4
  104. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -2
  105. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -2
  106. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -6
  107. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -2
  108. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -4
  109. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -4
  110. package/Libraries/LogBox/UI/LogBoxNotification.js +2 -4
  111. package/Libraries/Modal/Modal.js +2 -4
  112. package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
  113. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
  114. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
  115. package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
  116. package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
  117. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
  118. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -4
  119. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  120. package/Libraries/Network/XHRInterceptor.js +5 -6
  121. package/Libraries/NewAppScreen/components/Header.js +2 -4
  122. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -2
  123. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +2 -4
  124. package/Libraries/Performance/SamplingProfiler.js +3 -3
  125. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -3
  126. package/Libraries/Pressability/Pressability.js +2 -2
  127. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +4 -2
  128. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +8 -7
  129. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  130. package/Libraries/ReactNative/AppContainer.js +4 -6
  131. package/Libraries/ReactNative/AppRegistry.js +2 -3
  132. package/Libraries/ReactNative/I18nManager.js +2 -5
  133. package/Libraries/ReactNative/PaperUIManager.js +2 -3
  134. package/Libraries/ReactNative/RootTag.js +2 -3
  135. package/Libraries/ReactNative/renderApplication.js +1 -2
  136. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  137. package/Libraries/Storage/AsyncStorage.js +21 -21
  138. package/Libraries/StyleSheet/StyleSheet.js +2 -1
  139. package/Libraries/StyleSheet/StyleSheetTypes.js +26 -1
  140. package/Libraries/StyleSheet/processColor.js +2 -2
  141. package/Libraries/StyleSheet/splitLayoutProps.js +1 -3
  142. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +1 -0
  143. package/Libraries/Text/RCTTextAttributes.h +2 -0
  144. package/Libraries/Text/RCTTextAttributes.m +29 -13
  145. package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
  146. package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
  147. package/Libraries/Text/Text/RCTTextView.m +123 -54
  148. package/Libraries/Text/Text.js +2 -9
  149. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
  150. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +58 -3
  151. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
  152. package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
  153. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +89 -5
  154. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +13 -1
  155. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
  156. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
  157. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +12 -0
  158. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +9 -1
  159. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +120 -2
  160. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +12 -1
  161. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +40 -1
  162. package/Libraries/Text/TextNativeComponent.js +5 -5
  163. package/Libraries/Text/TextProps.js +29 -0
  164. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  165. package/Libraries/Types/CoreEventTypes.js +0 -1
  166. package/Libraries/Utilities/Appearance.js +8 -5
  167. package/Libraries/Utilities/BackHandler.android.js +4 -4
  168. package/Libraries/Utilities/HMRClient.js +2 -2
  169. package/Libraries/Utilities/JSDevSupportModule.js +3 -4
  170. package/Libraries/Utilities/MatrixMath.js +19 -19
  171. package/Libraries/Utilities/PerformanceLoggerContext.js +2 -3
  172. package/Libraries/Utilities/ReactNativeTestTools.js +2 -4
  173. package/Libraries/Utilities/SceneTracker.js +1 -3
  174. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -3
  175. package/Libraries/Utilities/buildStyleInterpolator.js +9 -9
  176. package/Libraries/Utilities/codegenNativeComponent.js +4 -2
  177. package/Libraries/Utilities/differ/deepDiffer.js +1 -1
  178. package/Libraries/Utilities/differ/insetsDiffer.js +1 -1
  179. package/Libraries/Utilities/differ/matricesDiffer.js +1 -1
  180. package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
  181. package/Libraries/Utilities/differ/sizesDiffer.js +1 -1
  182. package/Libraries/Utilities/logError.js +1 -1
  183. package/Libraries/Utilities/mergeIntoFast.js +1 -1
  184. package/Libraries/Utilities/truncate.js +1 -1
  185. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  186. package/Libraries/Vibration/Vibration.js +2 -2
  187. package/Libraries/WebSocket/WebSocketInterceptor.js +4 -4
  188. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  189. package/Libraries/vendor/emitter/_EmitterSubscription.js +2 -1
  190. package/Libraries/vendor/emitter/_EventEmitter.js +2 -1
  191. package/Libraries/vendor/emitter/_EventSubscription.js +2 -1
  192. package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +1 -1
  193. package/React/Base/RCTAssert.h +30 -15
  194. package/React/Base/RCTAssert.m +59 -19
  195. package/React/Base/RCTBridge.m +5 -3
  196. package/React/Base/RCTConstants.h +6 -0
  197. package/React/Base/RCTConstants.m +15 -0
  198. package/React/Base/RCTConvert.m +8 -4
  199. package/React/Base/RCTEventDispatcherProtocol.h +5 -0
  200. package/React/Base/RCTRootView.m +0 -51
  201. package/React/Base/RCTTouchHandler.m +4 -0
  202. package/React/Base/RCTUIKit.h +8 -13
  203. package/React/Base/RCTUtils.m +33 -3
  204. package/React/Base/RCTVersion.m +1 -1
  205. package/React/Base/macOS/RCTUIKit.m +40 -0
  206. package/React/CoreModules/RCTAppearance.mm +21 -5
  207. package/React/CoreModules/RCTEventDispatcher.mm +6 -1
  208. package/React/CoreModules/RCTLogBox.h +1 -1
  209. package/React/CoreModules/RCTLogBox.mm +10 -11
  210. package/React/CoreModules/RCTLogBoxView.h +4 -6
  211. package/React/CoreModules/RCTLogBoxView.mm +29 -24
  212. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  213. package/React/CoreModules/React-CoreModules.podspec +1 -1
  214. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
  215. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +1 -0
  216. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +69 -19
  217. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +2 -1
  218. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
  219. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
  220. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +35 -9
  221. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +2 -2
  222. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +4 -3
  223. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
  224. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -5
  225. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
  226. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +1 -1
  227. package/React/Fabric/Mounting/RCTMountingManager.h +1 -1
  228. package/React/Fabric/Mounting/RCTMountingManager.mm +19 -11
  229. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
  230. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
  231. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +5 -3
  232. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +1 -1
  233. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +1 -1
  234. package/React/Fabric/RCTConversions.h +9 -1
  235. package/React/Fabric/RCTImageResponseObserverProxy.h +1 -0
  236. package/React/Fabric/RCTLocalizationProvider.mm +10 -4
  237. package/React/Fabric/RCTScheduler.h +7 -0
  238. package/React/Fabric/RCTScheduler.mm +15 -0
  239. package/React/Fabric/RCTSurfacePresenter.h +2 -0
  240. package/React/Fabric/RCTSurfacePresenter.mm +46 -22
  241. package/React/Fabric/RCTSurfaceTouchHandler.mm +0 -1
  242. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
  243. package/React/Modules/RCTUIManager.m +29 -14
  244. package/React/React-RCTFabric.podspec +2 -2
  245. package/React/Views/RCTActivityIndicatorView.m +2 -1
  246. package/React/Views/RCTCursor.h +39 -0
  247. package/React/Views/RCTCursor.m +105 -0
  248. package/React/Views/RCTView.h +16 -0
  249. package/React/Views/RCTView.m +142 -192
  250. package/React/Views/RCTViewKeyboardEvent.h +6 -28
  251. package/React/Views/RCTViewKeyboardEvent.m +66 -61
  252. package/React/Views/RCTViewManager.m +19 -13
  253. package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
  254. package/React/Views/ScrollView/RCTScrollContentView.m +18 -0
  255. package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
  256. package/React/Views/ScrollView/RCTScrollView.h +2 -1
  257. package/React/Views/ScrollView/RCTScrollView.m +66 -89
  258. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
  259. package/React/Views/UIView+React.h +2 -0
  260. package/React/Views/UIView+React.m +23 -14
  261. package/ReactAndroid/gradle.properties +1 -1
  262. package/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js +1 -2
  263. package/ReactAndroid/src/androidTest/js/Asserts.js +2 -2
  264. package/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js +1 -1
  265. package/ReactAndroid/src/androidTest/js/JSResponderTestApp.js +1 -2
  266. package/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js +1 -2
  267. package/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js +54 -54
  268. package/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js +1 -1
  269. package/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +6 -7
  270. package/ReactAndroid/src/androidTest/js/ShareTestModule.js +1 -1
  271. package/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +12 -19
  272. package/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js +2 -3
  273. package/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js +2 -2
  274. package/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js +17 -17
  275. package/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js +10 -10
  276. package/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js +2 -2
  277. package/ReactAndroid/src/androidTest/js/TextInputTestModule.js +2 -3
  278. package/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js +3 -6
  279. package/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +3 -6
  280. package/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js +5 -5
  281. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
  282. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  283. package/ReactAndroid/src/main/jni/Application.mk +1 -1
  284. package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
  285. package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
  286. package/ReactCommon/React-Fabric.podspec +1 -1
  287. package/ReactCommon/React-rncore.podspec +1 -1
  288. package/ReactCommon/ReactCommon.podspec +1 -1
  289. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  290. package/ReactCommon/cxxreact/tests/BUCK +1 -1
  291. package/ReactCommon/hermes/inspector/tools/msggen/src/HeaderWriter.js +1 -1
  292. package/ReactCommon/hermes/inspector/tools/msggen/src/index.js +1 -1
  293. package/ReactCommon/microprofiler/BUCK +1 -1
  294. package/ReactCommon/react/debug/react_native_assert.h +1 -1
  295. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
  296. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
  297. package/ReactCommon/react/renderer/animations/conversions.h +11 -11
  298. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
  299. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
  300. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
  301. package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
  302. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  303. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +4 -2
  304. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
  305. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
  306. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
  307. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
  308. package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
  309. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
  310. package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
  311. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
  312. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
  313. package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
  314. package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
  315. package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
  316. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
  317. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
  318. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
  319. package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
  320. package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
  321. package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
  322. package/ReactCommon/react/renderer/core/EventListener.h +44 -0
  323. package/ReactCommon/react/renderer/core/Props.h +0 -4
  324. package/ReactCommon/react/renderer/core/RawProps.h +1 -1
  325. package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
  326. package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
  327. package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
  328. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
  329. package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
  330. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  331. package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
  332. package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
  333. package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
  334. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  335. package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
  336. package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
  337. package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
  338. package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
  339. package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
  340. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
  341. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
  342. package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
  343. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
  344. package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
  345. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +8 -8
  346. package/ReactCommon/react/utils/ContextContainer.h +2 -2
  347. package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
  348. package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
  349. package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
  350. package/ReactCommon/yoga/Yoga.podspec +1 -1
  351. package/jest/assetFileTransformer.js +2 -2
  352. package/jest/preprocessor.js +2 -2
  353. package/jest/setup.js +3 -3
  354. package/package.json +22 -25
  355. package/scripts/generate-artifacts.js +21 -17
  356. package/scripts/react_native_pods.rb +1 -4
  357. package/template/App.js +4 -8
  358. package/template/Gemfile.lock +7 -7
  359. package/template/android/gradlew.bat +89 -89
  360. package/template/ios/HelloWorldTests/HelloWorldTests.m +1 -0
  361. package/template/package.json +1 -1
  362. package/Libraries/Types/RootTagTypes.js~merged +0 -23
  363. package/ReactCommon/butter/optional.h +0 -38
  364. package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
  365. package/third-party-podspecs/boost-for-react-native.podspec +0 -20
@@ -11,15 +11,13 @@
11
11
 
12
12
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
13
13
 
14
- @interface RCTLogBoxWindow : UIWindow // TODO(macOS GH#774) Renamed from _view to _window
14
+ @interface RCTLogBoxView : UIWindow
15
15
 
16
16
  - (instancetype)initWithFrame:(CGRect)frame;
17
17
 
18
18
  - (void)createRootViewController:(UIView *)view;
19
19
 
20
- - (instancetype)initWithFrame:(CGRect)frame bridge:(RCTBridge *)bridge;
21
-
22
- - (void)hide; // TODO(macOS GH#774)
20
+ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge;
23
21
 
24
22
  - (void)show;
25
23
 
@@ -27,11 +25,11 @@
27
25
 
28
26
  #else // [TODO(macOS GH#774)
29
27
 
30
- @interface RCTLogBoxWindow : NSWindow // TODO(macOS GH#774) Renamed from _view to _window
28
+ @interface RCTLogBoxView : NSWindow // TODO(macOS GH#774)
31
29
 
32
30
  - (instancetype)initWithBridge:(RCTBridge *)bridge;
33
31
 
34
- - (void)hide;
32
+ - (void)setHidden:(BOOL)hidden;
35
33
 
36
34
  - (void)show;
37
35
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
14
14
 
15
- @implementation RCTLogBoxWindow { // TODO(macOS GH#774) Renamed from _view to _window
15
+ @implementation RCTLogBoxView {
16
16
  RCTSurface *_surface;
17
17
  }
18
18
 
@@ -34,35 +34,38 @@
34
34
  self.rootViewController = _rootViewController;
35
35
  }
36
36
 
37
- - (instancetype)initWithFrame:(CGRect)frame bridge:(RCTBridge *)bridge
37
+ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
38
38
  {
39
- if ((self = [super initWithFrame:frame])) {
40
- self.windowLevel = UIWindowLevelStatusBar - 1;
41
- self.backgroundColor = [UIColor clearColor];
42
-
43
- _surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
39
+ if (@available(iOS 13.0, *)) {
40
+ self = [super initWithWindowScene:window.windowScene];
41
+ } else {
42
+ self = [super initWithFrame:window.frame];
43
+ }
44
44
 
45
- [_surface start];
46
- [_surface setSize:frame.size];
45
+ self.windowLevel = UIWindowLevelStatusBar - 1;
46
+ self.backgroundColor = [UIColor clearColor];
47
47
 
48
- if (![_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:1]) {
49
- RCTLogInfo(@"Failed to mount LogBox within 1s");
50
- }
48
+ _surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
49
+ [_surface start];
51
50
 
52
- [self createRootViewController:(UIView *)_surface.view];
51
+ if (![_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:1]) {
52
+ RCTLogInfo(@"Failed to mount LogBox within 1s");
53
53
  }
54
+ [self createRootViewController:(UIView *)_surface.view];
55
+
54
56
  return self;
55
57
  }
56
58
 
57
- - (void)dealloc
59
+ - (void)layoutSubviews
58
60
  {
59
- [RCTSharedApplication().delegate.window makeKeyWindow];
61
+ [super layoutSubviews];
62
+ [_surface setSize:self.frame.size];
60
63
  }
61
64
 
62
- - (void)hide // [TODO(macOS GH#774)
65
+ - (void)dealloc
63
66
  {
64
- [self setHidden:YES];
65
- } // ]TODO(macOS GH#774)
67
+ [RCTSharedApplication().delegate.window makeKeyWindow];
68
+ }
66
69
 
67
70
  - (void)show
68
71
  {
@@ -74,7 +77,7 @@
74
77
 
75
78
  #else // [TODO(macOS GH#774)
76
79
 
77
- @implementation RCTLogBoxWindow { // TODO(macOS GH#774) Renamed from _view to _window
80
+ @implementation RCTLogBoxView {
78
81
  RCTSurface *_surface;
79
82
  }
80
83
 
@@ -100,13 +103,15 @@
100
103
  return self;
101
104
  }
102
105
 
103
- - (void)hide
106
+ - (void)setHidden:(BOOL)hidden // [TODO(macOS GH#774)
104
107
  {
105
- if (NSApp.modalWindow == self) {
106
- [NSApp stopModal];
108
+ if (hidden) {
109
+ if (NSApp.modalWindow == self) {
110
+ [NSApp stopModal];
111
+ }
112
+ [self orderOut:nil];
107
113
  }
108
- [self orderOut:nil];
109
- }
114
+ } // ]TODO(macOS GH#774)
110
115
 
111
116
  - (void)show
112
117
  {
@@ -176,7 +176,7 @@ RCT_EXPORT_MODULE()
176
176
  {
177
177
  if (!_devMenuItem) {
178
178
  __weak __typeof__(self) weakSelf = self;
179
- __weak RCTDevSettings *devSettings = [self->_moduleRegistry moduleForName:"DevSettings"];
179
+ __weak RCTDevSettings *devSettings = [[self bridge] devSettings]; // TODO(macOS GH#774)
180
180
  if (devSettings.isPerfMonitorShown) {
181
181
  [weakSelf show];
182
182
  }
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  s.header_dir = "CoreModules"
38
38
  s.pod_target_xcconfig = {
39
39
  "USE_HEADERMAP" => "YES",
40
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
40
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
41
41
  "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
42
42
  }
43
43
 
@@ -39,7 +39,7 @@ Pod::Spec.new do |s|
39
39
 
40
40
  s.pod_target_xcconfig = {
41
41
  "USE_HEADERMAP" => "YES",
42
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
42
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
43
43
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\""
44
44
  }
45
45
 
@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
19
19
  + (BOOL)isSupported:(NSString *)componentName;
20
20
 
21
21
  + (void)supportLegacyViewManagerWithName:(NSString *)componentName;
22
+ + (void)supportLegacyViewManagersWithPrefix:(NSString *)prefix;
22
23
 
23
24
  @end
24
25
 
@@ -8,6 +8,7 @@
8
8
  #import "RCTLegacyViewManagerInteropComponentView.h"
9
9
 
10
10
  #import <React/RCTAssert.h>
11
+ #import <React/RCTConstants.h>
11
12
  #import <React/UIView+React.h>
12
13
  #import <react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h>
13
14
  #import <react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h>
@@ -24,17 +25,17 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
24
25
  NSMutableArray<UIView *> *_viewsToBeUnmounted;
25
26
  RCTLegacyViewManagerInteropCoordinatorAdapter *_adapter;
26
27
  LegacyViewManagerInteropShadowNode::ConcreteState::Shared _state;
28
+ BOOL _hasInvokedForwardingWarning;
27
29
  }
28
30
 
29
31
  - (instancetype)initWithFrame:(CGRect)frame
30
32
  {
31
33
  if (self = [super initWithFrame:frame]) {
32
- RCTWarnNotAllowedForNewArchitecture(
33
- self, @"ViewManager with interop layer is not allowed in the new architecture.");
34
34
  static const auto defaultProps = std::make_shared<const LegacyViewManagerInteropViewProps>();
35
35
  _props = defaultProps;
36
36
  _viewsToBeMounted = [NSMutableArray new];
37
37
  _viewsToBeUnmounted = [NSMutableArray new];
38
+ _hasInvokedForwardingWarning = NO;
38
39
  }
39
40
 
40
41
  return self;
@@ -51,6 +52,41 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
51
52
  return result;
52
53
  }
53
54
 
55
+ - (RCTLegacyViewManagerInteropCoordinator *)_coordinator
56
+ {
57
+ if (_state != nullptr) {
58
+ const auto &state = _state->getData();
59
+ return unwrapManagedObject(state.coordinator);
60
+ } else {
61
+ return nil;
62
+ }
63
+ }
64
+
65
+ - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
66
+ {
67
+ const auto &state = _state->getData();
68
+ RCTLegacyViewManagerInteropCoordinator *coordinator = unwrapManagedObject(state.coordinator);
69
+ return coordinator.componentViewName;
70
+ }
71
+
72
+ #pragma mark - Method forwarding
73
+
74
+ - (void)forwardInvocation:(NSInvocation *)anInvocation
75
+ {
76
+ if (!_hasInvokedForwardingWarning) {
77
+ _hasInvokedForwardingWarning = YES;
78
+ NSLog(
79
+ @"Invoked unsupported method on RCTLegacyViewManagerInteropComponentView. Resulting to noop instead of a crash.");
80
+ }
81
+ }
82
+
83
+ - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
84
+ {
85
+ return [super methodSignatureForSelector:aSelector] ?: [self.contentView methodSignatureForSelector:aSelector];
86
+ }
87
+
88
+ #pragma mark - Supported ViewManagers
89
+
54
90
  + (NSMutableSet<NSString *> *)supportedViewManagers
55
91
  {
56
92
  static NSMutableSet<NSString *> *supported = [NSMutableSet setWithObjects:@"DatePicker",
@@ -65,31 +101,39 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
65
101
  return supported;
66
102
  }
67
103
 
68
- + (BOOL)isSupported:(NSString *)componentName
104
+ + (NSMutableSet<NSString *> *)supportedViewManagersPrefixes
69
105
  {
70
- return [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
106
+ static NSMutableSet<NSString *> *supported = [NSMutableSet new];
107
+ return supported;
71
108
  }
72
109
 
73
- + (void)supportLegacyViewManagerWithName:(NSString *)componentName
110
+ + (BOOL)isSupported:(NSString *)componentName
74
111
  {
75
- [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] addObject:componentName];
112
+ // Step 1: check if ViewManager with specified name is supported.
113
+ BOOL isComponentNameSupported =
114
+ [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
115
+ if (isComponentNameSupported) {
116
+ return YES;
117
+ }
118
+
119
+ // Step 2: check if component has supported prefix.
120
+ for (NSString *item in [RCTLegacyViewManagerInteropComponentView supportedViewManagersPrefixes]) {
121
+ if ([componentName hasPrefix:item]) {
122
+ return YES;
123
+ }
124
+ }
125
+
126
+ return NO;
76
127
  }
77
128
 
78
- - (RCTLegacyViewManagerInteropCoordinator *)coordinator
129
+ + (void)supportLegacyViewManagersWithPrefix:(NSString *)prefix
79
130
  {
80
- if (_state != nullptr) {
81
- const auto &state = _state->getData();
82
- return unwrapManagedObject(state.coordinator);
83
- } else {
84
- return nil;
85
- }
131
+ [[RCTLegacyViewManagerInteropComponentView supportedViewManagersPrefixes] addObject:prefix];
86
132
  }
87
133
 
88
- - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
134
+ + (void)supportLegacyViewManagerWithName:(NSString *)componentName
89
135
  {
90
- const auto &state = _state->getData();
91
- RCTLegacyViewManagerInteropCoordinator *coordinator = unwrapManagedObject(state.coordinator);
92
- return coordinator.componentViewName;
136
+ [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] addObject:componentName];
93
137
  }
94
138
 
95
139
  #pragma mark - RCTComponentViewProtocol
@@ -101,6 +145,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
101
145
  [_viewsToBeUnmounted removeAllObjects];
102
146
  _state.reset();
103
147
  self.contentView = nil;
148
+ _hasInvokedForwardingWarning = NO;
104
149
  [super prepareForRecycle];
105
150
  }
106
151
 
@@ -136,7 +181,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
136
181
  [super finalizeUpdates:updateMask];
137
182
 
138
183
  if (!_adapter) {
139
- _adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:self.coordinator
184
+ _adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:[self _coordinator]
140
185
  reactTag:self.tag];
141
186
  __weak __typeof(self) weakSelf = self;
142
187
  _adapter.eventInterceptor = ^(std::string eventName, folly::dynamic event) {
@@ -153,7 +198,12 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
153
198
  for (NSDictionary *mountInstruction in _viewsToBeMounted) {
154
199
  NSNumber *index = mountInstruction[kRCTLegacyInteropChildIndexKey];
155
200
  UIView *childView = mountInstruction[kRCTLegacyInteropChildComponentKey];
156
- [_adapter.paperView insertReactSubview:childView atIndex:index.integerValue];
201
+ if ([childView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
202
+ UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childView).contentView;
203
+ [_adapter.paperView insertReactSubview:target atIndex:index.integerValue];
204
+ } else {
205
+ [_adapter.paperView insertReactSubview:childView atIndex:index.integerValue];
206
+ }
157
207
  }
158
208
 
159
209
  [_viewsToBeMounted removeAllObjects];
@@ -192,7 +192,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
192
192
 
193
193
  #pragma mark - RCTMountingTransactionObserving
194
194
 
195
- - (void)mountingTransactionWillMountWithMetadata:(MountingTransactionMetadata const &)metadata
195
+ - (void)mountingTransactionWillMount:(MountingTransaction const &)transaction
196
+ withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry
196
197
  {
197
198
  _modalContentsSnapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO];
198
199
  }
@@ -24,7 +24,6 @@ using namespace facebook::react;
24
24
  if (self = [super initWithFrame:frame]) {
25
25
  static auto const defaultProps = std::make_shared<SafeAreaViewProps const>();
26
26
  _props = defaultProps;
27
- self.clipsToBounds = YES;
28
27
  }
29
28
 
30
29
  return self;
@@ -25,7 +25,7 @@ using namespace facebook::react;
25
25
 
26
26
  @implementation RCTPullToRefreshViewComponentView {
27
27
  UIRefreshControl *_refreshControl;
28
- RCTScrollViewComponentView *_scrollViewComponentView;
28
+ RCTScrollViewComponentView *__weak _scrollViewComponentView;
29
29
  }
30
30
 
31
31
  - (instancetype)initWithFrame:(CGRect)frame
@@ -52,7 +52,11 @@ static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(ScrollV
52
52
  }
53
53
  }
54
54
 
55
- static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteger tag)
55
+ // Once Fabric implements proper NativeAnimationDriver, this should be removed.
56
+ // This is just a workaround to allow animations based on onScroll event.
57
+ // This is only used to animate sticky headers in ScrollViews, and only the contentOffset and tag is used.
58
+ // TODO: T116850910 [Fabric][iOS] Make Fabric not use legacy RCTEventDispatcher for native-driven AnimatedEvents
59
+ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInteger tag)
56
60
  {
57
61
  static uint16_t coalescingKey = 0;
58
62
  RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:@"onScroll"
@@ -64,7 +68,15 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
64
68
  scrollViewZoomScale:scrollView.zoomScale
65
69
  userData:nil
66
70
  coalescingKey:coalescingKey];
67
- [[RCTBridge currentBridge].eventDispatcher sendEvent:scrollEvent];
71
+ RCTBridge *bridge = [RCTBridge currentBridge];
72
+ if (bridge) {
73
+ [bridge.eventDispatcher sendEvent:scrollEvent];
74
+ } else {
75
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:scrollEvent, @"event", nil];
76
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
77
+ object:nil
78
+ userInfo:userInfo];
79
+ }
68
80
  }
69
81
 
70
82
  @interface RCTScrollViewComponentView () <
@@ -85,6 +97,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
85
97
  // This helps to only update state from `scrollViewDidScroll` in case
86
98
  // some other part of the system scrolls scroll view.
87
99
  BOOL _isUserTriggeredScrolling;
100
+ BOOL _shouldUpdateContentInsetAdjustmentBehavior;
88
101
 
89
102
  CGPoint _contentOffsetWhenClipped;
90
103
  }
@@ -108,6 +121,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
108
121
  _scrollView.delaysContentTouches = NO;
109
122
  ((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self;
110
123
  _isUserTriggeredScrolling = NO;
124
+ _shouldUpdateContentInsetAdjustmentBehavior = YES;
111
125
  [self addSubview:_scrollView];
112
126
 
113
127
  _containerView = [[UIView alloc] initWithFrame:CGRectZero];
@@ -135,7 +149,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
135
149
 
136
150
  #pragma mark - RCTMountingTransactionObserving
137
151
 
138
- - (void)mountingTransactionDidMountWithMetadata:(MountingTransactionMetadata const &)metadata
152
+ - (void)mountingTransactionDidMount:(MountingTransaction const &)transaction
153
+ withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry
139
154
  {
140
155
  [self _remountChildren];
141
156
  }
@@ -253,7 +268,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
253
268
  }
254
269
  }
255
270
 
256
- if (oldScrollViewProps.contentInsetAdjustmentBehavior != newScrollViewProps.contentInsetAdjustmentBehavior) {
271
+ if ((oldScrollViewProps.contentInsetAdjustmentBehavior != newScrollViewProps.contentInsetAdjustmentBehavior) ||
272
+ _shouldUpdateContentInsetAdjustmentBehavior) {
257
273
  auto const contentInsetAdjustmentBehavior = newScrollViewProps.contentInsetAdjustmentBehavior;
258
274
  if (contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Never) {
259
275
  scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
@@ -264,6 +280,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
264
280
  } else if (contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Always) {
265
281
  scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAlways;
266
282
  }
283
+ _shouldUpdateContentInsetAdjustmentBehavior = NO;
267
284
  }
268
285
 
269
286
  MAP_SCROLL_VIEW_PROP(disableIntervalMomentum);
@@ -377,8 +394,16 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
377
394
  {
378
395
  const auto &props = *std::static_pointer_cast<const ScrollViewProps>(_props);
379
396
  _scrollView.contentOffset = RCTCGPointFromPoint(props.contentOffset);
397
+ // We set the default behavior to "never" so that iOS
398
+ // doesn't do weird things to UIScrollView insets automatically
399
+ // and keeps it as an opt-in behavior.
400
+ _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
401
+ _shouldUpdateContentInsetAdjustmentBehavior = YES;
380
402
  _state.reset();
381
403
  _isUserTriggeredScrolling = NO;
404
+ CGRect oldFrame = self.frame;
405
+ self.frame = CGRectZero;
406
+ self.frame = oldFrame;
382
407
  [super prepareForRecycle];
383
408
  }
384
409
 
@@ -403,9 +428,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
403
428
  if (_eventEmitter) {
404
429
  std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScroll([self _scrollViewMetrics]);
405
430
  }
406
- // Once Fabric implements proper NativeAnimationDriver, this should be removed.
407
- // This is just a workaround to allow animations based on onScroll event.
408
- RCTSendPaperScrollEvent_DEPRECATED(scrollView, self.tag);
431
+
432
+ RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag);
409
433
  }
410
434
 
411
435
  [self _remountChildrenIfNeeded];
@@ -566,7 +590,6 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
566
590
  offset = CGPointMake(localX, localY);
567
591
  }
568
592
 
569
- [self _forceDispatchNextScrollEvent];
570
593
  [self scrollToOffset:offset animated:animated];
571
594
  }
572
595
 
@@ -621,12 +644,15 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
621
644
 
622
645
  - (void)scrollToOffset:(CGPoint)offset
623
646
  {
624
- [self _forceDispatchNextScrollEvent];
625
647
  [self scrollToOffset:offset animated:YES];
626
648
  }
627
649
 
628
650
  - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
629
651
  {
652
+ if (CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
653
+ return;
654
+ }
655
+
630
656
  [self _forceDispatchNextScrollEvent];
631
657
 
632
658
  if (_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft) {
@@ -566,8 +566,8 @@ using namespace facebook::react;
566
566
 
567
567
  - (void)_restoreTextSelection
568
568
  {
569
- const auto selection = std::dynamic_pointer_cast<TextInputProps const>(_props)->selection.get_pointer();
570
- if (selection == nullptr) {
569
+ auto const selection = std::dynamic_pointer_cast<TextInputProps const>(_props)->selection;
570
+ if (!selection.has_value()) {
571
571
  return;
572
572
  }
573
573
  auto start = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
@@ -7,8 +7,9 @@
7
7
 
8
8
  #import <UIKit/UIKit.h>
9
9
 
10
+ #import <optional>
11
+
10
12
  #import <React/RCTBackedTextInputViewProtocol.h>
11
- #import <butter/optional.h>
12
13
  #import <react/renderer/components/iostextinput/primitives.h>
13
14
 
14
15
  NS_ASSUME_NONNULL_BEGIN
@@ -17,7 +18,7 @@ void RCTCopyBackedTextInput(
17
18
  UIView<RCTBackedTextInputViewProtocol> *fromTextInput,
18
19
  UIView<RCTBackedTextInputViewProtocol> *toTextInput);
19
20
 
20
- UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(facebook::butter::optional<bool> autoCorrect);
21
+ UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(std::optional<bool> autoCorrect);
21
22
 
22
23
  UITextAutocapitalizationType RCTUITextAutocapitalizationTypeFromAutocapitalizationType(
23
24
  facebook::react::AutocapitalizationType autocapitalizationType);
@@ -25,7 +26,7 @@ UITextAutocapitalizationType RCTUITextAutocapitalizationTypeFromAutocapitalizati
25
26
  UIKeyboardAppearance RCTUIKeyboardAppearanceFromKeyboardAppearance(
26
27
  facebook::react::KeyboardAppearance keyboardAppearance);
27
28
 
28
- UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(facebook::butter::optional<bool> spellCheck);
29
+ UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(std::optional<bool> spellCheck);
29
30
 
30
31
  UITextFieldViewMode RCTUITextFieldViewModeFromTextInputAccessoryVisibilityMode(
31
32
  facebook::react::TextInputAccessoryVisibilityMode mode);
@@ -51,7 +51,7 @@ void RCTCopyBackedTextInput(
51
51
  [toTextInput setSelectedTextRange:fromTextInput.selectedTextRange notifyDelegate:NO];
52
52
  }
53
53
 
54
- UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(facebook::butter::optional<bool> autoCorrect)
54
+ UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(std::optional<bool> autoCorrect)
55
55
  {
56
56
  return autoCorrect.has_value() ? (*autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo)
57
57
  : UITextAutocorrectionTypeDefault;
@@ -84,7 +84,7 @@ UIKeyboardAppearance RCTUIKeyboardAppearanceFromKeyboardAppearance(KeyboardAppea
84
84
  }
85
85
  }
86
86
 
87
- UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(facebook::butter::optional<bool> spellCheck)
87
+ UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(std::optional<bool> spellCheck)
88
88
  {
89
89
  return spellCheck.has_value() ? (*spellCheck ? UITextSpellCheckingTypeYes : UITextSpellCheckingTypeNo)
90
90
  : UITextSpellCheckingTypeDefault;
@@ -8,6 +8,7 @@
8
8
  #import "RCTViewComponentView.h"
9
9
 
10
10
  #import <CoreGraphics/CoreGraphics.h>
11
+ #import <QuartzCore/QuartzCore.h>
11
12
  #import <objc/runtime.h>
12
13
 
13
14
  #import <React/RCTAssert.h>
@@ -42,7 +43,7 @@ using namespace facebook::react;
42
43
  return self;
43
44
  }
44
45
 
45
- - (facebook::react::SharedProps)props
46
+ - (facebook::react::Props::Shared)props
46
47
  {
47
48
  return _props;
48
49
  }
@@ -335,12 +336,12 @@ using namespace facebook::react;
335
336
 
336
337
  // `accessibilityValue`
337
338
  if (oldViewProps.accessibilityValue != newViewProps.accessibilityValue) {
338
- if (newViewProps.accessibilityValue.text.hasValue()) {
339
+ if (newViewProps.accessibilityValue.text.has_value()) {
339
340
  self.accessibilityElement.accessibilityValue =
340
341
  RCTNSStringFromStringNilIfEmpty(newViewProps.accessibilityValue.text.value());
341
342
  } else if (
342
- newViewProps.accessibilityValue.now.hasValue() && newViewProps.accessibilityValue.min.hasValue() &&
343
- newViewProps.accessibilityValue.max.hasValue()) {
343
+ newViewProps.accessibilityValue.now.has_value() && newViewProps.accessibilityValue.min.has_value() &&
344
+ newViewProps.accessibilityValue.max.has_value()) {
344
345
  CGFloat val = (CGFloat)(newViewProps.accessibilityValue.now.value()) /
345
346
  (newViewProps.accessibilityValue.max.value() - newViewProps.accessibilityValue.min.value());
346
347
  self.accessibilityElement.accessibilityValue =
@@ -591,6 +592,12 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
591
592
 
592
593
  RCTBorderColors borderColors = RCTCreateRCTBorderColorsFromBorderColors(borderMetrics.borderColors);
593
594
 
595
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
596
+ CGFloat scaleFactor = self.window.backingScaleFactor;
597
+ #else
598
+ // On iOS setting the scaleFactor to 0.0 will default to the device's native scale factor.
599
+ CGFloat scaleFactor = 0.0;
600
+ #endif // ]TODO(macOS GH#774)
594
601
  UIImage *image = RCTGetBorderImage(
595
602
  RCTBorderStyleFromBorderStyle(borderMetrics.borderStyles.left),
596
603
  layer.bounds.size,
@@ -598,7 +605,8 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
598
605
  RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths),
599
606
  borderColors,
600
607
  _backgroundColor.CGColor,
601
- self.clipsToBounds);
608
+ self.clipsToBounds,
609
+ scaleFactor); // TODO(macOS GH#774)
602
610
 
603
611
  RCTReleaseRCTBorderColors(borderColors);
604
612
 
@@ -95,9 +95,9 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
95
95
  {
96
96
  .viewClass = viewClass,
97
97
  .observesMountingTransactionWillMount =
98
- (bool)class_respondsToSelector(viewClass, @selector(mountingTransactionWillMountWithMetadata:)),
98
+ (bool)class_respondsToSelector(viewClass, @selector(mountingTransactionWillMount:withSurfaceTelemetry:)),
99
99
  .observesMountingTransactionDidMount =
100
- (bool)class_respondsToSelector(viewClass, @selector(mountingTransactionDidMountWithMetadata:)),
100
+ (bool)class_respondsToSelector(viewClass, @selector(mountingTransactionDidMount:withSurfaceTelemetry:)),
101
101
  };
102
102
  #pragma clang diagnostic pop
103
103
  }
@@ -117,7 +117,16 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
117
117
  }
118
118
 
119
119
  // Fallback 2: Try to use Paper Interop.
120
- if ([RCTLegacyViewManagerInteropComponentView isSupported:RCTNSStringFromString(name)]) {
120
+ NSString *componentNameString = RCTNSStringFromString(name);
121
+ if ([RCTLegacyViewManagerInteropComponentView isSupported:componentNameString]) {
122
+ RCTLogNewArchitectureValidation(
123
+ RCTNotAllowedInBridgeless,
124
+ self,
125
+ [NSString
126
+ stringWithFormat:
127
+ @"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
128
+ componentNameString]);
129
+
121
130
  auto flavor = std::make_shared<std::string const>(name);
122
131
  auto componentName = ComponentName{flavor->c_str()};
123
132
  auto componentHandle = reinterpret_cast<ComponentHandle>(componentName);
@@ -114,7 +114,7 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
114
114
  /*
115
115
  * Read the last props used to update the view.
116
116
  */
117
- - (facebook::react::SharedProps)props;
117
+ - (facebook::react::Props::Shared)props;
118
118
 
119
119
  - (BOOL)isJSResponder;
120
120
  - (void)setIsJSResponder:(BOOL)isJSResponder;
@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
63
63
 
64
64
  - (void)setIsJSResponder:(BOOL)isJSResponder
65
65
  blockNativeResponder:(BOOL)blockNativeResponder
66
- forShadowView:(facebook::react::ShadowView)shadowView;
66
+ forShadowView:(facebook::react::ShadowView const &)shadowView;
67
67
 
68
68
  - (void)synchronouslyUpdateViewOnUIThread:(ReactTag)reactTag
69
69
  changedProps:(NSDictionary *)props