react-native-macos 0.0.0-d7a11eac4 → 0.0.0-dd6d6b77d

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 (34) hide show
  1. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
  4. package/Libraries/Text/Text/RCTTextView.m +7 -9
  5. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
  6. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +1 -1
  7. package/README.md +4 -3
  8. package/React/Base/RCTConvert.m +1 -1
  9. package/React/Base/RCTImageSource.m +2 -0
  10. package/React/Base/RCTJSStackFrame.m +2 -0
  11. package/React/Base/RCTJavaScriptLoader.mm +2 -0
  12. package/React/Base/RCTKeyCommands.m +2 -0
  13. package/React/Base/RCTModuleData.mm +2 -0
  14. package/React/Base/RCTModuleMethod.mm +2 -0
  15. package/React/Base/RCTTouchEvent.m +2 -0
  16. package/React/Base/RCTVersion.m +1 -1
  17. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  18. package/React/CoreModules/RCTActionSheetManager.mm +4 -0
  19. package/React/CxxModule/RCTCxxMethod.mm +2 -0
  20. package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
  21. package/React/Modules/RCTLayoutAnimation.m +2 -0
  22. package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
  23. package/React/Views/RCTShadowView.m +3 -1
  24. package/React/Views/RCTView.h +3 -0
  25. package/React/Views/RCTView.m +20 -8
  26. package/React/Views/RCTViewManager.m +9 -8
  27. package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
  28. package/ReactAndroid/gradle.properties +1 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  30. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  31. package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
  32. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1225 -1481
  33. package/package.json +19 -11
  34. package/template/package.json +2 -2
