react-native-macos 0.0.0-08d0c3b4f → 0.0.0-0c343d926

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 (208) hide show
  1. package/Libraries/Alert/Alert.js +115 -6
  2. package/Libraries/Alert/NativeAlertManager.js +1 -19
  3. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  4. package/Libraries/Components/View/ViewAccessibility.js +0 -5
  5. package/Libraries/Components/View/ViewPropTypes.js +95 -115
  6. package/Libraries/Core/ReactNativeVersion.js +1 -1
  7. package/Libraries/Image/React-RCTImage.podspec +1 -1
  8. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  9. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h +14 -0
  10. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
  11. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
  12. package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
  13. package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
  14. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
  15. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  16. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  17. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  18. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +7 -0
  19. package/Libraries/Text/RCTTextAttributes.h +9 -3
  20. package/Libraries/Text/RCTTextAttributes.m +17 -0
  21. package/Libraries/Text/Text/RCTTextView.m +5 -11
  22. package/Libraries/Text/Text.js +0 -6
  23. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +2 -2
  24. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  25. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  26. package/React/Base/RCTAssert.h +30 -16
  27. package/React/Base/RCTAssert.m +53 -22
  28. package/React/Base/RCTBridge.m +5 -3
  29. package/React/Base/RCTEventDispatcherProtocol.h +5 -0
  30. package/React/Base/RCTUIKit.h +54 -0
  31. package/React/Base/RCTVersion.m +1 -1
  32. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
  33. package/React/Base/macOS/RCTUIKit.m +38 -0
  34. package/React/CoreModules/RCTAlertManager.mm +1 -1
  35. package/React/CoreModules/RCTEventDispatcher.mm +6 -1
  36. package/React/CoreModules/RCTLogBox.h +1 -1
  37. package/React/CoreModules/RCTLogBox.mm +35 -19
  38. package/React/CoreModules/RCTLogBoxView.h +8 -5
  39. package/React/CoreModules/RCTLogBoxView.mm +64 -23
  40. package/React/CoreModules/React-CoreModules.podspec +1 -1
  41. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
  42. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  43. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
  44. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  45. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  46. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  47. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  48. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
  49. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -29
  50. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  51. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  52. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  53. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  54. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +8 -4
  55. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  56. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  57. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
  58. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +5 -3
  59. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +23 -6
  60. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  61. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +16 -0
  62. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +6 -4
  63. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +66 -28
  64. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  65. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +5 -5
  66. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  67. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
  68. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
  69. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
  70. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
  71. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
  72. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  73. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -0
  74. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  75. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +39 -5
  76. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +9 -6
  77. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +16 -4
  78. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  79. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
  80. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  81. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
  82. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  83. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +23 -22
  84. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  85. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  86. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  87. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +10 -1
  88. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
  89. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  90. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  91. package/React/Fabric/Mounting/RCTMountingManager.h +3 -3
  92. package/React/Fabric/Mounting/RCTMountingManager.mm +19 -11
  93. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  94. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
  95. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
  96. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
  97. package/React/Fabric/RCTConversions.h +6 -6
  98. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  99. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  100. package/React/Fabric/RCTScheduler.h +3 -1
  101. package/React/Fabric/RCTScheduler.mm +5 -0
  102. package/React/Fabric/RCTSurfacePresenter.h +8 -2
  103. package/React/Fabric/RCTSurfacePresenter.mm +47 -16
  104. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  105. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  106. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  107. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -8
  108. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  109. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
  110. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  111. package/React/Modules/RCTSurfacePresenterStub.h +4 -0
  112. package/React/Modules/RCTUIManager.m +2 -1
  113. package/React/React-RCTFabric.podspec +1 -1
  114. package/React/Views/RCTMaskedView.h +1 -1
  115. package/React/Views/RCTModalHostView.h +2 -2
  116. package/React/Views/RCTModalHostViewController.h +1 -1
  117. package/React/Views/RCTModalManager.h +1 -1
  118. package/React/Views/RCTSwitch.h +1 -10
  119. package/React/Views/RCTSwitch.m +0 -20
  120. package/React/Views/RCTSwitchManager.m +0 -4
  121. package/React/Views/RCTView.m +1 -1
  122. package/React/Views/RCTViewManager.m +2 -1
  123. package/React/Views/RCTWeakViewHolder.h +1 -1
  124. package/React/Views/RCTWrapperViewController.h +2 -2
  125. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  126. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  127. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  128. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  129. package/React/Views/ScrollView/RCTScrollView.m +0 -30
  130. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  131. package/ReactAndroid/gradle.properties +1 -1
  132. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
  133. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  134. package/ReactAndroid/src/main/jni/Application.mk +1 -1
  135. package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
  136. package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
  137. package/ReactCommon/ReactCommon.podspec +1 -1
  138. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  139. package/ReactCommon/cxxreact/tests/BUCK +1 -1
  140. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  141. package/ReactCommon/microprofiler/BUCK +1 -1
  142. package/ReactCommon/react/debug/react_native_assert.h +1 -1
  143. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
  144. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
  145. package/ReactCommon/react/renderer/animations/conversions.h +11 -11
  146. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
  147. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
  148. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
  149. package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
  150. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  151. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  152. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
  153. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
  154. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
  155. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
  156. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
  157. package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
  158. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
  159. package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
  160. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
  161. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
  162. package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
  163. package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
  164. package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
  165. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
  166. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
  167. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
  168. package/ReactCommon/react/renderer/core/Props.h +0 -4
  169. package/ReactCommon/react/renderer/core/RawProps.h +1 -1
  170. package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
  171. package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
  172. package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
  173. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
  174. package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
  175. package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
  176. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  177. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  178. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  179. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  180. package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
  181. package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
  182. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  183. package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
  184. package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
  185. package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
  186. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
  187. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
  188. package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
  189. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +5 -2
  190. package/ReactCommon/react/renderer/scheduler/Scheduler.h +4 -1
  191. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  192. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  193. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
  194. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  195. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  196. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  197. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  198. package/ReactCommon/react/utils/ContextContainer.h +2 -2
  199. package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
  200. package/ReactCommon/yoga/Yoga.podspec +1 -1
  201. package/index.js +0 -11
  202. package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
  203. package/package.json +4 -1
  204. package/scripts/react_native_pods.rb +1 -1
  205. package/template/Gemfile.lock +1 -1
  206. package/template/package.json +1 -1
  207. package/Libraries/Alert/AlertMacOS.js +0 -211
  208. package/ReactCommon/butter/optional.h +0 -38
