react-native-macos 0.66.21 → 0.66.22

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.
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 66,
15
- patch: 21,
15
+ patch: 22,
16
16
  prerelease: null,
17
17
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(66),
26
- RCTVersionPatch: @(21),
26
+ RCTVersionPatch: @(22),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -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
  }
@@ -1169,6 +1172,19 @@ static CGFloat RCTDefaultIfNegativeTo(CGFloat defaultValue, CGFloat x)
1169
1172
  backgroundColor = _backgroundColor.CGColor;
1170
1173
  #endif
1171
1174
 
1175
+ #if TARGET_OS_OSX // [TODO(macOS GH#1035)
1176
+ CATransform3D transform = [self transform3D];
1177
+ CGPoint anchorPoint = [layer anchorPoint];
1178
+ if (CGPointEqualToPoint(anchorPoint, CGPointZero) && !CATransform3DEqualToTransform(transform, CATransform3DIdentity)) {
1179
+ // https://developer.apple.com/documentation/quartzcore/calayer/1410817-anchorpoint
1180
+ // This compensates for the fact that layer.anchorPoint is {0, 0} instead of {0.5, 0.5} on macOS for some reason.
1181
+ CATransform3D originAdjust = CATransform3DTranslate(CATransform3DIdentity, self.frame.size.width / 2, self.frame.size.height / 2, 0);
1182
+ transform = CATransform3DConcat(CATransform3DConcat(CATransform3DInvert(originAdjust), transform), originAdjust);
1183
+ // Enable edge antialiasing in perspective transforms
1184
+ [layer setAllowsEdgeAntialiasing:!(transform.m34 == 0.0f)];
1185
+ }
1186
+ [layer setTransform:transform];
1187
+ #endif // ]TODO(macOS GH#1035)
1172
1188
  if (useIOSBorderRendering) {
1173
1189
  layer.cornerRadius = cornerRadii.topLeft;
1174
1190
  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)
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.21
1
+ VERSION_NAME=0.66.22
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 66,
20
- "patch", 21,
20
+ "patch", 22,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 66;
20
- int32_t Patch = 21;
20
+ int32_t Patch = 22;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.66.21",
3
+ "version": "0.66.22",
4
4
  "bin": "./cli.js",
5
5
  "description": "[Microsoft Fork] A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "17.0.2",
14
- "react-native": "0.66.21"
14
+ "react-native": "0.66.22"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",