react-native-macos 0.0.0-cb5eaa9e1 → 0.0.0-ccc088f1d

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 (281) hide show
  1. package/Libraries/Alert/Alert.js +115 -6
  2. package/Libraries/Alert/NativeAlertManager.js +1 -19
  3. package/Libraries/Animated/animations/TimingAnimation.js +2 -7
  4. package/Libraries/Animated/nodes/AnimatedColor.js +20 -1
  5. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  6. package/Libraries/Components/Pressable/Pressable.js +2 -3
  7. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  8. package/Libraries/Components/TextInput/TextInput.js +7 -0
  9. package/Libraries/Components/View/ViewAccessibility.js +0 -5
  10. package/Libraries/Components/View/ViewNativeComponent.js +64 -7
  11. package/Libraries/Components/View/ViewPropTypes.js +97 -117
  12. package/Libraries/Core/ReactNativeVersion.js +1 -5
  13. package/Libraries/Core/setUpReactDevTools.js +3 -2
  14. package/Libraries/Image/RCTImageLoader.mm +19 -13
  15. package/Libraries/Image/RCTImageView.h +0 -8
  16. package/Libraries/Image/React-RCTImage.podspec +1 -1
  17. package/Libraries/Inspector/Inspector.js +2 -4
  18. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  19. package/Libraries/Lists/VirtualizedList.js +13 -1
  20. package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
  21. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
  22. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
  23. package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
  24. package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
  25. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
  26. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +506 -0
  27. package/Libraries/NativeComponent/StaticViewConfigValidator.js +5 -1
  28. package/Libraries/NativeComponent/ViewConfig.js +4 -4
  29. package/Libraries/NativeComponent/ViewConfigIgnore.js +27 -0
  30. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  31. package/Libraries/Pressability/PressabilityDebug.js +5 -9
  32. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  33. package/Libraries/ReactNative/DummyUIManager.js +5 -3
  34. package/Libraries/ReactNative/UIManager.js +1 -2
  35. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  36. package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
  37. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +7 -0
  38. package/Libraries/Text/RCTTextAttributes.h +9 -3
  39. package/Libraries/Text/RCTTextAttributes.m +17 -0
  40. package/Libraries/Text/Text/RCTTextView.h +1 -1
  41. package/Libraries/Text/Text/RCTTextView.m +8 -14
  42. package/Libraries/Text/Text.js +0 -6
  43. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +5 -0
  44. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +55 -5
  45. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +2 -0
  46. package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +1 -1
  47. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +7 -3
  48. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +2 -2
  49. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +7 -1
  50. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +2 -3
  51. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  52. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
  53. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  54. package/React/Base/RCTAssert.h +30 -15
  55. package/React/Base/RCTAssert.m +59 -19
  56. package/React/Base/RCTBridge.m +5 -3
  57. package/React/Base/RCTConstants.h +6 -0
  58. package/React/Base/RCTConstants.m +15 -0
  59. package/React/Base/RCTEventDispatcherProtocol.h +5 -0
  60. package/React/Base/RCTRootContentView.m +2 -2
  61. package/React/Base/RCTTouchHandler.m +4 -3
  62. package/React/Base/RCTUIKit.h +91 -19
  63. package/React/Base/RCTVersion.m +1 -5
  64. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
  65. package/React/Base/macOS/RCTUIKit.m +83 -7
  66. package/React/CoreModules/RCTAlertManager.mm +1 -1
  67. package/React/CoreModules/RCTEventDispatcher.mm +6 -1
  68. package/React/CoreModules/RCTLogBox.h +1 -1
  69. package/React/CoreModules/RCTLogBox.mm +35 -19
  70. package/React/CoreModules/RCTLogBoxView.h +8 -5
  71. package/React/CoreModules/RCTLogBoxView.mm +64 -23
  72. package/React/CoreModules/React-CoreModules.podspec +1 -1
  73. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
  74. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  75. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
  76. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  77. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  78. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  79. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  80. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
  81. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -25
  82. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  83. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  84. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  85. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  86. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +10 -5
  87. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  88. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  89. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +10 -1
  90. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +5 -3
  91. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +23 -6
  92. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  93. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +17 -1
  94. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +6 -4
  95. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +98 -34
  96. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  97. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +19 -5
  98. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  99. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
  100. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +5 -1
  101. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +3 -1
  102. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +4 -2
  103. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +6 -2
  104. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  105. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +22 -1
  106. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  107. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +39 -5
  108. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +9 -6
  109. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +16 -4
  110. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  111. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
  112. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  113. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
  114. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  115. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +41 -23
  116. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  117. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  118. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  119. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
  120. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
  121. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  122. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  123. package/React/Fabric/Mounting/RCTMountingManager.h +4 -4
  124. package/React/Fabric/Mounting/RCTMountingManager.mm +30 -19
  125. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  126. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
  127. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
  128. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +6 -4
  129. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
  130. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
  131. package/React/Fabric/RCTConversions.h +17 -7
  132. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  133. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  134. package/React/Fabric/RCTLocalizationProvider.mm +10 -4
  135. package/React/Fabric/RCTScheduler.h +8 -1
  136. package/React/Fabric/RCTScheduler.mm +15 -0
  137. package/React/Fabric/RCTSurfacePresenter.h +10 -2
  138. package/React/Fabric/RCTSurfacePresenter.mm +59 -27
  139. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  140. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  141. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  142. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -9
  143. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  144. package/React/Fabric/Surface/RCTFabricSurface.mm +3 -1
  145. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  146. package/React/Modules/RCTSurfacePresenterStub.h +4 -0
  147. package/React/Modules/RCTUIManager.h +1 -1
  148. package/React/Modules/RCTUIManager.m +6 -5
  149. package/React/React-RCTFabric.podspec +2 -2
  150. package/React/Views/RCTMaskedView.h +1 -1
  151. package/React/Views/RCTModalHostView.h +2 -2
  152. package/React/Views/RCTModalHostViewController.h +1 -1
  153. package/React/Views/RCTModalManager.h +1 -1
  154. package/React/Views/RCTSlider.h +4 -0
  155. package/React/Views/RCTSwitch.h +1 -10
  156. package/React/Views/RCTSwitch.m +0 -20
  157. package/React/Views/RCTSwitchManager.m +0 -4
  158. package/React/Views/RCTView.m +8 -3
  159. package/React/Views/RCTViewManager.m +2 -1
  160. package/React/Views/RCTWeakViewHolder.h +1 -1
  161. package/React/Views/RCTWrapperViewController.h +2 -2
  162. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  163. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  164. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  165. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  166. package/React/Views/ScrollView/RCTScrollView.m +1 -31
  167. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  168. package/ReactAndroid/gradle.properties +1 -1
  169. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +0 -21
  170. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +7 -3
  171. package/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK +1 -0
  172. package/ReactAndroid/src/main/java/com/facebook/react/animated/ColorAnimatedNode.java +66 -0
  173. package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +2 -0
  174. package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.java +2 -0
  175. package/ReactAndroid/src/main/java/com/facebook/react/animated/StyleAnimatedNode.java +2 -0
  176. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +0 -3
  177. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +1 -1
  178. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
  179. package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java +20 -8
  180. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -5
  181. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -11
  182. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ColorUtil.java +19 -0
  183. package/ReactAndroid/src/main/jni/Application.mk +1 -1
  184. package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
  185. package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
  186. package/ReactAndroid/src/test/java/com/facebook/react/views/BUCK +5 -2
  187. package/ReactAndroid/src/test/java/com/facebook/react/views/view/ColorUtilTest.java +9 -0
  188. package/ReactCommon/React-Fabric.podspec +1 -1
  189. package/ReactCommon/React-rncore.podspec +1 -1
  190. package/ReactCommon/ReactCommon.podspec +1 -1
  191. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -5
  192. package/ReactCommon/cxxreact/tests/BUCK +1 -1
  193. package/ReactCommon/hermes/inspector/Exceptions.h +6 -0
  194. package/ReactCommon/hermes/inspector/Inspector.cpp +5 -2
  195. package/ReactCommon/hermes/inspector/Inspector.h +14 -0
  196. package/ReactCommon/hermes/inspector/InspectorState.cpp +16 -8
  197. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +6 -6
  198. package/ReactCommon/microprofiler/BUCK +1 -1
  199. package/ReactCommon/react/debug/react_native_assert.h +1 -1
  200. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
  201. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
  202. package/ReactCommon/react/renderer/animations/conversions.h +11 -11
  203. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
  204. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
  205. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
  206. package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
  207. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  208. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  209. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
  210. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
  211. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
  212. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
  213. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
  214. package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
  215. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
  216. package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
  217. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
  218. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
  219. package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
  220. package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
  221. package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
  222. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
  223. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
  224. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
  225. package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
  226. package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
  227. package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
  228. package/ReactCommon/react/renderer/core/EventListener.h +44 -0
  229. package/ReactCommon/react/renderer/core/Props.h +0 -4
  230. package/ReactCommon/react/renderer/core/RawProps.h +1 -1
  231. package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
  232. package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
  233. package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
  234. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
  235. package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
  236. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  237. package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
  238. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  239. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  240. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  241. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  242. package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
  243. package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
  244. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  245. package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
  246. package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
  247. package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
  248. package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
  249. package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
  250. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +38 -32
  251. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +18 -1
  252. package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
  253. package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +7 -2
  254. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +40 -4
  255. package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
  256. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  257. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  258. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
  259. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  260. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  261. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  262. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm +5 -0
  263. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  264. package/ReactCommon/react/utils/ContextContainer.h +2 -2
  265. package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
  266. package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
  267. package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
  268. package/ReactCommon/yoga/Yoga.podspec +1 -1
  269. package/index.js +0 -11
  270. package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
  271. package/package.json +4 -1
  272. package/scripts/react_native_pods.rb +1 -1
  273. package/template/Gemfile.lock +5 -5
  274. package/template/package.json +1 -1
  275. package/Libraries/Alert/AlertMacOS.js +0 -211
  276. package/Libraries/Components/View/PlatformViewPropTypes.macos.js +0 -16
  277. package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -374
  278. package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
  279. package/Libraries/ReactNative/UIManagerInjection.js +0 -15
  280. package/ReactCommon/butter/optional.h +0 -38
  281. package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
