react-native-macos 0.73.35 → 0.73.36

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: 73,
15
- patch: 35,
15
+ patch: 36,
16
16
  prerelease: null,
17
17
  };
@@ -128,8 +128,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)
128
128
  #else // [macOS
129
129
  // -[NSView hitTest:] takes coordinates in a view's superview coordinate system.
130
130
  // The assumption here is that a RCTUIView/RCTSurfaceView will always have a superview.
131
- CGPoint touchLocation = [self.view.superview convertPoint:touch.locationInWindow fromView:nil];
132
- NSView *targetView = [self.view hitTest:touchLocation];
131
+ NSView *superview = [[self view] superview];
132
+ const CGPoint touchLocationInSuperview = [superview convertPoint:touch.locationInWindow fromView:nil];
133
+ NSView *targetView = [self.view hitTest:touchLocationInSuperview];
133
134
  // Don't record clicks on scrollbars.
134
135
  if ([targetView isKindOfClass:[NSScroller class]]) {
135
136
  continue;
@@ -148,8 +149,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)
148
149
  } else {
149
150
  _shouldSendMouseUpOnSystemBehalf = NO;
150
151
  }
151
- touchLocation = [targetView convertPoint:touchLocation fromView:self.view.superview];
152
-
152
+
153
153
  while (targetView) {
154
154
  BOOL isUserInteractionEnabled = NO;
155
155
  if ([((RCTUIView*)targetView) respondsToSelector:@selector(isUserInteractionEnabled)]) { // [macOS]
@@ -161,7 +161,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)
161
161
  targetView = targetView.superview;
162
162
  }
163
163
 
164
- NSNumber *reactTag = [targetView reactTagAtPoint:touchLocation];
164
+ const CGPoint touchLocationInSelf = [targetView convertPoint:touchLocationInSuperview fromView:self.view.superview];
165
+ NSNumber *reactTag = [targetView reactTagAtPoint:touchLocationInSelf];
165
166
  BOOL isUserInteractionEnabled = NO;
166
167
  if ([((RCTUIView*)targetView) respondsToSelector:@selector(isUserInteractionEnabled)]) { // [macOS]
167
168
  isUserInteractionEnabled = ((RCTUIView*)targetView).isUserInteractionEnabled; // [macOS]
@@ -487,7 +487,10 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path);
487
487
 
488
488
  NS_INLINE RCTPlatformView *RCTUIViewHitTestWithEvent(RCTPlatformView *view, CGPoint point, __unused UIEvent *__nullable event)
489
489
  {
490
- return [view hitTest:point];
490
+ // [macOS IMPORTANT -- point is in local coordinate space, but OSX expects super coordinate space for hitTest:
491
+ NSView *superview = [view superview];
492
+ NSPoint pointInSuperview = superview != nil ? [view convertPoint:point toView:superview] : point;
493
+ return [view hitTest:pointInSuperview];
491
494
  }
492
495
 
493
496
  BOOL RCTUIViewSetClipsToBounds(RCTPlatformView *view);
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(73),
26
- RCTVersionPatch: @(35),
26
+ RCTVersionPatch: @(36),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -491,7 +491,10 @@ static RCTUIView *RCTUIViewCommonInit(RCTUIView *self)
491
491
 
492
492
  - (NSView *)hitTest:(NSPoint)point
493
493
  {
494
- return [self hitTest:NSPointToCGPoint(point) withEvent:nil];
494
+ // IMPORTANT point is passed in super coordinates by OSX, but expected to be passed in local coordinates
495
+ NSView *superview = [self superview];
496
+ NSPoint pointInSelf = superview != nil ? [self convertPoint:point fromView:superview] : point;
497
+ return [self hitTest:pointInSelf withEvent:nil];
495
498
  }
496
499
 
497
500
  - (BOOL)wantsUpdateLayer
@@ -541,7 +544,11 @@ static RCTUIView *RCTUIViewCommonInit(RCTUIView *self)
541
544
 
542
545
  - (NSView *)hitTest:(CGPoint)point withEvent:(__unused UIEvent *)event
