react-native-macos 0.0.0-d7b3947f3 → 0.0.0-d7b689f90

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 (122) hide show
  1. package/Libraries/Alert/Alert.js +115 -6
  2. package/Libraries/Alert/NativeAlertManager.js +1 -19
  3. package/Libraries/Components/View/ViewAccessibility.js +0 -5
  4. package/Libraries/Components/View/ViewPropTypes.js +95 -115
  5. package/Libraries/Core/ReactNativeVersion.js +1 -5
  6. package/Libraries/Image/RCTImageLoader.mm +19 -13
  7. package/Libraries/Image/RCTImageView.h +0 -8
  8. package/Libraries/Text/Text.js +0 -6
  9. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +7 -3
  10. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +2 -2
  11. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +7 -1
  12. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +2 -2
  13. package/React/Base/RCTTouchHandler.m +2 -1
  14. package/React/Base/RCTUIKit.h +70 -2
  15. package/React/Base/RCTVersion.m +1 -5
  16. package/React/Base/macOS/RCTUIKit.m +51 -2
  17. package/React/CoreModules/RCTAlertManager.mm +1 -1
  18. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  19. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
  20. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  21. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  22. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  23. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  24. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +1 -1
  25. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +6 -6
  26. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  27. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  28. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  29. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  30. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +8 -4
  31. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  32. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  33. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +10 -0
  34. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +5 -3
  35. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +23 -6
  36. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  37. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +16 -0
  38. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +6 -4
  39. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +65 -27
  40. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  41. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +19 -5
  42. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  43. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
  44. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +5 -1
  45. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +3 -1
  46. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +4 -2
  47. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +6 -2
  48. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  49. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +21 -0
  50. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  51. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +37 -3
  52. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +5 -3
  53. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +14 -2
  54. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  55. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
  56. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  57. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
  58. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  59. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +28 -18
  60. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  61. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  62. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  63. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +3 -3
  64. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  65. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  66. package/React/Fabric/Mounting/RCTMountingManager.h +3 -3
  67. package/React/Fabric/Mounting/RCTMountingManager.mm +12 -9
  68. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  69. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
  70. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +5 -5
  71. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +5 -5
  72. package/React/Fabric/RCTConversions.h +8 -6
  73. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  74. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  75. package/React/Fabric/RCTScheduler.h +1 -1
  76. package/React/Fabric/RCTSurfacePresenter.h +2 -2
  77. package/React/Fabric/RCTSurfacePresenter.mm +5 -5
  78. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  79. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  80. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  81. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -8
  82. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  83. package/React/Fabric/Surface/RCTFabricSurface.mm +2 -0
  84. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  85. package/React/Views/RCTMaskedView.h +1 -1
  86. package/React/Views/RCTModalHostView.h +2 -2
  87. package/React/Views/RCTModalHostViewController.h +1 -1
  88. package/React/Views/RCTModalManager.h +1 -1
  89. package/React/Views/RCTSwitch.h +1 -10
  90. package/React/Views/RCTSwitch.m +0 -20
  91. package/React/Views/RCTSwitchManager.m +0 -4
  92. package/React/Views/RCTWeakViewHolder.h +1 -1
  93. package/React/Views/RCTWrapperViewController.h +2 -2
  94. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  95. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  96. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  97. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  98. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  99. package/ReactAndroid/gradle.properties +1 -1
  100. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -5
  101. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -5
  102. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  103. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  104. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +3 -3
  105. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  106. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  107. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  108. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  109. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  110. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  111. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +7 -7
  112. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  113. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  114. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  115. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm +5 -0
  116. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  117. package/index.js +0 -11
  118. package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
  119. package/package.json +4 -1
  120. package/template/Gemfile.lock +3 -3
  121. package/template/package.json +1 -1
  122. package/Libraries/Alert/AlertMacOS.js +0 -211
@@ -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
@@ -83,6 +83,7 @@ inline UIEdgeInsets RCTUIEdgeInsetsFromEdgeInsets(const facebook::react::EdgeIns
83
83
  return {edgeInsets.top, edgeInsets.left, edgeInsets.bottom, edgeInsets.right};
84
84
  }
85
85
 