@@ -10,6 +10,9 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {Rect} from './Rect';
13
+ import type {Rect, RectOrSize} from './Rect';
14
14
 
15
+ // TODO: allow all EdgeInsets-like property to be set using a single number
16
+ // and unify EdgeInsetsProp with EdgeInsetsOrSizeProp
15
17
  export type EdgeInsetsProp = Rect;
18
+ export type EdgeInsetsOrSizeProp = RectOrSize;
@@ -6,6 +6,9 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTBaseTextViewManager.h>
9
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
10
+ #import <React/RCTCursor.h>
11
+ #endif // ]TODO(macOS GH#774)
9
12
 
10
13
  @implementation RCTBaseTextViewManager
11
14
 
@@ -56,4 +59,8 @@ RCT_REMAP_SHADOW_PROPERTY(textShadowColor, textAttributes.textShadowColor, UICol
56
59
  RCT_REMAP_SHADOW_PROPERTY(isHighlighted, textAttributes.isHighlighted, BOOL)
57
60
  RCT_REMAP_SHADOW_PROPERTY(textTransform, textAttributes.textTransform, RCTTextTransform)
58
61
 
62
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
63
+ RCT_REMAP_SHADOW_PROPERTY(cursor, textAttributes.cursor, RCTCursor)
64
+ #endif // ]TODO(macOS GH#774)
65
+
59
66
  @end
@@ -6,13 +6,15 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
-
10
9
  #import <React/RCTTextDecorationLineType.h>
11
10
  #import <React/RCTDynamicTypeRamp.h> // TODO(macOS GH#774)
12
- #import <React/RCTFontSmoothing.h> // TODO(OSS Candidate ISS#2710739)
13
-
11
+ #import <React/RCTFontSmoothing.h> // TODO(macOS GH#774)
14
12
  #import "RCTTextTransform.h"
15
13
 
14
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+ #import <React/RCTCursor.h>
16
+ #endif // ]TODO(macOS GH#774)
17
+
16
18
  NS_ASSUME_NONNULL_BEGIN
17
19
 
18
20
  extern NSString *const RCTTextAttributesIsHighlightedAttributeName;
@@ -61,6 +63,10 @@ extern NSString *const RCTTextAttributesTagAttributeName;
61
63
  @property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection;
62
64
  @property (nonatomic, assign) RCTTextTransform textTransform;
63
65
 
66
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
67
+ @property (nonatomic, assign) RCTCursor cursor;
68
+ #endif // ]TODO(macOS GH#774)
69
+
64
70
  #pragma mark - Inheritance
65
71
 
66
72
  - (void)applyTextAttributes:(RCTTextAttributes *)textAttributes;
@@ -11,6 +11,10 @@
11
11
  #import <React/RCTFont.h>
12
12
  #import <React/RCTLog.h>
13
13
 
14
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+ #import <React/RCTCursor.h>
16
+ #endif // ]TODO(macOS GH#774)
17
+
14
18
  NSString *const RCTTextAttributesIsHighlightedAttributeName = @"RCTTextAttributesIsHighlightedAttributeName";
15
19
  NSString *const RCTTextAttributesFontSmoothingAttributeName = @"RCTTextAttributesFontSmoothingAttributeName"; // TODO(OSS Candidate ISS#2710739)
16
20
  NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttributeName";
@@ -45,6 +49,9 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
45
49
  // [TODO(macOS GH#774)
46
50
  _foregroundColor = [RCTTextAttributes defaultForegroundColor];
47
51
  // ]TODO(macOS GH#774)
52
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
53
+ _cursor = RCTCursorAuto;
54
+ #endif // ]TODO(macOS GH#774)
48
55
  }
