react-native-macos 0.66.18 → 0.66.19

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: 18,
15
+ patch: 19,
16
16
  prerelease: null,
17
17
  };
@@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
36
36
  - (BOOL)textInputShouldHandleDeleteBackward:(id<RCTBackedTextInputViewProtocol>)sender; // Return `YES` to have the deleteBackward event handled normally. Return `NO` to disallow it and handle it yourself. TODO(OSS Candidate ISS#2710739)
37
37
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
38
38
  - (BOOL)textInputShouldHandleDeleteForward:(id<RCTBackedTextInputViewProtocol>)sender; // Return `YES` to have the deleteForward event handled normally. Return `NO` to disallow it and handle it yourself.
39
+
40
+ - (void)textInputDidCancel; // Handle `Escape` key press.
39
41
  #endif // ]TODO(macOS GH#774)
40
42
 
41
43
  @optional
@@ -187,17 +187,17 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
187
187
 
188
188
  - (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector
189
189
  {
190
+ id<RCTBackedTextInputDelegate> textInputDelegate = [_backedTextInputView textInputDelegate];
190
191
  BOOL commandHandled = NO;
191
192
  // enter/return
192
193
  if (commandSelector == @selector(insertNewline:) || commandSelector == @selector(insertNewlineIgnoringFieldEditor:)) {
193
194
  [self textFieldDidEndEditingOnExit];
194
- if ([[_backedTextInputView textInputDelegate] textInputShouldReturn]) {
195
+ if ([textInputDelegate textInputShouldReturn]) {
195
196
  [[_backedTextInputView window] makeFirstResponder:nil];
196
197
  }
197
198
  commandHandled = YES;
198
199
  //backspace
199
200
  } else if (commandSelector == @selector(deleteBackward:)) {
200
- id<RCTBackedTextInputDelegate> textInputDelegate = [_backedTextInputView textInputDelegate];
201
201
  if (textInputDelegate != nil && ![textInputDelegate textInputShouldHandleDeleteBackward:_backedTextInputView]) {
202
202
  commandHandled = YES;
203
203
  } else {
@@ -214,7 +214,13 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
214
214
  //paste
215
215
  } else if (commandSelector == @selector(paste:)) {
216
216
  _backedTextInputView.textWasPasted = YES;
217
- }
217
+ //escape
218
+ } else if (commandSelector == @selector(cancelOperation:)) {
219
+ [textInputDelegate textInputDidCancel];
220
+ [[_backedTextInputView window] makeFirstResponder:nil];
221
+ commandHandled = YES;
222
+ }
223
+
218
224
  return commandHandled;
219
225
  }
220
226
 
@@ -411,6 +417,12 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
411
417
  //deleteForward
412
418
  } else if (commandSelector == @selector(deleteForward:)) {
413
419
  commandHandled = textInputDelegate != nil && ![textInputDelegate textInputShouldHandleDeleteForward:_backedTextInputView];
420
+ //escape
421
+ } else if (commandSelector == @selector(cancelOperation:)) {
422
+ [textInputDelegate textInputDidCancel];
423
+ [_backedTextInputView.window makeFirstResponder:nil];
424
+ commandHandled = YES;
425
+
414
426
  }
415
427
 
416
428
  return commandHandled;
@@ -569,6 +569,15 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
569
569
  - (BOOL)textInputShouldHandleDeleteForward:(__unused id)sender {
570
570
  return YES;
571
571
  }
572
+
573
+ - (void)textInputDidCancel {
574
+ [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress
575
+ reactTag:self.reactTag
576
+ text:nil
577
+ key:@"Escape"
578
+ eventCount:_nativeEventCount];
579
+ [self textInputDidEndEditing];
580
+ }
572
581
  #endif // ]TODO(macOS GH#774)
573
582
 
574
583
  - (void)updateLocalData
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(66),
26
- RCTVersionPatch: @(18),
26
+ RCTVersionPatch: @(19),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.18
1
+ VERSION_NAME=0.66.19
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", 18,
20
+ "patch", 19,
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 = 18;
20
+ int32_t Patch = 19;
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.18",
3
+ "version": "0.66.19",
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.18"
14
+ "react-native": "0.66.19"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",