86
+ #if !TARGET_OS_OSX // TODO(macOS GH#774)
86
87
  UIAccessibilityTraits const AccessibilityTraitSwitch = 0x20000000000001;
87
88
 
88
89
  inline UIAccessibilityTraits RCTUIAccessibilityTraitsFromAccessibilityTraits(
@@ -146,6 +147,7 @@ inline UIAccessibilityTraits RCTUIAccessibilityTraitsFromAccessibilityTraits(
146
147
  }
147
148
  return result;
148
149
  };
150
+ #endif // TODO(macOS GH#774)
149
151
 
150
152
  inline CATransform3D RCTCATransform3DFromTransformMatrix(const facebook::react::Transform &transformMatrix)
151
153
  {
@@ -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
 
@@ -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 <memory>
10
10
 
11
11
  #import <react/renderer/componentregistry/ComponentDescriptorFactory.h>
@@ -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>
@@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
78
78
  /*
79
79
  * Please do not use this, this will be deleted soon.
80
80
  */
81
- - (nullable UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag;
81
+ - (nullable RCTUIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; // TODO(macOS GH#774)
82
82
 
83
83
  @end
84
84
 
@@ -171,10 +171,10 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
171
171
  initialProperties:initialProperties];
172
172
  }
173
173
 
174
- - (UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag
174
+ - (RCTUIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag // TODO(macOS GH#774)
175
175
  {
176
- UIView<RCTComponentViewProtocol> *componentView =
177
- [_mountingManager.componentViewRegistry findComponentViewWithTag:tag];
176
+ RCTUIView<RCTComponentViewProtocol> *componentView =
177
+ [_mountingManager.componentViewRegistry findComponentViewWithTag:tag]; // TODO(macOS GH#774)
178
178
  return componentView;
179
179
  }
180
180
 
@@ -186,8 +186,8 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
186
186
  }
187
187
 
188
188
  ReactTag tag = [reactTag integerValue];
189
- UIView<RCTComponentViewProtocol> *componentView =
190
- [_mountingManager.componentViewRegistry findComponentViewWithTag:tag];
189
+ RCTUIView<RCTComponentViewProtocol> *componentView =
190
+ [_mountingManager.componentViewRegistry findComponentViewWithTag:tag]; // TODO(macOS GH#774)
191
191
  if (componentView == nil) {
192
192
  return NO; // This view probably isn't managed by Fabric
193
193
  }
@@ -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.
@@ -60,7 +60,7 @@ struct ActiveTouch {
60
60
  /*
61
61
  * A component view on which the touch was begun.
62
62
  */
63
- __strong UIView<RCTComponentViewProtocol> *componentView = nil;
63
+ __strong RCTUIView<RCTComponentViewProtocol> *componentView = nil; // TODO(macOS GH#774)
64
64
 
65
65
  struct Hasher {
66
66
  size_t operator()(const ActiveTouch &activeTouch) const
@@ -80,8 +80,8 @@ struct ActiveTouch {
80
80
  static void UpdateActiveTouchWithUITouch(
81
81
  ActiveTouch &activeTouch,
82
82
  UITouch *uiTouch,
83
- UIView *rootComponentView,
84
- CGPoint rootViewOriginOffset)
83
+ RCTUIView *rootComponentView,
84
+ CGPoint rootViewOriginOffset) // TODO(macOS GH#774)
85
85
  {
86
86
  CGPoint offsetPoint = [uiTouch locationInView:activeTouch.componentView];
87
87
  CGPoint screenPoint = [uiTouch locationInView:uiTouch.window];
@@ -99,12 +99,12 @@ static void UpdateActiveTouchWithUITouch(
99
99
  }
100
100
  }
101
101
 
102
- static ActiveTouch CreateTouchWithUITouch(UITouch *uiTouch, UIView *rootComponentView, CGPoint rootViewOriginOffset)
102
+ static ActiveTouch CreateTouchWithUITouch(UITouch *uiTouch, RCTUIView *rootComponentView, CGPoint rootViewOriginOffset) // TODO(macOS GH#774)
103
103
  {
104
104
  ActiveTouch activeTouch = {};
105
105
 
106
106
  // Find closest Fabric-managed touchable view
107
- UIView *componentView = uiTouch.view;
107
+ RCTUIView *componentView = uiTouch.view; // TODO(macOS GH#774)
108
108
  while (componentView) {
109
109
  if ([componentView respondsToSelector:@selector(touchEventEmitterAtPoint:)]) {
110
110
  activeTouch.eventEmitter = [(id<RCTTouchableComponentViewProtocol>)componentView
@@ -164,7 +164,7 @@ struct PointerHasher {
164
164
  /*
165
165
  * We hold the view weakly to prevent a retain cycle.
166
166
  */
167
- __weak UIView *_rootComponentView;
167
+ __weak RCTUIView *_rootComponentView; // TODO(macOS GH#774)
168
168
  IdentifierPool<11> _identifierPool;
169
169
  }
170
170
 
@@ -187,7 +187,7 @@ struct PointerHasher {
187
187
 
188
188
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)action)
189
189
 
190
- - (void)attachToView:(UIView *)view
190
+ - (void)attachToView:(RCTUIView *)view // TODO(macOS GH#774)
191
191
  {
192
192
  RCTAssert(self.view == nil, @"RCTTouchHandler already has attached view.");
193
193
 
@@ -195,7 +195,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
195
195
  _rootComponentView = view;
196
196
  }
197
197
 
198
- - (void)detachFromView:(UIView *)view
198
+ - (void)detachFromView:(RCTUIView *)view // TODO(macOS GH#774)
199
199
  {
200
200
  RCTAssertParam(view);
201
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>
@@ -66,10 +66,12 @@ using namespace facebook::react;
66
66
 
67
67
  [self _updateLayoutContext];
68
68
 
69
+ #if !TARGET_OS_OSX // TODO(macOS GH#774)
69
70
  [[NSNotificationCenter defaultCenter] addObserver:self
70
71
  selector:@selector(handleContentSizeCategoryDidChangeNotification:)
71
72
  name:UIContentSizeCategoryDidChangeNotification
72
73
  object:nil];
74
+ #endif // TODO(macOS GH#774)
73
75
  }
74
76
 
75
77
  return self;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  NS_ASSUME_NONNULL_BEGIN
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/RCTView.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/RCTInvalidating.h>
11
11
  #import <React/RCTModalHostViewManager.h>
@@ -16,7 +16,7 @@
16
16
 
17
17
  @protocol RCTModalHostViewInteractor;
18
18
 
19
- @interface RCTModalHostView : UIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate>
19
+ @interface RCTModalHostView : RCTUIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate> // TODO(macOS GH#774)
20
20
 
21
21
  @property (nonatomic, copy) NSString *animationType;
22
22
  @property (nonatomic, assign) UIModalPresentationStyle presentationStyle;
@@ -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
  @interface RCTModalHostViewController : UIViewController
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/RCTBridgeModule.h>
11
11
  #import <React/RCTEventEmitter.h>
@@ -9,18 +9,9 @@
9
9
 
10
10
  #import <React/RCTComponent.h>
11
11
 
12
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
13
- @interface RCTSwitch : UISwitch
14
- #else // [TODO(macOS GH#774)
15
- @interface RCTSwitch : NSSwitch
16
- #endif // ]TODO(macOS GH#774)
12
+ @interface RCTSwitch : RCTUISwitch
17
13
 
18
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
19
14
  @property (nonatomic, assign) BOOL wasOn;
20
- #else // [TODO(macOS GH#774)
21
- @property (nonatomic, assign) BOOL on;
22
- - (void)setOn:(BOOL)on animated:(BOOL)animated;
23
- #endif // ]TODO(macOS GH#774)
24
15
  @property (nonatomic, copy) RCTBubblingEventBlock onChange;
25
16
 
26
17
  @end
@@ -11,30 +11,10 @@
11
11
 
12
12
  @implementation RCTSwitch
13
13
 
14
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
15
14
  - (void)setOn:(BOOL)on animated:(BOOL)animated
16
15
  {
17
16
  _wasOn = on;
18
17
  [super setOn:on animated:animated];
19
18
  }
20
- #else // [TODO(macOS GH#774)
21
- - (void)setOn:(BOOL)on animated:(BOOL)animated {
22
- self.state = on ? NSControlStateValueOn : NSControlStateValueOff;
23
- }
24
- #endif // ]TODO(macOS GH#774)
25
-
26
- #if TARGET_OS_OSX
27
-
28
- - (BOOL)on
29
- {
30
- return self.state == NSControlStateValueOn;
31
- }
32
-
33
- - (void)setOn:(BOOL)on
34
- {
35
- self.state = on ? NSControlStateValueOn : NSControlStateValueOff;
36
- }
37
-
38
- #endif // ]TODO(macOS GH#774)
39
19
 
40
20
  @end
@@ -30,16 +30,12 @@ RCT_EXPORT_MODULE()
30
30
 
31
31
  - (void)onChange:(RCTSwitch *)sender
32
32
  {
33
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
34
33
  if (sender.wasOn != sender.on) {
35
34
  if (sender.onChange) {
36
35
  sender.onChange(@{@"value" : @(sender.on)});
37
36
  }
38
37
  sender.wasOn = sender.on;
39
38
  }
40
- #else // [TODO(macOS GH#774)
41
- sender.onChange(@{ @"value": @(sender.on) });
42
- #endif // ]TODO(macOS GH#774)
43
39
  }
44
40
 
45
41
  RCT_EXPORT_METHOD(setValue : (nonnull NSNumber *)viewTag toValue : (BOOL)value)
@@ -14,6 +14,6 @@
14
14
  */
15
15
  @protocol RCTWeakViewHolder
16
16
 
17
- @property (nonatomic, strong) NSMapTable<NSNumber *, UIView *> *weakViews;
17
+ @property (nonatomic, strong) NSMapTable<NSNumber *, RCTUIView *> *weakViews; // TODO(macOS GH#774)
18
18
 
19
19
  @end
@@ -5,12 +5,12 @@
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
  @class RCTWrapperViewController;
11
11
 
12
12
  @interface RCTWrapperViewController : UIViewController
13
13
 
14
- - (instancetype)initWithContentView:(UIView *)contentView NS_DESIGNATED_INITIALIZER;
14
+ - (instancetype)initWithContentView:(RCTUIView *)contentView NS_DESIGNATED_INITIALIZER; // TODO(macOS GH#774)
15
15
 
16
16
  @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/RCTComponent.h>
11
11
  #import <React/RCTScrollableProtocol.h>
@@ -14,6 +14,6 @@
14
14
 
15
15
  @property (nonatomic, copy) NSString *title;
16
16
  @property (nonatomic, copy) RCTDirectEventBlock onRefresh;
17
- @property (nonatomic, weak) UIScrollView *scrollView;
17
+ @property (nonatomic, weak) RCTUIScrollView *scrollView; // TODO(macOS GH#774)
18
18
 
19
19
  @end
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTComponent.h>
9
- #import <UIKit/UIKit.h>
9
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
10
10
 
11
11
  /**
12
12
  * Protocol used to dispatch commands in `RCTRefreshControlManager.h`.
@@ -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/RCTView.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
 
@@ -42,7 +42,7 @@
42
42
 
43
43
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
44
44
  @optional
45
- @property (nonatomic, weak) UIScrollView *scrollView;
45
+ @property (nonatomic, weak) RCTUIScrollView *scrollView;
46
46
  #endif // TODO(macOS GH#774)
47
47
 
48
48
  @end
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.0.0-d7b3947f3
1
+ VERSION_NAME=0.0.0-d7b689f90
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -13,14 +13,10 @@ import com.facebook.react.common.MapBuilder;
13
13
 
14
14
  import java.util.Map;
15
15
 
16
- // [TODO(macOS GH#944)
17
- // Note: Be careful not to override these version numbers
18
- // when we merge upstream stable branches into main
19
- // TODO(macOS GH#944)]
20
16
  public class ReactNativeVersion {
21
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
22
18
  "major", 0,
23
19
  "minor", 0,
24
20
  "patch", 0,
25
- "prerelease", "d7b3947f3");
21
+ "prerelease", "d7b689f90");
26
22
  }
@@ -14,15 +14,11 @@
14
14
 
15
15
  namespace facebook::react {
16
16
 
17
- // [TODO(macOS GH#944)
18
- // Note: Be careful not to override these version numbers
19
- // when we merge upstream stable branches into main
20
- // TODO(macOS GH#944)]
21
17
  constexpr struct {
22
18
  int32_t Major = 0;
23
19
  int32_t Minor = 0;
24
20
  int32_t Patch = 0;
25
- std::string_view Prerelease = "d7b3947f3";
21
+ std::string_view Prerelease = "d7b689f90";
26
22
  } ReactNativeVersion;
27
23
 
28
24
  } // namespace facebook::react
@@ -2107,9 +2107,9 @@ decimal.js@^10.2.1:
2107
2107
  integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==
2108
2108
 
2109
2109
  decode-uri-component@^0.2.0:
2110
- version "0.2.0"
2111
- resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
2112
- integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
2110
+ version "0.2.2"
2111
+ resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
2112
+ integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
2113
2113
 
2114
2114
  deep-is@~0.1.3:
2115
2115
  version "0.1.4"
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  #import <Foundation/Foundation.h>
9
- #import <UIKit/UIKit.h>
9
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
10
10
  #include <folly/dynamic.h>
11
11
 
12
12
  NS_ASSUME_NONNULL_BEGIN
@@ -20,13 +20,13 @@ typedef void (^InterceptorBlock)(std::string eventName, folly::dynamic event);
20
20
 
21
21
  - (instancetype)initWithComponentData:(RCTComponentData *)componentData bridge:(RCTBridge *)bridge;
22
22
 
23
- - (UIView *)createPaperViewWithTag:(NSInteger)tag;
23
+ - (RCTUIView *)createPaperViewWithTag:(NSInteger)tag; // TODO(macOS GH#774)
24
24
 
25
25
  - (void)addObserveForTag:(NSInteger)tag usingBlock:(InterceptorBlock)block;
26
26
 
27
27
  - (void)removeObserveForTag:(NSInteger)tag;
28
28
 
29
- - (void)setProps:(folly::dynamic const &)props forView:(UIView *)view;
29
+ - (void)setProps:(folly::dynamic const &)props forView:(RCTUIView *)view; // TODO(macOS GH#774)
30
30
 
31
31
  - (NSString *)componentViewName;
32
32
 
@@ -71,9 +71,9 @@ using namespace facebook::react;
71
71
  [_eventInterceptors removeObjectForKey:[NSNumber numberWithInteger:tag]];
72
72
  }
73
73
 
74
- - (UIView *)createPaperViewWithTag:(NSInteger)tag;
74
+ - (RCTUIView *)createPaperViewWithTag:(NSInteger)tag; // TODO(macOS GH#774)
75
75
  {
76
- UIView *view = [_componentData createViewWithTag:[NSNumber numberWithInteger:tag] rootTag:NULL];
76
+ RCTUIView *view = [_componentData createViewWithTag:[NSNumber numberWithInteger:tag] rootTag:NULL]; // TODO(macOS GH#774)
77
77
  if ([_componentData.bridgelessViewManager conformsToProtocol:@protocol(RCTWeakViewHolder)]) {
78
78
  id<RCTWeakViewHolder> weakViewHolder = (id<RCTWeakViewHolder>)_componentData.bridgelessViewManager;
79
79
  if (!weakViewHolder.weakViews) {
@@ -84,7 +84,7 @@ using namespace facebook::react;
84
84
  return view;
85
85
  }
86
86
 
87
- - (void)setProps:(folly::dynamic const &)props forView:(UIView *)view
87
+ - (void)setProps:(folly::dynamic const &)props forView:(RCTUIView *)view // TODO(macOS GH#774)
88
88
  {
89
89
  if (props.isObject()) {
90
90
  NSDictionary<NSString *, id> *convertedProps = convertFollyDynamicToId(props);
@@ -9,7 +9,7 @@
9
9
 
10
10
  #import <Foundation/Foundation.h>
11
11
  #import <React/RCTUtils.h>
12
- #import <UIKit/UIKit.h>
12
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
13
13
 
14
14
  #include <string>
15
15
 
@@ -131,7 +131,7 @@ static NSDictionary<NSString *, NSDictionary *> *_PlatformColorSelectorsDict()
131
131
  return dict;
132
132
  }
133
133
 
134
- static UIColor *_UIColorFromHexValue(NSNumber *hexValue)
134
+ static RCTUIColor *_UIColorFromHexValue(NSNumber *hexValue) // TODO(macOS GH#774)
135
135
  {
136
136
  NSUInteger hexIntValue = [hexValue unsignedIntegerValue];
137
137
 
@@ -140,10 +140,10 @@ static UIColor *_UIColorFromHexValue(NSNumber *hexValue)
140
140
  CGFloat blue = ((CGFloat)((hexIntValue & 0xFF00) >> 8)) / 255.0;
141
141
  CGFloat alpha = ((CGFloat)(hexIntValue & 0xFF)) / 255.0;
142
142
 
143
- return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
143
+ return [RCTUIColor colorWithRed:red green:green blue:blue alpha:alpha]; // TODO(macOS GH#774)
144
144
  }
145
145
 
146
- static UIColor *_Nullable _UIColorFromSemanticString(NSString *semanticString)
146
+ static RCTUIColor *_Nullable _UIColorFromSemanticString(NSString *semanticString) // TODO(macOS GH#774)
147
147
  {
148
148
  NSString *platformColorString = [semanticString hasSuffix:kColorSuffix]
149
149
  ? [semanticString substringToIndex:[semanticString length] - [kColorSuffix length]]
@@ -152,17 +152,17 @@ static UIColor *_Nullable _UIColorFromSemanticString(NSString *semanticString)
152
152
  NSDictionary<NSString *, id> *colorInfo = platformColorSelectorsDict[platformColorString];
153
153
  if (colorInfo) {
154
154
  SEL objcColorSelector = NSSelectorFromString([platformColorString stringByAppendingString:kColorSuffix]);
155
- if (![UIColor respondsToSelector:objcColorSelector]) {
155
+ if (![RCTUIColor respondsToSelector:objcColorSelector]) { // TODO(macOS GH#774)
156
156
  NSNumber *fallbackRGB = colorInfo[kFallbackARGBKey];
157
157
  if (fallbackRGB) {
158
158
  return _UIColorFromHexValue(fallbackRGB);
159
159
  }
160
160
  } else {
161
- Class uiColorClass = [UIColor class];
161
+ Class uiColorClass = [RCTUIColor class]; // TODO(macOS GH#774)
162
162
  IMP imp = [uiColorClass methodForSelector:objcColorSelector];
163
163
  id (*getUIColor)(id, SEL) = ((id(*)(id, SEL))imp);
164
164
  id colorObject = getUIColor(uiColorClass, objcColorSelector);
165
- if ([colorObject isKindOfClass:[UIColor class]]) {
165
+ if ([colorObject isKindOfClass:[RCTUIColor class]]) { // TODO(macOS GH#774)
166
166
  return colorObject;
167
167
  }
168
168
  }
@@ -177,7 +177,7 @@ static inline NSString *_NSStringFromCString(
177
177
  return [NSString stringWithCString:string.c_str() encoding:encoding];
178
178
  }
179
179
 
180
- static inline facebook::react::ColorComponents _ColorComponentsFromUIColor(UIColor *color)
180
+ static inline facebook::react::ColorComponents _ColorComponentsFromUIColor(RCTUIColor *color) // TODO(macOS GH#774)
181
181
  {
182
182
  CGFloat rgba[4];
183
183
  RCTGetRGBAColorComponents(color.CGColor, rgba);
@@ -188,7 +188,7 @@ facebook::react::ColorComponents RCTPlatformColorComponentsFromSemanticItems(std
188
188
  {
189
189
  for (const auto &semanticCString : semanticItems) {
190
190
  NSString *semanticNSString = _NSStringFromCString(semanticCString);
191
- UIColor *uiColor = [UIColor colorNamed:semanticNSString];
191
+ RCTUIColor *uiColor = [RCTUIColor colorNamed:semanticNSString]; // TODO(macOS GH#774)
192
192
  if (uiColor != nil) {
193
193
  return _ColorComponentsFromUIColor(uiColor);
194
194
  }
@@ -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 <RCTImageManagerProtocol.h>
11
11