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
@@ -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/RCTComponentViewProtocol.h>
11
11
 
@@ -14,13 +14,13 @@ NS_ASSUME_NONNULL_BEGIN
14
14
  /**
15
15
  * Default implementation of RCTComponentViewProtocol.
16
16
  */
17
- @interface UIView (ComponentViewProtocol) <RCTComponentViewProtocol>
17
+ @interface RCTUIView (ComponentViewProtocol) <RCTComponentViewProtocol> // TODO(macOS GH#774)
18
18
 
19
19
  + (std::vector<facebook::react::ComponentDescriptorProvider>)supplementalComponentDescriptorProviders;
20
20
 
21
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index;
21
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index; // TODO(macOS GH#774)
22
22
 
23
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index;
23
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index; // TODO(macOS GH#774)
24
24
 
25
25
  - (void)updateProps:(facebook::react::Props::Shared const &)props
26
26
  oldProps:(facebook::react::Props::Shared const &)oldProps;
@@ -37,14 +37,14 @@ NS_ASSUME_NONNULL_BEGIN
37
37
 
38
38
  - (void)prepareForRecycle;
39
39
 
40
- - (facebook::react::SharedProps)props;
40
+ - (facebook::react::Props::Shared)props;
41
41
 
42
42
  - (void)setIsJSResponder:(BOOL)isJSResponder;
43
43
 
44
44
  - (void)setPropKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN:(nullable NSSet<NSString *> *)props;
45
45
  - (nullable NSSet<NSString *> *)propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
46
46
 
