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.
- package/Libraries/Components/Pressable/Pressable.js +33 -10
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTImageLoader.mm +7 -9
- package/React/Base/RCTDefines.h +1 -2
- package/React/Base/RCTJSInvokerModule.h +1 -1
- package/React/Base/RCTRootView.m +1 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTActionSheetManager.mm +8 -8
- package/React/CoreModules/RCTDevLoadingView.mm +2 -2
- package/React/CoreModules/RCTDevMenu.mm +0 -1
- package/React/CoreModules/RCTDevSettings.h +0 -8
- package/React/CoreModules/RCTDevSettings.mm +0 -12
- package/React/CxxBridge/RCTCxxBridge.mm +3 -7
- package/React/Modules/RCTEventEmitter.h +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +1 -1
- package/template/package.json +1 -1
|
@@ -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,
|
|
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
|
-
|
|
174
|
-
|
|
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
|
|
214
|
-
onHoverOut
|
|
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
|
-
|
|
244
|
-
|
|
266
|
+
onHoverIn,
|
|
267
|
+
onHoverOut,
|
|
245
268
|
onLongPress,
|
|
246
269
|
onPress,
|
|
247
270
|
onPressIn,
|
|
@@ -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
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
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
|
|
package/React/Base/RCTDefines.h
CHANGED
|
@@ -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
|
package/React/Base/RCTRootView.m
CHANGED
|
@@ -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
|
-
|
|
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];
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -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 (
|
|
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:(
|
|
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
|
|
@@ -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]
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/package.json
CHANGED