react-native-macos 0.0.0-a45ffbd53 → 0.0.0-a51a1d1e9

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.
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 0,
15
15
  patch: 0,
16
- prerelease: 'a45ffbd53',
16
+ prerelease: 'a51a1d1e9',
17
17
  };
@@ -649,18 +649,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
649
649
 
650
650
  - (NSColor *)tintColor
651
651
  {
652
- NSColor *tintColor = nil;
653
- if (@available(macOS 10.14, *)) {
654
- tintColor = _imageView.contentTintColor;
655
- }
656
- return tintColor;
652
+ return _imageView.contentTintColor;
657
653
  }
658
654
 
659
655
  - (void)setTintColor:(NSColor *)tintColor
660
656
  {
661
- if (@available(macOS 10.14, *)) {
662
- _imageView.contentTintColor = tintColor;
663
- }
657
+ _imageView.contentTintColor = tintColor;
664
658
  }
665
659
  #endif // ]TODO(macOS GH#774)
666
660
 
package/README.md CHANGED
@@ -62,7 +62,7 @@ You can read more about the macOS implementation on our website - [React Native
62
62
 
63
63
  ## Requirements
64
64
 
65
- You can run React Native for macOS apps on Mac devices with versions Mojave (10.14) or newer.
65
+ You can run React Native for macOS apps on Mac devices with versions Catalina (10.15) or newer.
66
66
 
67
67
  For a full and detailed list of the system requirements and how to set up your development platform, see our [System Requirements](https://microsoft.github.io/react-native-windows/docs/rnm-dependencies) documentation on our website.
68
68
 
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(0),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"a45ffbd53",
27
+ RCTVersionPrerelease: @"a51a1d1e9",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -59,14 +59,12 @@ static NSString *const RCTDarkAquaColor = @"darkAquaColor";
59
59
  - (NSColor *)effectiveColor
60
60
  {
61
61
  NSColor *effectiveColor = _aquaColor;
62
- if (@available(macOS 10.14, *)) {
63
- NSAppearance *appearance = [NSAppearance currentAppearance] ?: [NSApp effectiveAppearance];
62
+ NSAppearance *appearance = [NSAppearance currentAppearance] ?: [NSApp effectiveAppearance];
64
63
 
65
- NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
64
+ NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
66
65
 
67
- if (_darkAquaColor != nil && [appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
68
- effectiveColor = _darkAquaColor;
69
- }
66
+ if (_darkAquaColor != nil && [appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
67
+ effectiveColor = _darkAquaColor;
70
68
  }
71
69
  return effectiveColor;
72
70
  }
@@ -66,29 +66,24 @@ NSString *RCTColorSchemePreference(UITraitCollection *traitCollection)
66
66
  #else // [TODO(macOS GH#774)
67
67
  NSString *RCTColorSchemePreference(NSAppearance *appearance)
68
68
  {
69
- if (@available(macOS 10.14, *)) {
70
- static NSDictionary *appearances;
71
- static dispatch_once_t onceToken;
72
-
73
- dispatch_once(&onceToken, ^{
74
- appearances = @{
75
- NSAppearanceNameAqua: RCTAppearanceColorSchemeLight,
76
- NSAppearanceNameDarkAqua: RCTAppearanceColorSchemeDark
77
- };
78
- });
79
-
80
- if (!sAppearancePreferenceEnabled) {
81
- // Return the default if the app doesn't allow different color schemes.
82
- return RCTAppearanceColorSchemeLight;
83
- }
84
-
85
- appearance = appearance ?: [NSAppearance currentAppearance];
86
- NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
87
- return appearances[appearanceName] ?: RCTAppearanceColorSchemeLight;
69
+ static NSDictionary *appearances;
70
+ static dispatch_once_t onceToken;
71
+
72
+ dispatch_once(&onceToken, ^{
73
+ appearances = @{
74
+ NSAppearanceNameAqua: RCTAppearanceColorSchemeLight,
75
+ NSAppearanceNameDarkAqua: RCTAppearanceColorSchemeDark
76
+ };
77
+ });
78
+
79
+ if (!sAppearancePreferenceEnabled) {
80
+ // Return the default if the app doesn't allow different color schemes.
81
+ return RCTAppearanceColorSchemeLight;
88
82
  }
89
83
 
90
- // Default to light on older OS version - same behavior as Android.
91
- return RCTAppearanceColorSchemeLight;
84
+ appearance = appearance ?: [NSAppearance currentAppearance];
85
+ NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
86
+ return appearances[appearanceName] ?: RCTAppearanceColorSchemeLight;
92
87
  }
93
88
  #endif // ]TODO(macOS GH#774)
94
89
 
@@ -165,7 +160,7 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getColorScheme)
165
160
 
166
161
  - (void)startObserving
167
162
  {
168
- if (@available(macOS 10.14, iOS 13.0, *)) { // TODO(macOS GH#774)
163
+ if (@available(iOS 13.0, *)) {
169
164
  [[NSNotificationCenter defaultCenter] addObserver:self
170
165
  selector:@selector(appearanceChanged:)
171
166
  name:RCTUserInterfaceStyleDidChangeNotification
@@ -175,7 +170,7 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getColorScheme)
175
170
 
176
171
  - (void)stopObserving
177
172
  {
178
- if (@available(macOS 10.14, iOS 13.0, *)) { // TODO(macOS GH#774)
173
+ if (@available(iOS 13.0, *)) {
179
174
  [[NSNotificationCenter defaultCenter] removeObserver:self];
180
175
  }
181
176
  }
@@ -12,7 +12,7 @@
12
12
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
13
13
  @interface RCTSwitch : UISwitch
14
14
  #else // [TODO(macOS GH#774)
15
- @interface RCTSwitch : NSButton
15
+ @interface RCTSwitch : NSSwitch
16
16
  #endif // ]TODO(macOS GH#774)
17
17
 
18
18
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
@@ -7,25 +7,10 @@
7
7
 
8
8
  #import "RCTSwitch.h"
9
9
 
10
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
11
- #import <QuartzCore/QuartzCore.h>
12
- #endif // ]TODO(macOS GH#774)
13
-
14
10
  #import "UIView+React.h"
15
11
 
16
12
  @implementation RCTSwitch
17
13
 
18
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
19
- - (instancetype)initWithFrame:(CGRect)frame
20
- {
21
- if ((self = [super initWithFrame:frame])) {
22
- self.buttonType = NSButtonTypeSwitch;
23
- self.title = @""; // default is "Button"
24
- }
25
- return self;
26
- }
27
- #endif
28
-
29
14
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
30
15
  - (void)setOn:(BOOL)on animated:(BOOL)animated
31
16
  {
@@ -1393,19 +1393,6 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1393
1393
  return ([self focusable] && [NSApp isFullKeyboardAccessEnabled]) || [super acceptsFirstResponder];
1394
1394
  }
1395
1395
 
1396
- - (BOOL)performKeyEquivalent:(NSEvent *)theEvent
1397
- {
1398
- if (self.onClick != nil &&
1399
- [self focusable] &&
1400
- [[self window] firstResponder] == self) {
1401
- if ([[theEvent characters] isEqualToString:@" "] || [[theEvent characters] isEqualToString:@"\r"]) {
1402
- self.onClick(nil);
1403
- return YES;
1404
- }
1405
- }
1406
- return [super performKeyEquivalent:theEvent];
1407
- }
1408
-
1409
1396
  - (void)updateTrackingAreas
1410
1397
  {
1411
1398
  if (_trackingArea) {
@@ -78,7 +78,7 @@ Pod::Spec.new do |s|
78
78
  end
79
79
 
80
80
  s.subspec "Hermes" do |ss|
81
- ss.platforms = { :osx => "10.15" }
81
+ ss.platforms = { :osx => "10.15", :ios => "11.0" }
82
82
  ss.source_files = "ReactCommon/hermes/executor/*.{cpp,h}",
83
83
  "ReactCommon/hermes/inspector/*.{cpp,h}",
84
84
  "ReactCommon/hermes/inspector/chrome/*.{cpp,h}",
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.0.0-a45ffbd53
1
+ VERSION_NAME=0.0.0-a51a1d1e9
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 0,
20
20
  "patch", 0,
21
- "prerelease", "a45ffbd53");
21
+ "prerelease", "a51a1d1e9");
22
22
  }
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 0;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "a45ffbd53";
21
+ std::string_view Prerelease = "a51a1d1e9";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -6,12 +6,8 @@ target 'HelloWorld-macOS' do
6
6
  use_native_modules!
7
7
  use_react_native!(
8
8
  :path => '../node_modules/react-native-macos',
9
-
10
- # To use Hermes, install the `hermes-engine-darwin` npm package, e.g.:
11
- # $ yarn add 'hermes-engine-darwin@~0.5.3'
12
- #
13
- # Then enable this option:
14
- # :hermes_enabled => true
9
+ # to enable hermes on macOS, change `false` to `true` and then install pods
10
+ :hermes_enabled => false
15
11
  )
16
12
 
17
13
  # Pods specifically for macOS target
@@ -29,7 +25,6 @@ target 'HelloWorld-iOS' do
29
25
  use_flipper!
30
26
 
31
27
  post_install do |installer|
32
- flipper_post_install(installer)
33
28
  react_native_post_install(installer)
34
29
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
35
30
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.0.0-a45ffbd53",
3
+ "version": "0.0.0-a51a1d1e9",
4
4
  "bin": "./cli.js",
5
5
  "description": "[Microsoft Fork] A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -47,7 +47,6 @@
47
47
  "scripts/launchPackager.command",
48
48
  "scripts/node-binary.sh",
49
49
  "scripts/packager.sh",
50
- "scripts/postInstall.js",
51
50
  "scripts/react_native_pods.rb",
52
51
  "scripts/react-native-xcode.sh",
53
52
  "template.config.js",
@@ -83,8 +82,7 @@
83
82
  "test-android-e2e": "yarn run docker-build-android && yarn run test-android-run-e2e",
84
83
  "build-ios-e2e": "detox build -c ios.sim.release",
85
84
  "test-ios-e2e": "detox test -c ios.sim.release packages/rn-tester/e2e",
86
- "test-ios": "./scripts/objc-test.sh test",
87
- "postinstall": "node scripts/postInstall.js"
85
+ "test-ios": "./scripts/objc-test.sh test"
88
86
  },
89
87
  "peerDependencies": {
90
88
  "react": "17.0.2"
@@ -166,7 +164,6 @@
166
164
  "yargs": "^15.3.1",
167
165
  "@typescript-eslint/eslint-plugin": "4.30.0",
168
166
  "@typescript-eslint/parser": "4.30.0",
169
- "hermes-engine-darwin": "~0.5.0",
170
167
  "typescript": "4.4.2"
171
168
  },
172
169
  "detox": {
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "17.0.2",
14
- "react-native": "0.0.0-a45ffbd53"
14
+ "react-native": "0.0.0-a51a1d1e9"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",
@@ -1,9 +0,0 @@
1
- #!/bin/sh
2
-
3
- # npm publish is currently performed on Windows build agents and loses the executable bit on files.
4
- # restore the executable bit during npm postinstall
5
-
6
- echo "Fixing the executable bit on macOS scripts"
7
-
8
- find . -iname \*.sh -exec chmod +x {} \;
9
- find . -iname \*.command -exec chmod +x {} \;
@@ -1,6 +0,0 @@
1
- const child_process = require('child_process');
2
-
3
- const isMacOS = process.platform === 'darwin';
4
- if (isMacOS) {
5
- child_process.execSync('source scripts/fixmacscripts.sh', {stdio: 'inherit'});
6
- }