47
- - (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView;
47
+ - (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView; // TODO(macOS GH#774)
48
48
 
49
49
  @end
50
50
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  using namespace facebook::react;
17
17
 
18
- @implementation UIView (ComponentViewProtocol)
18
+ @implementation RCTUIView (ComponentViewProtocol) // TODO(macOS GH#774)
19
19
 
20
20
  + (ComponentDescriptorProvider)componentDescriptorProvider
21
21
  {
@@ -28,7 +28,7 @@ using namespace facebook::react;
28
28
  return {};
29
29
  }
30
30
 
31
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
31
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
32
32
  {
33
33
  RCTAssert(
34
34
  childComponentView.superview == nil,
@@ -40,7 +40,7 @@ using namespace facebook::react;
40
40
  [self insertSubview:childComponentView atIndex:index];
41
41
  }
42
42
 
43
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
43
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
44
44
  {
45
45
  RCTAssert(
46
46
  childComponentView.superview == self,
@@ -129,7 +129,7 @@ using namespace facebook::react;
129
129
  // Default implementation does nothing.
130
130
  }
131
131
 
132
- - (facebook::react::SharedProps)props
132
+ - (facebook::react::Props::Shared)props
133
133
  {
134
134
  RCTAssert(NO, @"props access should be implemented by RCTViewComponentView.");
135
135
  return nullptr;
@@ -156,14 +156,14 @@ using namespace facebook::react;
156
156
  return nil;
157
157
  }
158
158
 
159
- - (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView
159
+ - (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView // TODO(macOS GH#774)
160
160
  {
161
161
  clipRect = [clipView convertRect:clipRect toView:self];
162
162
 
163
163
  // Normal views don't support unmounting, so all
164
164
  // this does is forward message to our subviews,
165
165
  // in case any of those do support it
166
- for (UIView *subview in self.subviews) {
166
+ for (RCTUIView *subview in self.subviews) { // TODO(macOS GH#774)
167
167
  [subview updateClippedSubviewsWithClipRect:clipRect relativeToView:self];
168
168
  }
169
169
  }
@@ -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/renderer/components/view/AccessibilityPrimitives.h>
11
11
  #import <react/renderer/components/view/primitives.h>
@@ -35,26 +35,26 @@ inline std::string RCTStringFromNSString(NSString *string)
35
35
  return std::string{string.UTF8String ?: ""};
36
36
  }
37
37
 
38
- inline UIColor *_Nullable RCTUIColorFromSharedColor(facebook::react::SharedColor const &sharedColor)
38
+ inline RCTUIColor *_Nullable RCTUIColorFromSharedColor(facebook::react::SharedColor const &sharedColor) // TODO(macOS GH#774)
39
39
  {
40
40
  if (!sharedColor) {
41
41
  return nil;
42
42
  }
43
43
 
44
44
  if (*facebook::react::clearColor() == *sharedColor) {
45
- return [UIColor clearColor];
45
+ return [RCTUIColor clearColor]; // TODO(macOS GH#774)
46
46
  }
47
47
 
48
48
  if (*facebook::react::blackColor() == *sharedColor) {
49
- return [UIColor blackColor];
49
+ return [RCTUIColor blackColor]; // TODO(macOS GH#774)
50
50
  }
51
51
 
52
52
  if (*facebook::react::whiteColor() == *sharedColor) {
53
- return [UIColor whiteColor];
53
+ return [RCTUIColor whiteColor]; // TODO(macOS GH#774)
54
54
  }
55
55
 
56
56
  auto components = facebook::react::colorComponentsFromColor(sharedColor);
57
- return [UIColor colorWithRed:components.red green:components.green blue:components.blue alpha:components.alpha];
57
+ return [RCTUIColor colorWithRed:components.red green:components.green blue:components.blue alpha:components.alpha]; // TODO(macOS GH#774)
58
58
  }
59
59
 
60
60
  inline CF_RETURNS_RETAINED CGColorRef
@@ -173,9 +173,17 @@ inline facebook::react::Point RCTPointFromCGPoint(const CGPoint &point)
173
173
  return {point.x, point.y};
174
174
  }
175
175
 
176
+ inline facebook::react::Float RCTFloatFromCGFloat(CGFloat value)
177
+ {
178
+ if (value == CGFLOAT_MAX) {
179
+ return std::numeric_limits<facebook::react::Float>::infinity();
180
+ }
181
+ return value;
182
+ }
183
+
176
184
  inline facebook::react::Size RCTSizeFromCGSize(const CGSize &size)
177
185
  {
178
- return {size.width, size.height};
186
+ return {RCTFloatFromCGFloat(size.width), RCTFloatFromCGFloat(size.height)};
179
187
  }
180
188
 
181
189
  inline facebook::react::Rect RCTRectFromCGRect(const CGRect &rect)
@@ -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
  NS_ASSUME_NONNULL_BEGIN
11
11
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTDefines.h>
9
- #import <UIKit/UIKit.h>
9
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
10
10
 
11
11
  @protocol RCTLocalizationProtocol <NSObject>
12
12
 
@@ -26,15 +26,21 @@ void setLocalizationLanguagePack(NSDictionary<NSString *, NSString *> *pack)
26
26
 
27
27
  + (NSString *)RCTLocalizedString:(NSString *)oldString withDescription:(NSString *)description
28
28
  {
29
+ NSString *candidate = nil;
30
+
29
31
  if (_delegate != nil) {
30
- return [_delegate localizedString:oldString withDescription:description];
32
+ candidate = [_delegate localizedString:oldString withDescription:description];
33
+ }
34
+
35
+ if (candidate == nil && _languagePack != nil) {
36
+ candidate = _languagePack[oldString];
31
37
  }
32
38
 
33
- if (_languagePack != nil) {
34
- return _languagePack[oldString];
39
+ if (candidate == nil) {
40
+ candidate = oldString;
35
41
  }
36
42
 
37
- return oldString;
43
+ return candidate;
38
44
  }
39
45
 
40
46
  @end
@@ -5,16 +5,18 @@
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
  #import <memory>
10
10
 
11
11
  #import <react/renderer/componentregistry/ComponentDescriptorFactory.h>
12
12
  #import <react/renderer/core/ComponentDescriptor.h>
13
+ #import <react/renderer/core/EventListener.h>
13
14
  #import <react/renderer/core/LayoutConstraints.h>
14
15
  #import <react/renderer/core/LayoutContext.h>
15
16
  #import <react/renderer/mounting/MountingCoordinator.h>
16
17
  #import <react/renderer/scheduler/SchedulerToolbox.h>
17
18
  #import <react/renderer/scheduler/SurfaceHandler.h>
19
+ #import <react/renderer/uimanager/UIManager.h>
18
20
  #import <react/utils/ContextContainer.h>
19
21
 
20
22
  NS_ASSUME_NONNULL_BEGIN
@@ -47,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
47
49
  @interface RCTScheduler : NSObject
48
50
 
49
51
  @property (atomic, weak, nullable) id<RCTSchedulerDelegate> delegate;
52
+ @property (readonly) std::shared_ptr<facebook::react::UIManager> const uiManager;
50
53
 
51
54
  - (instancetype)initWithToolbox:(facebook::react::SchedulerToolbox)toolbox;
52
55
 
@@ -64,6 +67,10 @@ NS_ASSUME_NONNULL_BEGIN
64
67
 
65
68
  - (void)animationTick;
66
69
 
70
+ - (void)addEventListener:(std::shared_ptr<facebook::react::EventListener> const &)listener;
71
+
72
+ - (void)removeEventListener:(std::shared_ptr<facebook::react::EventListener> const &)listener;
73
+
67
74
  @end
68
75
 
69
76
  NS_ASSUME_NONNULL_END
@@ -193,4 +193,19 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
193
193
  }
194
194
  }
195
195
 
196
+ - (void)addEventListener:(std::shared_ptr<EventListener> const &)listener
197
+ {
198
+ return _scheduler->addEventListener(listener);
199
+ }
200
+
201
+ - (void)removeEventListener:(std::shared_ptr<EventListener> const &)listener
202
+ {
203
+ return _scheduler->removeEventListener(listener);
204
+ }
205
+
206
+ - (std::shared_ptr<facebook::react::UIManager> const)uiManager
207
+ {
208
+ return _scheduler->getUIManager();
209
+ }
210
+
196
211
  @end
@@ -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/RCTPrimitives.h>
11
11
  #import <React/RCTSurfacePresenterStub.h>
@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
19
19
  @class RCTFabricSurface;
20
20
  @class RCTImageLoader;
21
21
  @class RCTMountingManager;
22
+ @class RCTScheduler;
22
23
 
23
24
  /**
24
25
  * Coordinates presenting of React Native Surfaces and represents application
@@ -53,6 +54,13 @@ NS_ASSUME_NONNULL_BEGIN
53
54
  - (void)unregisterSurface:(RCTFabricSurface *)surface;
54
55
 
55
56
  @property (readonly) RCTMountingManager *mountingManager;
57
+ @property (readonly, nullable) RCTScheduler *scheduler;
58
+
59
+ /*
60
+ * Allow callers to initialize a new fabric surface without adding Fabric as a Buck dependency.
61
+ */
62
+ - (id<RCTSurfaceProtocol>)createFabricSurfaceForModuleName:(NSString *)moduleName
63
+ initialProperties:(NSDictionary *)initialProperties;
56
64
 
57
65
  - (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag;
58
66
 
@@ -70,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
70
78
  /*
71
79
  * Please do not use this, this will be deleted soon.
72
80
  */
73
- - (nullable UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag;
81
+ - (nullable RCTUIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; // TODO(macOS GH#774)
74
82
 
75
83
  @end
76
84
 
@@ -80,9 +80,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
80
80
  RuntimeExecutor _runtimeExecutor; // Protected by `_schedulerLifeCycleMutex`.
81
81
 
82
82
  butter::shared_mutex _observerListMutex;
83
- NSMutableArray<id<RCTSurfacePresenterObserver>> *_observers;
84
- RCTImageLoader *_imageLoader;
85
- RuntimeExecutor _runtimeExecutor;
83
+ std::vector<__weak id<RCTSurfacePresenterObserver>> _observers; // Protected by `_observerListMutex`.
86
84
  }
87
85
 
88
86
  - (instancetype)initWithContextContainer:(ContextContainer::Shared)contextContainer
@@ -98,8 +96,6 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
98
96
  _mountingManager.contextContainer = contextContainer;
99
97
  _mountingManager.delegate = self;
100
98
 
101
- _observers = [NSMutableArray array];
102
-
103
99
  _scheduler = [self _createScheduler];
104
100
  }
105
101
 
@@ -111,7 +107,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
111
107
  return _mountingManager;
112
108
  }
113
109
 
114
- - (RCTScheduler *_Nullable)_scheduler
110
+ - (RCTScheduler *_Nullable)scheduler
115
111
  {
116
112
  std::lock_guard<std::mutex> lock(_schedulerAccessMutex);
117
113
  return _scheduler;
@@ -147,7 +143,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
147
143
  - (void)registerSurface:(RCTFabricSurface *)surface
148
144
  {
149
145
  [_surfaceRegistry registerSurface:surface];
150
- RCTScheduler *scheduler = [self _scheduler];
146
+ RCTScheduler *scheduler = [self scheduler];
151
147
  if (scheduler) {
152
148
  [scheduler registerSurface:surface.surfaceHandler];
153
149
  }
@@ -155,7 +151,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
155
151
 
156
152
  - (void)unregisterSurface:(RCTFabricSurface *)surface
157
153
  {
158
- RCTScheduler *scheduler = [self _scheduler];
154
+ RCTScheduler *scheduler = [self scheduler];
159
155
  if (scheduler) {
160
156
  [scheduler unregisterSurface:surface.surfaceHandler];
161
157
  }
@@ -167,23 +163,31 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
167
163
  return [_surfaceRegistry surfaceForRootTag:rootTag];
168
164
  }
169
165
 
170
- - (UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag
166
+ - (id<RCTSurfaceProtocol>)createFabricSurfaceForModuleName:(NSString *)moduleName
167
+ initialProperties:(NSDictionary *)initialProperties
171
168
  {
172
- UIView<RCTComponentViewProtocol> *componentView =
173
- [_mountingManager.componentViewRegistry findComponentViewWithTag:tag];
169
+ return [[RCTFabricSurface alloc] initWithSurfacePresenter:self
170
+ moduleName:moduleName
171
+ initialProperties:initialProperties];
172
+ }
173
+
174
+ - (RCTUIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag // TODO(macOS GH#774)
175
+ {
176
+ RCTUIView<RCTComponentViewProtocol> *componentView =
177
+ [_mountingManager.componentViewRegistry findComponentViewWithTag:tag]; // TODO(macOS GH#774)
174
178
  return componentView;
175
179
  }
176
180
 
177
181
  - (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props
178
182
  {
179
- RCTScheduler *scheduler = [self _scheduler];
183
+ RCTScheduler *scheduler = [self scheduler];
180
184
  if (!scheduler) {
181
185
  return NO;
182
186
  }
183
187
 
184
188
  ReactTag tag = [reactTag integerValue];
185
- UIView<RCTComponentViewProtocol> *componentView =
186
- [_mountingManager.componentViewRegistry findComponentViewWithTag:tag];
189
+ RCTUIView<RCTComponentViewProtocol> *componentView =
190
+ [_mountingManager.componentViewRegistry findComponentViewWithTag:tag]; // TODO(macOS GH#774)
187
191
  if (componentView == nil) {
188
192
  return NO; // This view probably isn't managed by Fabric
189
193
  }
@@ -200,7 +204,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
200
204
 
201
205
  - (void)setupAnimationDriverWithSurfaceHandler:(facebook::react::SurfaceHandler const &)surfaceHandler
202
206
  {
203
- [[self _scheduler] setupAnimationDriver:surfaceHandler];
207
+ [[self scheduler] setupAnimationDriver:surfaceHandler];
204
208
  }
205
209
 
206
210
  - (BOOL)suspend
@@ -257,6 +261,10 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
257
261
  RCTExperimentSetPreemptiveViewAllocationDisabled(YES);
258
262
  }
259
263
 
264
+ if (reactNativeConfig && reactNativeConfig->getBool("rn_convergence:dispatch_pointer_events")) {
265
+ RCTSetDispatchW3CPointerEvents(YES);
266
+ }
267
+
260
268
  auto componentRegistryFactory =
261
269
  [factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
262
270
  EventDispatcher::Weak const &eventDispatcher, ContextContainer::Shared const &contextContainer) {
@@ -271,7 +279,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
271
279
  toolbox.componentRegistryFactory = componentRegistryFactory;
272
280
 
273
281
  auto weakRuntimeScheduler = _contextContainer->find<std::weak_ptr<RuntimeScheduler>>("RuntimeScheduler");
274
- auto runtimeScheduler = weakRuntimeScheduler.hasValue() ? weakRuntimeScheduler.value().lock() : nullptr;
282
+ auto runtimeScheduler = weakRuntimeScheduler.has_value() ? weakRuntimeScheduler.value().lock() : nullptr;
275
283
  if (runtimeScheduler) {
276
284
  runtimeExecutor = [runtimeScheduler](std::function<void(jsi::Runtime & runtime)> &&callback) {
277
285
  runtimeScheduler->scheduleWork(std::move(callback));
@@ -342,7 +350,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
342
350
  NSString *commandStr = [[NSString alloc] initWithUTF8String:commandName.c_str()];
343
351
  NSArray *argsArray = convertFollyDynamicToId(args);
344
352
 
345
- [self->_mountingManager dispatchCommand:tag commandName:commandStr args:argsArray];
353
+ [_mountingManager dispatchCommand:tag commandName:commandStr args:argsArray];
346
354
  }
347
355
 
348
356
  - (void)schedulerDidSendAccessibilityEvent:(const facebook::react::ShadowView &)shadowView
@@ -351,28 +359,30 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
351
359
  ReactTag tag = shadowView.tag;
352
360
  NSString *eventTypeStr = [[NSString alloc] initWithUTF8String:eventType.c_str()];
353
361
 
354
- [self->_mountingManager sendAccessibilityEvent:tag eventType:eventTypeStr];
362
+ [_mountingManager sendAccessibilityEvent:tag eventType:eventTypeStr];
355
363
  }
356
364
 
357
365
  - (void)schedulerDidSetIsJSResponder:(BOOL)isJSResponder
358
366
  blockNativeResponder:(BOOL)blockNativeResponder
359
367
  forShadowView:(facebook::react::ShadowView const &)shadowView;
360
368
  {
361
- [self->_mountingManager setIsJSResponder:isJSResponder
362
- blockNativeResponder:blockNativeResponder
363
- forShadowView:shadowView];
369
+ [_mountingManager setIsJSResponder:isJSResponder blockNativeResponder:blockNativeResponder forShadowView:shadowView];
364
370
  }
365
371
 
366
372
  - (void)addObserver:(id<RCTSurfacePresenterObserver>)observer
367
373
  {
368
374
  std::unique_lock<butter::shared_mutex> lock(_observerListMutex);
369
- [self->_observers addObject:observer];
375
+ _observers.push_back(observer);
370
376
  }
371
377
 
372
378
  - (void)removeObserver:(id<RCTSurfacePresenterObserver>)observer
373
379
  {
374
380
  std::unique_lock<butter::shared_mutex> lock(_observerListMutex);
375
- [self->_observers removeObject:observer];
381
+ std::vector<__weak id<RCTSurfacePresenterObserver>>::const_iterator it =
382
+ std::find(_observers.begin(), _observers.end(), observer);
383
+ if (it != _observers.end()) {
384
+ _observers.erase(it);
385
+ }
376
386
  }
377
387
 
378
388
  #pragma mark - RCTMountingManagerDelegate
@@ -381,8 +391,13 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
381
391
  {
382
392
  RCTAssertMainQueue();
383
393
 
384
- std::shared_lock<butter::shared_mutex> lock(_observerListMutex);
385
- for (id<RCTSurfacePresenterObserver> observer in _observers) {
394
+ NSArray<id<RCTSurfacePresenterObserver>> *observersCopy;
395
+ {
396
+ std::shared_lock<butter::shared_mutex> lock(_observerListMutex);
397
+ observersCopy = [self _getObservers];
398
+ }
399
+
400
+ for (id<RCTSurfacePresenterObserver> observer in observersCopy) {
386
401
  if ([observer respondsToSelector:@selector(willMountComponentsWithRootTag:)]) {
387
402
  [observer willMountComponentsWithRootTag:rootTag];
388
403
  }
@@ -393,12 +408,29 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
393
408
  {
394
409
  RCTAssertMainQueue();
395
410
 
396
- std::shared_lock<butter::shared_mutex> lock(_observerListMutex);
397
- for (id<RCTSurfacePresenterObserver> observer in _observers) {
411
+ NSArray<id<RCTSurfacePresenterObserver>> *observersCopy;
412
+ {
413
+ std::shared_lock<butter::shared_mutex> lock(_observerListMutex);
414
+ observersCopy = [self _getObservers];
415
+ }
416
+
417
+ for (id<RCTSurfacePresenterObserver> observer in observersCopy) {
398
418
  if ([observer respondsToSelector:@selector(didMountComponentsWithRootTag:)]) {
399
419
  [observer didMountComponentsWithRootTag:rootTag];
400
420
  }
401
421
  }
402
422
  }
403
423
 
424
+ - (NSArray<id<RCTSurfacePresenterObserver>> *)_getObservers
425
+ {
426
+ NSMutableArray<id<RCTSurfacePresenterObserver>> *observersCopy = [NSMutableArray new];
427
+ for (id<RCTSurfacePresenterObserver> observer : _observers) {
428
+ if (observer) {
429
+ [observersCopy addObject:observer];
430
+ }
431
+ }
432
+
433
+ return observersCopy;
434
+ }
435
+
404
436
  @end
@@ -7,7 +7,7 @@
7
7
 
8
8
  #import <Foundation/Foundation.h>
9
9
  #import <ReactCommon/RuntimeExecutor.h>
10
- #import <UIKit/UIKit.h>
10
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
11
11
  #import <react/utils/ContextContainer.h>
12
12
 
13
13
  NS_ASSUME_NONNULL_BEGIN
@@ -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/RCTPrimitives.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
  NS_ASSUME_NONNULL_BEGIN
11
11
 
@@ -15,8 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
15
15
  * Attaches (and detaches) a view to the touch handler.
16
16
  * The receiver does not retain the provided view.
17
17
  */
18
- - (void)attachToView:(UIView *)view;
19
- - (void)detachFromView:(UIView *)view;
18
+ - (void)attachToView:(RCTUIView *)view; // TODO(macOS GH#774)
19
+ - (void)detachFromView:(RCTUIView *)view; // TODO(macOS GH#774)
20
20
 
21
21
  /*
22
22
  * Offset of the attached view relative to the root component in points.
@@ -9,7 +9,6 @@
9
9
 
10
10
  #import <React/RCTUtils.h>
11
11
  #import <React/RCTViewComponentView.h>
12
- #import <UIKit/UIGestureRecognizerSubclass.h>
13
12
 
14
13
  #import "RCTConversions.h"
15
14
  #import "RCTTouchableComponentViewProtocol.h"
@@ -61,7 +60,7 @@ struct ActiveTouch {
61
60
  /*
62
61
  * A component view on which the touch was begun.
63
62
  */
64
- __strong UIView<RCTComponentViewProtocol> *componentView = nil;
63
+ __strong RCTUIView<RCTComponentViewProtocol> *componentView = nil; // TODO(macOS GH#774)
65
64
 
66
65
  struct Hasher {
67
66
  size_t operator()(const ActiveTouch &activeTouch) const
@@ -81,8 +80,8 @@ struct ActiveTouch {
81
80
  static void UpdateActiveTouchWithUITouch(
82
81
  ActiveTouch &activeTouch,
83
82
  UITouch *uiTouch,
84
- UIView *rootComponentView,
85
- CGPoint rootViewOriginOffset)
83
+ RCTUIView *rootComponentView,
84
+ CGPoint rootViewOriginOffset) // TODO(macOS GH#774)
86
85
  {
87
86
  CGPoint offsetPoint = [uiTouch locationInView:activeTouch.componentView];
88
87
  CGPoint screenPoint = [uiTouch locationInView:uiTouch.window];
@@ -100,12 +99,12 @@ static void UpdateActiveTouchWithUITouch(
100
99
  }
101
100
  }
102
101
 
103
- static ActiveTouch CreateTouchWithUITouch(UITouch *uiTouch, UIView *rootComponentView, CGPoint rootViewOriginOffset)
102
+ static ActiveTouch CreateTouchWithUITouch(UITouch *uiTouch, RCTUIView *rootComponentView, CGPoint rootViewOriginOffset) // TODO(macOS GH#774)
104
103
  {
105
104
  ActiveTouch activeTouch = {};
106
105
 
107
106
  // Find closest Fabric-managed touchable view
108
- UIView *componentView = uiTouch.view;
107
+ RCTUIView *componentView = uiTouch.view; // TODO(macOS GH#774)
109
108
  while (componentView) {
110
109
  if ([componentView respondsToSelector:@selector(touchEventEmitterAtPoint:)]) {
111
110
  activeTouch.eventEmitter = [(id<RCTTouchableComponentViewProtocol>)componentView
@@ -165,7 +164,7 @@ struct PointerHasher {
165
164
  /*
166
165
  * We hold the view weakly to prevent a retain cycle.
167
166
  */
168
- __weak UIView *_rootComponentView;
167
+ __weak RCTUIView *_rootComponentView; // TODO(macOS GH#774)
169
168
  IdentifierPool<11> _identifierPool;
170
169
  }
171
170
 
@@ -188,7 +187,7 @@ struct PointerHasher {
188
187
 
189
188
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)action)
190
189
 
191
- - (void)attachToView:(UIView *)view
190
+ - (void)attachToView:(RCTUIView *)view // TODO(macOS GH#774)
192
191
  {
193
192
  RCTAssert(self.view == nil, @"RCTTouchHandler already has attached view.");
194
193
 
@@ -196,7 +195,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
196
195
  _rootComponentView = view;
197
196
  }
198
197
 
199
- - (void)detachFromView:(UIView *)view
198
+ - (void)detachFromView:(RCTUIView *)view // TODO(macOS GH#774)
200
199
  {
201
200
  RCTAssertParam(view);
202
201
  RCTAssert(self.view == view, @"RCTTouchHandler attached to another view.");
@@ -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
  #import <react/renderer/components/view/TouchEventEmitter.h>
10
10
 
11
11
  @protocol RCTTouchableComponentViewProtocol <NSObject>
@@ -34,7 +34,7 @@ using namespace facebook::react;
34
34
  // `SurfaceHandler` is a thread-safe object, so we don't need additional synchronization.
35
35
  // Objective-C++ classes cannot have instance variables without default constructors,
36
36
  // hence we wrap a value into `optional` to workaround it.
37
- butter::optional<SurfaceHandler> _surfaceHandler;
37
+ std::optional<SurfaceHandler> _surfaceHandler;
38
38
 
39
39
  // Protects Surface's start and stop processes.
40
40
  // Even though SurfaceHandler is tread-safe, it will crash if we try to stop a surface that is not running.
@@ -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
  NS_ASSUME_NONNULL_BEGIN
11
11
 
@@ -10,6 +10,8 @@
10
10
  #import <React/RCTBridge.h>
11
11
  #import <React/RCTUIKit.h> // TODO(macOS GH#774)
12
12
 
13
+ @protocol RCTSurfaceProtocol;
14
+
13
15
  NS_ASSUME_NONNULL_BEGIN
14
16
 
15
17
  // TODO: Eventually this should go away and files should just include RCTSurfacePresenter.h, but
@@ -27,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
27
29
 
28
30
  @protocol RCTSurfacePresenterStub <NSObject>
29
31
 
32
+ - (id<RCTSurfaceProtocol>)createFabricSurfaceForModuleName:(NSString *)moduleName
33
+ initialProperties:(NSDictionary *)initialProperties;
30
34
  - (nullable RCTPlatformView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; // TODO(macOS GH#774)
31
35
  - (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props;
32
36
  - (void)addObserver:(id<RCTSurfacePresenterObserver>)observer;