react-native-macos 0.0.0-7e8402d33 → 0.0.0-7fbfa751a

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 (248) hide show
  1. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  2. package/Libraries/Components/ScrollView/ScrollView.js +11 -0
  3. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  4. package/Libraries/Components/TextInput/TextInput.js +79 -1
  5. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  6. package/Libraries/Components/View/ViewPropTypes.js +10 -0
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/Image/RCTImageView.mm +14 -10
  9. package/Libraries/Image/React-RCTImage.podspec +1 -1
  10. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  11. package/Libraries/Lists/FlatList.js +1 -1
  12. package/Libraries/Lists/VirtualizedList.js +26 -9
  13. package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
  14. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
  15. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
  16. package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
  17. package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
  18. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
  19. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  20. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  21. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  22. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
  23. package/Libraries/Text/RCTTextAttributes.h +11 -3
  24. package/Libraries/Text/RCTTextAttributes.m +26 -0
  25. package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
  26. package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
  27. package/Libraries/Text/Text/RCTTextView.m +123 -58
  28. package/Libraries/Text/Text.js +0 -14
  29. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
  30. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +57 -4
  31. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
  32. package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
  33. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +69 -2
  34. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +7 -1
  35. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
  36. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +4 -1
  37. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +91 -2
  38. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +6 -1
  39. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +33 -0
  40. package/Libraries/Text/TextNativeComponent.js +2 -0
  41. package/Libraries/Text/TextProps.js +29 -0
  42. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  43. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  44. package/React/Base/RCTAssert.h +30 -15
  45. package/React/Base/RCTAssert.m +59 -19
  46. package/React/Base/RCTBridge.m +5 -3
  47. package/React/Base/RCTConstants.h +6 -0
  48. package/React/Base/RCTConstants.m +15 -0
  49. package/React/Base/RCTConvert.m +7 -4
  50. package/React/Base/RCTEventDispatcherProtocol.h +5 -0
  51. package/React/Base/RCTTouchHandler.m +4 -0
  52. package/React/Base/RCTUIKit.h +19 -13
  53. package/React/Base/RCTUtils.m +6 -3
  54. package/React/Base/RCTVersion.m +1 -1
  55. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
  56. package/React/Base/macOS/RCTUIKit.m +33 -0
  57. package/React/CoreModules/RCTEventDispatcher.mm +6 -1
  58. package/React/CoreModules/RCTLogBox.h +1 -1
  59. package/React/CoreModules/RCTLogBox.mm +35 -19
  60. package/React/CoreModules/RCTLogBoxView.h +8 -5
  61. package/React/CoreModules/RCTLogBoxView.mm +64 -23
  62. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  63. package/React/CoreModules/React-CoreModules.podspec +1 -1
  64. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
  65. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  66. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  67. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  68. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  69. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  70. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
  71. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -25
  72. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  73. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  74. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  75. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  76. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +10 -5
  77. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  78. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  79. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
  80. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +3 -3
  81. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +4 -4
  82. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  83. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
  84. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +4 -4
  85. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +56 -30
  86. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  87. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +5 -5
  88. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  89. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
  90. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
  91. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
  92. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
  93. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  94. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -0
  95. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  96. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +5 -5
  97. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +7 -6
  98. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +4 -4
  99. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  100. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +2 -2
  101. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  102. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +2 -2
  103. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  104. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +31 -23
  105. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  106. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  107. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  108. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
  109. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
  110. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  111. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  112. package/React/Fabric/Mounting/RCTMountingManager.h +4 -4
  113. package/React/Fabric/Mounting/RCTMountingManager.mm +28 -19
  114. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  115. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
  116. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
  117. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +6 -4
  118. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
  119. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
  120. package/React/Fabric/RCTConversions.h +15 -7
  121. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  122. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  123. package/React/Fabric/RCTLocalizationProvider.mm +10 -4
  124. package/React/Fabric/RCTScheduler.h +8 -1
  125. package/React/Fabric/RCTScheduler.mm +15 -0
  126. package/React/Fabric/RCTSurfacePresenter.h +10 -2
  127. package/React/Fabric/RCTSurfacePresenter.mm +59 -27
  128. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  129. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  130. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  131. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -9
  132. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  133. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
  134. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  135. package/React/Modules/RCTSurfacePresenterStub.h +4 -0
  136. package/React/Modules/RCTUIManager.m +2 -1
  137. package/React/React-RCTFabric.podspec +2 -2
  138. package/React/Views/RCTActivityIndicatorView.m +2 -1
  139. package/React/Views/RCTMaskedView.h +1 -1
  140. package/React/Views/RCTModalHostView.h +2 -2
  141. package/React/Views/RCTModalHostViewController.h +1 -1
  142. package/React/Views/RCTModalManager.h +1 -1
  143. package/React/Views/RCTView.h +7 -0
  144. package/React/Views/RCTView.m +92 -28
  145. package/React/Views/RCTViewManager.m +11 -1
  146. package/React/Views/RCTWeakViewHolder.h +1 -1
  147. package/React/Views/RCTWrapperViewController.h +2 -2
  148. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  149. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  150. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  151. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  152. package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
  153. package/React/Views/ScrollView/RCTScrollContentView.m +6 -0
  154. package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
  155. package/React/Views/ScrollView/RCTScrollView.h +2 -0
  156. package/React/Views/ScrollView/RCTScrollView.m +16 -31
  157. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
  158. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  159. package/React/Views/UIView+React.h +2 -0
  160. package/React/Views/UIView+React.m +22 -13
  161. package/ReactAndroid/gradle.properties +1 -1
  162. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
  163. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  164. package/ReactAndroid/src/main/jni/Application.mk +1 -1
  165. package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
  166. package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
  167. package/ReactCommon/React-Fabric.podspec +1 -1
  168. package/ReactCommon/React-rncore.podspec +1 -1
  169. package/ReactCommon/ReactCommon.podspec +1 -1
  170. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  171. package/ReactCommon/cxxreact/tests/BUCK +1 -1
  172. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  173. package/ReactCommon/microprofiler/BUCK +1 -1
  174. package/ReactCommon/react/debug/react_native_assert.h +1 -1
  175. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
  176. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
  177. package/ReactCommon/react/renderer/animations/conversions.h +11 -11
  178. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
  179. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
  180. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
  181. package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
  182. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  183. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  184. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
  185. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
  186. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
  187. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
  188. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
  189. package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
  190. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
  191. package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
  192. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
  193. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
  194. package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
  195. package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
  196. package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
  197. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
  198. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
  199. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
  200. package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
  201. package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
  202. package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
  203. package/ReactCommon/react/renderer/core/EventListener.h +44 -0
  204. package/ReactCommon/react/renderer/core/Props.h +0 -4
  205. package/ReactCommon/react/renderer/core/RawProps.h +1 -1
  206. package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
  207. package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
  208. package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
  209. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
  210. package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
  211. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  212. package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
  213. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  214. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  215. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  216. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  217. package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
  218. package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
  219. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  220. package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
  221. package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
  222. package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
  223. package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
  224. package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
  225. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
  226. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
  227. package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
  228. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
  229. package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
  230. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  231. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  232. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
  233. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  234. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  235. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  236. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  237. package/ReactCommon/react/utils/ContextContainer.h +2 -2
  238. package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
  239. package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
  240. package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
  241. package/ReactCommon/yoga/Yoga.podspec +1 -1
  242. package/package.json +4 -1
  243. package/scripts/react_native_pods.rb +1 -4
  244. package/template/Gemfile.lock +5 -5
  245. package/template/package.json +1 -1
  246. package/ReactCommon/butter/optional.h +0 -38
  247. package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
  248. package/third-party-podspecs/boost-for-react-native.podspec +0 -20
