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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTImageView.mm +2 -8
- package/README.md +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/macOS/RCTDynamicColor.m +4 -6
- package/React/CoreModules/RCTAppearance.mm +18 -23
- package/React/Views/RCTSwitch.h +1 -1
- package/React/Views/RCTSwitch.m +0 -15
- package/React/Views/RCTView.m +0 -13
- package/React-Core.podspec +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/local-cli/generator-macos/templates/macos/Podfile +2 -7
- package/package.json +2 -5
- package/template/package.json +1 -1
- package/scripts/fixmacscripts.sh +0 -9
- package/scripts/postInstall.js +0 -6
|
@@ -649,18 +649,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
|
|
649
649
|
|
|
650
650
|
- (NSColor *)tintColor
|
|
651
651
|
{
|
|
652
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -59,14 +59,12 @@ static NSString *const RCTDarkAquaColor = @"darkAquaColor";
|
|
|
59
59
|
- (NSColor *)effectiveColor
|
|
60
60
|
{
|
|
61
61
|
NSColor *effectiveColor = _aquaColor;
|
|
62
|
-
|
|
63
|
-
NSAppearance *appearance = [NSAppearance currentAppearance] ?: [NSApp effectiveAppearance];
|
|
62
|
+
NSAppearance *appearance = [NSAppearance currentAppearance] ?: [NSApp effectiveAppearance];
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if
|
|
81
|
-
|
|
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
|
-
|
|
91
|
-
|
|
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(
|
|
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(
|
|
173
|
+
if (@available(iOS 13.0, *)) {
|
|
179
174
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
180
175
|
}
|
|
181
176
|
}
|
package/React/Views/RCTSwitch.h
CHANGED
|
@@ -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 :
|
|
15
|
+
@interface RCTSwitch : NSSwitch
|
|
16
16
|
#endif // ]TODO(macOS GH#774)
|
|
17
17
|
|
|
18
18
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
package/React/Views/RCTSwitch.m
CHANGED
|
@@ -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
|
{
|
package/React/Views/RCTView.m
CHANGED
|
@@ -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) {
|
package/React-Core.podspec
CHANGED
|
@@ -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}",
|
|
@@ -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
|
-
|
|
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-
|
|
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": {
|
package/template/package.json
CHANGED
package/scripts/fixmacscripts.sh
DELETED
|
@@ -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 {} \;
|