react-native-macos 0.0.0-3a2426fff → 0.0.0-3b6429a3b

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 (105) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +7 -0
  3. package/Libraries/Text/RCTTextAttributes.h +9 -3
  4. package/Libraries/Text/RCTTextAttributes.m +17 -0
  5. package/Libraries/Text/Text/RCTTextView.m +0 -4
  6. package/React/Base/RCTUIKit.h +11 -0
  7. package/React/Base/RCTVersion.m +1 -1
  8. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
  9. package/React/CoreModules/RCTLogBox.mm +26 -9
  10. package/React/CoreModules/RCTLogBoxView.h +5 -0
  11. package/React/CoreModules/RCTLogBoxView.mm +36 -0
  12. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  13. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  14. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  15. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  16. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  17. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +1 -1
  18. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +6 -6
  19. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  20. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  21. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  22. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  23. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +8 -4
  24. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  25. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  26. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +3 -3
  27. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +4 -4
  28. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  29. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +4 -4
  30. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +22 -22
  31. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  32. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +5 -5
  33. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  34. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
  35. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
  36. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
  37. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
  38. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  39. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -0
  40. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  41. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +3 -3
  42. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +3 -3
  43. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
  44. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  45. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +2 -2
  46. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  47. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +2 -2
  48. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  49. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +18 -18
  50. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  51. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  52. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  53. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +3 -3
  54. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  55. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  56. package/React/Fabric/Mounting/RCTMountingManager.h +3 -3
  57. package/React/Fabric/Mounting/RCTMountingManager.mm +10 -9
  58. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  59. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
  60. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +5 -5
  61. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +5 -5
  62. package/React/Fabric/RCTConversions.h +6 -6
  63. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  64. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  65. package/React/Fabric/RCTScheduler.h +1 -1
  66. package/React/Fabric/RCTSurfacePresenter.h +8 -2
  67. package/React/Fabric/RCTSurfacePresenter.mm +13 -5
  68. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  69. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  70. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  71. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -8
  72. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  73. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  74. package/React/Modules/RCTSurfacePresenterStub.h +4 -0
  75. package/React/Views/RCTMaskedView.h +1 -1
  76. package/React/Views/RCTModalHostView.h +2 -2
  77. package/React/Views/RCTModalHostViewController.h +1 -1
  78. package/React/Views/RCTModalManager.h +1 -1
  79. package/React/Views/RCTWeakViewHolder.h +1 -1
  80. package/React/Views/RCTWrapperViewController.h +2 -2
  81. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  82. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  83. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  84. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  85. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  86. package/ReactAndroid/gradle.properties +1 -1
  87. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  88. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  89. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  90. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  91. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +3 -3
  92. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  93. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  94. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  95. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  96. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  97. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  98. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +7 -7
  99. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  100. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  101. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  102. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  103. package/package.json +4 -1
  104. package/template/Gemfile.lock +1 -1
  105. package/template/package.json +1 -1
@@ -17,5 +17,5 @@ exports.version = {
17
17
  major: 0,
18
18
  minor: 0,
19
19
  patch: 0,
20
- prerelease: '3a2426fff',
20
+ prerelease: '3b6429a3b',
21
21
  };
@@ -6,6 +6,9 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTBaseTextViewManager.h>
9
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
10
+ #import <React/RCTCursor.h>
11
+ #endif // ]TODO(macOS GH#774)
9
12
 
10
13
  @implementation RCTBaseTextViewManager
11
14
 
