react-native-macos 0.64.24 → 0.64.28

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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ * @flow
9
+ */
10
+
11
+ 'use strict';
12
+ import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
13
+ import type {ViewProps} from '../Components/View/ViewPropTypes';
14
+
15
+ const {requireNativeComponent} = require('react-native');
16
+
17
+ type NativeProps = $ReadOnly<{|
18
+ ...ViewProps,
19
+ |}>;
20
+
21
+ const RCTAddressSanitizerCrash: HostComponent<NativeProps> = requireNativeComponent<NativeProps>(
22
+ 'RCTAddressSanitizerCrash',
23
+ );
24
+
25
+ module.exports = RCTAddressSanitizerCrash;
@@ -29,6 +29,11 @@ import type {
29
29
  LayoutEvent,
30
30
  MouseEvent,
31
31
  PressEvent,
32
+ // [TODO(macOS GH#774)
33
+ FocusEvent,
34
+ BlurEvent,
35
+ KeyEvent,
36
+ // ]TODO(macOS GH#774)
32
37
  } from '../../Types/CoreEventTypes';
33
38
  import type {DraggedTypesType} from '../View/DraggedType'; // TODO(macOS GH#774)
34
39
  import View from '../View/View';
@@ -130,6 +135,40 @@ type Props = $ReadOnly<{|
130
135
  */
131
136
  onPressOut?: ?(event: PressEvent) => void,
132
137
 
138
+ // [TODO(macOS GH#774)
139
+ /**
140
+ * Called after the element is focused.
141
+ */
142
+ onFocus?: ?(event: FocusEvent) => mixed,
143
+
144
+ /**
145
+ * Called after the element loses focus.
146
+ */
147
+ onBlur?: ?(event: BlurEvent) => mixed,
148
+
149
+ /**
150
+ * Called after a key down event is detected.
151
+ */
152
+ onKeyDown?: ?(event: KeyEvent) => mixed,
153
+
154
+ /**
155
+ * Called after a key up event is detected.
156
+ */
157
+ onKeyUp?: ?(event: KeyEvent) => mixed,
158
+
159
+ /**
160
+ * Array of keys to receive key down events for
161
+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
162
+ */
163
+ validKeysDown?: ?Array<string>,
164
+
165
+ /**
166
+ * Array of keys to receive key up events for
167
+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
168
+ */
169
+ validKeysUp?: ?Array<string>,
170
+ // ]TODO(macOS GH#774)
171
+
133
172
  /**
134
173
  * Either view styles or a function that receives a boolean reflecting whether
135
174
  * the component is currently pressed and returns view styles.
@@ -197,6 +236,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
197
236
  onPress,
198
237
  onPressIn,
199
238
  onPressOut,
239
+ // [TODO(macOS GH#774)
240
+ onFocus,
241
+ onBlur,
242
+ onKeyDown,
243
+ onKeyUp,
244
+ // ]TODO(macOS GH#774)
200
245
  pressRetentionOffset,
201
246
  style,
202
247
  testOnly_pressed,
@@ -256,6 +301,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
256
301
  onPressOut(event);
257
302
  }
258
303
  },
304
+ // [TODO(macOS GH#774)
305
+ onFocus,
306
+ onBlur,
307
+ onKeyDown,
308
+ onKeyUp,
309
+ // ]TODO(macOS GH#774)
259
310
  }),
260
311
  [
261
312
  android_disableSound,
@@ -271,6 +322,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
271
322
  onPress,
272
323
  onPressIn,
273
324
  onPressOut,
325
+ // [TODO(macOS GH#774)
326
+ onFocus,
327
+ onBlur,
328
+ onKeyDown,
329
+ onKeyUp,
330
+ // ]TODO(macOS GH#774)
274
331
  pressRetentionOffset,
275
332
  setPressed,
276
333
  unstable_pressDelay,
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 64,
15
- patch: 24,
15
+ patch: 28,
16
16
  prerelease: null,
17
17
  };
@@ -475,21 +475,6 @@ export default class Pressability {
475
475
  },
476
476
  };
477
477
 
478
- const keyEventHandlers = {
479
- onKeyDown: (event: KeyEvent): void => {
480
- const {onKeyDown} = this._config;
481
- if (onKeyDown != null) {
482
- onKeyDown(event);
483
- }
484
- },
485
- onKeyUp: (event: KeyEvent): void => {
486
- const {onKeyUp} = this._config;
487
- if (onKeyUp != null) {
488
- onKeyUp(event);
489
- }
490
- },
491
- };
492
-
493
478
  const responderEventHandlers = {
494
479
  onStartShouldSetResponder: (): boolean => {
495
480
  const {disabled} = this._config;
@@ -644,11 +629,28 @@ export default class Pressability {
644
629
  },
645
630
  };
646
631
 
632
+ // [TODO(macOS GH#774)
633
+ const keyboardEventHandlers = {
634
+ onKeyDown: (event: KeyEvent): void => {
635
+ const {onKeyDown} = this._config;
636
+ if (onKeyDown != null) {
637
+ onKeyDown(event);
638
+ }
639
+ },
640
+ onKeyUp: (event: KeyEvent): void => {
641
+ const {onKeyUp} = this._config;
642
+ if (onKeyUp != null) {
643
+ onKeyUp(event);
644
+ }
645
+ },
646
+ };
647
+ // ]TODO(macOS GH#774)
648
+
647
649
  return {
648
650
  ...focusEventHandlers,
649
651
  ...responderEventHandlers,
650
652
  ...mouseEventHandlers,
651
- ...keyEventHandlers,
653
+ ...keyboardEventHandlers, // [TODO(macOS GH#774)]
652
654
  };
653
655
  }
654
656
 
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(64),
26
- RCTVersionPatch: @(24),
26
+ RCTVersionPatch: @(28),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -0,0 +1,12 @@
1
+ /*
2
+ *
3
+ * This source code is licensed under the MIT license found in the
4
+ * LICENSE file in the root directory of this source tree.
5
+ */
6
+
7
+ #import <React/RCTUIKit.h>
8
+ #import <React/RCTBridge.h>
9
+
10
+ @interface RCTAddressSanitizerCrashManager : NSObject <RCTBridgeModule>
11
+
12
+ @end
@@ -0,0 +1,18 @@
1
+ //
2
+ // RCTAddressSanitizerCrashManager.mm
3
+ // Pods
4
+ //
5
+
6
+ #import "RCTAddressSanitizerCrashManager.h"
7
+
8
+ @implementation RCTAddressSanitizerCrashManager
9
+
10
+ RCT_EXPORT_MODULE(ASANCrash)
11
+
12
+ RCT_EXPORT_METHOD(invokeMemoryCrash) {
13
+ char *s = (char*)malloc(100);
14
+ free(s);
15
+ strcpy(s, "Hello world!"); // AddressSanitizer: heap-use-after-free
16
+ }
17
+
18
+ @end
@@ -32,12 +32,16 @@
32
32
 
33
33
  - (void)show:(BOOL)animated completion:(void (^)(void))completion
34
34
  {
35
- [self.alertWindow makeKeyAndVisible];
36
-
37
35
  // [TODO(macOS GH#774)
36
+ // Call self.alertWindow to ensure that it gets populated
37
+ UIWindow *alertWindow = self.alertWindow;
38
+
38
39
  // If the window is tracked by our application then it will show the alert
39
- if ([[[UIApplication sharedApplication] windows] containsObject:self.alertWindow]) {
40
- [self.alertWindow.rootViewController presentViewController:self animated:animated completion:completion];
40
+ if ([[[UIApplication sharedApplication] windows] containsObject:alertWindow]) {
41
+ // On iOS 14, makeKeyAndVisible should only be called if alertWindow is tracked by the application.
42
+ // Later versions of iOS appear to already do this check for us behind the scenes.
43
+ [alertWindow makeKeyAndVisible];
44
+ [alertWindow.rootViewController presentViewController:self animated:animated completion:completion];
41
45
  } else {
42
46
  // When using Scenes, we must present the alert from a view controller associated with a window in the Scene. A fresh window (i.e. _alertWindow) cannot show the alert.
43
47
  [RCTPresentedViewController() presentViewController:self animated:animated completion:completion];
@@ -1,5 +1,5 @@
1
1
  # TODO :: ANDROID patch to stay consistant with the npm version.
2
- VERSION_NAME=0.64.24
2
+ VERSION_NAME=0.64.28
3
3
  GROUP=com.facebook.react
4
4
 
5
5
  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", 64,
20
- "patch", 24,
20
+ "patch", 28,
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 = 64;
20
- int32_t Patch = 24;
20
+ int32_t Patch = 28;
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.64.24",
3
+ "version": "0.64.28",
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.1",
14
- "react-native": "0.64.24"
14
+ "react-native": "0.64.28"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",