49
56
 
50
57
  return self;
@@ -94,6 +101,10 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
94
101
  _tag = textAttributes->_tag ?: _tag;
95
102
  _layoutDirection = textAttributes->_layoutDirection != UIUserInterfaceLayoutDirectionLeftToRight ? textAttributes->_layoutDirection : _layoutDirection;
96
103
  _textTransform = textAttributes->_textTransform != RCTTextTransformUndefined ? textAttributes->_textTransform : _textTransform;
104
+
105
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
106
+ _cursor = textAttributes->_cursor != RCTCursorAuto ? textAttributes->_cursor : _cursor;
107
+ #endif // ]TODO(macOS GH#774)
97
108
  }
98
109
 
99
110
  - (NSParagraphStyle *)effectiveParagraphStyle
@@ -210,6 +221,12 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
210
221
  attributes[RCTTextAttributesTagAttributeName] = _tag;
211
222
  }
212
223
 
224
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
225
+ if (_cursor != RCTCursorAuto) {
226
+ attributes[NSCursorAttributeName] = [RCTConvert NSCursor:_cursor];
227
+ }
228
+ #endif // ]TODO(macOS GH#774)
229
+
213
230
  return [attributes copy];
214
231
  }
215
232
 
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
14
14
 
15
15
  @interface RCTTextView : RCTUIView // TODO(macOS ISS#3536887)
16
16
 
17
- - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; // TODO(OSS Candidate ISS#2710739)
17
+ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher; // TODO(OSS Candidate ISS#2710739)
18
18
 
19
19
  @property (nonatomic, assign) BOOL selectable;
20
20
 
@@ -9,8 +9,6 @@
9
9
 
10
10
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
11
11
  #import <MobileCoreServices/UTCoreTypes.h>
12
- #else
13
- #import <Quartz/Quartz.h> // TODO(macOS GH#774) for CATiledLayer
14
12
  #endif // TODO(macOS GH#774)
15
13
 
16
14
  #import <React/RCTAssert.h> // TODO(macOS GH#774)
@@ -20,7 +18,7 @@
20
18
 
21
19
  #import <React/RCTTextShadowView.h>
22
20
 
23
- #import <QuartzCore/QuartzCore.h> // TODO(macOS GH#774)
21
+ #import <QuartzCore/QuartzCore.h>
24
22
 
25
23
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
26
24
 
@@ -53,14 +51,14 @@
53
51
  NSTextView *_textView;
54
52
  #endif // ]TODO(macOS GH#774)
55
53
 
56
- RCTEventDispatcher *_eventDispatcher; // TODO(OSS Candidate ISS#2710739)
54
+ id<RCTEventDispatcherProtocol> _eventDispatcher; // TODO(OSS Candidate ISS#2710739)
57
55
  NSArray<RCTUIView *> *_Nullable _descendantViews; // TODO(macOS ISS#3536887)
58
56
  NSTextStorage *_Nullable _textStorage;
59
57
  CGRect _contentFrame;
60
58
  }
61
59
 
62
60
  // [TODO(OSS Candidate ISS#2710739)
63
- - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
61
+ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher
64
62
  {
65
63
  if ((self = [self initWithFrame:CGRectZero])) {
66
64
  _eventDispatcher = eventDispatcher;
@@ -75,6 +73,7 @@
75
73
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
76
74
  self.isAccessibilityElement = YES;
77
75
  self.accessibilityTraits |= UIAccessibilityTraitStaticText;
76
+ self.opaque = NO;
78
77
  #else // [TODO(macOS GH#774)
79
78
  self.accessibilityRole = NSAccessibilityStaticTextRole;
80
79
  // Fix blurry text on non-retina displays.
@@ -92,16 +91,11 @@
92
91
  _textStorage = _textView.textStorage;
93
92
  [self addSubview:_textView];
94
93
  #endif // ]TODO(macOS GH#774)
95
- self.opaque = NO;
96
94
  RCTUIViewSetContentModeRedraw(self); // TODO(macOS GH#774) and TODO(macOS ISS#3536887)
97
95
  }
98
96
  return self;
99
97
  }
100
98
 
101
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
102
-
103
- #endif // ]TODO(macOS GH#774)
104
-
105
99
  #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
106
100
  - (NSString *)description