@@ -56,4 +59,8 @@ RCT_REMAP_SHADOW_PROPERTY(textShadowColor, textAttributes.textShadowColor, UICol
56
59
  RCT_REMAP_SHADOW_PROPERTY(isHighlighted, textAttributes.isHighlighted, BOOL)
57
60
  RCT_REMAP_SHADOW_PROPERTY(textTransform, textAttributes.textTransform, RCTTextTransform)
58
61
 
62
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
63
+ RCT_REMAP_SHADOW_PROPERTY(cursor, textAttributes.cursor, RCTCursor)
64
+ #endif // ]TODO(macOS GH#774)
65
+
59
66
  @end
@@ -6,13 +6,15 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
-
10
9
  #import <React/RCTTextDecorationLineType.h>
11
10
  #import <React/RCTDynamicTypeRamp.h> // TODO(macOS GH#774)
12
- #import <React/RCTFontSmoothing.h> // TODO(OSS Candidate ISS#2710739)
13
-
11
+ #import <React/RCTFontSmoothing.h> // TODO(macOS GH#774)
14
12
  #import "RCTTextTransform.h"
15
13
 
14
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+ #import <React/RCTCursor.h>
16
+ #endif // ]TODO(macOS GH#774)
17
+
16
18
  NS_ASSUME_NONNULL_BEGIN
17
19
 
18
20
  extern NSString *const RCTTextAttributesIsHighlightedAttributeName;
@@ -61,6 +63,10 @@ extern NSString *const RCTTextAttributesTagAttributeName;
61
63
  @property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection;
62
64
  @property (nonatomic, assign) RCTTextTransform textTransform;
63
65
 
66
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
67
+ @property (nonatomic, assign) RCTCursor cursor;
68
+ #endif // ]TODO(macOS GH#774)
69
+
64
70
  #pragma mark - Inheritance
65
71
 
66
72
  - (void)applyTextAttributes:(RCTTextAttributes *)textAttributes;
@@ -11,6 +11,10 @@
11
11
  #import <React/RCTFont.h>
12
12
  #import <React/RCTLog.h>
13
13
 
14
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+ #import <React/RCTCursor.h>
16
+ #endif // ]TODO(macOS GH#774)
17
+
14
18
  NSString *const RCTTextAttributesIsHighlightedAttributeName = @"RCTTextAttributesIsHighlightedAttributeName";
15
19
  NSString *const RCTTextAttributesFontSmoothingAttributeName = @"RCTTextAttributesFontSmoothingAttributeName"; // TODO(OSS Candidate ISS#2710739)
16
20
  NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttributeName";
@@ -45,6 +49,9 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
45
49
  // [TODO(macOS GH#774)
46
50
  _foregroundColor = [RCTTextAttributes defaultForegroundColor];
47
51
  // ]TODO(macOS GH#774)
52
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
53
+ _cursor = RCTCursorAuto;
54
+ #endif // ]TODO(macOS GH#774)
48
55
  }
49
56
 
50
57
  return self;
@@ -94,6 +101,10 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
94
101
  _tag = textAttributes->_tag ?: _tag;
95
102
  _layoutDirection = textAttributes->_layoutDirection != UIUserInterfaceLayoutDirectionLeftToRight ? textAttributes->_layoutDirection : _layoutDirection;
96
103
  _textTransform = textAttributes->_textTransform != RCTTextTransformUndefined ? textAttributes->_textTransform : _textTransform;
104
+
105
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
106
+ _cursor = textAttributes->_cursor != RCTCursorAuto ? textAttributes->_cursor : _cursor;
107
+ #endif // ]TODO(macOS GH#774)
97
108
  }
98
109
 
99
110
  - (NSParagraphStyle *)effectiveParagraphStyle
@@ -210,6 +221,12 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
210
221
  attributes[RCTTextAttributesTagAttributeName] = _tag;
211
222
  }
212
223
 
224
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
225
+ if (_cursor != RCTCursorAuto) {
226
+ attributes[NSCursorAttributeName] = [RCTConvert NSCursor:_cursor];
227
+ }
228
+ #endif // ]TODO(macOS GH#774)
229
+
213
230
  return [attributes copy];
214
231
  }
215
232
 
@@ -96,10 +96,6 @@
96
96
  return self;
97
97
  }
98
98
 
99
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
100
-
101
- #endif // ]TODO(macOS GH#774)
102
-
103
99
  #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
104
100
  - (NSString *)description
105
101
  {
@@ -468,3 +468,14 @@ NS_INLINE CGRect CGRectValue(NSValue *value)
468
468
  }
469
469
 
470
470
  #endif // ] TARGET_OS_OSX
471
+
472
+ //
473
+ // fabric component types
474
+ //
475
+
476
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
477
+ #define RCTUISlider UISlider
478
+ #else
479
+ @interface RCTUISlider : NSSlider
480
+ @end
481
+ #endif // ]TODO(macOS GH#774)
@@ -28,7 +28,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
28
28
  RCTVersionMajor: @(0),
29
29
  RCTVersionMinor: @(0),
30
30
  RCTVersionPatch: @(0),
31
- RCTVersionPrerelease: @"3a2426fff",
31
+ RCTVersionPrerelease: @"3b6429a3b",
32
32
  };
33
33
  });
34
34
  return __rnVersion;
@@ -6,7 +6,6 @@
6
6
  */
7
7
 
8
8
  #import "RCTSurfaceHostingView.h"
9
-
10
9
  #import "RCTConstants.h"
11
10
  #import "RCTDefines.h"
12
11
  #import "RCTSurface.h"
@@ -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
@@ -23,6 +22,7 @@
23
22
 
24
23
  @implementation RCTLogBox {
25
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()) {
@@ -49,19 +54,31 @@ RCT_EXPORT_METHOD(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)
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)
55
74
  strongSelf->_view = [[RCTLogBoxView alloc] initWithWindow:RCTKeyWindow() bridge:strongSelf->_bridge];
