react-native-macos 0.0.0-23149044f → 0.0.0-2e9dd121f

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.
@@ -25,10 +25,9 @@ import type {
25
25
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
26
26
  import usePressability from '../../Pressability/usePressability';
27
27
  import {normalizeRect, type RectOrSize} from '../../StyleSheet/Rect';
28
- import type {ColorValue} from '../../StyleSheet/StyleSheet';
29
28
  import type {
30
29
  LayoutEvent,
31
- MouseEvent, // TODO(macOS GH#774)
30
+ MouseEvent,
32
31
  PressEvent,
33
32
  } from '../../Types/CoreEventTypes';
34
33
  import type {DraggedTypesType} from '../View/DraggedType'; // TODO(macOS GH#774)
@@ -65,6 +64,16 @@ type Props = $ReadOnly<{|
65
64
  */
66
65
  children: React.Node | ((state: StateCallbackType) => React.Node),
67
66
 
67
+ /**
68
+ * Duration to wait after hover in before calling `onHoverIn`.
69
+ */
70
+ delayHoverIn?: ?number,
71
+
72
+ /**
73
+ * Duration to wait after hover out before calling `onHoverOut`.
74
+ */
75
+ delayHoverOut?: ?number,
76
+
68
77
  /**
69
78
  * Duration (in milliseconds) from `onPressIn` before `onLongPress` is called.
70
79
  */
@@ -91,6 +100,16 @@ type Props = $ReadOnly<{|
91
100
  */
92
101
  onLayout?: ?(event: LayoutEvent) => void,
93
102
 
103
+ /**
104
+ * Called when the hover is activated to provide visual feedback.
105
+ */
106
+ onHoverIn?: ?(event: MouseEvent) => mixed,
107
+
108
+ /**
109
+ * Called when the hover is deactivated to undo visual feedback.
110
+ */
111
+ onHoverOut?: ?(event: MouseEvent) => mixed,
112
+
94
113
  /**
95
114
  * Called when a long-tap gesture is detected.
96
115
  */
@@ -146,8 +165,6 @@ type Props = $ReadOnly<{|
146
165
  acceptsFirstMouse?: ?boolean,
147
166
  enableFocusRing?: ?boolean,
148
167
  tooltip?: ?string,
149
- onMouseEnter?: (event: MouseEvent) => void,
150
- onMouseLeave?: (event: MouseEvent) => void,
151
168
  onDragEnter?: (event: MouseEvent) => void,
152
169
  onDragLeave?: (event: MouseEvent) => void,
153
170
  onDrop?: (event: MouseEvent) => void,
@@ -167,11 +184,13 @@ function Pressable(props: Props, forwardedRef): React.Node {
167
184
  android_disableSound,
168
185
  android_ripple,
169
186
  children,
187
+ delayHoverIn,
188
+ delayHoverOut,
170
189
  delayLongPress,
171
190
  disabled,
172
191
  focusable,
173
- onMouseEnter, // [TODO(macOS GH#774)
174
- onMouseLeave, // ]TODO(macOS GH#774)
192
+ onHoverIn,
193
+ onHoverOut,
175
194
  onLongPress,
176
195
  onPress,
177
196
  onPressIn,
@@ -208,10 +227,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
208
227
  hitSlop,
209
228
  pressRectOffset: pressRetentionOffset,
210
229
  android_disableSound,
230
+ delayHoverIn,
231
+ delayHoverOut,
211
232
  delayLongPress,
212
233
  delayPressIn: unstable_pressDelay,
213
- onHoverIn: onMouseEnter, // [TODO(macOS GH#774)
214
- onHoverOut: onMouseLeave, // ]TODO(macOS GH#774)
234
+ onHoverIn,
235
+ onHoverOut,
215
236
  onLongPress,
216
237
  onPress,
217
238
  onPressIn(event: PressEvent): void {
@@ -237,11 +258,13 @@ function Pressable(props: Props, forwardedRef): React.Node {
237
258
  [
238
259
  android_disableSound,
239
260
  android_rippleConfig,
261
+ delayHoverIn,
262
+ delayHoverOut,
240
263
  delayLongPress,
241
264
  disabled,
242
265
  hitSlop,
243
- onMouseEnter, // [TODO(macOS GH#774)
244
- onMouseLeave, // ]TODO(macOS GH#774)
266
+ onHoverIn,
267
+ onHoverOut,
245
268
  onLongPress,
246
269
  onPress,
247
270
  onPressIn,
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 0,
15
15
  patch: 0,
16
- prerelease: '23149044f',
16
+ prerelease: '2e9dd121f',
17
17
  };
@@ -966,15 +966,13 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
966
966
  UIImage *image = RCTDecodeImageWithData(data, size, scale, resizeMode);
967
967
 
968
968
  #if !TARGET_OS_OSX && RCT_DEV // TODO(macOS GH#774)
969
- if ([[self->_bridge devSettings] isDevModeEnabled]) { // TODO(OSS Candidate ISS#2710739)
970
- CGSize imagePixelSize = RCTSizeInPixels(image.size, UIImageGetScale(image)); // TODO(macOS GH#774)
971
- CGSize screenPixelSize = RCTSizeInPixels(RCTScreenSize(), RCTScreenScale());
972
- if (imagePixelSize.width * imagePixelSize.height >
973
- screenPixelSize.width * screenPixelSize.height) {
974
- RCTLogInfo(@"[PERF ASSETS] Loading image at size %@, which is larger "
975
- "than the screen size %@", NSStringFromCGSize(imagePixelSize),
976
- NSStringFromCGSize(screenPixelSize));
977
- }
969
+ CGSize imagePixelSize = RCTSizeInPixels(image.size, UIImageGetScale(image)); // TODO(macOS GH#774)
970
+ CGSize screenPixelSize = RCTSizeInPixels(RCTScreenSize(), RCTScreenScale());
971
+ if (imagePixelSize.width * imagePixelSize.height >
972
+ screenPixelSize.width * screenPixelSize.height) {
973
+ RCTLogInfo(@"[PERF ASSETS] Loading image at size %@, which is larger "
974
+ "than the screen size %@", NSStringFromCGSize(imagePixelSize),
975
+ NSStringFromCGSize(screenPixelSize));
978
976
  }
979
977
  #endif
980
978
 
@@ -42,8 +42,7 @@
42
42
  #if DEBUG
43
43
  #define RCT_DEV 1
44
44
  #else
45
- // Dev Mode is now enabled or disabled at runtime via the -[RCTDevSettings isDevModeEnabled] property
46
- #define RCT_DEV 1
45
+ #define RCT_DEV 0
47
46
  #endif
48
47
  #endif
49
48
 
@@ -12,6 +12,6 @@
12
12
  @protocol RCTJSInvokerModule
13
13
 
14
14
  @property (nonatomic, copy, nonnull) void (^invokeJS)(NSString * _Nullable module, NSString * _Nullable method, NSArray * _Nullable args); // TODO(macOS GH#774)
15
- @property (nonatomic, copy) void (^invokeJSWithModuleDotMethod)(NSString * _Nullable moduleDotMethod, NSArray * _Nullable args);
15
+ @property (nonatomic, copy, nonnull) void (^invokeJSWithModuleDotMethod)(NSString * _Nullable moduleDotMethod, NSArray * _Nullable args); // TODO(macOS GH#774)
16
16
 
17
17
  @end
@@ -467,9 +467,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
467
467
  {
468
468
  NSMenu *menu = nil;
469
469
  #if __has_include("RCTDevMenu.h") && RCT_DEV
470
- if ([[_bridge devSettings] isDevModeEnabled]) {
471
- menu = [[_bridge devMenu] menu];
472
- }
470
+ menu = [[_bridge devMenu] menu];
473
471
  #endif
474
472
  if (menu == nil) {
475
473
  menu = [super menuForEvent:event];
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(0),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"23149044f",
27
+ RCTVersionPrerelease: @"2e9dd121f",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -112,15 +112,15 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
112
112
  UIColor *tintColor = [RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];
113
113
 
114
114
  if (controller == nil) {
115
- RCTLogError(@"Tried to display action sheet but there is no application window. options: %@", @{
116
- @"title" : title,
117
- @"message" : message,
118
- @"options" : buttons,
115
+ RCTLogError(@"Tried to display action sheet but there is no application window. options: %@", @{ /* // [ TODO(macOS GH#774): nil check our dict values before inserting them or we may crash */
116
+ @"title" : title ?: [NSNull null],
117
+ @"message" : message ?: [NSNull null],
118
+ @"options" : buttons ?: [NSNull null],
119
119
  @"cancelButtonIndex" : @(cancelButtonIndex),
120
- @"destructiveButtonIndices" : destructiveButtonIndices,
121
- @"anchor" : anchor,
122
- @"tintColor" : tintColor,
123
- });
120
+ @"destructiveButtonIndices" : destructiveButtonIndices ?: [NSNull null],
121
+ @"anchor" : anchor ?: [NSNull null],
122
+ @"tintColor" : tintColor ?: [NSNull null],
123
+ }); /* // TODO(macOS GH#774): nil check our dict values before inserting them or we may crash ] */
124
124
  return;
125
125
  }
126
126
  #endif // TODO(macOS GH#774)
@@ -71,7 +71,7 @@ RCT_EXPORT_MODULE()
71
71
  name:RCTJavaScriptDidFailToLoadNotification
72
72
  object:nil];
73
73
 
74
- if ([[bridge devSettings] isDevModeEnabled] && bridge.loading) { // TODO(OSS Candidate ISS#2710739)
74
+ if (bridge.loading) {
75
75
  [self showWithURL:bridge.bundleURL];
76
76
  }
77
77
  }
@@ -339,7 +339,7 @@ RCT_EXPORT_METHOD(hide)
339
339
  + (void)setEnabled:(BOOL)enabled
340
340
  {
341
341
  }
342
- - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor
342
+ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColor:(RCTUIColor *)backgroundColor // TODO(macOS GH#774) RCTUIColor
343
343
  {
344
344
  }
345
345
  - (void)showMessage:(NSString *)message withColor:(NSNumber *)color withBackgroundColor:(NSNumber *)backgroundColor
@@ -511,7 +511,6 @@ RCT_EXPORT_METHOD(show)
511
511
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
512
512
  - (NSMenu *)menu
513
513
  {
514
- NSMenu *menu = nil;
515
514
  if ([_bridge.devSettings isSecondaryClickToShowDevMenuEnabled]) {
516
515
  NSMenu *menu = nil;
517
516
  if (_bridge) {
@@ -41,14 +41,6 @@
41
41
 
42
42
  - (instancetype)initWithDataSource:(id<RCTDevSettingsDataSource>)dataSource;
43
43
 
44
- // [TODO(OSS Candidate ISS#2710739)
45
- /**
46
- * Whether Dev Mode is enabled meaning the development tools
47
- * such as the debug executors, dev menu, red box, etc. are available.
48
- */
49
- @property (nonatomic, assign, setter=setDevModeEnabled:) BOOL isDevModeEnabled;
50
- // ]TODO(OSS Candidate ISS#2710739)
51
-
52
44
  @property (nonatomic, readonly) BOOL isHotLoadingAvailable;
53
45
  @property (nonatomic, readonly) BOOL isLiveReloadAvailable;
54
46
  @property (nonatomic, readonly) BOOL isRemoteDebuggingAvailable;
@@ -250,18 +250,6 @@ RCT_EXPORT_MODULE()
250
250
  #endif // RCT_ENABLE_INSPECTOR
251
251
  }
252
252
 
253
- // [TODO(OSS Candidate ISS#2710739)
254
- RCT_EXPORT_METHOD(setDevModeEnabled:(BOOL)enabled)
255
- {
256
- [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingDevModeEnabled];
257
- }
258
-
259
- - (BOOL)isDevModeEnabled
260
- {
261
- return [[self settingForKey:kRCTDevSettingDevModeEnabled] boolValue];
262
- }
263
- // ]TODO(OSS Candidate ISS#2710739)
264
-
265
253
  - (BOOL)isRemoteDebuggingAvailable
266
254
  {
267
255
  if (RCTTurboModuleEnabled()) {
@@ -470,7 +470,7 @@ struct RCTInstanceCallback : public InstanceCallback {
470
470
  #if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
471
471
  // [TODO(OSS Candidate ISS#2710739)
472
472
  // Note: RCTDevLoadingView should have been loaded at this point, so no need to allow lazy loading.
473
- if ([weakSelf isValid] && [[weakSelf devSettings] isDevModeEnabled]) {
473
+ if ([weakSelf isValid]) {
474
474
  id<RCTDevLoadingViewProtocol> loadingView = [weakSelf moduleForName:@"DevLoadingView"
475
475
  lazilyLoadIfNecessary:YES];
476
476
  [loadingView updateProgress:progressData];
@@ -673,9 +673,7 @@ struct RCTInstanceCallback : public InstanceCallback {
673
673
  // This can only be false if the bridge was invalidated before startup completed
674
674
  if (_reactInstance) {
675
675
  #if RCT_DEV
676
- if ([[self devSettings] isDevModeEnabled]) { // TODO(OSS Candidate ISS#2710739)
677
- executorFactory = std::make_shared<GetDescAdapter>(self, executorFactory);
678
- } // TODO(OSS Candidate ISS#2710739)
676
+ executorFactory = std::make_shared<GetDescAdapter>(self, executorFactory);
679
677
  #endif
680
678
 
681
679
  [self _initializeBridgeLocked:executorFactory];
@@ -1037,9 +1035,7 @@ struct RCTInstanceCallback : public InstanceCallback {
1037
1035
  [self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:completion];
1038
1036
  }
1039
1037
 
1040
- if (self.devSettings.isDevModeEnabled) { // TODO(OSS Candidate ISS#2710739)
1041
- [self.devSettings setupHMRClientWithBundleURL:self.bundleURL];
1042
- }
1038
+ [self.devSettings setupHMRClientWithBundleURL:self.bundleURL];
1043
1039
  }
1044
1040
 
1045
1041
  #if RCT_DEV_MENU
@@ -16,7 +16,7 @@
16
16
 
17
17
  @property (nonatomic, weak) RCTBridge * _Nullable bridge; // TODO(macOS GH#774)
18
18
 
19
- - (instancetype)initWithDisabledObservation;
19
+ - (instancetype _Nullable)initWithDisabledObservation; // TODO(macOS GH#774)
20
20
 
21
21
  /**
22
22
  * Override this method to return an array of supported event names. Attempting
@@ -1,5 +1,5 @@
1
1
  # TODO :: ANDROID patch to stay consistant with the npm version.
2
- VERSION_NAME=0.0.0-23149044f
2
+ VERSION_NAME=0.0.0-2e9dd121f
3
3
  GROUP=com.facebook.react
4
4
 
5
5
  POM_NAME=ReactNative
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 0,
20
20
  "patch", 0,
21
- "prerelease", "23149044f");
21
+ "prerelease", "2e9dd121f");
22
22
  }
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 0;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "23149044f";
21
+ std::string_view Prerelease = "2e9dd121f";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.0.0-23149044f",
3
+ "version": "0.0.0-2e9dd121f",
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.0.0-23149044f"
14
+ "react-native": "0.0.0-2e9dd121f"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.8.4",