@@ -8,7 +8,7 @@
8
8
  #import "RCTInputAccessoryContentView.h"
9
9
 
10
10
  @implementation RCTInputAccessoryContentView {
11
- UIView *_safeAreaContainer;
11
+ RCTUIView *_safeAreaContainer; // TODO(macOS GH#774)
12
12
  NSLayoutConstraint *_heightConstraint;
13
13
  }
14
14
 
@@ -17,7 +17,7 @@
17
17
  if (self = [super init]) {
18
18
  self.autoresizingMask = UIViewAutoresizingFlexibleHeight;
19
19
 
20
- _safeAreaContainer = [UIView new];
20
+ _safeAreaContainer = [RCTUIView new]; // TODO(macOS GH#774)
21
21
  _safeAreaContainer.translatesAutoresizingMaskIntoConstraints = NO;
22
22
  [self addSubview:_safeAreaContainer];
23
23
 
@@ -40,7 +40,7 @@
40
40
  return CGSizeZero;
41
41
  }
42
42
 
43
- - (void)insertSubview:(UIView *)view atIndex:(NSInteger)index
43
+ - (void)insertSubview:(RCTUIView *)view atIndex:(NSInteger)index // TODO(macOS GH#774)
44
44
  {
45
45
  [_safeAreaContainer insertSubview:view atIndex:index];
46
46
  }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTViewComponentView.h>
11
11
 
@@ -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>
@@ -21,28 +22,28 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
21
22
 
22
23
  @implementation RCTLegacyViewManagerInteropComponentView {
23
24
  NSMutableArray<NSDictionary *> *_viewsToBeMounted;
24
- NSMutableArray<UIView *> *_viewsToBeUnmounted;
25
+ NSMutableArray<RCTUIView *> *_viewsToBeUnmounted; // TODO(macOS GH#774)
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;
41
42
  }