56
- #else // [TODO(macOS GH#774)
75
+ #else // TODO(macOS GH#774)
57
76
  strongSelf->_view = [[RCTLogBoxView alloc] initWithBridge:self->_bridge]; // TODO(macOS GH#774)
58
77
  #endif // ]TODO(macOS GH#774)
59
- [strongSelf->_view show];
60
78
  }
61
- } else {
62
- NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:strongSelf, @"logbox", nil];
63
- [[NSNotificationCenter defaultCenter] postNotificationName:@"CreateLogBoxSurface" object:nil userInfo:userInfo];
64
79
  }
80
+
81
+ [strongSelf->_view show];
65
82
  });
66
83
  }
67
84
  }
@@ -6,6 +6,7 @@
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
 
@@ -17,6 +18,8 @@
17
18
 
18
19
  - (void)createRootViewController:(UIView *)view;
19
20
 
21
+ - (instancetype)initWithFrame:(CGRect)frame surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter;
22
+
20
23
  - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge;
21
24
 
22
25
  - (void)show;
@@ -27,6 +30,8 @@
27
30
 
28
31
  @interface RCTLogBoxView : NSWindow // TODO(macOS GH#774)
29
32
 
33
+ - (instancetype)initWithSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter;
34
+
30
35
  - (instancetype)initWithBridge:(RCTBridge *)bridge;
31
36
 
32
37
  - (void)setHidden:(BOOL)hidden;
@@ -9,6 +9,7 @@
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
 
@@ -34,6 +35,21 @@
34
35
  self.rootViewController = _rootViewController;
35
36
  }
36
37
 
38
+ - (instancetype)initWithFrame:(CGRect)frame surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
39
+ {
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
+ }
52
+
37
53
  - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
38
54
  {
39
55
  if (@available(iOS 13.0, *)) {
@@ -81,6 +97,26 @@
81
97
  RCTSurface *_surface;
82
98
  }
83
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
+
84
120
  - (instancetype)initWithBridge:(RCTBridge *)bridge
85
121
  {
86
122
  NSRect bounds = NSMakeRect(0, 0, 600, 800);
@@ -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
 
@@ -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
 
@@ -22,7 +22,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
22
22
 
23
23
  @implementation RCTLegacyViewManagerInteropComponentView {
24
24
  NSMutableArray<NSDictionary *> *_viewsToBeMounted;
25
- NSMutableArray<UIView *> *_viewsToBeUnmounted;
25
+ NSMutableArray<RCTUIView *> *_viewsToBeUnmounted; // TODO(macOS GH#774)
26
26
  RCTLegacyViewManagerInteropCoordinatorAdapter *_adapter;
27
27
  LegacyViewManagerInteropShadowNode::ConcreteState::Shared _state;
28
28
  BOOL _hasInvokedForwardingWarning;
@@ -41,9 +41,9 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
41
41
  return self;
42
42
  }
43
43
 
44
- - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
44
+ - (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
45
45
  {
46
- UIView *result = [super hitTest:point withEvent:event];
46
+ RCTUIView *result = [super hitTest:point withEvent:event]; // TODO(macOS GH#774)
47
47
 
48
48
  if (result == _adapter.paperView) {
49
49
  return self;
@@ -149,7 +149,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
149
149
  [super prepareForRecycle];
150
150
  }
151
151
 
152
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
152
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
153
153
  {
154
154
  [_viewsToBeMounted addObject:@{
155
155
  kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
@@ -157,7 +157,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
157
157
  }];
158
158
  }
159
159
 
160
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
160
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
161
161
  {
162
162
  if (_adapter) {
163
163
  [_adapter.paperView removeReactSubview:childComponentView];
@@ -208,7 +208,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
208
208
 
209
209
  [_viewsToBeMounted removeAllObjects];
210
210
 
211
- for (UIView *view in _viewsToBeUnmounted) {
211
+ for (RCTUIView *view in _viewsToBeUnmounted) { // TODO(macOS GH#774)
212
212
  [_adapter.paperView removeReactSubview:view];
213
213
  }
214
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
@@ -269,15 +272,16 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
269
272
  _state = std::static_pointer_cast<const ModalHostViewShadowNode::ConcreteState>(state);
270
273
  }
271
274
 
272
- - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
275
+ - (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
273
276
  {
274
277
  [self.viewController.view insertSubview:childComponentView atIndex:index];
275
278
  }
276
279
 
277
- - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
280
+ - (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
278
281
  {
279
282
  [childComponentView removeFromSuperview];
280
283
  }
284
+ #endif // ]TODO(macOS GH#774)
281
285
 
282
286
  @end
283
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
 
@@ -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