react-native-macos 0.71.13 → 0.71.14
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 +59 -3
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.d.ts +1 -0
- package/Libraries/Components/View/ViewPropTypes.js +13 -4
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.macos.js +1 -0
- package/React/Base/RCTUIKit.h +3 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/macOS/RCTUIKit.m +10 -0
- package/React/Views/RCTView.m +11 -0
- package/React/Views/RCTViewManager.m +5 -0
- 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
|
@@ -196,12 +196,66 @@ type Props = $ReadOnly<{|
|
|
|
196
196
|
*/
|
|
197
197
|
validKeysUp?: ?Array<string>,
|
|
198
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Specifies whether the view should receive the mouse down event when the
|
|
201
|
+
* containing window is in the background.
|
|
202
|
+
*
|
|
203
|
+
* @platform macos
|
|
204
|
+
*/
|
|
199
205
|
acceptsFirstMouse?: ?boolean,
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Specifies whether clicking and dragging the view can move the window. This is useful
|
|
209
|
+
* to disable in Button like components like Pressable where mouse the user should still
|
|
210
|
+
* be able to click and drag off the view to cancel the click without accidentally moving the window.
|
|
211
|
+
*
|
|
212
|
+
* @platform macos
|
|
213
|
+
*/
|
|
214
|
+
mouseDownCanMoveWindow?: ?boolean,
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Specifies whether system focus ring should be drawn when the view has keyboard focus.
|
|
218
|
+
*
|
|
219
|
+
* @platform macos
|
|
220
|
+
*/
|
|
200
221
|
enableFocusRing?: ?boolean,
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Specifies the Tooltip for the Pressable.
|
|
225
|
+
* @platform macos
|
|
226
|
+
*/
|
|
201
227
|
tooltip?: ?string,
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Fired when a file is dragged into the Pressable via the mouse.
|
|
231
|
+
*
|
|
232
|
+
* @platform macos
|
|
233
|
+
*/
|
|
202
234
|
onDragEnter?: (event: MouseEvent) => void,
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Fired when a file is dragged out of the Pressable via the mouse.
|
|
238
|
+
*
|
|
239
|
+
* @platform macos
|
|
240
|
+
*/
|
|
203
241
|
onDragLeave?: (event: MouseEvent) => void,
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Fired when a file is dropped on the Pressable via the mouse.
|
|
245
|
+
*
|
|
246
|
+
* @platform macos
|
|
247
|
+
*/
|
|
204
248
|
onDrop?: (event: MouseEvent) => void,
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* The types of dragged files that the Pressable will accept.
|
|
252
|
+
*
|
|
253
|
+
* Possible values for `draggedTypes` are:
|
|
254
|
+
*
|
|
255
|
+
* - `'fileUrl'`
|
|
256
|
+
*
|
|
257
|
+
* @platform macos
|
|
258
|
+
*/
|
|
205
259
|
draggedTypes?: ?DraggedTypesType,
|
|
206
260
|
// macOS]
|
|
207
261
|
|
|
@@ -250,8 +304,6 @@ type Props = $ReadOnly<{|
|
|
|
250
304
|
* LTI update could not be added via codemod */
|
|
251
305
|
function Pressable(props: Props, forwardedRef): React.Node {
|
|
252
306
|
const {
|
|
253
|
-
acceptsFirstMouse, // [macOS]
|
|
254
|
-
enableFocusRing, // [macOS]
|
|
255
307
|
accessible,
|
|
256
308
|
accessibilityState,
|
|
257
309
|
'aria-live': ariaLive,
|
|
@@ -282,6 +334,9 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
282
334
|
onBlur,
|
|
283
335
|
onKeyDown,
|
|
284
336
|
onKeyUp,
|
|
337
|
+
acceptsFirstMouse,
|
|
338
|
+
mouseDownCanMoveWindow,
|
|
339
|
+
enableFocusRing,
|
|
285
340
|
// macOS]
|
|
286
341
|
pressRetentionOffset,
|
|
287
342
|
style,
|
|
@@ -322,7 +377,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
322
377
|
const restPropsWithDefaults: React.ElementConfig<typeof View> = {
|
|
323
378
|
...restProps,
|
|
324
379
|
...android_rippleConfig?.viewProps,
|
|
325
|
-
acceptsFirstMouse: acceptsFirstMouse !== false && !disabled, // [macOS
|
|
380
|
+
acceptsFirstMouse: acceptsFirstMouse !== false && !disabled, // [macOS]
|
|
381
|
+
mouseDownCanMoveWindow: false, // [macOS]
|
|
326
382
|
enableFocusRing: enableFocusRing !== false && !disabled,
|
|
327
383
|
accessible: accessible !== false,
|
|
328
384
|
accessibilityViewIsModal:
|
|
@@ -173,6 +173,7 @@ export type DraggedTypesType = DraggedType | DraggedType[];
|
|
|
173
173
|
|
|
174
174
|
export interface ViewPropsMacOS {
|
|
175
175
|
acceptsFirstMouse?: boolean | undefined;
|
|
176
|
+
mouseDownCanMoveWindow?: boolean | undefined;
|
|
176
177
|
enableFocusRing?: boolean | undefined;
|
|
177
178
|
onMouseEnter?: ((event: MouseEvent) => void) | undefined;
|
|
178
179
|
onMouseLeave?: ((event: MouseEvent) => void) | undefined;
|
|
@@ -474,14 +474,14 @@ type IOSViewProps = $ReadOnly<{|
|
|
|
474
474
|
// [macOS
|
|
475
475
|
type MacOSViewProps = $ReadOnly<{|
|
|
476
476
|
/**
|
|
477
|
-
* Fired when a dragged
|
|
477
|
+
* Fired when a file is dragged into the view via the mouse.
|
|
478
478
|
*
|
|
479
479
|
* @platform macos
|
|
480
480
|
*/
|
|
481
481
|
onDragEnter?: (event: MouseEvent) => void,
|
|
482
482
|
|
|
483
483
|
/**
|
|
484
|
-
* Fired when a dragged
|
|
484
|
+
* Fired when a file is dragged out of the view via the mouse.
|
|
485
485
|
*
|
|
486
486
|
* @platform macos
|
|
487
487
|
*/
|
|
@@ -509,14 +509,23 @@ type MacOSViewProps = $ReadOnly<{|
|
|
|
509
509
|
acceptsFirstMouse?: ?boolean,
|
|
510
510
|
|
|
511
511
|
/**
|
|
512
|
-
* Specifies whether
|
|
512
|
+
* Specifies whether clicking and dragging the view can move the window. This is useful
|
|
513
|
+
* to disable in Button like components like Pressable where mouse the user should still
|
|
514
|
+
* be able to click and drag off the view to cancel the click without accidentally moving the window.
|
|
515
|
+
*
|
|
516
|
+
* @platform macos
|
|
517
|
+
*/
|
|
518
|
+
mouseDownCanMoveWindow?: ?boolean,
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Specifies whether system focus ring should be drawn when the view has keyboard focus.
|
|
513
522
|
*
|
|
514
523
|
* @platform macos
|
|
515
524
|
*/
|
|
516
525
|
enableFocusRing?: ?boolean,
|
|
517
526
|
|
|
518
527
|
/**
|
|
519
|
-
*
|
|
528
|
+
* The types of dragged files that the view will accept.
|
|
520
529
|
*
|
|
521
530
|
* Possible values for `draggedTypes` are:
|
|
522
531
|
*
|
package/React/Base/RCTUIKit.h
CHANGED
|
@@ -405,6 +405,9 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path);
|
|
|
405
405
|
* containing window is in the background.
|
|
406
406
|
*/
|
|
407
407
|
@property (nonatomic, assign) BOOL acceptsFirstMouse;
|
|
408
|
+
|
|
409
|
+
@property (nonatomic, assign) BOOL mouseDownCanMoveWindow;
|
|
410
|
+
|
|
408
411
|
/**
|
|
409
412
|
* Specifies whether the view participates in the key view loop as user tabs through different controls
|
|
410
413
|
* This is equivalent to acceptsFirstResponder on mac OS.
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -215,6 +215,7 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *bezierPath)
|
|
|
215
215
|
NSColor *_backgroundColor;
|
|
216
216
|
BOOL _clipsToBounds;
|
|
217
217
|
BOOL _userInteractionEnabled;
|
|
218
|
+
BOOL _mouseDownCanMoveWindow;
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
+ (NSSet<NSString *> *)keyPathsForValuesAffectingValueForKey:(NSString *)key
|
|
@@ -243,6 +244,7 @@ static RCTUIView *RCTUIViewCommonInit(RCTUIView *self)
|
|
|
243
244
|
self.wantsLayer = YES;
|
|
244
245
|
self->_userInteractionEnabled = YES;
|
|
245
246
|
self->_enableFocusRing = YES;
|
|
247
|
+
self->_mouseDownCanMoveWindow = YES;
|
|
246
248
|
}
|
|
247
249
|
return self;
|
|
248
250
|
}
|
|
@@ -288,6 +290,14 @@ static RCTUIView *RCTUIViewCommonInit(RCTUIView *self)
|
|
|
288
290
|
[self didMoveToWindow];
|
|
289
291
|
}
|
|
290
292
|
|
|
293
|
+
- (BOOL)mouseDownCanMoveWindow{
|
|
294
|
+
return _mouseDownCanMoveWindow;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
- (void)setMouseDownCanMoveWindow:(BOOL)mouseDownCanMoveWindow{
|
|
298
|
+
_mouseDownCanMoveWindow = mouseDownCanMoveWindow;
|
|
299
|
+
}
|
|
300
|
+
|
|
291
301
|
- (BOOL)isFlipped
|
|
292
302
|
{
|
|
293
303
|
return YES;
|
package/React/Views/RCTView.m
CHANGED
|
@@ -133,6 +133,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // [macOS]
|
|
|
133
133
|
#if TARGET_OS_OSX // [macOS
|
|
134
134
|
NSTrackingArea *_trackingArea;
|
|
135
135
|
BOOL _hasMouseOver;
|
|
136
|
+
BOOL _mouseDownCanMoveWindow;
|
|
136
137
|
#endif // macOS]
|
|
137
138
|
NSMutableDictionary<NSString *, NSDictionary *> *accessibilityActionsNameMap;
|
|
138
139
|
NSMutableDictionary<NSString *, NSDictionary *> *accessibilityActionsLabelMap;
|
|
@@ -172,6 +173,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // [macOS]
|
|
|
172
173
|
#if TARGET_OS_OSX // [macOS
|
|
173
174
|
_transform3D = CATransform3DIdentity;
|
|
174
175
|
_shadowColor = nil;
|
|
176
|
+
_mouseDownCanMoveWindow = YES;
|
|
175
177
|
#endif // macOS]
|
|
176
178
|
|
|
177
179
|
_backgroundColor = super.backgroundColor;
|
|
@@ -1495,6 +1497,15 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1495
1497
|
additionalData:nil];
|
|
1496
1498
|
}
|
|
1497
1499
|
|
|
1500
|
+
- (BOOL)mouseDownCanMoveWindow{
|
|
1501
|
+
return _mouseDownCanMoveWindow;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
- (void)setMouseDownCanMoveWindow:(BOOL)mouseDownCanMoveWindow{
|
|
1505
|
+
_mouseDownCanMoveWindow = mouseDownCanMoveWindow;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
|
|
1498
1509
|
- (NSDictionary*)locationInfoFromEvent:(NSEvent*)event
|
|
1499
1510
|
{
|
|
1500
1511
|
NSPoint locationInWindow = event.locationInWindow;
|
|
@@ -417,12 +417,16 @@ RCT_CUSTOM_VIEW_PROPERTY(acceptsFirstMouse, BOOL, RCTView)
|
|
|
417
417
|
view.acceptsFirstMouse = json ? [RCTConvert BOOL:json] : defaultView.acceptsFirstMouse;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
+
|
|
421
|
+
RCT_EXPORT_VIEW_PROPERTY(mouseDownCanMoveWindow, BOOL)
|
|
422
|
+
|
|
420
423
|
RCT_CUSTOM_VIEW_PROPERTY(focusable, BOOL, RCTView)
|
|
421
424
|
{
|
|
422
425
|
if ([view respondsToSelector:@selector(setFocusable:)]) {
|
|
423
426
|
view.focusable = json ? [RCTConvert BOOL:json] : defaultView.focusable;
|
|
424
427
|
}
|
|
425
428
|
}
|
|
429
|
+
|
|
426
430
|
RCT_CUSTOM_VIEW_PROPERTY(enableFocusRing, BOOL, RCTView)
|
|
427
431
|
{
|
|
428
432
|
if ([view respondsToSelector:@selector(setEnableFocusRing:)]) {
|
|
@@ -511,6 +515,7 @@ RCT_EXPORT_VIEW_PROPERTY(onKeyDown, RCTDirectEventBlock) // macOS keyboard event
|
|
|
511
515
|
RCT_EXPORT_VIEW_PROPERTY(onKeyUp, RCTDirectEventBlock) // macOS keyboard events
|
|
512
516
|
RCT_EXPORT_VIEW_PROPERTY(validKeysDown, NSArray<NSString*>)
|
|
513
517
|
RCT_EXPORT_VIEW_PROPERTY(validKeysUp, NSArray<NSString*>)
|
|
518
|
+
|
|
514
519
|
#endif // macOS]
|
|
515
520
|
|
|
516
521
|
#pragma mark - ShadowView properties
|
package/package.json
CHANGED