react-native-macos 0.66.4 → 0.66.8

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.
@@ -27,6 +27,11 @@ import type {
27
27
  LayoutEvent,
28
28
  MouseEvent,
29
29
  PressEvent,
30
+ // [TODO(macOS GH#774)
31
+ FocusEvent,
32
+ BlurEvent,
33
+ KeyEvent,
34
+ // ]TODO(macOS GH#774)
30
35
  } from '../../Types/CoreEventTypes';
31
36
  import type {DraggedTypesType} from '../View/DraggedType'; // TODO(macOS GH#774)
32
37
  import View from '../View/View';
@@ -134,6 +139,40 @@ type Props = $ReadOnly<{|
134
139
  */
135
140
  onPressOut?: ?(event: PressEvent) => mixed,
136
141
 
142
+ // [TODO(macOS GH#774)
143
+ /**
144
+ * Called after the element is focused.
145
+ */
146
+ onFocus?: ?(event: FocusEvent) => mixed,
147
+
148
+ /**
149
+ * Called after the element loses focus.
150
+ */
151
+ onBlur?: ?(event: BlurEvent) => mixed,
152
+
153
+ /**
154
+ * Called after a key down event is detected.
155
+ */
156
+ onKeyDown?: ?(event: KeyEvent) => mixed,
157
+
158
+ /**
159
+ * Called after a key up event is detected.
160
+ */
161
+ onKeyUp?: ?(event: KeyEvent) => mixed,
162
+
163
+ /**
164
+ * Array of keys to receive key down events for
165
+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
166
+ */
167
+ validKeysDown?: ?Array<string>,
168
+
169
+ /**
170
+ * Array of keys to receive key up events for
171
+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
172
+ */
173
+ validKeysUp?: ?Array<string>,
174
+ // ]TODO(macOS GH#774)
175
+
137
176
  /**
138
177
  * Either view styles or a function that receives a boolean reflecting whether
139
178
  * the component is currently pressed and returns view styles.
@@ -200,6 +239,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
200
239
  onPress,
201
240
  onPressIn,
202
241
  onPressOut,
242
+ // [TODO(macOS GH#774)
243
+ onFocus,
244
+ onBlur,
245
+ onKeyDown,
246
+ onKeyUp,
247
+ // ]TODO(macOS GH#774)
203
248
  pressRetentionOffset,
204
249
  style,
205
250
  testOnly_pressed,
@@ -266,6 +311,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
266
311
  onPressOut(event);
267
312
  }
268
313
  },
314
+ // [TODO(macOS GH#774)
315
+ onFocus,
316
+ onBlur,
317
+ onKeyDown,
318
+ onKeyUp,
319
+ // ]TODO(macOS GH#774)
269
320
  }),
270
321
  [
271
322
  android_disableSound,
@@ -282,6 +333,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
282
333
  onPress,
283
334
  onPressIn,
284
335
  onPressOut,
336
+ // [TODO(macOS GH#774)
337
+ onFocus,
338
+ onBlur,
339
+ onKeyDown,
340
+ onKeyUp,
341
+ // ]TODO(macOS GH#774)
285
342
  pressRetentionOffset,
286
343
  setPressed,
287
344
  unstable_pressDelay,
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 66,
15
- patch: 4,
15
+ patch: 8,
16
16
  prerelease: null,
17
17
  };
@@ -466,21 +466,6 @@ export default class Pressability {
466
466
  },
467
467
  };
468
468
 
469
- const keyEventHandlers = {
470
- onKeyDown: (event: KeyEvent): void => {
471
- const {onKeyDown} = this._config;
472
- if (onKeyDown != null) {
473
- onKeyDown(event);
474
- }
475
- },
476
- onKeyUp: (event: KeyEvent): void => {
477
- const {onKeyUp} = this._config;
478
- if (onKeyUp != null) {
479
- onKeyUp(event);
480
- }
481
- },
482
- };
483
-
484
469
  const responderEventHandlers = {
485
470
  onStartShouldSetResponder: (): boolean => {
486
471
  const {disabled} = this._config;
@@ -636,11 +621,28 @@ export default class Pressability {
636
621
  },
637
622
  };
638
623
 
624
+ // [TODO(macOS GH#774)
625
+ const keyboardEventHandlers = {
626
+ onKeyDown: (event: KeyEvent): void => {
627
+ const {onKeyDown} = this._config;
628
+ if (onKeyDown != null) {
629
+ onKeyDown(event);
630
+ }
631
+ },
632
+ onKeyUp: (event: KeyEvent): void => {
633
+ const {onKeyUp} = this._config;
634
+ if (onKeyUp != null) {
635
+ onKeyUp(event);
636
+ }
637
+ },
638
+ };
639
+ // ]TODO(macOS GH#774)
640
+
639
641
  return {
640
642
  ...focusEventHandlers,
641
643
  ...responderEventHandlers,
642
644
  ...mouseEventHandlers,
643
- ...keyEventHandlers,
645
+ ...keyboardEventHandlers, // [TODO(macOS GH#774)]
644
646
  };
645
647
  }
646
648
 
@@ -104,7 +104,13 @@
104
104
  NSString *superDescription = super.description;
105
105
  NSRange semicolonRange = [superDescription rangeOfString:@";"];
106
106
  NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@; text: %@", self.reactTag, _textStorage.string];
107
- return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
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
+ }
113
+ // TODO(macOS GH#774)]
108
114
  }
109
115
 
110
116
  - (void)setSelectable:(BOOL)selectable
@@ -42,6 +42,7 @@ export const NativeText: HostComponent<NativeTextProps> = (createReactNativeComp
42
42
  onInlineViewLayout: true,
43
43
  dataDetectorType: true,
44
44
  android_hyphenationFrequency: true,
45
+ tooltip: true, // [TODO(macOS GH#774)]
45
46
  },
46
47
  directEventTypes: {
47
48
  topTextLayout: {
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(66),
26
- RCTVersionPatch: @(4),
26
+ RCTVersionPatch: @(8),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1393,19 +1393,6 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1393
1393
  return ([self focusable] && [NSApp isFullKeyboardAccessEnabled]) || [super acceptsFirstResponder];
1394
1394
  }
1395
1395
 
1396
- - (BOOL)performKeyEquivalent:(NSEvent *)theEvent
1397
- {
1398
- if (self.onClick != nil &&
1399
- [self focusable] &&
1400
- [[self window] firstResponder] == self) {
1401
- if ([[theEvent characters] isEqualToString:@" "] || [[theEvent characters] isEqualToString:@"\r"]) {
1402
- self.onClick(nil);
1403
- return YES;
1404
- }
1405
- }
1406
- return [super performKeyEquivalent:theEvent];
1407
- }
1408
-
1409
1396
  - (void)updateTrackingAreas
1410
1397
  {
1411
1398
  if (_trackingArea) {
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.4
1
+ VERSION_NAME=0.66.8
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", 4,
20
+ "patch", 8,
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 = 4;
20
+ int32_t Patch = 8;
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.4",
3
+ "version": "0.66.8",
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.4"
14
+ "react-native": "0.66.8"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",