react-native-macos 0.66.44 → 0.66.47

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: 44,
15
+ patch: 47,
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: @(44),
26
+ RCTVersionPatch: @(47),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -14,8 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
14
14
  @property (nonatomic, assign) CGFloat horizontalScrollerHeight;
15
15
  @property (nonatomic, assign) CGFloat verticalScrollerWidth;
16
16
 
17
- - (instancetype)initWithVerticalScroller:(nullable NSScroller *)verticalScroller
18
- horizontalScroller:(nullable NSScroller *)horizontalScroller;
17
+ - (instancetype)initWithVerticalScrollerWidth:(CGFloat)verticalScrollerWidth
18
+ horizontalScrollerHeight:(CGFloat)horizontalScrollerHeight;
19
19
 
20
20
  @end
21
21
 
@@ -9,12 +9,12 @@
9
9
 
10
10
  @implementation RCTScrollContentLocalData
11
11
 
12
- - (instancetype)initWithVerticalScroller:(NSScroller *)verticalScroller
13
- horizontalScroller:(NSScroller *)horizontalScroller
12
+ - (instancetype)initWithVerticalScrollerWidth:(CGFloat)verticalScrollerWidth
13
+ horizontalScrollerHeight:(CGFloat)horizontalScrollerHeight;
14
14
  {
15
15
  if (self = [super init]) {
16
- _verticalScrollerWidth = NSWidth([verticalScroller frame]);
17
- _horizontalScrollerHeight = NSHeight([horizontalScroller frame]);
16
+ _verticalScrollerWidth = verticalScrollerWidth;
17
+ _horizontalScrollerHeight = horizontalScrollerHeight;
18
18
  }
19
19
  return self;
20
20
  }
@@ -18,15 +18,11 @@
18
18
  #import "RCTScrollView.h"
19
19
 
20
20
  @implementation RCTScrollContentView
21
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
22
- {
23
- BOOL _hasHorizontalScroller;
24
- BOOL _hasVerticalScroller;
25
- }
26
- #endif // ]TODO(macOS GH#774)
27
21
 
28
22
  - (void)reactSetFrame:(CGRect)frame
29
23
  {
24
+ [super reactSetFrame:frame];
25
+
30
26
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
31
27
  RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview;
32
28
  #else // [TODO(macOS GH#774)
@@ -34,8 +30,6 @@
34
30
  RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview.superview;
35
31
  #endif // ]TODO(macOS GH#774)
36
32
 
37
- [super reactSetFrame:frame];
38
-
39
33
  if (!scrollView) {
40
34
  return;
41
35
  }
@@ -43,7 +37,6 @@
43
37
  RCTAssert([scrollView isKindOfClass:[RCTScrollView class]], @"Unexpected view hierarchy of RCTScrollView component.");
44
38
 
45
39
  [scrollView updateContentSizeIfNeeded];
46
-
47
40
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
48
41
  // On macOS scroll indicators may float over the content view like they do in iOS
49
42
  // or depending on system preferences they may be outside of the content view
@@ -52,21 +45,14 @@
52
45
  // the contents will overflow causing the scroll indicators to appear unnecessarily.
53
46
  NSScrollView *platformScrollView = [scrollView scrollView];
54
47
  if ([platformScrollView scrollerStyle] == NSScrollerStyleLegacy) {
55
- const BOOL nextHasHorizontalScroller = [platformScrollView hasHorizontalScroller];
56
- const BOOL nextHasVerticalScroller = [platformScrollView hasVerticalScroller];
57
-
58
- if (_hasHorizontalScroller != nextHasHorizontalScroller ||
59
- _hasVerticalScroller != nextHasVerticalScroller) {
60
-
61
- _hasHorizontalScroller = nextHasHorizontalScroller;
62
- _hasVerticalScroller = nextHasVerticalScroller;
63
-
64
- RCTScrollContentLocalData *localData =
65
- [[RCTScrollContentLocalData alloc]
66
- initWithVerticalScroller:[platformScrollView verticalScroller]
67
- horizontalScroller:[platformScrollView horizontalScroller]];
68
- [[[scrollView bridge] uiManager] setLocalData:localData forView:self];
69
- }
48
+ CGFloat horizontalScrollerHeight = [platformScrollView hasHorizontalScroller] ? NSHeight([[platformScrollView horizontalScroller] frame]) : 0;
49
+ CGFloat verticalScrollerWidth = [platformScrollView hasVerticalScroller] ? NSWidth([[platformScrollView verticalScroller] frame]) : 0;
50
+
51
+ RCTScrollContentLocalData *localData =
52
+ [[RCTScrollContentLocalData alloc]
53
+ initWithVerticalScrollerWidth:horizontalScrollerHeight
54
+ horizontalScrollerHeight:verticalScrollerWidth];
55
+ [[[scrollView bridge] uiManager] setLocalData:localData forView:self];
70
56
  }
71
57
  #endif // ]TODO(macOS GH#774)
72
58
  }
@@ -56,6 +56,7 @@
56
56
  self.scrollEnabled = YES;
57
57
  self.hasHorizontalScroller = YES;
58
58
  self.hasVerticalScroller = YES;
59
+ self.autohidesScrollers = YES;
59
60
  self.panGestureRecognizer = [[NSPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleCustomPan:)];
60
61
  #else // ]TODO(macOS GH#774)
61
62
  [self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];
@@ -642,11 +643,6 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(
642
643
  [self react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];
643
644
  _lastClippedToRect = bounds;
644
645
  }
645
-
646
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
647
- [[self scrollView] setHasHorizontalScroller:[self isHorizontal:_scrollView]];
648
- [[self scrollView] setHasVerticalScroller:[self isVertical:_scrollView]];
649
- #endif // ]TODO(macOS GH#774)
650
646
  }
651
647
 
652
648
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.44
1
+ VERSION_NAME=0.66.47
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", 44,
20
+ "patch", 47,
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 = 44;
20
+ int32_t Patch = 47;
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.44",
3
+ "version": "0.66.47",
4
4
  "bin": "./cli.js",
5
5
  "description": "React Native for macOS",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "17.0.2",
14
- "react-native": "0.66.44"
14
+ "react-native": "0.66.47"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",