543
546
  {
544
- return self.userInteractionEnabled ? [super hitTest:NSPointFromCGPoint(point)] : nil;
547
+ // [macOS
548
+ // IMPORTANT point is expected to be passed in local coordinates, but OSX expects point to be super
549
+ NSView *superview = [self superview];
550
+ NSPoint pointInSuperview = superview != nil ? [self convertPoint:point toView:superview] : point;
551
+ return self.userInteractionEnabled ? [super hitTest:pointInSuperview] : nil;
545
552
  }
546
553
 
547
554
  - (BOOL)pointInside:(CGPoint)point withEvent:(__unused UIEvent *)event
@@ -252,16 +252,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
252
252
  // of the hit view will return YES from -pointInside:withEvent:). See:
253
253
  // - https://developer.apple.com/library/ios/qa/qa2013/qa1812.html
254
254
  for (RCTUIView *subview in [sortedSubviews reverseObjectEnumerator]) { // [macOS]
255
- CGPoint pointForHitTest = CGPointZero; // [macOS
256
- #if !TARGET_OS_OSX // [macOS]
257
- pointForHitTest = [subview convertPoint:point fromView:self];
258
- #else // [macOS
259
- if ([subview isKindOfClass:[RCTView class]]) {
260
- pointForHitTest = [subview convertPoint:point fromView:self];
261
- } else {
262
- pointForHitTest = point;
263
- }
264
- #endif // macOS]
255
+ CGPoint pointForHitTest = [subview convertPoint:point fromView:self];
265
256
  hitSubview = RCTUIViewHitTestWithEvent(subview, pointForHitTest, event); // macOS]
266
257
  if (hitSubview != nil) {
267
258
  break;
@@ -573,10 +573,13 @@ static __weak RCTPlatformView *_pendingFocusView; // [macOS]
573
573
 
574
574
  // [macOS
575
575
  #pragma mark - Hit testing
576
- #if TARGET_OS_OSX
576
+ #if TARGET_OS_OSX
577
+ // IMPORTANT -- point is in local coordinate space, unlike the hitTest: version from OSX which is in super's coordinate space
577
578
  - (RCTPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
578
579
  {
579
- return [self hitTest:point];
580
+ NSView *superview = [self superview];
581
+ NSPoint pointInSuper = superview != nil ? [self convertPoint:point toView:superview] : point;
582
+ return [self hitTest:pointInSuper];
580
583
  }
581
584
  #endif // macOS]
582
585
 
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.73.35
1
+ VERSION_NAME=0.73.36
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -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", 73,
20
- "patch", 35,
20
+ "patch", 36,
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 = 73;
20
- int32_t Patch = 35;
20
+ int32_t Patch = 36;
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.73.35",
3
+ "version": "0.73.36",
4
4
  "description": "React Native for macOS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,33 +0,0 @@
1
-
2
- /*
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by GenerateRCTThirdPartyFabricComponentsProviderH
9
- */
10
-
11
- #pragma GCC diagnostic push
12
- #pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
13
-
14
- #import <React/RCTComponentViewProtocol.h>
15
-
16
- #ifdef __cplusplus
17
- extern "C" {
18
- #endif
19
-
20
- Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
21
-
22
- #ifndef RCT_DYNAMIC_FRAMEWORKS
23
-
24
-
25
-
26
- #endif
27
-
28
- #ifdef __cplusplus
29
- }
30
- #endif
31
-
32
- #pragma GCC diagnostic pop
33
-
@@ -1,31 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by GenerateRCTThirdPartyFabricComponentsProviderCpp
9
- */
10
-
11
- // OSS-compatibility layer
12
-
13
- #import "RCTThirdPartyFabricComponentsProvider.h"
14
-
15
- #import <string>
16
- #import <unordered_map>
17
-
18
- Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name) {
19
- static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
20
- #ifndef RCT_DYNAMIC_FRAMEWORKS
21
-
22
- #endif
23
- };
24
-
25
- auto p = sFabricComponentsClassMap.find(name);
26
- if (p != sFabricComponentsClassMap.end()) {
27
- auto classFunc = p->second;
28
- return classFunc();
29
- }
30
- return nil;
31
- }