@@ -77,9 +77,8 @@ const AccessibilityInfo = {
77
77
  * See https://reactnative.dev/docs/accessibilityinfo.html#isBoldTextEnabled
78
78
  */
79
79
  isBoldTextEnabled(): Promise<boolean> {
80
- if (Platform.OS === 'android') {
81
- return Promise.resolve(false);
82
- } else {
80
+ // [TODO(macOS GH#774) - rework logic to return Promise.resolve(false) on macOS
81
+ if (Platform.OS === 'ios') {
83
82
  return new Promise((resolve, reject) => {
84
83
  if (NativeAccessibilityManagerApple != null) {
85
84
  NativeAccessibilityManagerApple.getCurrentBoldTextState(
@@ -90,7 +89,10 @@ const AccessibilityInfo = {
90
89
  reject(null);
91
90
  }
92
91
  });
92
+ } else {
93
+ return Promise.resolve(false);
93
94
  }
95
+ // ]TODO(macOS GH#774)
94
96
  },
95
97
 
96
98
  /**
@@ -102,9 +104,8 @@ const AccessibilityInfo = {
102
104
  * See https://reactnative.dev/docs/accessibilityinfo.html#isGrayscaleEnabled
103
105
  */
104
106
  isGrayscaleEnabled(): Promise<boolean> {
105
- if (Platform.OS === 'android') {
106
- return Promise.resolve(false);
107
- } else {
107
+ // [TODO(macOS GH#774) - rework logic to return Promise.resolve(false) on macOS
108
+ if (Platform.OS === 'ios') {
108
109
  return new Promise((resolve, reject) => {
109
110
  if (NativeAccessibilityManagerApple != null) {
110
111
  NativeAccessibilityManagerApple.getCurrentGrayscaleState(
@@ -115,12 +116,16 @@ const AccessibilityInfo = {
115
116
  reject(null);
116
117
  }
117
118
  });
119
+ } else {
120
+ return Promise.resolve(false);
118
121
  }
122
+ // ]TODO(macOS GH#774)
119
123
  },
120
124
 
121
125
  /**
122
126
  * macOS only
123
127
  */
128
+ // [TODO(macOS GH#774)
124
129
  isHighContrastEnabled: function(): Promise<boolean> {
125
130
  if (Platform.OS === 'macos') {
126
131
  return new Promise((resolve, reject) => {
@@ -137,6 +142,7 @@ const AccessibilityInfo = {
137
142
  return Promise.resolve(false);
138
143
  }
139
144
  },
145
+ // ]TODO(macOS GH#774)
140
146
 
141
147
  /**
142
148
  * Query whether inverted colors are currently enabled.
@@ -147,9 +153,8 @@ const AccessibilityInfo = {
147
153
  * See https://reactnative.dev/docs/accessibilityinfo.html#isInvertColorsEnabled
148
154
  */
149
155
  isInvertColorsEnabled(): Promise<boolean> {
150
- if (Platform.OS === 'android') {
151
- return Promise.resolve(false);
152
- } else {
156
+ // [TODO(macOS GH#774) - rework logic to return Promise.resolve(false) on macOS
157
+ if (Platform.OS === 'ios') {
153
158
  return new Promise((resolve, reject) => {
154
159
  if (NativeAccessibilityManagerApple != null) {
155
160
  NativeAccessibilityManagerApple.getCurrentInvertColorsState(
@@ -160,7 +165,10 @@ const AccessibilityInfo = {
160
165
  reject(null);
161
166
  }
162
167
  });
168
+ } else {
169
+ return Promise.resolve(false);
163
170
  }
171
+ // ]TODO(macOS GH#774)
164
172
  },
165
173
 
166
174
  /**
@@ -201,9 +209,8 @@ const AccessibilityInfo = {
201
209
  * See https://reactnative.dev/docs/accessibilityinfo.html#isReduceTransparencyEnabled
202
210
  */
203
211
  isReduceTransparencyEnabled(): Promise<boolean> {
204
- if (Platform.OS === 'android') {
205
- return Promise.resolve(false);
206
- } else {
212
+ // [TODO(macOS GH#774) - rework logic to return Promise.resolve(false) on macOS
213
+ if (Platform.OS === 'ios') {
207
214
  return new Promise((resolve, reject) => {
208
215
  if (NativeAccessibilityManagerApple != null) {
209
216
  NativeAccessibilityManagerApple.getCurrentReduceTransparencyState(
@@ -214,7 +221,10 @@ const AccessibilityInfo = {
214
221
  reject(null);
215
222
  }
216
223
  });
224
+ } else {
225
+ return Promise.resolve(false);
217
226
  }
227
+ // ]TODO(macOS GH#774)
218
228
  },
219
229
 
220
230
  /**
@@ -17,5 +17,5 @@ exports.version = {
17
17
  major: 0,
18
18
  minor: 0,
19
19
  patch: 0,
20
- prerelease: 'd7a11eac4',
20
+ prerelease: 'dd6d6b77d',
21
21
  };
@@ -24,10 +24,12 @@
24
24
  [self.superview dirtyLayout];
25
25
  }
26
26
 
27
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
27
28
  - (NSString *)description
28
29
  {
29
30
  NSString *superDescription = super.description;
30
31
  return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; text: %@>", self.text];
31
32
  }
33
+ #endif // TODO(macOS GH#774)
32
34
 
33
35
  @end
@@ -55,6 +55,8 @@
55
55
  self.accessibilityTraits |= UIAccessibilityTraitStaticText;
56
56
  #else // [TODO(macOS GH#774)
57
57
  self.accessibilityRole = NSAccessibilityStaticTextRole;
58
+ // Fix blurry text on non-retina displays.
59
+ self.canDrawSubviewsIntoLayer = YES;
58
60
  #endif // ]TODO(macOS GH#774)
59
61
  self.opaque = NO;
60
62
  RCTUIViewSetContentModeRedraw(self); // TODO(macOS GH#774) and TODO(macOS ISS#3536887)
@@ -99,19 +101,15 @@
99
101
  }
100
102
  #endif // ]TODO(macOS GH#774)
101
103
 
104
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
102
105
  - (NSString *)description
103
106
  {
104
- NSString *superDescription = super.description;
105
- NSRange semicolonRange = [superDescription rangeOfString:@";"];
106
- NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@; text: %@", self.reactTag, _textStorage.string];
107
- // [TODO(macOS GH#774): super.description isn't guaranteed to have a semicolon in it on macOS
108
- if (semicolonRange.location == NSNotFound) {
109
- return [superDescription stringByAppendingString:replacement];
110
- } else {
111
- return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
112
- }
107
+ // [TODO(macOS GH#774): we shouldn't make assumptions on what super's description is. Just append additional content.
108
+ NSString *stringToAppend = [NSString stringWithFormat:@" reactTag: %@; text: %@", self.reactTag, _textStorage.string];
109
+ return [[super description] stringByAppendingString:stringToAppend];
113
110
  // TODO(macOS GH#774)]
114
111
  }
112
+ #endif // TODO(macOS GH#774)
115
113
 
116
114
  - (void)setSelectable:(BOOL)selectable
117
115
  {
@@ -49,6 +49,8 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
49
49
  NSTextCheckingTypes checkingTypes = 0;
50
50
  self.enabledTextCheckingTypes = checkingTypes;
51
51
  self.insertionPointColor = [NSColor selectedControlColor];
52
+ // Fix blurry text on non-retina displays.
53
+ self.canDrawSubviewsIntoLayer = YES;
52
54
  #endif // ]TODO(macOS GH#774)
53
55
 
54
56
  _textInputDelegateAdapter = [[RCTBackedTextViewDelegateAdapter alloc] initWithTextView:self];
@@ -159,6 +161,12 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
159
161
  self.string = text;
160
162
  }
161
163
 
164
+ - (void)setTypingAttributes:(__unused NSDictionary *)typingAttributes
165
+ {
166
+ // Prevent NSTextView from changing its own typing attributes out from under us.
167
+ [super setTypingAttributes:_defaultTextAttributes];
168
+ }
169
+
162
170
  - (NSAttributedString*)attributedText
163
171
  {
164
172
  return self.textStorage;
@@ -307,13 +315,7 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
307
315
  if (self.placeholder == nil) {
308
316
  return nil;
309
317
  }
310
- NSMutableDictionary *placeholderAttributes = [self.typingAttributes mutableCopy];
311
- if (placeholderAttributes == nil) {
312
- placeholderAttributes = [NSMutableDictionary dictionary];
313
- }
314
- placeholderAttributes[NSForegroundColorAttributeName] = self.placeholderColor ?: defaultPlaceholderColor();
315
- placeholderAttributes[NSFontAttributeName] = self.font ?: defaultPlaceholderFont();
316
- return [[NSAttributedString alloc] initWithString:self.placeholder attributes:placeholderAttributes];
318
+ return [[NSAttributedString alloc] initWithString:self.placeholder attributes:[self _placeholderTextAttributes]];
317
319
  }
318
320
 
319
321
  - (void)drawRect:(NSRect)dirtyRect
@@ -388,7 +390,7 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
388
390
  placeholderSize = CGSizeMake(RCTCeilPixelValue(placeholderSize.width), RCTCeilPixelValue(placeholderSize.height));
389
391
  #else // [TODO(macOS GH#774)
390
392
  CGFloat scale = self.window.backingScaleFactor;
391
- CGSize placeholderSize = [placeholder sizeWithAttributes:@{NSFontAttributeName: self.font ?: defaultPlaceholderFont()}];
393
+ CGSize placeholderSize = [placeholder sizeWithAttributes:[self _placeholderTextAttributes]];
392
394
  placeholderSize = CGSizeMake(RCTCeilPixelValue(placeholderSize.width, scale), RCTCeilPixelValue(placeholderSize.height, scale));
393
395
  #endif // ]TODO(macOS GH#774)
394
396
  placeholderSize.width += textContainerInset.left + textContainerInset.right;
@@ -493,7 +493,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
493
493
 
494
494
  if (range.location + range.length > backedTextInputView.attributedText.string.length) {
495
495
  _predictedText = backedTextInputView.attributedText.string;
496
- } else {
496
+ } else if (text != nil) { // TODO(macOS GH#774): -[NSString stringByReplacingCharactersInRange:withString:] doesn't like when the replacement string is nil
497
497
  _predictedText = [backedTextInputView.attributedText.string stringByReplacingCharactersInRange:range withString:text];
498
498
  }
499
499
 
package/README.md CHANGED
@@ -61,10 +61,11 @@ The source for the React Native documentation and website is hosted on a separat
61
61
  [React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/) has its own separate documentation site where Windows and macOS
62
62
  specific information, like API docs and blog updates live. We are still working on the documentation for macOS, contributions are welcome!
63
63
 
64
- ### Examples
64
+ If you're looking for sample code, just browse the [RNTester folder](https://github.com/microsoft/react-native-macos/tree/master/packages/rn-tester) for examples
65
65
 
66
- - Using the CLI in the [Getting Started](https://microsoft.github.io/react-native-windows/docs/rnm-getting-started) guide will set you up with a sample React Native for macOS app that you can begin editing right away.
67
- - If you're looking for sample code, just browse the [RNTester folder](https://github.com/microsoft/react-native-macos/tree/master/packages/rn-tester) for examples
66
+ ### Git flow and syncing with upstream
67
+
68
+ For more details on how this fork handles keeping up with upstream, and how the general git flow works, check out [this dedicated document](./docs/GitFlow.md).
68
69
 
69
70
  ## License
70
71
 
@@ -1423,7 +1423,7 @@ RCT_ENUM_CONVERTER(
1423
1423
  @"link": NSAccessibilityLinkRole, // also a legacy iOS accessibilityTraits
1424
1424
  @"menu": NSAccessibilityMenuRole,
1425
1425
  @"menubar": NSAccessibilityMenuBarRole,
1426
- @"menuitem": NSAccessibilityMenuBarItemRole,
1426
+ @"menuitem": NSAccessibilityMenuItemRole,
1427
1427
  @"none": NSAccessibilityUnknownRole,
1428
1428
  @"progressbar": NSAccessibilityProgressIndicatorRole,
1429
1429
  @"radio": NSAccessibilityRadioButtonRole,
@@ -42,6 +42,7 @@
42
42
  (CGSizeEqualToSize(_size, object.size) || CGSizeEqualToSize(object.size, CGSizeZero));
43
43
  }
44
44
 
45
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
45
46
  - (NSString *)description
46
47
  {
47
48
  return [NSString stringWithFormat:@"<RCTImageSource: %p URL=%@, size=%@, scale=%0.f>",
@@ -50,6 +51,7 @@
50
51
  NSStringFromCGSize(_size),
51
52
  _scale];
52
53
  }
54
+ #endif // TODO(macOS GH#774)
53
55
 
54
56
  @end
55
57
 
@@ -136,6 +136,7 @@ static NSRegularExpression *RCTJSStackFrameRegex()
136
136
  return stack;
137
137
  }
138
138
 
139
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
139
140
  - (NSString *)description
140
141
  {
141
142
  return [NSString stringWithFormat:@"<%@: %p method name: %@; file name: %@; line: %ld; column: %ld>",
@@ -146,5 +147,6 @@ static NSRegularExpression *RCTJSStackFrameRegex()
146
147
  (long)self.lineNumber,
147
148
  (long)self.column];
148
149
  }
150
+ #endif // TODO(macOS GH#774)
149
151
 
150
152
  @end
@@ -62,6 +62,7 @@ static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_R
62
62
 
63
63
  @implementation RCTLoadingProgress
64
64
 
65
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
65
66
  - (NSString *)description
66
67
  {
67
68
  NSMutableString *desc = [NSMutableString new];
@@ -77,6 +78,7 @@ static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_R
77
78
  [desc appendString:@"\u2026"];
78
79
  return desc;
79
80
  }
81
+ #endif // TODO(macOS GH#774)
80
82
 
81
83
  @end
82
84
 
@@ -74,6 +74,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
74
74
  return [_key isEqual:input] && (_flags == flags || flags == 0);
75
75
  }
76
76
 
77
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
77
78
  - (NSString *)description
78
79
  {
79
80
  return [NSString stringWithFormat:@"<%@:%p input=\"%@\" flags=%lld hasBlock=%@>",
@@ -83,6 +84,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
83
84
  (long long)_flags,
84
85
  _block ? @"YES" : @"NO"];
85
86
  }
87
+ #endif // TODO(macOS GH#774)
86
88
 
87
89
  @end
88
90
 
@@ -570,9 +570,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init);
570
570
  _methodQueue = nil;
571
571
  }
572
572
 
573
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
573
574
  - (NSString *)description
574
575
  {
575
576
  return [NSString stringWithFormat:@"<%@: %p; name=\"%@\">", [self class], self, self.name];
576
577
  }
578
+ #endif // TODO(macOS GH#774)
577
579
 
578
580
  @end
@@ -602,6 +602,7 @@ RCT_EXTERN_C_END
602
602
  return [NSString stringWithFormat:@"-[%@ %s]", _moduleClass, sel_getName(_selector)];
603
603
  }
604
604
 
605
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
605
606
  - (NSString *)description
606
607
  {
607
608
  return [NSString stringWithFormat:@"<%@: %p; exports %@ as %s(); type: %s>",
@@ -611,5 +612,6 @@ RCT_EXTERN_C_END
611
612
  self.JSMethodName,
612
613
  RCTFunctionDescriptorFromType(self.functionType)];
613
614
  }
615
+ #endif // TODO(macOS GH#774)
614
616
 
615
617
  @end
@@ -98,10 +98,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
98
98
  return _coalescingKey;
99
99
  }
100
100
 
101
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
101
102
  - (NSString *)description
102
103
  {
103
104
  return [NSString
104
105
  stringWithFormat:@"<%@: %p; name = %@; coalescing key = %hu>", [self class], self, _eventName, _coalescingKey];
105
106
  }
107
+ #endif // TODO(macOS GH#774)
106
108
 
107
109
  @end
@@ -28,7 +28,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
28
28
  RCTVersionMajor: @(0),
29
29
  RCTVersionMinor: @(0),
30
30
  RCTVersionPatch: @(0),
31
- RCTVersionPrerelease: @"d7a11eac4",
31
+ RCTVersionPrerelease: @"dd6d6b77d",
32
32
  };
33
33
  });
34
34
  return __rnVersion;
@@ -50,7 +50,7 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
50
50
  os_unfair_lock_lock(&rctDisplayLink->_lock);
51
51
  if (rctDisplayLink->_runLoop != nil) {
52
52
  CFRunLoopRef cfRunLoop = [rctDisplayLink->_runLoop getCFRunLoop];
53
- CFRunLoopPerformBlock(cfRunLoop, kCFRunLoopDefaultMode, ^{
53
+ CFRunLoopPerformBlock(cfRunLoop, (__bridge CFArrayRef)rctDisplayLink->_modes, ^{
54
54
  [rctDisplayLink tick];
55
55
  });
56
56
  CFRunLoopWakeUp(cfRunLoop);
@@ -71,14 +71,17 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
71
71
 
72
72
  - (void)addToRunLoop:(NSRunLoop *)runloop forMode:(NSRunLoopMode)mode
73
73
  {
74
+ os_unfair_lock_lock(&_lock);
74
75
  _runLoop = runloop;
75
76
 
76
77
  if (_displayLink != NULL) {
77
78
  [_modes addObject:mode];
79
+ os_unfair_lock_unlock(&_lock);
78
80
  return;
79
81
  }
80
82
 
81
83
  _modes = @[mode].mutableCopy;
84
+ os_unfair_lock_unlock(&_lock);
82
85
  CVReturn ret = CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
83
86
  if (ret != kCVReturnSuccess) {
84
87
  ret = CVDisplayLinkCreateWithCGDisplay(CGMainDisplayID(), &_displayLink);
@@ -43,7 +43,11 @@ NSSharingServicePickerDelegate
43
43
 
44
44
  RCT_EXPORT_MODULE()
45
45
 
46
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
47
+ @synthesize bridge = _bridge;
48
+ #else // TODO(macOS GH#774)
46
49
  @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
50
+ #endif // ]TODO(macOS GH#774)
47
51
 
48
52
  - (dispatch_queue_t)methodQueue
49
53
  {
@@ -131,9 +131,11 @@ using namespace facebook::react;
131
131
  }
132
132
  }
133
133
 
134
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
134
135
  - (NSString *)description
135
136
  {
136
137
  return [NSString stringWithFormat:@"<%@: %p; name = %s>", [self class], self, self.JSMethodName];
137
138
  }
139
+ #endif // TODO(macOS GH#774)
138
140
 
139
141
  @end
@@ -110,9 +110,21 @@ static void sendEventToAllConnections(NSString *event)
110
110
  }
111
111
 
112
112
  NSString *key = [inspectorURL absoluteString];
113
+ // [TODO(macOS GH#774) - safety check to avoid a crash
114
+ if (key == nil) {
115
+ RCTLogError(@"failed to get inspector URL");
116
+ return nil;
117
+ }
118
+ // ]TODO(macOS GH#774)
113
119
  RCTInspectorPackagerConnection *connection = socketConnections[key];
114
120
  if (!connection || !connection.isConnected) {
115
121
  connection = [[RCTInspectorPackagerConnection alloc] initWithURL:inspectorURL];
122
+ // [TODO(macOS GH#774) - safety check to avoid a crash
123
+ if (connection == nil) {
124
+ RCTLogError(@"failed to initialize RCTInspectorPackagerConnection");
125
+ return nil;
126
+ }
127
+ // ]TODO(macOS GH#774)
116
128
  socketConnections[key] = connection;
117
129
  [connection connect];
118
130
  }
@@ -190,6 +190,7 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
190
190
  _animationType == animation.animationType;
191
191
  }
192
192
 
193
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
193
194
  - (NSString *)description
194
195
  {
195
196
  return [NSString
@@ -204,5 +205,6 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
204
205
  _initialVelocity,
205
206
  (long)_animationType];
206
207
  }
208
+ #endif // TODO(macOS GH#774)
207
209
 
208
210
  @end
@@ -64,6 +64,7 @@
64
64
  [_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);
65
65
  }
66
66
 
67
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
67
68
  - (NSString *)description
68
69
  {
69
70
  return
@@ -75,5 +76,6 @@
75
76
  [_updatingLayoutAnimation description],
76
77
  [_deletingLayoutAnimation description]];
77
78
  }
79
+ #endif // TODO(macOS GH#774)
78
80
 
79
81
  @end
@@ -52,7 +52,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
52
52
  #if !TARGET_OS_OSX // [TODO(macOS GH#774)
53
53
  float pixelsInPoint = RCTScreenScale();
54
54
  #else
55
- float pixelsInPoint = 0; // TODO(ISS#1656079): Turn off pixel rounding for macOS until we can get screen resolution passed here
55
+ float pixelsInPoint = 1; // TODO(ISS#1656079): Use 1x alignment for macOS until we can use backing resolution
56
56
  #endif // ]TODO(macOS GH#774)
57
57
  YGConfigSetPointScaleFactor(yogaConfig, pixelsInPoint);
58
58
  YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
@@ -393,6 +393,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
393
393
  return self.reactTag;
394
394
  }
395
395
 
396
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
396
397
  - (NSString *)description
397
398
  {
398
399
  NSString *description = super.description;
@@ -403,6 +404,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
403
404
  NSStringFromCGRect(self.layoutMetrics.frame)];
404
405
  return description;
405
406
  }
407
+ #endif // TODO(macOS GH#774)
406
408
 
407
409
  - (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level
408
410
  {
@@ -128,6 +128,9 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
128
128
  /**
129
129
  * macOS Properties
130
130
  */
131
+
132
+ @property (nonatomic, assign) CATransform3D transform3D;
133
+
131
134
  @property (nonatomic, copy) RCTDirectEventBlock onDoubleClick;
132
135
  @property (nonatomic, copy) RCTDirectEventBlock onClick;
133
136
  @property (nonatomic, copy) RCTDirectEventBlock onMouseEnter;
@@ -162,6 +162,9 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
162
162
  _borderBottomEndRadius = -1;
163
163
  _borderStyle = RCTBorderStyleSolid;
164
164
  _hitTestEdgeInsets = UIEdgeInsetsZero;
165
+ #if TARGET_OS_OSX // TODO(macOS GH#774)
166
+ _transform3D = CATransform3DIdentity;
167
+ #endif // TODO(macOS GH#774)
165
168
 
166
169
  _backgroundColor = super.backgroundColor;
167
170
  }
@@ -708,17 +711,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
708
711
  }
709
712
  #endif // ]TODO(macOS GH#774)
710
713
 
714
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
711
715
  - (NSString *)description
712
716
  {
713
- NSString *superDescription = super.description;
714
- NSRange semicolonRange = [superDescription rangeOfString:@";"];
715
- if (semicolonRange.location == NSNotFound) { // [TODO(macOS GH#774)
716
- return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; reactTag: %@; frame = %@; layer = %@>", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
717
- } else { // ]TODO(macOS GH#774)
718
- NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@;", self.reactTag];
719
- return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
720
- } // TODO(macOS GH#774)
717
+ // TODO(macOS GH#774): we shouldn't make assumptions on what super's description is. Just append additional content.
718
+ return [[super description] stringByAppendingFormat:@" reactTag: %@; frame = %@; layer = %@", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
721
719
  }
720
+ #endif // TODO(macOS GH#774)
722
721
 
723
722
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
724
723
  - (void)viewDidMoveToWindow
@@ -1169,6 +1168,19 @@ static CGFloat RCTDefaultIfNegativeTo(CGFloat defaultValue, CGFloat x)
1169
1168
  backgroundColor = _backgroundColor.CGColor;
1170
1169
  #endif
1171
1170
 
1171
+ #if TARGET_OS_OSX // [TODO(macOS GH#1035)
1172
+ CATransform3D transform = [self transform3D];
1173
+ CGPoint anchorPoint = [layer anchorPoint];
1174
+ if (CGPointEqualToPoint(anchorPoint, CGPointZero) && !CATransform3DEqualToTransform(transform, CATransform3DIdentity)) {
1175
+ // https://developer.apple.com/documentation/quartzcore/calayer/1410817-anchorpoint
1176
+ // This compensates for the fact that layer.anchorPoint is {0, 0} instead of {0.5, 0.5} on macOS for some reason.
1177
+ CATransform3D originAdjust = CATransform3DTranslate(CATransform3DIdentity, self.frame.size.width / 2, self.frame.size.height / 2, 0);
1178
+ transform = CATransform3DConcat(CATransform3DConcat(CATransform3DInvert(originAdjust), transform), originAdjust);
1179
+ // Enable edge antialiasing in perspective transforms
1180
+ [layer setAllowsEdgeAntialiasing:!(transform.m34 == 0.0f)];
1181
+ }
1182
+ [layer setTransform:transform];
1183
+ #endif // ]TODO(macOS GH#1035)
1172
1184
  if (useIOSBorderRendering) {
1173
1185
  layer.cornerRadius = cornerRadii.topLeft;
1174
1186
  layer.borderColor = borderColors.left;
@@ -215,15 +215,16 @@ RCT_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, RCTView)
215
215
 
216
216
  RCT_CUSTOM_VIEW_PROPERTY(transform, CATransform3D, RCTView)
217
217
  {
218
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
218
+ #if TARGET_OS_OSX // [TODO(macOS GH#460)
219
+ CATransform3D transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
220
+ [view setTransform3D:transform];
221
+ [view setNeedsDisplay];
222
+ #else // ]TODO(macOS GH#460)]
219
223
  view.layer.transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
220
- // Enable edge antialiasing in perspective transforms
221
- view.layer.allowsEdgeAntialiasing = !(view.layer.transform.m34 == 0.0f);
222
- #elif TARGET_OS_OSX // [TODO(macOS GH#774)
223
- view.layer.sublayerTransform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.sublayerTransform;
224
- // TODO: Improve this by enabling edge antialiasing only for transforms with rotation or skewing
225
- view.layer.edgeAntialiasingMask = !CATransform3DIsIdentity(view.layer.sublayerTransform) ? kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge : 0;
226
- #endif // ]TODO(macOS GH#774)
224
+ // Enable edge antialiasing in rotation, skew, or perspective transforms
225
+ view.layer.allowsEdgeAntialiasing =
226
+ view.layer.transform.m12 != 0.0f || view.layer.transform.m21 != 0.0f || view.layer.transform.m34 != 0.0f;
227
+ #endif // [TODO(macOS GH#460)]
227
228
  }
228
229
 
229
230
  RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView)
@@ -30,6 +30,7 @@
30
30
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
31
31
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
32
32
 
33
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
33
34
  - (NSString *)description
34
35
  {
35
36
  NSString *superDescription = [super description];
@@ -44,6 +45,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
44
45
  NSStringFromUIEdgeInsets([self safeAreaInsetsIfSupportedAndEnabled]),
45
46
  NSStringFromUIEdgeInsets(_currentSafeAreaInsets)];
46
47
  }
48
+ #endif // TODO(macOS GH#774)
47
49
 
48
50
  - (BOOL)isSupportedByOS
49
51
  {
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.0.0-d7a11eac4
1
+ VERSION_NAME=0.0.0-dd6d6b77d
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -22,5 +22,5 @@ public class ReactNativeVersion {
22
22
  "major", 0,
23
23
  "minor", 0,
24
24
  "patch", 0,
25
- "prerelease", "d7a11eac4");
25
+ "prerelease", "dd6d6b77d");
26
26
  }
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 0;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "d7a11eac4";
25
+ std::string_view Prerelease = "dd6d6b77d";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "devtools-protocol": "0.0.730699",
36
- "yargs": "^14.2.0"
36
+ "yargs": "^15.3.0"
37
37
  },
38
38
  "beachball": {
39
39
  "shouldPublish": false