107
101
  {
@@ -527,7 +521,7 @@
527
521
  NSData *rtf = [attributedText dataFromRange:NSMakeRange(0, attributedText.length)
528
522
  documentAttributes:@{NSDocumentTypeDocumentAttribute: NSRTFDTextDocumentType}
529
523
  error:nil];
530
- #if TARGET_OS_IPHONE // TODO(macOS GH#774)
524
+ #if TARGET_OS_IPHONE // [TODO(macOS GH#774)
531
525
  NSMutableDictionary *item = [NSMutableDictionary new]; // TODO(macOS GH#774)
532
526
 
533
527
  if (rtf) {
@@ -538,13 +532,13 @@
538
532
 
539
533
  UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
540
534
  pasteboard.items = @[item];
541
- #elif TARGET_OS_OSX // TODO(macOS GH#774)
535
+ #elif TARGET_OS_OSX
542
536
  [_textView copy:sender];
543
537
 
544
538
  NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
545
539
  [pasteboard clearContents];
546
- [pasteboard writeObjects:[NSArray arrayWithObjects:attributedText.string, rtf, nil]];
547
- #endif // TODO(macOS GH#774)
540
+ [pasteboard setData:rtf forType:NSPasteboardTypeRTFD];
541
+ #endif // ]TODO(macOS GH#774)
548
542
  }
549
543
 
550
544
  @end
@@ -181,12 +181,6 @@ const Text: React.AbstractComponent<
181
181
 
182
182
  Text.displayName = 'Text';
183
183
 
184
- /**
185
- * Switch to `deprecated-react-native-prop-types` for compatibility with future
186
- * releases. This is deprecated and will be removed in the future.
187
- */
188
- Text.propTypes = require('deprecated-react-native-prop-types').TextPropTypes;
189
-
190
184
  /**
191
185
  * Returns false until the first time `newValue` is true, after which this will
192
186
  * always return true. This is necessary to lazily initialize `Pressability` so
@@ -12,8 +12,13 @@ NS_ASSUME_NONNULL_BEGIN
12
12
  @interface RCTMultilineTextInputView : RCTBaseTextInputView
13
13
 
14
14
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+
16
+ @property (nonatomic, assign) BOOL scrollEnabled;
17
+
15
18
  - (void)setReadablePasteBoardTypes:(NSArray<NSPasteboardType> *)readablePasteboardTypes;
19
+ @property (nonatomic, assign) BOOL hideVerticalScrollIndicator;
16
20
  #endif // ]TODO(macOS GH#774)
21
+
17
22
  @end
18
23
 
19
24
  NS_ASSUME_NONNULL_END
@@ -15,6 +15,7 @@
15
15
  {
16
16
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
17
17
  RCTUIScrollView *_scrollView;
18
+ RCTClipView *_clipView;
18
19
  #endif // ]TODO(macOS GH#774)
19
20
  RCTUITextView *_backedTextInputView;
20
21
  }
@@ -28,6 +29,7 @@
28
29
  _backedTextInputView = [[RCTUITextView alloc] initWithFrame:self.bounds];
29
30
  _backedTextInputView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
30
31
  #if TARGET_OS_OSX // TODO(macOS GH#774)
32
+ self.hideVerticalScrollIndicator = NO;
31
33
  _scrollView = [[RCTUIScrollView alloc] initWithFrame:self.bounds]; // TODO(macOS ISS#3536887)
32
34
  _scrollView.backgroundColor = [RCTUIColor clearColor];
33
35
  _scrollView.drawsBackground = NO;
@@ -35,6 +37,10 @@
35
37
  _scrollView.hasHorizontalRuler = NO;
36
38
  _scrollView.hasVerticalRuler = NO;
37
39
  _scrollView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
40
+ [_scrollView setHasVerticalScroller:YES];
41
+
42
+ _clipView = [[RCTClipView alloc] initWithFrame:_scrollView.frame];
43
+ [_scrollView setContentView:_clipView];
38
44
 
39
45
  _backedTextInputView.verticallyResizable = YES;
40
46
  _backedTextInputView.horizontallyResizable = YES;
@@ -92,16 +98,63 @@
92
98
  [self setNeedsLayout];
93
99
  }
94
100
 
95
- - (void)setEnableFocusRing:(BOOL)enableFocusRing {
101
+ - (void)setEnableFocusRing:(BOOL)enableFocusRing
102
+ {
96
103
  [super setEnableFocusRing:enableFocusRing];
97
104
  if ([_scrollView respondsToSelector:@selector(setEnableFocusRing:)]) {
98
105
  [_scrollView setEnableFocusRing:enableFocusRing];
99
106
  }
100
107
  }
101
108
 
102
- - (void)setReadablePasteBoardTypes:(NSArray<NSPasteboardType> *)readablePasteboardTypes {
109
+ - (void)setReadablePasteBoardTypes:(NSArray<NSPasteboardType> *)readablePasteboardTypes
110
+ {
103
111
  [_backedTextInputView setReadablePasteBoardTypes:readablePasteboardTypes];
104
112
  }
113
+
114
+ - (void)setScrollEnabled:(BOOL)scrollEnabled
115
+ {
116
+ if (scrollEnabled) {
117
+ _scrollView.scrollEnabled = YES;
118
+ [_clipView setConstrainScrolling:NO];
119
+ } else {
120
+ _scrollView.scrollEnabled = NO;
121
+ [_clipView setConstrainScrolling:YES];
122
+ }
123
+ }
124
+
125
+ - (BOOL)scrollEnabled
126
+ {
127
+ return _scrollView.isScrollEnabled;
128
+ }
129
+
130
+ - (BOOL)shouldShowVerticalScrollbar
131
+ {
132
+ // Hide vertical scrollbar if explicity set to NO
133
+ if (self.hideVerticalScrollIndicator) {
134
+ return NO;
135
+ }
136
+
137
+ // Hide vertical scrollbar if attributed text overflows view
138
+ CGSize textViewSize = [_backedTextInputView intrinsicContentSize];
139
+ NSClipView *clipView = (NSClipView *)_scrollView.contentView;
140
+ if (textViewSize.height > clipView.bounds.size.height) {
141
+ return YES;
142
+ };
143
+
144
+ return NO;
145
+ }
146
+
147
+ - (void)textInputDidChange
148
+ {
149
+ [_scrollView setHasVerticalScroller:[self shouldShowVerticalScrollbar]];
150
+ }
151
+
152
+ - (void)setAttributedText:(NSAttributedString *)attributedText
153
+ {
154
+ [_backedTextInputView setAttributedText:attributedText];
155
+ [_scrollView setHasVerticalScroller:[self shouldShowVerticalScrollbar]];
156
+ }
157
+
105
158
  #endif // ]TODO(macOS GH#774)
106
159
 
107
160
  #pragma mark - UIScrollViewDelegate
@@ -109,9 +162,6 @@
109
162
  - (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS ISS#3536887)
110
163
  {
111
164
  RCTDirectEventBlock onScroll = self.onScroll;
112
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
113
- [_scrollView setHasVerticalScroller:YES];
114
- #endif // ]TODO(macOS GH#774)
115
165
  if (onScroll) {
116
166
  CGPoint contentOffset = scrollView.contentOffset;
117
167
  CGSize contentSize = scrollView.contentSize;
@@ -24,6 +24,8 @@ RCT_REMAP_NOT_OSX_VIEW_PROPERTY(dataDetectorTypes, backedTextInputView.dataDetec
24
24
  RCT_REMAP_OSX_VIEW_PROPERTY(dataDetectorTypes, backedTextInputView.enabledTextCheckingTypes, NSTextCheckingTypes) // TODO(macOS GH#774)
25
25
 
26
26
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
27
+ RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)
28
+ RCT_EXPORT_VIEW_PROPERTY(hideVerticalScrollIndicator, BOOL)
27
29
  RCT_CUSTOM_VIEW_PROPERTY(pastedTypes, NSArray<NSPasteboardType>*, RCTUITextView)
28
30
  {
29
31
  NSArray<NSPasteboardType> *types = json ? [RCTConvert NSPasteboardTypeArray:json] : nil;
@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
46
46
  @property (nonatomic, strong, nullable) NSString *inputAccessoryViewID;
47
47
 
48
48
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
49
- @property (nonatomic, assign) BOOL scrollEnabled;
49
+ @property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;
50
50
  @property (nonatomic, strong, nullable) RCTUIColor *selectionColor; // TODO(OSS Candidate ISS#2710739)
51
51
  @property (nonatomic, assign) UIEdgeInsets textContainerInsets;
52
52
  @property (nonatomic, copy) NSString *text;
@@ -212,8 +212,12 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
212
212
 
213
213
  - (BOOL)resignFirstResponder
214
214
  {
215
- BOOL success = [super resignFirstResponder];
215
+ if (self.selectable) {
216
+ self.selectedRange = NSMakeRange(NSNotFound, 0);
217
+ }
216
218
 
219
+ BOOL success = [super resignFirstResponder];
220
+
217
221
  if (success) {
218
222
  // Break undo coalescing when losing focus.
219
223
  [self breakUndoCoalescing];
@@ -436,13 +440,13 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
436
440
  {
437
441
  [super selectAll:sender];
438
442
 
439
- #if !TARGET_OS_OSX // TODO(macOS GH#774) For `selectTextOnFocus` prop, which isn't supported on macOS atm.
443
+ #if !TARGET_OS_OSX // TODO(macOS GH#774)
440
444
  // `selectAll:` does not work for UITextView when it's being called inside UITextView's delegate methods.
441
445
  dispatch_async(dispatch_get_main_queue(), ^{
442
446
  UITextRange *selectionRange = [self textRangeFromPosition:self.beginningOfDocument toPosition:self.endOfDocument];
443
447
  [self setSelectedTextRange:selectionRange notifyDelegate:NO];
444
448
  });
445
- #endif
449
+ #endif // TODO(macOS GH#774)
446
450
  }
447
451
 
448
452
  #pragma mark - Layout
@@ -25,9 +25,9 @@ NS_ASSUME_NONNULL_END
25
25
 
26
26
  NS_ASSUME_NONNULL_BEGIN
27
27
 
28
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
28
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
29
29
  @protocol RCTBackedTextInputViewProtocol <UITextInput>
30
- #else // [TODO(macOS GH#774)
30
+ #else
31
31
  @protocol RCTBackedTextInputViewProtocol
32
32
  #endif // ]TODO(macOS GH#774)
33
33
 
@@ -379,7 +379,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)decoder)
379
379
  }
380
380
 
381
381
  if (_selectTextOnFocus) {
382
- [self.backedTextInputView selectAll:nil];
382
+ if ([self.backedTextInputView respondsToSelector:@selector(selectAll:)]) {
383
+ [self.backedTextInputView selectAll:nil];
384
+ }
385
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
386
+ } else {
387
+ [self.backedTextInputView setSelectedTextRange:NSMakeRange(NSNotFound, 0) notifyDelegate:NO];
388
+ #endif // ]TODO(macOS GH#774)
383
389
  }
384
390
 
385
391
  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus
@@ -53,15 +53,14 @@ RCT_REMAP_NOT_OSX_VIEW_PROPERTY(spellCheck, backedTextInputView.spellCheckingTyp
53
53
  RCT_REMAP_OSX_VIEW_PROPERTY(spellCheck, backedTextInputView.continuousSpellCheckingEnabled, BOOL) // TODO(macOS GH#774)
54
54
  RCT_REMAP_NOT_OSX_VIEW_PROPERTY(caretHidden, backedTextInputView.caretHidden, BOOL) // TODO(macOS GH#774)
55
55
  RCT_REMAP_NOT_OSX_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode) // TODO(macOS GH#774)
56
- RCT_REMAP_VIEW_PROPERTY(scrollEnabled, backedTextInputView.scrollEnabled, BOOL)
57
56
  RCT_REMAP_NOT_OSX_VIEW_PROPERTY(secureTextEntry, backedTextInputView.secureTextEntry, BOOL) // TODO(macOS GH#774)
58
57
  RCT_EXPORT_VIEW_PROPERTY(autoFocus, BOOL)
59
58
  RCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)
60
- RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(clearTextOnFocus, BOOL) // TODO(macOS GH#774)
59
+ RCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)
61
60
  RCT_REMAP_NOT_OSX_VIEW_PROPERTY(keyboardType, backedTextInputView.keyboardType, UIKeyboardType) // TODO(macOS GH#774)
62
61
  RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(showSoftInputOnFocus, BOOL) // TODO(macOS GH#774)
63
62
  RCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)
64
- RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(selectTextOnFocus, BOOL) // TODO(macOS GH#774)
63
+ RCT_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)
65
64
  RCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)
66
65
  RCT_EXPORT_VIEW_PROPERTY(inputAccessoryViewID, NSString)
67
66
  RCT_EXPORT_VIEW_PROPERTY(textContentType, NSString)
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
33
33
  s.header_dir = "RCTTypeSafety"
34
34
  s.pod_target_xcconfig = {
35
35
  "USE_HEADERMAP" => "YES",
36
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
36
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
37
37
  "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/Libraries/TypeSafety\" \"$(PODS_ROOT)/RCT-Folly\""
38
38
  }
39
39
 
@@ -8,7 +8,7 @@
8
8
  * @flow
9
9
  */
10
10
 
11
- import ReactNativeViewViewConfig from '../Components/View/ReactNativeViewViewConfig';
11
+ import PlatformBaseViewConfig from '../NativeComponent/PlatformBaseViewConfig';
12
12
  import {type ViewConfig} from '../Renderer/shims/ReactNativeTypes';
13
13
 
14
14
  const IGNORED_KEYS = ['transform', 'hitSlop'];
@@ -109,7 +109,7 @@ export function getConfigWithoutViewProps(
109
109
  }
110
110
 
111
111
  return Object.keys(viewConfig[propName])
112
- .filter(prop => !ReactNativeViewViewConfig[propName][prop])
112
+ .filter(prop => !PlatformBaseViewConfig[propName][prop])
113
113
  .reduce((obj, prop) => {
114
114
  obj[prop] = viewConfig[propName][prop];
115
115
  return obj;
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
35
35
  s.header_dir = "RCTVibration"
36
36
  s.pod_target_xcconfig = {
37
37
  "USE_HEADERMAP" => "YES",
38
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
39
39
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
40
40
  }
41
41
  s.frameworks = "AudioToolbox"
@@ -170,20 +170,35 @@ RCT_EXTERN NSString *RCTFormatStackTrace(NSArray<NSDictionary<NSString *, id> *>
170
170
 
171
171
  #endif
172
172
 
173
- /**
174
- * Controls for ensuring the new architecture runtime assumption holds.
175
- * Note: this is work in progress.
176
- */
173
+ // MARK: - New Architecture Validation
177
174
 
178
- // Enable reporting of any violation related to the new React Native architecture.
179
- // If RCT_NEW_ARCHITECTURE is defined, it is already enabled by default, otherwise, no violation will be
180
- // reported until enabled.
181
- // Note: enabling this at runtime is not early enough to report issues within ObjC class +load execution.
182
- __attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureViolationReporting(BOOL enabled);
175
+ typedef enum {
176
+ RCTNotAllowedInFabric = 1,
177
+ RCTNotAllowedInBridgeless = 2,
178
+ } RCTNotAllowedValidation;
183
179
 
184
- // When reporting is enabled, trigger an assertion.
185
- __attribute__((used)) RCT_EXTERN void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra);
186
-
187
- // When reporting is enabled, warn about the violation. Use this to prepare a specific callsite
188
- // for stricter enforcement. When ready, switch it to use the variant above.
189
- __attribute__((used)) RCT_EXTERN void RCTWarnNotAllowedForNewArchitecture(id context, NSString *extra);
180
+ /**
181
+ * Ensure runtime assumptions holds for the new architecture by reporting when assumptions are violated.
182
+ * Note: this is work in progress.
183
+ *
184
+ * When type is RCTNotAllowedInFabric, validate Fabric assumptions in Bridge or Bridgeless mode.
185
+ * i.e. Report legacy pre-Fabric call sites that should not be used while Fabric is enabled,
186
+ *
187
+ * When type is RCTNotAllowedInBridgeless, validate Bridgeless assumptions, in Bridgeless mode only.
188
+ * i.e. Report Bridge call sites that should not be used while Bridgeless mode is enabled.
189
+ *
190
+ * Note: enabling this at runtime is not early enough to report issues within ObjC class +load execution.
191
+ */
192
+ __attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureValidationReporting(RCTNotAllowedValidation type);
193
+
194
+ // When new architecture validation reporting is enabled, trigger an assertion and crash.
195
+ __attribute__((used)) RCT_EXTERN void
196
+ RCTEnforceNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra);
197
+ // When new architecture validation reporting is enabled, trigger an error but do not crash.
198
+ // When ready, switch to stricter variant above.
199
+ __attribute__((used)) RCT_EXTERN void
200
+ RCTErrorNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra);
201
+ // When new architecture validation reporting is enabled, log an message.
202
+ // When ready, switch to stricter variant above.
203
+ __attribute__((used)) RCT_EXTERN void
204
+ RCTLogNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra);
@@ -231,54 +231,94 @@ RCTFatalExceptionHandler RCTGetFatalExceptionHandler(void)
231
231
  return RCTCurrentFatalExceptionHandler;
232
232
  }
233
233
 
234
- // -------------------------
235
- // New architecture section
236
- // -------------------------
234
+ // MARK: - New Architecture Validation - Enable Reporting
237
235
 
238
236
  #if RCT_NEW_ARCHITECTURE
239
- static BOOL newArchitectureViolationReporting = YES;
237
+ static RCTNotAllowedValidation validationReportingEnabled = RCTNotAllowedInBridgeless;
240
238
  #else
241
- static BOOL newArchitectureViolationReporting = NO;
239
+ static RCTNotAllowedValidation validationReportingEnabled = 0;
242
240
  #endif
243
241
 
244
- void RCTEnableNewArchitectureViolationReporting(BOOL enabled)
242
+ __attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureValidationReporting(RCTNotAllowedValidation type)
245
243
  {
246
244
  #if RCT_NEW_ARCHITECTURE
247
245
  // Cannot disable the reporting in this mode.
248
246
  #else
249
- newArchitectureViolationReporting = enabled;
247
+ validationReportingEnabled = type;
250
248
  #endif
251
249
  }
252
250
 
253
- static NSString *getNewArchitectureViolationMessage(id context, NSString *extra)
251
+ // MARK: - New Architecture Validation - Private
252
+
253
+ static BOOL shouldEnforceValidation(RCTNotAllowedValidation type)
254
+ {
255
+ switch (type) {
256
+ case RCTNotAllowedInFabric:
257
+ return validationReportingEnabled == RCTNotAllowedInBridgeless ||
258
+ validationReportingEnabled == RCTNotAllowedInFabric;
259
+ case RCTNotAllowedInBridgeless:
260
+ return validationReportingEnabled == RCTNotAllowedInBridgeless;
261
+ }
262
+ return NO;
263
+ }
264
+
265
+ static NSString *stringDescribingContext(id context)
254
266
  {
255
- NSString *tag = @"uncategorized";
256
267
  if ([context isKindOfClass:NSString.class]) {
257
- tag = context;
268
+ return context;
258
269
  } else if (context) {
259
270
  Class klass = [context class];
260
271
  if (klass) {
261
- tag = NSStringFromClass(klass);
272
+ return NSStringFromClass(klass);
262
273
  }
263
274
  }
264
- NSString *errorMessage = extra ?: @"Unexpectedly reached this code path.";
265
- return [NSString stringWithFormat:@"[ReactNative Architecture][%@] %@", tag, errorMessage];
275
+ return @"uncategorized";
276
+ }
277
+
278
+ static NSString *validationMessage(RCTNotAllowedValidation type, id context, NSString *extra)
279
+ {
280
+ NSString *notAllowedType;
281
+ switch (type) {
282
+ case RCTNotAllowedInFabric:
283
+ notAllowedType = @"Fabric";
284
+ break;
285
+ case RCTNotAllowedInBridgeless:
286
+ notAllowedType = @"Bridgeless";
287
+ break;
288
+ }
289
+
290
+ return
291
+ [NSString stringWithFormat:@"[ReactNative Architecture][NotAllowedIn%@] Unexpectedly reached code path in %@. %@",
292
+ notAllowedType,
293
+ stringDescribingContext(context),
294
+ extra ?: @""];
295
+ }
296
+
297
+ // MARK: - New Architecture Validation - Public
298
+
299
+ void RCTEnforceNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra)
300
+ {
301
+ if (!shouldEnforceValidation(type)) {
302
+ return;
303
+ }
304
+
305
+ RCTAssert(0, @"%@", validationMessage(type, context, extra));
266
306
  }
