react-native-macos 0.68.59 → 0.68.61

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.
@@ -16,6 +16,6 @@
16
16
  exports.version = {
17
17
  major: 0,
18
18
  minor: 68,
19
- patch: 59,
19
+ patch: 61,
20
20
  prerelease: null,
21
21
  };
@@ -628,12 +628,35 @@ export default class Pressability {
628
628
  if (onKeyDown != null) {
629
629
  onKeyDown(event);
630
630
  }
631
+ // Pressables on macOS should respond to the enter/return and spacebar keys.
632
+ // The keyDown event triggers a press event as well as the pressIn effect mimicking a native control behavior.
633
+ if (
634
+ (event.nativeEvent.key === 'Enter' ||
635
+ event.nativeEvent.key === ' ') &&
636
+ event.defaultPrevented !== true
637
+ ) {
638
+ const {onPress, onPressIn} = this._config;
639
+ // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
640
+ onPressIn && onPressIn(event);
641
+ // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
642
+ onPress && onPress(event);
643
+ }
631
644
  },
632
645
  onKeyUp: (event: KeyEvent): void => {
633
646
  const {onKeyUp} = this._config;
634
647
  if (onKeyUp != null) {
635
648
  onKeyUp(event);
636
649
  }
650
+ // The keyUp event triggers the pressOut effect.
651
+ if (
652
+ (event.nativeEvent.key === 'Enter' ||
653
+ event.nativeEvent.key === ' ') &&
654
+ event.defaultPrevented !== true
655
+ ) {
656
+ const {onPressOut} = this._config;
657
+ // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
658
+ onPressOut && onPressOut(event);
659
+ }
637
660
  },
638
661
  };
639
662
  // ]TODO(macOS GH#774)
@@ -224,8 +224,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)
224
224
  #else // [TODO(macOS GH#774)
225
225
  NSEvent *nativeTouch = _nativeTouches[touchIndex];
226
226
  CGPoint location = nativeTouch.locationInWindow;
227
- CGPoint rootViewLocation = CGPointMake(location.x, CGRectGetHeight(self.view.window.frame) - location.y);
228
- CGPoint touchViewLocation = rootViewLocation;
227
+ RCTAssert(_cachedRootView, @"We were unable to find a root view for the touch");
228
+ CGPoint rootViewLocation = [_cachedRootView.window.contentView convertPoint:location toView:_cachedRootView];
229
+ NSView *touchView = _touchViews[touchIndex];
230
+ CGPoint touchViewLocation = [touchView convertPoint:location fromView:nil];
229
231
  #endif // ]TODO(macOS GH#774)
230
232
 
231
233
  NSMutableDictionary *reactTouch = _reactTouches[touchIndex];
@@ -27,7 +27,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
27
27
  __rnVersion = @{
28
28
  RCTVersionMajor: @(0),
29
29
  RCTVersionMinor: @(68),
30
- RCTVersionPatch: @(59),
30
+ RCTVersionPatch: @(61),
31
31
  RCTVersionPrerelease: [NSNull null],
32
32
  };
33
33
  });
@@ -1632,6 +1632,12 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1632
1632
  NSArray<NSString *> *validKeys = keyDown ? self.validKeysDown : self.validKeysUp;
1633
1633
  NSString *key = [RCTViewKeyboardEvent keyFromEvent:event];
1634
1634
 
1635
+ // If the view is focusable and the component didn't explicity set the validKeysDown or Up,
1636
+ // allow enter/return and spacebar key events to mimic the behavior of native controls.
1637
+ if (self.focusable && validKeys == nil) {
1638
+ validKeys = @[@"Enter", @" "];
1639
+ }
1640
+
1635
1641
  // Only post events for keys we care about
1636
1642
  if (![validKeys containsObject:key]) {
1637
1643
  return nil;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.68.59
1
+ VERSION_NAME=0.68.61
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -21,6 +21,6 @@ public class ReactNativeVersion {
21
21
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
22
22
  "major", 0,
23
23
  "minor", 68,
24
- "patch", 59,
24
+ "patch", 61,
25
25
  "prerelease", null);
26
26
  }
@@ -21,7 +21,7 @@ namespace facebook::react {
21
21
  constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 68;
24
- int32_t Patch = 59;
24
+ int32_t Patch = 61;
25
25
  std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.68.59",
3
+ "version": "0.68.61",
4
4
  "bin": "./cli.js",
5
5
  "description": "React Native for macOS",
6
6
  "license": "MIT",
package/template/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
- ruby '3.0.4'
4
+ ruby '3.0.5'
5
5
 
6
6
  gem 'cocoapods', '~> 1.11', '>= 1.11.2'
@@ -65,8 +65,8 @@ GEM
65
65
  httpclient (2.8.3)
66
66
  i18n (1.12.0)
67
67
  concurrent-ruby (~> 1.0)
68
- json (2.6.2)
69
- minitest (5.16.3)
68
+ json (2.6.3)
69
+ minitest (5.17.0)
70
70
  molinillo (0.8.0)
71
71
  nanaimo (0.3.0)
72
72
  nap (1.1.0)
@@ -94,7 +94,7 @@ DEPENDENCIES
94
94
  cocoapods (~> 1.11, >= 1.11.2)
95
95
 
96
96
  RUBY VERSION
97
- ruby 3.0.4p208
97
+ ruby 3.0.5p211
98
98
 
99
99
  BUNDLED WITH
100
100
  2.3.26
@@ -1 +1 @@
1
- 3.0.4
1
+ 3.0.5
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "react": "17.0.2",
15
- "react-native-macos": "0.68.59"
15
+ "react-native-macos": "0.68.61"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/core": "^7.12.9",