42
43
 
43
- - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
44
+ - (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
44
45
  {
45
- UIView *result = [super hitTest:point withEvent:event];
46
+ RCTUIView *result = [super hitTest:point withEvent:event]; // TODO(macOS GH#774)
46
47
 
47
48
  if (result == _adapter.paperView) {
48
49
  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,10 +145,11 @@ 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
 
107
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
152
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
108
153
  {
109
154
  [_viewsToBeMounted addObject:@{
110
155
  kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
@@ -112,7 +157,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
112
157
  }];
113
158
  }
114
159
 
115
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
160
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
116
161
  {
117
162
  if (_adapter) {
118
163
  [_adapter.paperView removeReactSubview:childComponentView];
@@ -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,12 +198,17 @@ 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];
160
210
 
161
- for (UIView *view in _viewsToBeUnmounted) {
211
+ for (RCTUIView *view in _viewsToBeUnmounted) { // TODO(macOS GH#774)
162
212
  [_adapter.paperView removeReactSubview:view];
163
213
  }
164
214
 
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
14
14
 
15
15
  - (instancetype)initWithCoordinator:(RCTLegacyViewManagerInteropCoordinator *)coordinator reactTag:(NSInteger)tag;
16
16
 
17
- @property (strong, nonatomic) UIView *paperView;
17
+ @property (strong, nonatomic) RCTUIView *paperView; // TODO(macOS GH#774)
18
18
 
19
19
  @property (nonatomic, copy, nullable) void (^eventInterceptor)(std::string eventName, folly::dynamic event);
20
20
 
@@ -28,7 +28,7 @@
28
28
  [_coordinator removeObserveForTag:_tag];
29
29
  }
30
30
 
31
- - (UIView *)paperView
31
+ - (RCTUIView *)paperView // TODO(macOS GH#774)
32
32
  {
33
33
  if (!_paperView) {
34
34
  _paperView = [_coordinator createPaperViewWithTag:_tag];
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  @protocol RCTFabricModalHostViewControllerDelegate <NSObject>
11
11
  - (void)boundsDidChange:(CGRect)newBounds;
@@ -13,6 +13,7 @@
13
13
  */
14
14
  @interface RCTModalHostViewComponentView : RCTViewComponentView <RCTMountingTransactionObserving>
15
15
 
16
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
16
17
  /**
17
18
  * Subclasses may override this method and present the modal on different view controller.
18
19
  * Default implementation presents the modal on `[self reactViewController]`.
@@ -28,5 +29,6 @@
28
29
  - (void)dismissViewController:(UIViewController *)modalViewController
29
30
  animated:(BOOL)animated
30
31
  completion:(void (^)(void))completion;
32
+ #endif // ]TODO(macOS GH#774)
31
33
 
32
34
  @end
@@ -21,6 +21,7 @@
21
21
 
22
22
  using namespace facebook::react;
23
23
 
24
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
24
25
  static UIInterfaceOrientationMask supportedOrientationsMask(ModalHostViewSupportedOrientationsMask mask)
25
26
  {
26
27
  UIInterfaceOrientationMask supportedOrientations = 0;
@@ -93,6 +94,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
93
94
  : ModalHostViewEventEmitter::OnOrientationChangeOrientation::Landscape;
94
95
  return {orientation};
95
96
  }
97
+ #endif // ]TODO(macOS GH#774)
96
98
 
97
99
  @interface RCTModalHostViewComponentView () <RCTFabricModalHostViewControllerDelegate>
98
100
 
@@ -104,9 +106,10 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
104
106
  BOOL _shouldAnimatePresentation;
105
107
  BOOL _shouldPresent;
106
108
  BOOL _isPresented;
107
- UIView *_modalContentsSnapshot;
109
+ RCTUIView *_modalContentsSnapshot; // TODO(macOS GH#774)
108
110
  }
109
111
 
112
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
110
113
  - (instancetype)initWithFrame:(CGRect)frame
111
114
  {
112
115
  if (self = [super initWithFrame:frame]) {
@@ -165,7 +168,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
165
168
  _isPresented = NO;
166
169
  // To animate dismissal of view controller, snapshot of
167
170
  // view hierarchy needs to be added to the UIViewController.
168
- UIView *snapshot = _modalContentsSnapshot;
171
+ RCTUIView *snapshot = _modalContentsSnapshot; // TODO(macOS GH#774)
169
172
  [self.viewController.view addSubview:snapshot];
170
173
 
171
174
  [self dismissViewController:self.viewController
@@ -192,7 +195,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
192
195
 
193
196
  #pragma mark - RCTMountingTransactionObserving
194
197
 
195
- - (void)mountingTransactionWillMountWithMetadata:(MountingTransactionMetadata const &)metadata
198
+ - (void)mountingTransactionWillMount:(MountingTransaction const &)transaction
199
+ withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry
196
200
  {
197
201
  _modalContentsSnapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO];
198
202
  }
@@ -268,15 +272,16 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
268
272
  _state = std::static_pointer_cast<const ModalHostViewShadowNode::ConcreteState>(state);
269
273
  }
270
274
 
271
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
275
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
272
276
  {
273
277
  [self.viewController.view insertSubview:childComponentView atIndex:index];
274
278
  }
275
279
 
276
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
280
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
277
281
  {
278
282
  [childComponentView removeFromSuperview];
279
283
  }
284
+ #endif // ]TODO(macOS GH#774)
280
285
 
281
286
  @end
282
287
 
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTViewComponentView.h>
11
11
 
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTViewComponentView.h>
11
11
 
@@ -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;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTGenericDelegateSplitter.h>
11
11
  #import <React/RCTViewComponentView.h>
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
19
19
  */
20
20
  @protocol RCTEnhancedScrollViewOverridingDelegate <NSObject>
21
21
 
22
- - (BOOL)touchesShouldCancelInContentView:(UIView *)view;
22
+ - (BOOL)touchesShouldCancelInContentView:(RCTUIView *)view; // TODO(macOS GH#774)
23
23
 
24
24
  @end
25
25
 
@@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
27
27
  * `UIScrollView` subclass which has some improvements and tweaks
28
28
  * which are not directly related to React Native.
29
29
  */
30
- @interface RCTEnhancedScrollView : UIScrollView
30
+ @interface RCTEnhancedScrollView : RCTUIScrollView // TODO(macOS GH#774)
31
31
 
32
32
  /*
33
33
  * Returns a delegate splitter that can be used to create as many `UIScrollView` delegates as needed.
@@ -88,7 +88,7 @@
88
88
  RCTSanitizeNaNValue(contentOffset.y, @"scrollView.contentOffset.y"));
89
89
  }
90
90
 
91
- - (BOOL)touchesShouldCancelInContentView:(UIView *)view
91
+ - (BOOL)touchesShouldCancelInContentView:(RCTUIView *)view // TODO(macOS GH#774)
92
92
  {
93
93
  if ([_overridingDelegate respondsToSelector:@selector(touchesShouldCancelInContentView:)]) {
94
94
  return [_overridingDelegate touchesShouldCancelInContentView:view];
@@ -130,9 +130,9 @@
130
130
 
131
131
  #pragma mark - UIScrollViewDelegate
132
132
 
133
- - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView
133
+ - (void)scrollViewWillEndDragging:(RCTUIScrollView *)scrollView
134
134
  withVelocity:(CGPoint)velocity
135
- targetContentOffset:(inout CGPoint *)targetContentOffset
135
+ targetContentOffset:(inout CGPoint *)targetContentOffset // TODO(macOS GH#774)
136
136
  {
137
137
  if (self.snapToOffsets && self.snapToOffsets.count > 0) {
138
138
  // An alternative to enablePaging and snapToInterval which allows setting custom
@@ -259,7 +259,7 @@
259
259
 
260
260
  #pragma mark -
261
261
 
262
- - (BOOL)isHorizontal:(UIScrollView *)scrollView
262
+ - (BOOL)isHorizontal:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
263
263
  {
264
264
  return scrollView.contentSize.width > self.frame.size.width;
265
265
  }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTViewComponentView.h>
11
11
 
@@ -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
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTDefines.h>
11
11
  #import <React/RCTGenericDelegateSplitter.h>
@@ -28,19 +28,19 @@ NS_ASSUME_NONNULL_BEGIN
28
28
  /*
29
29
  * Finds and returns the closet RCTScrollViewComponentView component to the given view
30
30
  */
31
- + (nullable RCTScrollViewComponentView *)findScrollViewComponentViewForView:(UIView *)view;
31
+ + (nullable RCTScrollViewComponentView *)findScrollViewComponentViewForView:(RCTUIView *)view; // TODO(macOS GH#774)
32
32
 
33
33
  /*
34
34
  * Returns an actual UIScrollView that this component uses under the hood.
35
35
  */
36
- @property (nonatomic, strong, readonly) UIScrollView *scrollView;
36
+ @property (nonatomic, strong, readonly) RCTUIScrollView *scrollView; // TODO(macOS GH#774)
37
37
 
38
38
  /*
39
39
  * Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to
40
40
  * separate component views from auxiliary views to be able to reliably implement pull-to-refresh- and RTL-related
41
41
  * functionality.
42
42
  */
43
- @property (nonatomic, strong, readonly) UIView *containerView;
43
+ @property (nonatomic, strong, readonly) RCTUIView *containerView; // TODO(macOS GH#774)
44
44
 
45
45
  /*
46
46
  * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate.