File tree 7 files changed +31
-0
lines changed
7 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,16 @@ type Props = $ReadOnly<{|
232
232
*/
233
233
enableFocusRing ?: ?boolean ,
234
234
235
+ /**
236
+ * Specifies whether the view ensures it is vibrant on top of other content.
237
+ * For more information, see the following apple documentation:
238
+ * https://developer.apple.com/documentation/appkit/nsview/1483793-allowsvibrancy
239
+ * https://developer.apple.com/documentation/appkit/nsvisualeffectview#1674177
240
+ *
241
+ * @platform macos
242
+ */
243
+ allowsVibrancy ?: ?boolean ,
244
+
235
245
/**
236
246
* Specifies the Tooltip for the Pressable.
237
247
* @platform macos
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ export type DraggedTypesType = DraggedType | DraggedType[];
173
173
174
174
export interface ViewPropsMacOS {
175
175
acceptsFirstMouse ?: boolean | undefined ;
176
+ allowsVibrancy ?: boolean | undefined ;
176
177
mouseDownCanMoveWindow ?: boolean | undefined ;
177
178
enableFocusRing ?: boolean | undefined ;
178
179
onMouseEnter ?: ( ( event : MouseEvent ) => void ) | undefined ;
Original file line number Diff line number Diff line change @@ -553,6 +553,16 @@ type MacOSViewProps = $ReadOnly<{|
553
553
*/
554
554
mouseDownCanMoveWindow ?: ?boolean ,
555
555
556
+ /**
557
+ * Specifies whether the view ensures it is vibrant on top of other content.
558
+ * For more information, see the following apple documentation:
559
+ * https://developer.apple.com/documentation/appkit/nsview/1483793-allowsvibrancy
560
+ * https://developer.apple.com/documentation/appkit/nsvisualeffectview#1674177
561
+ *
562
+ * @platform macos
563
+ */
564
+ allowsVibrancy ?: ?boolean ,
565
+
556
566
/**
557
567
* Specifies whether system focus ring should be drawn when the view has keyboard focus.
558
568
*
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ const directEventTypes = {
48
48
const validAttributesForNonEventProps = {
49
49
acceptsFirstMouse : true ,
50
50
accessibilityTraits : true ,
51
+ allowsVibrancy : true ,
51
52
cursor : true ,
52
53
draggedTypes : true ,
53
54
enableFocusRing : true ,
Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
156
156
157
157
@property (nonatomic , assign ) CATransform3D transform3D;
158
158
159
+ // `allowsVibrancy` is readonly on NSView, so let's create a new property to make it assignable
160
+ // that we can set through JS and the getter for `allowsVibrancy` can read in RCTView.
161
+ @property (nonatomic , assign ) BOOL allowsVibrancyInternal;
162
+
159
163
@property (nonatomic , copy ) RCTDirectEventBlock onMouseEnter;
160
164
@property (nonatomic , copy ) RCTDirectEventBlock onMouseLeave;
161
165
@property (nonatomic , copy ) RCTDirectEventBlock onDragEnter;
Original file line number Diff line number Diff line change @@ -1519,6 +1519,9 @@ - (void)setMouseDownCanMoveWindow:(BOOL)mouseDownCanMoveWindow{
1519
1519
_mouseDownCanMoveWindow = mouseDownCanMoveWindow;
1520
1520
}
1521
1521
1522
+ - (BOOL )allowsVibrancy {
1523
+ return _allowsVibrancyInternal;
1524
+ }
1522
1525
1523
1526
- (NSDictionary *)locationInfoFromEvent : (NSEvent *)event
1524
1527
{
Original file line number Diff line number Diff line change @@ -430,6 +430,8 @@ - (RCTShadowView *)shadowView
430
430
431
431
RCT_EXPORT_VIEW_PROPERTY (mouseDownCanMoveWindow, BOOL )
432
432
433
+ RCT_REMAP_VIEW_PROPERTY(allowsVibrancy, allowsVibrancyInternal, BOOL )
434
+
433
435
RCT_CUSTOM_VIEW_PROPERTY(focusable, BOOL , RCTView)
434
436
{
435
437
if ([view respondsToSelector: @selector (setFocusable: )]) {
You can’t perform that action at this time.
0 commit comments