@@ -13,7 +13,6 @@
13
13
  #import <React/RCTLog.h>
14
14
  #import <React/RCTRedBoxSetEnabled.h>
15
15
  #import <React/RCTSurface.h>
16
-
17
16
  #import "CoreModulesPlugins.h"
18
17
 
19
18
  #if RCT_DEV_MENU
@@ -22,7 +21,8 @@
22
21
  @end
23
22
 
24
23
  @implementation RCTLogBox {
25
- RCTLogBoxWindow *_window; // TODO(macOS GH#774) Renamed from _view to _window
24
+ RCTLogBoxView *_view;
25
+ __weak id<RCTSurfacePresenterStub> _bridgelessSurfacePresenter;
26
26
  }
27
27
 
28
28
  @synthesize bridge = _bridge;
@@ -34,6 +34,11 @@ RCT_EXPORT_MODULE()
34
34
  return YES;
35
35
  }
36
36
 
37
+ - (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
38
+ {
39
+ _bridgelessSurfacePresenter = surfacePresenter;
40
+ }
41
+
37
42
  RCT_EXPORT_METHOD(show)
38
43
  {
39
44
  if (RCTRedBoxGetEnabled()) {
@@ -44,25 +49,36 @@ RCT_EXPORT_METHOD(show)
44
49
  return;
45
50
  }
46
51
 
47
- if (strongSelf->_window) { // TODO(macOS GH#774) Renamed from _view to _window
48
- [strongSelf->_window show]; // TODO(macOS GH#774) Renamed from _view to _window
52
+ if (strongSelf->_view) {
53
+ [strongSelf->_view show];
49
54
  return;
50
55
  }
51
56
 
52
- if (strongSelf->_bridge) {
53
- if (strongSelf->_bridge.valid) {
54
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
55
- strongSelf->_window = [[RCTLogBoxWindow alloc] initWithFrame:[UIScreen mainScreen].bounds // TODO(macOS GH#774) Renamed from _view to _window
56
- bridge:strongSelf->_bridge];
57
- #else // [TODO(macOS GH#774)
58
- strongSelf->_window = [[RCTLogBoxWindow alloc] initWithBridge:self->_bridge]; // TODO(macOS GH#774) Renamed from _view to _window
57
+ if (strongSelf->_bridgelessSurfacePresenter) {
58
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
59
+ strongSelf->_view = [[RCTLogBoxView alloc] initWithFrame:RCTKeyWindow().frame
60
+ surfacePresenter:strongSelf->_bridgelessSurfacePresenter];
61
+ #else
62
+ strongSelf->_view = [[RCTLogBoxView alloc] initWithSurfacePresenter:strongSelf->_bridgelessSurfacePresenter]; // TODO(macOS GH#774)
63
+ #endif // ]TODO(macOS GH#774)
64
+ } else if (strongSelf->_bridge && strongSelf->_bridge.valid) {
65
+ if (strongSelf->_bridge.surfacePresenter) {
66
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
67
+ strongSelf->_view = [[RCTLogBoxView alloc] initWithFrame:RCTKeyWindow().frame
68
+ surfacePresenter:strongSelf->_bridge.surfacePresenter];
69
+ #else // TODO(macOS GH#774)
70
+ strongSelf->_view = [[RCTLogBoxView alloc] initWithSurfacePresenter:strongSelf->_bridge.surfacePresenter]; // TODO(macOS GH#774)
71
+ #endif // ]TODO(macOS GH#774)
72
+ } else {
73
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
74
+ strongSelf->_view = [[RCTLogBoxView alloc] initWithWindow:RCTKeyWindow() bridge:strongSelf->_bridge];
75
+ #else // TODO(macOS GH#774)
76
+ strongSelf->_view = [[RCTLogBoxView alloc] initWithBridge:self->_bridge]; // TODO(macOS GH#774)
59
77
  #endif // ]TODO(macOS GH#774)
60
- [strongSelf->_window show]; // TODO(macOS GH#774) Renamed from _view to _window
61
78
  }
62
- } else {
63
- NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:strongSelf, @"logbox", nil];
64
- [[NSNotificationCenter defaultCenter] postNotificationName:@"CreateLogBoxSurface" object:nil userInfo:userInfo];
65
79
  }
80
+
81
+ [strongSelf->_view show];
66
82
  });
67
83
  }
68
84
  }
@@ -76,8 +92,8 @@ RCT_EXPORT_METHOD(hide)
76
92
  if (!strongSelf) {
77
93
  return;
78
94
  }
79
- [strongSelf->_window hide]; // TODO(macOS GH#774) setHidden: -> hide
80
- strongSelf->_window = nil;
95
+ [strongSelf->_view setHidden:YES];
96
+ strongSelf->_view = nil;
81
97
  });
82
98
  }
83
99
  }
@@ -88,9 +104,9 @@ RCT_EXPORT_METHOD(hide)
88
104
  return std::make_shared<facebook::react::NativeLogBoxSpecJSI>(params);
89
105
  }
90
106
 
91
- - (void)setRCTLogBoxWindow:(RCTLogBoxWindow *)window // TODO(macOS GH#774) Renamed from _view to _window
107
+ - (void)setRCTLogBoxView:(RCTLogBoxView *)view
92
108
  {
93
- self->_window = window;
109
+ self->_view = view;
94
110
  }
95
111
 
96
112
  @end
@@ -6,20 +6,21 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTBridge.h>
9
+ #import <React/RCTSurfacePresenterStub.h>
9
10
  #import <React/RCTSurfaceView.h>
10
11
  #import <React/RCTUIKit.h> // TODO(macOS GH#774)
11
12
 
12
13
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
13
14
 
14
- @interface RCTLogBoxWindow : UIWindow // TODO(macOS GH#774) Renamed from _view to _window
15
+ @interface RCTLogBoxView : UIWindow
15
16
 
16
17
  - (instancetype)initWithFrame:(CGRect)frame;
17
18
 
18
19
  - (void)createRootViewController:(UIView *)view;
19
20
 
20
- - (instancetype)initWithFrame:(CGRect)frame bridge:(RCTBridge *)bridge;
21
+ - (instancetype)initWithFrame:(CGRect)frame surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter;
21
22
 
22
- - (void)hide; // TODO(macOS GH#774)
23
+ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge;
23
24
 
24
25
  - (void)show;
25
26
 
@@ -27,11 +28,13 @@
27
28
 
28
29
  #else // [TODO(macOS GH#774)
29
30
 
30
- @interface RCTLogBoxWindow : NSWindow // TODO(macOS GH#774) Renamed from _view to _window
31
+ @interface RCTLogBoxView : NSWindow // TODO(macOS GH#774)
32
+
33
+ - (instancetype)initWithSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter;
31
34
 
32
35
  - (instancetype)initWithBridge:(RCTBridge *)bridge;
33
36
 
34
- - (void)hide;
37
+ - (void)setHidden:(BOOL)hidden;
35
38
 
36
39
  - (void)show;
37
40
 
@@ -9,10 +9,11 @@
9
9
 
10
10
  #import <React/RCTLog.h>
11
11
  #import <React/RCTSurface.h>
12
+ #import <React/RCTSurfaceHostingView.h>
12
13
 
13
14
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
14
15
 
15
- @implementation RCTLogBoxWindow { // TODO(macOS GH#774) Renamed from _view to _window
16
+ @implementation RCTLogBoxView {
16
17
  RCTSurface *_surface;
17
18
  }
18
19
 
@@ -34,35 +35,53 @@
34
35
  self.rootViewController = _rootViewController;
35
36
  }
36
37
 
37
- - (instancetype)initWithFrame:(CGRect)frame bridge:(RCTBridge *)bridge
38
+ - (instancetype)initWithFrame:(CGRect)frame surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
38
39
  {
39
- if ((self = [super initWithFrame:frame])) {
40
- self.windowLevel = UIWindowLevelStatusBar - 1;
41
- self.backgroundColor = [UIColor clearColor];
40
+ if (self = [super initWithFrame:frame]) {
41
+ id<RCTSurfaceProtocol> surface = [surfacePresenter createFabricSurfaceForModuleName:@"LogBox"
42
+ initialProperties:@{}];
43
+ [surface start];
44
+ RCTSurfaceHostingView *rootView = [[RCTSurfaceHostingView alloc]
45
+ initWithSurface:surface
46
+ sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
47
+
48
+ [self createRootViewController:rootView];
49
+ }
50
+ return self;
51
+ }
42
52
 
43
- _surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
53
+ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
54
+ {
55
+ if (@available(iOS 13.0, *)) {
56
+ self = [super initWithWindowScene:window.windowScene];
57
+ } else {
58
+ self = [super initWithFrame:window.frame];
59
+ }
44
60
 
45
- [_surface start];
46
- [_surface setSize:frame.size];
61
+ self.windowLevel = UIWindowLevelStatusBar - 1;
62
+ self.backgroundColor = [UIColor clearColor];
47
63
 
48
- if (![_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:1]) {
49
- RCTLogInfo(@"Failed to mount LogBox within 1s");
50
- }
64
+ _surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
65
+ [_surface start];
51
66
 
52
- [self createRootViewController:(UIView *)_surface.view];
67
+ if (![_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:1]) {
68
+ RCTLogInfo(@"Failed to mount LogBox within 1s");
53
69
  }
70
+ [self createRootViewController:(UIView *)_surface.view];
71
+
54
72
  return self;
55
73
  }
56
74
 
57
- - (void)dealloc
75
+ - (void)layoutSubviews
58
76
  {
59
- [RCTSharedApplication().delegate.window makeKeyWindow];
77
+ [super layoutSubviews];
78
+ [_surface setSize:self.frame.size];
60
79
  }
61
80
 
62
- - (void)hide // [TODO(macOS GH#774)
81
+ - (void)dealloc
63
82
  {
64
- [self setHidden:YES];
65
- } // ]TODO(macOS GH#774)
83
+ [RCTSharedApplication().delegate.window makeKeyWindow];
84
+ }
66
85
 
67
86
  - (void)show
68
87
  {
@@ -74,10 +93,30 @@
74
93
 
75
94
  #else // [TODO(macOS GH#774)
76
95
 
77
- @implementation RCTLogBoxWindow { // TODO(macOS GH#774) Renamed from _view to _window
96
+ @implementation RCTLogBoxView {
78
97
  RCTSurface *_surface;
79
98
  }
80
99
 
100
+ - (instancetype)initWithSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
101
+ {
102
+ NSRect bounds = NSMakeRect(0, 0, 600, 800);
103
+ if ((self = [self initWithContentRect:bounds
104
+ styleMask:NSWindowStyleMaskTitled
105
+ backing:NSBackingStoreBuffered
106
+ defer:YES])) {
107
+ id<RCTSurfaceProtocol> surface = [surfacePresenter createFabricSurfaceForModuleName:@"LogBox"
108
+ initialProperties:@{}];
109
+ [surface start];
110
+ RCTSurfaceHostingView *rootView = [[RCTSurfaceHostingView alloc]
111
+ initWithSurface:surface
112
+ sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
113
+
114
+ self.contentView = rootView;
115
+ self.contentView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
116
+ }
117
+ return self;
118
+ }
119
+
81
120
  - (instancetype)initWithBridge:(RCTBridge *)bridge
82
121
  {
83
122
  NSRect bounds = NSMakeRect(0, 0, 600, 800);
@@ -100,13 +139,15 @@
100
139
  return self;
101
140
  }
102
141
 
103
- - (void)hide
142
+ - (void)setHidden:(BOOL)hidden // [TODO(macOS GH#774)
104
143
  {
105
- if (NSApp.modalWindow == self) {
106
- [NSApp stopModal];
144
+ if (hidden) {
145
+ if (NSApp.modalWindow == self) {
146
+ [NSApp stopModal];
147
+ }
148
+ [self orderOut:nil];
107
149
  }
108
- [self orderOut:nil];
109
- }
150
+ } // ]TODO(macOS GH#774)
110
151
 
111
152
  - (void)show
112
153
  {
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  s.header_dir = "CoreModules"
38
38
  s.pod_target_xcconfig = {
39
39
  "USE_HEADERMAP" => "YES",
40
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
40
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
41
41
  "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
42
42
  }
43
43
 
@@ -39,7 +39,7 @@ Pod::Spec.new do |s|
39
39
 
40
40
  s.pod_target_xcconfig = {
41
41
  "USE_HEADERMAP" => "YES",
42
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
42
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
43
43
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\""
44
44
  }
45
45
 
@@ -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
 
@@ -8,6 +8,7 @@
8
8
  #import "RCTActivityIndicatorViewComponentView.h"
9
9
 
10
10
  #import <React/RCTConversions.h>
11
+ #import <React/RCTActivityIndicatorView.h> // TODO(macOS GH#774)
11
12
 
12
13
  #import <react/renderer/components/rncore/ComponentDescriptors.h>
13
14
  #import <react/renderer/components/rncore/EventEmitters.h>
@@ -28,7 +29,7 @@ static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const Acti
28
29
  }
29
30
 
30
31
  @implementation RCTActivityIndicatorViewComponentView {
31
- UIActivityIndicatorView *_activityIndicatorView;
32
+ RCTUIActivityIndicatorView *_activityIndicatorView; // TODO(macOS GH#774)
32
33
  }
33
34
 
34
35
  #pragma mark - RCTComponentViewProtocol
@@ -44,7 +45,7 @@ static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const Acti
44
45
  static const auto defaultProps = std::make_shared<const ActivityIndicatorViewProps>();
45
46
  _props = defaultProps;
46
47
 
47
- _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:self.bounds];
48
+ _activityIndicatorView = [[RCTUIActivityIndicatorView alloc] initWithFrame:self.bounds]; // TODO(macOS GH#774)
48
49
  _activityIndicatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
49
50
 
50
51
  if (defaultProps->animating) {
@@ -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
 
@@ -20,18 +20,18 @@
20
20
 
21
21
  using namespace facebook::react;
22
22
 
23
- static UIView<RCTBackedTextInputViewProtocol> *_Nullable RCTFindTextInputWithNativeId(UIView *view, NSString *nativeId)
23
+ static RCTUIView<RCTBackedTextInputViewProtocol> *_Nullable RCTFindTextInputWithNativeId(RCTUIView *view, NSString *nativeId) // TODO(macOS GH#774)
24
24
  {
25
25
  if ([view respondsToSelector:@selector(inputAccessoryViewID)] &&
26
26
  [view respondsToSelector:@selector(setInputAccessoryView:)]) {
27
- UIView<RCTBackedTextInputViewProtocol> *typed = (UIView<RCTBackedTextInputViewProtocol> *)view;
27
+ RCTUIView<RCTBackedTextInputViewProtocol> *typed = (RCTUIView<RCTBackedTextInputViewProtocol> *)view; // TODO(macOS GH#774)
28
28
  if (!nativeId || [typed.inputAccessoryViewID isEqualToString:nativeId]) {
29
29
  return typed;
30
30
  }
31
31
  }
32
32
 
33
- for (UIView *subview in view.subviews) {
34
- UIView<RCTBackedTextInputViewProtocol> *result = RCTFindTextInputWithNativeId(subview, nativeId);
33
+ for (RCTUIView *subview in view.subviews) { // TODO(macOS GH#774)
34
+ RCTUIView<RCTBackedTextInputViewProtocol> *result = RCTFindTextInputWithNativeId(subview, nativeId); // TODO(macOS GH#774)
35
35
  if (result) {
36
36
  return result;
37
37
  }
@@ -44,7 +44,7 @@ static UIView<RCTBackedTextInputViewProtocol> *_Nullable RCTFindTextInputWithNat
44
44
  InputAccessoryShadowNode::ConcreteState::Shared _state;
45
45
  RCTInputAccessoryContentView *_contentView;
46
46
  RCTSurfaceTouchHandler *_touchHandler;
47
- UIView<RCTBackedTextInputViewProtocol> __weak *_textInput;
47
+ RCTUIView<RCTBackedTextInputViewProtocol> __weak *_textInput; // TODO(macOS GH#774)
48
48
  }
49
49
 
50
50
  - (instancetype)initWithFrame:(CGRect)frame
@@ -83,7 +83,7 @@ static UIView<RCTBackedTextInputViewProtocol> *_Nullable RCTFindTextInputWithNat
83
83
  return true;
84
84
  }
85
85
 
86
- - (UIView *)inputAccessoryView
86
+ - (RCTUIView *)inputAccessoryView // TODO(macOS GH#774)
87
87
  {
88
88
  return _contentView;
89
89
  }
@@ -95,12 +95,12 @@ static UIView<RCTBackedTextInputViewProtocol> *_Nullable RCTFindTextInputWithNat
95
95
  return concreteComponentDescriptorProvider<InputAccessoryComponentDescriptor>();
96
96
  }
97
97
 
98
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
98
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
99
99
  {
100
100
  [_contentView insertSubview:childComponentView atIndex:index];
101
101
  }
102
102
 
103
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
103
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
104
104
  {
105
105
  [childComponentView removeFromSuperview];
106
106
  }
@@ -5,8 +5,8 @@
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
- @interface RCTInputAccessoryContentView : UIView
10
+ @interface RCTInputAccessoryContentView : RCTUIView // TODO(macOS GH#774)
11
11
 
12
12
  @end
@@ -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,9 +22,10 @@ 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
@@ -33,14 +35,15 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
33
35
  _props = defaultProps;
34
36
  _viewsToBeMounted = [NSMutableArray new];
35
37
  _viewsToBeUnmounted = [NSMutableArray new];
38
+ _hasInvokedForwardingWarning = NO;
36
39
  }
37
40
 
38
41
  return self;
39
42
  }
40
43
 
41
- - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
44
+ - (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
42
45
  {
43
- UIView *result = [super hitTest:point withEvent:event];
46
+ RCTUIView *result = [super hitTest:point withEvent:event]; // TODO(macOS GH#774)
44
47
 
45
48
  if (result == _adapter.paperView) {
46
49
  return self;
@@ -49,6 +52,41 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
49
52
  return result;
50
53
  }
51
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
+
52
90
  + (NSMutableSet<NSString *> *)supportedViewManagers
53
91
  {
54
92
  static NSMutableSet<NSString *> *supported = [NSMutableSet setWithObjects:@"DatePicker",
@@ -63,37 +101,39 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
63
101
  return supported;
64
102
  }
65
103
 
66
- + (BOOL)isSupported:(NSString *)componentName
104
+ + (NSMutableSet<NSString *> *)supportedViewManagersPrefixes
67
105
  {
68
- RCTLogNotAllowedForNewArchitecture(
69
- self,
70
- [NSString
71
- stringWithFormat:
72
- @"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
73
- componentName]);
74
- return [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
106
+ static NSMutableSet<NSString *> *supported = [NSMutableSet new];
107
+ return supported;
75
108
  }
76
109
 
77
- + (void)supportLegacyViewManagerWithName:(NSString *)componentName
110
+ + (BOOL)isSupported:(NSString *)componentName
78
111
  {
79
- [[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;
80
127
  }
81
128
 
82
- - (RCTLegacyViewManagerInteropCoordinator *)coordinator
129
+ + (void)supportLegacyViewManagersWithPrefix:(NSString *)prefix
83
130
  {
84
- if (_state != nullptr) {
85
- const auto &state = _state->getData();
86
- return unwrapManagedObject(state.coordinator);
87
- } else {
88
- return nil;
89
- }
131
+ [[RCTLegacyViewManagerInteropComponentView supportedViewManagersPrefixes] addObject:prefix];
90
132
  }
91
133
 
92
- - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
134
+ + (void)supportLegacyViewManagerWithName:(NSString *)componentName
93
135
  {
94
- const auto &state = _state->getData();
95
- RCTLegacyViewManagerInteropCoordinator *coordinator = unwrapManagedObject(state.coordinator);
96
- return coordinator.componentViewName;
136
+ [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] addObject:componentName];
97
137
  }
98
138
 
99
139
  #pragma mark - RCTComponentViewProtocol
@@ -105,10 +145,11 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
105
145
  [_viewsToBeUnmounted removeAllObjects];
106
146
  _state.reset();
107
147
  self.contentView = nil;
148
+ _hasInvokedForwardingWarning = NO;
108
149
  [super prepareForRecycle];
109
150
  }
110
151
 
111
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
152
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
112
153
  {
113
154
  [_viewsToBeMounted addObject:@{
114
155
  kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
@@ -116,7 +157,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
116
157
  }];
117
158
  }
118
159
 
119
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
160
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
120
161
  {
121
162
  if (_adapter) {
122
163
  [_adapter.paperView removeReactSubview:childComponentView];
@@ -140,7 +181,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
140
181
  [super finalizeUpdates:updateMask];
141
182
 
142
183
  if (!_adapter) {
143
- _adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:self.coordinator
184
+ _adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:[self _coordinator]
144
185
  reactTag:self.tag];
145
186
  __weak __typeof(self) weakSelf = self;
146
187
  _adapter.eventInterceptor = ^(std::string eventName, folly::dynamic event) {
@@ -157,12 +198,17 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
157
198
  for (NSDictionary *mountInstruction in _viewsToBeMounted) {
158
199
  NSNumber *index = mountInstruction[kRCTLegacyInteropChildIndexKey];
159
200
  UIView *childView = mountInstruction[kRCTLegacyInteropChildComponentKey];
160
- [_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
+ }
161
207
  }
162
208
 
163
209
  [_viewsToBeMounted removeAllObjects];
164
210
 
165
- for (UIView *view in _viewsToBeUnmounted) {
211
+ for (RCTUIView *view in _viewsToBeUnmounted) { // TODO(macOS GH#774)
166
212
  [_adapter.paperView removeReactSubview:view];
167
213
  }
168
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];