react-native-macos 0.64.14 → 0.64.18
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 -8
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTActionSheetManager.mm +8 -9
- package/React/CoreModules/RCTAlertController.m +10 -1
- package/React/Modules/MacOS/RCTAccessibilityManager.m +2 -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
|
*/
|
|
@@ -167,11 +186,13 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
167
186
|
android_disableSound,
|
|
168
187
|
android_ripple,
|
|
169
188
|
children,
|
|
189
|
+
delayHoverIn,
|
|
190
|
+
delayHoverOut,
|
|
170
191
|
delayLongPress,
|
|
171
192
|
disabled,
|
|
172
193
|
focusable,
|
|
173
|
-
|
|
174
|
-
|
|
194
|
+
onHoverIn,
|
|
195
|
+
onHoverOut,
|
|
175
196
|
onLongPress,
|
|
176
197
|
onPress,
|
|
177
198
|
onPressIn,
|
|
@@ -208,10 +229,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
208
229
|
hitSlop,
|
|
209
230
|
pressRectOffset: pressRetentionOffset,
|
|
210
231
|
android_disableSound,
|
|
232
|
+
delayHoverIn,
|
|
233
|
+
delayHoverOut,
|
|
211
234
|
delayLongPress,
|
|
212
235
|
delayPressIn: unstable_pressDelay,
|
|
213
|
-
onHoverIn
|
|
214
|
-
onHoverOut
|
|
236
|
+
onHoverIn,
|
|
237
|
+
onHoverOut,
|
|
215
238
|
onLongPress,
|
|
216
239
|
onPress,
|
|
217
240
|
onPressIn(event: PressEvent): void {
|
|
@@ -237,11 +260,13 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
237
260
|
[
|
|
238
261
|
android_disableSound,
|
|
239
262
|
android_rippleConfig,
|
|
263
|
+
delayHoverIn,
|
|
264
|
+
delayHoverOut,
|
|
240
265
|
delayLongPress,
|
|
241
266
|
disabled,
|
|
242
267
|
hitSlop,
|
|
243
|
-
|
|
244
|
-
|
|
268
|
+
onHoverIn,
|
|
269
|
+
onHoverOut,
|
|
245
270
|
onLongPress,
|
|
246
271
|
onPress,
|
|
247
272
|
onPressIn,
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -118,16 +118,15 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
|
|
118
118
|
UIColor *tintColor = [RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];
|
|
119
119
|
|
|
120
120
|
if (controller == nil) {
|
|
121
|
-
RCTLogError(@"Tried to display action sheet but there is no application window. options: %@", @{
|
|
122
|
-
@"title" : title,
|
|
123
|
-
@"message" : message,
|
|
124
|
-
@"options" : buttons,
|
|
121
|
+
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 */
|
|
122
|
+
@"title" : title ?: [NSNull null],
|
|
123
|
+
@"message" : message ?: [NSNull null],
|
|
124
|
+
@"options" : buttons ?: [NSNull null],
|
|
125
125
|
@"cancelButtonIndex" : @(cancelButtonIndex),
|
|
126
|
-
@"destructiveButtonIndices" : destructiveButtonIndices,
|
|
127
|
-
@"anchor" : anchor,
|
|
128
|
-
@"tintColor" : tintColor,
|
|
129
|
-
|
|
130
|
-
});
|
|
126
|
+
@"destructiveButtonIndices" : destructiveButtonIndices ?: [NSNull null],
|
|
127
|
+
@"anchor" : anchor ?: [NSNull null],
|
|
128
|
+
@"tintColor" : tintColor ?: [NSNull null],
|
|
129
|
+
}); /* // TODO(macOS GH#774): nil check our dict values before inserting them or we may crash ] */
|
|
131
130
|
return;
|
|
132
131
|
}
|
|
133
132
|
#endif // TODO(macOS GH#774)
|
|
@@ -33,7 +33,16 @@
|
|
|
33
33
|
- (void)show:(BOOL)animated completion:(void (^)(void))completion
|
|
34
34
|
{
|
|
35
35
|
[self.alertWindow makeKeyAndVisible];
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
// [TODO(macOS GH#774)
|
|
38
|
+
// 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];
|
|
41
|
+
} else {
|
|
42
|
+
// 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
|
+
[RCTPresentedViewController() presentViewController:self animated:animated completion:completion];
|
|
44
|
+
}
|
|
45
|
+
// TODO(macOS GH#774)]
|
|
37
46
|
}
|
|
38
47
|
#endif // ]TODO(macOS GH#774)
|
|
39
48
|
|
|
@@ -99,9 +99,10 @@ RCT_EXPORT_METHOD(getCurrentVoiceOverState:(RCTResponseSenderBlock)callback
|
|
|
99
99
|
|
|
100
100
|
RCT_EXPORT_METHOD(setAccessibilityFocus:(nonnull NSNumber *)reactTag)
|
|
101
101
|
{
|
|
102
|
-
|
|
102
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
103
103
|
NSView *view = [self.bridge.uiManager viewForReactTag:reactTag];
|
|
104
104
|
[[view window] makeFirstResponder:view];
|
|
105
|
+
NSAccessibilityPostNotification(view, NSAccessibilityLayoutChangedNotification);
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
|
package/package.json
CHANGED