267
307
 
268
- void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra)
308
+ void RCTErrorNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra)
269
309
  {
270
- if (!newArchitectureViolationReporting) {
310
+ if (!shouldEnforceValidation(type)) {
271
311
  return;
272
312
  }
273
313
 
274
- RCTAssert(0, @"%@", getNewArchitectureViolationMessage(context, extra));
314
+ RCTLogError(@"%@", validationMessage(type, context, extra));
275
315
  }
276
316
 
277
- void RCTWarnNotAllowedForNewArchitecture(id context, NSString *extra)
317
+ void RCTLogNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra)
278
318
  {
279
- if (!newArchitectureViolationReporting) {
319
+ if (!shouldEnforceValidation(type)) {
280
320
  return;
281
321
  }
282
322
 
283
- RCTLogWarn(@"%@", getNewArchitectureViolationMessage(context, extra));
323
+ RCTLogInfo(@"%@", validationMessage(type, context, extra));
284
324
  }
@@ -60,8 +60,10 @@ NSArray<Class> *RCTGetModuleClasses(void)
60
60
  void RCTRegisterModule(Class);
61
61
  void RCTRegisterModule(Class moduleClass)
62
62
  {
63
- RCTWarnNotAllowedForNewArchitecture(
64
- @"RCTRegisterModule()", [NSString stringWithFormat:@"'%@' was registered unexpectedly", moduleClass]);
63
+ RCTLogNewArchitectureValidation(
64
+ RCTNotAllowedInBridgeless,
65
+ @"RCTRegisterModule()",
66
+ [NSString stringWithFormat:@"'%@' was registered unexpectedly", moduleClass]);
65
67
 
66
68
  static dispatch_once_t onceToken;
67
69
  dispatch_once(&onceToken, ^{
@@ -223,7 +225,7 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
223
225
  launchOptions:(NSDictionary *)launchOptions
224
226
  {
225
227
  if (self = [super init]) {
226
- RCTEnforceNotAllowedForNewArchitecture(self, nil);
228
+ RCTEnforceNewArchitectureValidation(RCTNotAllowedInBridgeless, self, nil);
227
229
  _delegate = delegate;
228
230
  _bundleURL = bundleURL;
229
231
  _moduleProvider = block;