From f8e11682e9060534a4f8e921125fc908eeeb4e25 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Mon, 19 Apr 2021 13:01:44 -0600 Subject: [PATCH 01/17] add cursor prop to view --- .../Components/View/ReactNativeViewViewConfigMacOS.js | 5 +++-- React/Views/RCTView.h | 5 +++-- React/Views/RCTView.m | 8 ++++++++ React/Views/RCTViewManager.m | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js b/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js index 291bd7b7f9ae63..744c90d4dad957 100644 --- a/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +++ b/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js @@ -38,6 +38,7 @@ const ReactNativeViewViewConfigMacOS = { acceptsFirstMouse: true, acceptsKeyboardFocus: true, accessibilityTraits: true, + cursor: true, draggedTypes: true, enableFocusRing: true, onBlur: true, @@ -49,11 +50,11 @@ const ReactNativeViewViewConfigMacOS = { onFocus: true, onKeyDown: true, onKeyUp: true, - validKeysDown: true, - validKeysUp: true, onMouseEnter: true, onMouseLeave: true, tooltip: true, + validKeysDown: true, + validKeysUp: true, }, }; diff --git a/React/Views/RCTView.h b/React/Views/RCTView.h index 978e1acbf5cdee..b6d65e659a1026 100644 --- a/React/Views/RCTView.h +++ b/React/Views/RCTView.h @@ -128,6 +128,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; /** * macOS Properties */ +@property (nonatomic, copy) NSString *cursor; @property (nonatomic, copy) RCTDirectEventBlock onDoubleClick; @property (nonatomic, copy) RCTDirectEventBlock onClick; @property (nonatomic, copy) RCTDirectEventBlock onMouseEnter; @@ -139,8 +140,8 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; // Keyboarding events @property (nonatomic, copy) RCTDirectEventBlock onKeyDown; @property (nonatomic, copy) RCTDirectEventBlock onKeyUp; -@property (nonatomic, copy) NSArray *validKeysDown; -@property (nonatomic, copy) NSArray *validKeysUp; +@property (nonatomic, copy) NSArray *validKeysDown; +@property (nonatomic, copy) NSArray *validKeysUp; #endif // ]TODO(macOS ISS#2323203) /** diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 676659352fedd3..75abc0a491a609 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -1380,6 +1380,14 @@ - (void)drawFocusRingMask #pragma mark - macOS Event Handler #if TARGET_OS_OSX +- (void)resetCursorRects +{ + if (self.focusable || self.cursor != nil) { + NSString *cursorKey = self.cursor != nil ? [self.cursor stringByAppendingString:@"Cursor"] : @"pointingHandCursor"; + [self addCursorRect:self.bounds cursor:[NSCursor valueForKey:cursorKey]]; + } +} + - (void)setOnDoubleClick:(RCTDirectEventBlock)block { if (_onDoubleClick != block) { diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index fbc4f8c0487ab5..102f0db2bf7169 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -474,6 +474,7 @@ - (RCTShadowView *)shadowView #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) #pragma mark - macOS properties +RCT_EXPORT_VIEW_PROPERTY(cursor, NSString) RCT_EXPORT_VIEW_PROPERTY(onDoubleClick, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onClick, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onMouseEnter, RCTDirectEventBlock) From 24b77508fbf414a5a2d304fd0e6ec3a5439fcfa0 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Mon, 19 Apr 2021 15:30:35 -0600 Subject: [PATCH 02/17] add cursor to touchables --- Libraries/Components/Touchable/TouchableBounce.js | 1 + Libraries/Components/Touchable/TouchableHighlight.js | 1 + Libraries/Components/Touchable/TouchableOpacity.js | 1 + 3 files changed, 3 insertions(+) diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index cc0be04dd33e3b..bf8052180ed1d9 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -188,6 +188,7 @@ class TouchableBounce extends React.Component { !this.props.disabled, })} // macOS] + cursor={this.props.cursor} tooltip={this.props.tooltip} // TODO(macOS/win ISS#2323203) onMouseEnter={this.props.onMouseEnter} // [TODO(macOS ISS#2323203) onMouseLeave={this.props.onMouseLeave} diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 771c847e3e353c..ece3da9752d4f0 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -343,6 +343,7 @@ class TouchableHighlight extends React.Component { this.props.onPress !== undefined, })} // macOS] + cursor={this.props.cursor} tooltip={this.props.tooltip} // TODO(macOS/win ISS#2323203) onMouseEnter={this.props.onMouseEnter} // [TODO(macOS/win ISS#2323203) onMouseLeave={this.props.onMouseLeave} diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index f1441f27fa75e9..fdde35119a838a 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -294,6 +294,7 @@ class TouchableOpacity extends React.Component { this.props.onPress !== undefined, })} // macOS] + cursor={this.props.cursor} tooltip={this.props.tooltip} // TODO(macOS/win ISS#2323203) onMouseEnter={this.props.onMouseEnter} // [TODO(macOS ISS#2323203) onMouseLeave={this.props.onMouseLeave} From 9429d106500f7903cb9de132d38fc7fd139353ea Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Mon, 19 Apr 2021 23:19:18 -0600 Subject: [PATCH 03/17] use enum with as many css names and native names as we can support --- React/Views/RCTView.h | 26 ++++++++++++++- React/Views/RCTView.m | 62 ++++++++++++++++++++++++++++++++++-- React/Views/RCTViewManager.m | 54 ++++++++++++++++++++++++++++++- 3 files changed, 137 insertions(+), 5 deletions(-) diff --git a/React/Views/RCTView.h b/React/Views/RCTView.h index b6d65e659a1026..99dff7d4454fd4 100644 --- a/React/Views/RCTView.h +++ b/React/Views/RCTView.h @@ -16,6 +16,30 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; #endif // TODO(macOS ISS#2323203) +#if TARGET_OS_OSX +typedef NS_ENUM(NSInteger, RCTCursor) { + RCTCursorAuto, + RCTCursorArrow, + RCTCursorIBeam, + RCTCursorCrosshair, + RCTCursorClosedHand, + RCTCursorOpenHand, + RCTCursorPointingHand, + RCTCursorResizeLeft, + RCTCursorResizeRight, + RCTCursorResizeLeftRight, + RCTCursorResizeUp, + RCTCursorResizeDown, + RCTCursorResizeUpDown, + RCTCursorDisappearingItem, + RCTCursorIBeamCursorForVerticalLayout, + RCTCursorOperationNotAllowed, + RCTCursorDragLink, + RCTCursorDragCopy, + RCTCursorContextualMenu, +}; +#endif + @protocol RCTAutoInsetsProtocol; @class RCTView; @@ -128,7 +152,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; /** * macOS Properties */ -@property (nonatomic, copy) NSString *cursor; +@property (nonatomic, assign) RCTCursor cursor; @property (nonatomic, copy) RCTDirectEventBlock onDoubleClick; @property (nonatomic, copy) RCTDirectEventBlock onClick; @property (nonatomic, copy) RCTDirectEventBlock onMouseEnter; diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 75abc0a491a609..aa4440b4da6b76 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -1382,9 +1382,65 @@ - (void)drawFocusRingMask #if TARGET_OS_OSX - (void)resetCursorRects { - if (self.focusable || self.cursor != nil) { - NSString *cursorKey = self.cursor != nil ? [self.cursor stringByAppendingString:@"Cursor"] : @"pointingHandCursor"; - [self addCursorRect:self.bounds cursor:[NSCursor valueForKey:cursorKey]]; + switch (self.cursor) { + case RCTCursorAuto: + if (self.focusable) { + [self addCursorRect:self.bounds cursor:[NSCursor pointingHandCursor]]; + } + break; + case RCTCursorClosedHand: + [self addCursorRect:self.bounds cursor:[NSCursor closedHandCursor]]; + break; + case RCTCursorContextualMenu: + [self addCursorRect:self.bounds cursor:[NSCursor contextualMenuCursor]]; + break; + case RCTCursorCrosshair: + [self addCursorRect:self.bounds cursor:[NSCursor crosshairCursor]]; + break; + case RCTCursorDisappearingItem: + [self addCursorRect:self.bounds cursor:[NSCursor disappearingItemCursor]]; + break; + case RCTCursorDragCopy: + [self addCursorRect:self.bounds cursor:[NSCursor dragCopyCursor]]; + break; + case RCTCursorDragLink: + [self addCursorRect:self.bounds cursor:[NSCursor dragLinkCursor]]; + break; + case RCTCursorIBeam: + [self addCursorRect:self.bounds cursor:[NSCursor IBeamCursor]]; + break; + case RCTCursorIBeamCursorForVerticalLayout: + [self addCursorRect:self.bounds cursor:[NSCursor IBeamCursorForVerticalLayout]]; + break; + case RCTCursorOpenHand: + [self addCursorRect:self.bounds cursor:[NSCursor openHandCursor]]; + break; + case RCTCursorOperationNotAllowed: + [self addCursorRect:self.bounds cursor:[NSCursor operationNotAllowedCursor]]; + break; + case RCTCursorPointingHand: + [self addCursorRect:self.bounds cursor:[NSCursor pointingHandCursor]]; + break; + case RCTCursorResizeDown: + [self addCursorRect:self.bounds cursor:[NSCursor resizeDownCursor]]; + break; + case RCTCursorResizeLeft: + [self addCursorRect:self.bounds cursor:[NSCursor resizeLeftCursor]]; + break; + case RCTCursorResizeLeftRight: + [self addCursorRect:self.bounds cursor:[NSCursor resizeLeftRightCursor]]; + break; + case RCTCursorResizeRight: + [self addCursorRect:self.bounds cursor:[NSCursor resizeRightCursor]]; + break; + case RCTCursorResizeUp: + [self addCursorRect:self.bounds cursor:[NSCursor resizeUpCursor]]; + break; + case RCTCursorResizeUpDown: + [self addCursorRect:self.bounds cursor:[NSCursor resizeUpDownCursor]]; + break; + default: + [self addCursorRect:self.bounds cursor:[NSCursor arrowCursor]]; } } diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 102f0db2bf7169..e7884886a81fab 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -24,6 +24,58 @@ #import "RCTTVView.h" #endif +#if TARGET_OS_OSX +@implementation RCTConvert (UIView) + +RCT_ENUM_CONVERTER( + RCTCursor, + (@{ + // CSS cursor names + @"auto" : @(RCTCursorAuto), + @"default" : @(RCTCursorArrow), + @"contextMenu" : @(RCTCursorContextualMenu), + @"pointer" : @(RCTCursorPointingHand), + @"text" : @(RCTCursorIBeam), + @"verticalText" : @(RCTCursorIBeamCursorForVerticalLayout), + @"alias" : @(RCTCursorDragLink), + @"copy" : @(RCTCursorDragCopy), + @"noDrop" : @(RCTCursorOperationNotAllowed), + @"notAllowed" : @(RCTCursorOperationNotAllowed), + @"grab" : @(RCTCursorOpenHand), + @"grabbing" : @(RCTCursorClosedHand), + @"colResize" : @(RCTCursorResizeLeftRight), + @"rowResize" : @(RCTCursorResizeUpDown), + @"nResize" : @(RCTCursorResizeUp), + @"eResize" : @(RCTCursorResizeRight), + @"sResize" : @(RCTCursorResizeDown), + @"wResize" : @(RCTCursorResizeLeft), + + // macOS cursor names + @"arrow" : @(RCTCursorArrow), + @"iBeam" : @(RCTCursorIBeam), + @"crosshair" : @(RCTCursorCrosshair), + @"closedHand" : @(RCTCursorClosedHand), + @"openHand" : @(RCTCursorOpenHand), + @"pointingHand" : @(RCTCursorPointingHand), + @"resizeLeft" : @(RCTCursorResizeLeft), + @"resizeRight" : @(RCTCursorResizeRight), + @"resizeLeftRight" : @(RCTCursorResizeLeftRight), + @"resizeUp" : @(RCTCursorResizeUp), + @"resizeDown" : @(RCTCursorResizeDown), + @"resizeUpDown" : @(RCTCursorResizeUpDown), + @"disappearingItem" : @(RCTCursorDisappearingItem), + @"iBeamCursorForVerticalLayout" : @(RCTCursorIBeamCursorForVerticalLayout), + @"operationNotAllowed" : @(RCTCursorOperationNotAllowed), + @"dragLink" : @(RCTCursorDragLink), + @"dragCopy" : @(RCTCursorDragCopy), + @"contextualMenu" : @(RCTCursorContextualMenu), + }), + RCTCursorAuto, + integerValue) + +@end +#endif + #if !TARGET_OS_OSX // TODO(macOS ISS#2323203) @implementation RCTConvert (UIAccessibilityTraits) @@ -474,7 +526,7 @@ - (RCTShadowView *)shadowView #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) #pragma mark - macOS properties -RCT_EXPORT_VIEW_PROPERTY(cursor, NSString) +RCT_EXPORT_VIEW_PROPERTY(cursor, RCTCursor) RCT_EXPORT_VIEW_PROPERTY(onDoubleClick, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onClick, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onMouseEnter, RCTDirectEventBlock) From 84da3f238bef38bd364667bb123c017960c81ded Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Mon, 19 Apr 2021 23:27:38 -0600 Subject: [PATCH 04/17] clean up --- React/Views/RCTView.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/Views/RCTView.h b/React/Views/RCTView.h index 99dff7d4454fd4..f2078cee57c846 100644 --- a/React/Views/RCTView.h +++ b/React/Views/RCTView.h @@ -164,8 +164,8 @@ typedef NS_ENUM(NSInteger, RCTCursor) { // Keyboarding events @property (nonatomic, copy) RCTDirectEventBlock onKeyDown; @property (nonatomic, copy) RCTDirectEventBlock onKeyUp; -@property (nonatomic, copy) NSArray *validKeysDown; -@property (nonatomic, copy) NSArray *validKeysUp; +@property (nonatomic, copy) NSArray *validKeysDown; +@property (nonatomic, copy) NSArray *validKeysUp; #endif // ]TODO(macOS ISS#2323203) /** From a91c0ec9c9b542201141d8202f096eee7df92fae Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Tue, 20 Apr 2021 09:16:55 -0600 Subject: [PATCH 05/17] add cursor to view example --- RNTester/js/examples/View/ViewExample.js | 60 ++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/RNTester/js/examples/View/ViewExample.js b/RNTester/js/examples/View/ViewExample.js index 7f89797ed51570..13c2a7f8398532 100644 --- a/RNTester/js/examples/View/ViewExample.js +++ b/RNTester/js/examples/View/ViewExample.js @@ -45,6 +45,66 @@ exports.examples = [ ); }, }, + { + title: 'Cursor', + render(): React.Node { + return ( + <> + + auto + + + default + + + contextMenu + + + pointer + + + text + + + verticalText + + + alias + + + copy + + + notAllowed + + + grab + + + grabbing + + + colResize + + + rowResize + + + nResize + + + eResize + + + sResize + + + wResize + + + ); + }, + }, { title: 'Padding/Margin', render(): React.Node { From c452cac84e59df240538bc8cc7fbc327a5b6bb92 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 22 Apr 2021 15:17:28 -0600 Subject: [PATCH 06/17] update to only CSS kebab-case names --- React/Views/RCTViewManager.m | 51 +++++++++++------------------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index e7884886a81fab..55baa958e241c4 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -30,45 +30,26 @@ @implementation RCTConvert (UIView) RCT_ENUM_CONVERTER( RCTCursor, (@{ - // CSS cursor names - @"auto" : @(RCTCursorAuto), - @"default" : @(RCTCursorArrow), - @"contextMenu" : @(RCTCursorContextualMenu), - @"pointer" : @(RCTCursorPointingHand), - @"text" : @(RCTCursorIBeam), - @"verticalText" : @(RCTCursorIBeamCursorForVerticalLayout), @"alias" : @(RCTCursorDragLink), + @"auto" : @(RCTCursorAuto), + @"col-resize" : @(RCTCursorResizeLeftRight), + @"context-menu" : @(RCTCursorContextualMenu), @"copy" : @(RCTCursorDragCopy), - @"noDrop" : @(RCTCursorOperationNotAllowed), - @"notAllowed" : @(RCTCursorOperationNotAllowed), + @"crosshair" : @(RCTCursorCrosshair), + @"default" : @(RCTCursorArrow), + @"disappearing-item" : @(RCTCursorDisappearingItem), + @"e-resize" : @(RCTCursorResizeRight), @"grab" : @(RCTCursorOpenHand), @"grabbing" : @(RCTCursorClosedHand), - @"colResize" : @(RCTCursorResizeLeftRight), - @"rowResize" : @(RCTCursorResizeUpDown), - @"nResize" : @(RCTCursorResizeUp), - @"eResize" : @(RCTCursorResizeRight), - @"sResize" : @(RCTCursorResizeDown), - @"wResize" : @(RCTCursorResizeLeft), - - // macOS cursor names - @"arrow" : @(RCTCursorArrow), - @"iBeam" : @(RCTCursorIBeam), - @"crosshair" : @(RCTCursorCrosshair), - @"closedHand" : @(RCTCursorClosedHand), - @"openHand" : @(RCTCursorOpenHand), - @"pointingHand" : @(RCTCursorPointingHand), - @"resizeLeft" : @(RCTCursorResizeLeft), - @"resizeRight" : @(RCTCursorResizeRight), - @"resizeLeftRight" : @(RCTCursorResizeLeftRight), - @"resizeUp" : @(RCTCursorResizeUp), - @"resizeDown" : @(RCTCursorResizeDown), - @"resizeUpDown" : @(RCTCursorResizeUpDown), - @"disappearingItem" : @(RCTCursorDisappearingItem), - @"iBeamCursorForVerticalLayout" : @(RCTCursorIBeamCursorForVerticalLayout), - @"operationNotAllowed" : @(RCTCursorOperationNotAllowed), - @"dragLink" : @(RCTCursorDragLink), - @"dragCopy" : @(RCTCursorDragCopy), - @"contextualMenu" : @(RCTCursorContextualMenu), + @"n-resize" : @(RCTCursorResizeUp), + @"no-drop" : @(RCTCursorOperationNotAllowed), + @"not-allowed" : @(RCTCursorOperationNotAllowed), + @"pointer" : @(RCTCursorPointingHand), + @"row-resize" : @(RCTCursorResizeUpDown), + @"s-resize" : @(RCTCursorResizeDown), + @"text" : @(RCTCursorIBeam), + @"vertical-text" : @(RCTCursorIBeamCursorForVerticalLayout), + @"w-resize" : @(RCTCursorResizeLeft), }), RCTCursorAuto, integerValue) From 2a272ed31596b0a75cdd0e77f62851fbce25f4a8 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 22 Apr 2021 15:39:41 -0600 Subject: [PATCH 07/17] update examples to use new cursor names --- RNTester/js/examples/View/ViewExample.js | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/RNTester/js/examples/View/ViewExample.js b/RNTester/js/examples/View/ViewExample.js index 13c2a7f8398532..b9c4c30c401740 100644 --- a/RNTester/js/examples/View/ViewExample.js +++ b/RNTester/js/examples/View/ViewExample.js @@ -56,8 +56,8 @@ exports.examples = [ default - - contextMenu + + context-menu pointer @@ -65,8 +65,8 @@ exports.examples = [ text - - verticalText + + vertical-text alias @@ -74,8 +74,8 @@ exports.examples = [ copy - - notAllowed + + not-allowed grab @@ -83,23 +83,23 @@ exports.examples = [ grabbing - - colResize + + col-resize - - rowResize + + row-resize - - nResize + + n-resize - - eResize + + e-resize - - sResize + + s-resize - - wResize + + w-resize ); From 945549cd4be17bd7c6c1ec9cb7a887a5e45d72c7 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 22 Apr 2021 15:40:05 -0600 Subject: [PATCH 08/17] update default cursor to arrow --- React/Views/RCTViewManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 55baa958e241c4..34fe4037fadece 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -51,7 +51,7 @@ @implementation RCTConvert (UIView) @"vertical-text" : @(RCTCursorIBeamCursorForVerticalLayout), @"w-resize" : @(RCTCursorResizeLeft), }), - RCTCursorAuto, + RCTCursorArrow, integerValue) @end From 6b78c52f2e165bff0ad6761dd99f8cfa74b20df6 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 22 Apr 2021 15:40:57 -0600 Subject: [PATCH 09/17] remove auto case and clean up --- React/Views/RCTView.m | 48 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index aa4440b4da6b76..3aa45abc32ccc1 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -1382,65 +1382,67 @@ - (void)drawFocusRingMask #if TARGET_OS_OSX - (void)resetCursorRects { + NSCursor *cursor; + switch (self.cursor) { - case RCTCursorAuto: - if (self.focusable) { - [self addCursorRect:self.bounds cursor:[NSCursor pointingHandCursor]]; - } - break; case RCTCursorClosedHand: - [self addCursorRect:self.bounds cursor:[NSCursor closedHandCursor]]; + cursor = [NSCursor closedHandCursor]; break; case RCTCursorContextualMenu: - [self addCursorRect:self.bounds cursor:[NSCursor contextualMenuCursor]]; + cursor = [NSCursor contextualMenuCursor]; break; case RCTCursorCrosshair: - [self addCursorRect:self.bounds cursor:[NSCursor crosshairCursor]]; + cursor = [NSCursor crosshairCursor]; break; case RCTCursorDisappearingItem: - [self addCursorRect:self.bounds cursor:[NSCursor disappearingItemCursor]]; + cursor = [NSCursor disappearingItemCursor]; break; case RCTCursorDragCopy: - [self addCursorRect:self.bounds cursor:[NSCursor dragCopyCursor]]; + cursor = [NSCursor dragCopyCursor]; break; case RCTCursorDragLink: - [self addCursorRect:self.bounds cursor:[NSCursor dragLinkCursor]]; + cursor = [NSCursor dragLinkCursor]; break; case RCTCursorIBeam: - [self addCursorRect:self.bounds cursor:[NSCursor IBeamCursor]]; + cursor = [NSCursor IBeamCursor]; break; case RCTCursorIBeamCursorForVerticalLayout: - [self addCursorRect:self.bounds cursor:[NSCursor IBeamCursorForVerticalLayout]]; + cursor = [NSCursor IBeamCursorForVerticalLayout]; break; case RCTCursorOpenHand: - [self addCursorRect:self.bounds cursor:[NSCursor openHandCursor]]; + cursor = [NSCursor openHandCursor]; break; case RCTCursorOperationNotAllowed: - [self addCursorRect:self.bounds cursor:[NSCursor operationNotAllowedCursor]]; + cursor = [NSCursor operationNotAllowedCursor]; break; case RCTCursorPointingHand: - [self addCursorRect:self.bounds cursor:[NSCursor pointingHandCursor]]; + cursor = [NSCursor pointingHandCursor]; break; case RCTCursorResizeDown: - [self addCursorRect:self.bounds cursor:[NSCursor resizeDownCursor]]; + cursor = [NSCursor resizeDownCursor]; break; case RCTCursorResizeLeft: - [self addCursorRect:self.bounds cursor:[NSCursor resizeLeftCursor]]; + cursor = [NSCursor resizeLeftCursor]; break; case RCTCursorResizeLeftRight: - [self addCursorRect:self.bounds cursor:[NSCursor resizeLeftRightCursor]]; + cursor = [NSCursor resizeLeftRightCursor]; break; case RCTCursorResizeRight: - [self addCursorRect:self.bounds cursor:[NSCursor resizeRightCursor]]; + cursor = [NSCursor resizeRightCursor]; break; case RCTCursorResizeUp: - [self addCursorRect:self.bounds cursor:[NSCursor resizeUpCursor]]; + cursor = [NSCursor resizeUpCursor]; break; case RCTCursorResizeUpDown: - [self addCursorRect:self.bounds cursor:[NSCursor resizeUpDownCursor]]; + cursor = [NSCursor resizeUpDownCursor]; break; default: - [self addCursorRect:self.bounds cursor:[NSCursor arrowCursor]]; + cursor = [NSCursor arrowCursor]; + } + + if (cursor) { + [self discardCursorRects]; + [self addCursorRect:self.bounds cursor:cursor]; } } From b99356f166fdcea1a45c173610e87427cee33979 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Fri, 23 Apr 2021 10:10:44 -0600 Subject: [PATCH 10/17] add cursor to flow types for view and touchables --- .../Touchable/TouchableWithoutFeedback.js | 22 ++++++++++++++++ Libraries/Components/View/ViewPropTypes.js | 26 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 47553abe7bb944..9e96edf5df4e97 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -54,6 +54,28 @@ type Props = $ReadOnly<{| accessibilityViewIsModal?: ?boolean, accessible?: ?boolean, children?: ?React.Node, + cursor?: ?( + | 'alias' + | 'auto' + | 'col-resize' + | 'context-menu' + | 'copy' + | 'crosshair' + | 'default' + | 'disappearing-item' + | 'e-resize' + | 'grab' + | 'grabbing' + | 'n-resize' + | 'no-drop' + | 'not-allowed' + | 'pointer' + | 'row-resize' + | 's-resize' + | 'text' + | 'vertical-text' + | 'w-resize' + ), delayLongPress?: ?number, delayPressIn?: ?number, delayPressOut?: ?number, diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 5e30ba46c19de2..51dacf204c5f1e 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -626,4 +626,30 @@ export type ViewProps = $ReadOnly<{| * @platform macos */ draggedTypes?: ?DraggedTypesType, // TODO(macOS ISS#2323203) + + /* + * Sets the type of mouse cursor, to show when the mouse pointer is over the view. + */ + cursor?: ?( + | 'alias' + | 'auto' + | 'col-resize' + | 'context-menu' + | 'copy' + | 'crosshair' + | 'default' + | 'disappearing-item' + | 'e-resize' + | 'grab' + | 'grabbing' + | 'n-resize' + | 'no-drop' + | 'not-allowed' + | 'pointer' + | 'row-resize' + | 's-resize' + | 'text' + | 'vertical-text' + | 'w-resize' + ), |}>; From fce50ea4bdb0530e851747eaed487910061d87b5 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Fri, 30 Apr 2021 16:05:45 -0600 Subject: [PATCH 11/17] default to auto; fix arrow; always discard rects --- React/Views/RCTView.m | 8 +++++--- React/Views/RCTViewManager.m | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 3aa45abc32ccc1..139e6fe656a629 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -1385,6 +1385,9 @@ - (void)resetCursorRects NSCursor *cursor; switch (self.cursor) { + case RCTCursorArrow: + cursor = [NSCursor arrowCursor]; + break; case RCTCursorClosedHand: cursor = [NSCursor closedHandCursor]; break; @@ -1436,12 +1439,11 @@ - (void)resetCursorRects case RCTCursorResizeUpDown: cursor = [NSCursor resizeUpDownCursor]; break; - default: - cursor = [NSCursor arrowCursor]; } + [self discardCursorRects]; + if (cursor) { - [self discardCursorRects]; [self addCursorRect:self.bounds cursor:cursor]; } } diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 34fe4037fadece..55baa958e241c4 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -51,7 +51,7 @@ @implementation RCTConvert (UIView) @"vertical-text" : @(RCTCursorIBeamCursorForVerticalLayout), @"w-resize" : @(RCTCursorResizeLeft), }), - RCTCursorArrow, + RCTCursorAuto, integerValue) @end From 34275a704a0dc1f7277ed1736d18a1ed0f7b73ed Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 6 May 2021 16:20:25 -0600 Subject: [PATCH 12/17] apply patch making it a style prop --- .../View/ReactNativeViewViewConfig.js | 1 + Libraries/StyleSheet/StyleSheetTypes.js | 22 ++++++++++++ RNTester/js/examples/View/ViewExample.js | 34 +++++++++---------- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/Libraries/Components/View/ReactNativeViewViewConfig.js b/Libraries/Components/View/ReactNativeViewViewConfig.js index f14e672f813b87..557313d87bbf59 100644 --- a/Libraries/Components/View/ReactNativeViewViewConfig.js +++ b/Libraries/Components/View/ReactNativeViewViewConfig.js @@ -262,6 +262,7 @@ const ReactNativeViewConfig = { borderWidth: true, bottom: true, color: {process: require('../../StyleSheet/processColor')}, + cursor: true, decomposedMatrix: true, direction: true, display: true, diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 39ee7da194c656..fd26321ffd7011 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -583,6 +583,28 @@ export type ____ViewStyle_Internal = $ReadOnly<{| borderTopWidth?: number | AnimatedNode, opacity?: number | AnimatedNode, elevation?: number, + cursor?: ?( + | 'alias' + | 'auto' + | 'col-resize' + | 'context-menu' + | 'copy' + | 'crosshair' + | 'default' + | 'disappearing-item' + | 'e-resize' + | 'grab' + | 'grabbing' + | 'n-resize' + | 'no-drop' + | 'not-allowed' + | 'pointer' + | 'row-resize' + | 's-resize' + | 'text' + | 'vertical-text' + | 'w-resize' + ), |}>; export type ____FontWeight_Internal = diff --git a/RNTester/js/examples/View/ViewExample.js b/RNTester/js/examples/View/ViewExample.js index b9c4c30c401740..1b79b53999f1e0 100644 --- a/RNTester/js/examples/View/ViewExample.js +++ b/RNTester/js/examples/View/ViewExample.js @@ -50,55 +50,55 @@ exports.examples = [ render(): React.Node { return ( <> - + auto - + default - + context-menu - + pointer - + text - + vertical-text - + alias - + copy - + not-allowed - + grab - + grabbing - + col-resize - + row-resize - + n-resize - + e-resize - + s-resize - + w-resize From f9eaa5e0c9b75a949c2d2089eac4594dbbd32648 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 6 May 2021 16:51:23 -0600 Subject: [PATCH 13/17] move enum to RCTCursor --- React/Views/RCTCursor.h | 29 +++++++++++++++++++++++++++++ React/Views/RCTCursor.m | 32 ++++++++++++++++++++++++++++++++ React/Views/RCTView.h | 32 ++++++-------------------------- React/Views/RCTViewManager.m | 31 +------------------------------ 4 files changed, 68 insertions(+), 56 deletions(-) create mode 100644 React/Views/RCTCursor.h create mode 100644 React/Views/RCTCursor.m diff --git a/React/Views/RCTCursor.h b/React/Views/RCTCursor.h new file mode 100644 index 00000000000000..6d9de7cafb61ef --- /dev/null +++ b/React/Views/RCTCursor.h @@ -0,0 +1,29 @@ +#import + +typedef NS_ENUM(NSInteger, RCTCursor) { + RCTCursorAuto, + RCTCursorArrow, + RCTCursorIBeam, + RCTCursorCrosshair, + RCTCursorClosedHand, + RCTCursorOpenHand, + RCTCursorPointingHand, + RCTCursorResizeLeft, + RCTCursorResizeRight, + RCTCursorResizeLeftRight, + RCTCursorResizeUp, + RCTCursorResizeDown, + RCTCursorResizeUpDown, + RCTCursorDisappearingItem, + RCTCursorIBeamCursorForVerticalLayout, + RCTCursorOperationNotAllowed, + RCTCursorDragLink, + RCTCursorDragCopy, + RCTCursorContextualMenu, +}; + +@interface RCTConvert (RCTCursor) + ++ (RCTCursor)RCTCursor:(id)json; + +@end diff --git a/React/Views/RCTCursor.m b/React/Views/RCTCursor.m new file mode 100644 index 00000000000000..37e6a49e303d29 --- /dev/null +++ b/React/Views/RCTCursor.m @@ -0,0 +1,32 @@ +#import + +@implementation RCTConvert (RCTCursor) + +RCT_ENUM_CONVERTER( + RCTCursor, + (@{ + @"alias" : @(RCTCursorDragLink), + @"auto" : @(RCTCursorAuto), + @"col-resize" : @(RCTCursorResizeLeftRight), + @"context-menu" : @(RCTCursorContextualMenu), + @"copy" : @(RCTCursorDragCopy), + @"crosshair" : @(RCTCursorCrosshair), + @"default" : @(RCTCursorArrow), + @"disappearing-item" : @(RCTCursorDisappearingItem), + @"e-resize" : @(RCTCursorResizeRight), + @"grab" : @(RCTCursorOpenHand), + @"grabbing" : @(RCTCursorClosedHand), + @"n-resize" : @(RCTCursorResizeUp), + @"no-drop" : @(RCTCursorOperationNotAllowed), + @"not-allowed" : @(RCTCursorOperationNotAllowed), + @"pointer" : @(RCTCursorPointingHand), + @"row-resize" : @(RCTCursorResizeUpDown), + @"s-resize" : @(RCTCursorResizeDown), + @"text" : @(RCTCursorIBeam), + @"vertical-text" : @(RCTCursorIBeamCursorForVerticalLayout), + @"w-resize" : @(RCTCursorResizeLeft), + }), + RCTCursorAuto, + integerValue) + +@end diff --git a/React/Views/RCTView.h b/React/Views/RCTView.h index f2078cee57c846..b87dd007a35508 100644 --- a/React/Views/RCTView.h +++ b/React/Views/RCTView.h @@ -12,34 +12,14 @@ #import // TODO(OSS Candidate ISS#2710739) #import +#if TARGET_OS_OSX +#import +#endif + #if !TARGET_OS_OSX // TODO(macOS ISS#2323203) extern const UIAccessibilityTraits SwitchAccessibilityTrait; #endif // TODO(macOS ISS#2323203) -#if TARGET_OS_OSX -typedef NS_ENUM(NSInteger, RCTCursor) { - RCTCursorAuto, - RCTCursorArrow, - RCTCursorIBeam, - RCTCursorCrosshair, - RCTCursorClosedHand, - RCTCursorOpenHand, - RCTCursorPointingHand, - RCTCursorResizeLeft, - RCTCursorResizeRight, - RCTCursorResizeLeftRight, - RCTCursorResizeUp, - RCTCursorResizeDown, - RCTCursorResizeUpDown, - RCTCursorDisappearingItem, - RCTCursorIBeamCursorForVerticalLayout, - RCTCursorOperationNotAllowed, - RCTCursorDragLink, - RCTCursorDragCopy, - RCTCursorContextualMenu, -}; -#endif - @protocol RCTAutoInsetsProtocol; @class RCTView; @@ -164,8 +144,8 @@ typedef NS_ENUM(NSInteger, RCTCursor) { // Keyboarding events @property (nonatomic, copy) RCTDirectEventBlock onKeyDown; @property (nonatomic, copy) RCTDirectEventBlock onKeyUp; -@property (nonatomic, copy) NSArray *validKeysDown; -@property (nonatomic, copy) NSArray *validKeysUp; +@property (nonatomic, copy) NSArray *validKeysDown; +@property (nonatomic, copy) NSArray *validKeysUp; #endif // ]TODO(macOS ISS#2323203) /** diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 55baa958e241c4..c97e5a61b39f96 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -25,36 +25,7 @@ #endif #if TARGET_OS_OSX -@implementation RCTConvert (UIView) - -RCT_ENUM_CONVERTER( - RCTCursor, - (@{ - @"alias" : @(RCTCursorDragLink), - @"auto" : @(RCTCursorAuto), - @"col-resize" : @(RCTCursorResizeLeftRight), - @"context-menu" : @(RCTCursorContextualMenu), - @"copy" : @(RCTCursorDragCopy), - @"crosshair" : @(RCTCursorCrosshair), - @"default" : @(RCTCursorArrow), - @"disappearing-item" : @(RCTCursorDisappearingItem), - @"e-resize" : @(RCTCursorResizeRight), - @"grab" : @(RCTCursorOpenHand), - @"grabbing" : @(RCTCursorClosedHand), - @"n-resize" : @(RCTCursorResizeUp), - @"no-drop" : @(RCTCursorOperationNotAllowed), - @"not-allowed" : @(RCTCursorOperationNotAllowed), - @"pointer" : @(RCTCursorPointingHand), - @"row-resize" : @(RCTCursorResizeUpDown), - @"s-resize" : @(RCTCursorResizeDown), - @"text" : @(RCTCursorIBeam), - @"vertical-text" : @(RCTCursorIBeamCursorForVerticalLayout), - @"w-resize" : @(RCTCursorResizeLeft), - }), - RCTCursorAuto, - integerValue) - -@end +#import "RCTCursor.h" #endif #if !TARGET_OS_OSX // TODO(macOS ISS#2323203) From 1a3abaa7aa5c70f40f992b51506f2d8526ff38e3 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 6 May 2021 17:05:15 -0600 Subject: [PATCH 14/17] add CursorValue flow type --- .../Touchable/TouchableWithoutFeedback.js | 24 +--------- Libraries/Components/View/ViewPropTypes.js | 24 +--------- Libraries/StyleSheet/StyleSheetTypes.js | 46 ++++++++++--------- 3 files changed, 28 insertions(+), 66 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 9e96edf5df4e97..cd8135d375c63f 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -23,6 +23,7 @@ import type { AccessibilityValue, } from '../../Components/View/ViewAccessibility'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {CursorValue} from '../../StyleSheet/StyleSheetTypes'; import type { BlurEvent, FocusEvent, @@ -54,28 +55,7 @@ type Props = $ReadOnly<{| accessibilityViewIsModal?: ?boolean, accessible?: ?boolean, children?: ?React.Node, - cursor?: ?( - | 'alias' - | 'auto' - | 'col-resize' - | 'context-menu' - | 'copy' - | 'crosshair' - | 'default' - | 'disappearing-item' - | 'e-resize' - | 'grab' - | 'grabbing' - | 'n-resize' - | 'no-drop' - | 'not-allowed' - | 'pointer' - | 'row-resize' - | 's-resize' - | 'text' - | 'vertical-text' - | 'w-resize' - ), + cursor?: ?CursorValue, delayLongPress?: ?number, delayPressIn?: ?number, delayPressOut?: ?number, diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 51dacf204c5f1e..c54ed894369606 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -23,6 +23,7 @@ import type { import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; import type {Node} from 'react'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {CursorValue} from '../../StyleSheet/StyleSheetTypes'; import type { AccessibilityRole, AccessibilityState, @@ -630,26 +631,5 @@ export type ViewProps = $ReadOnly<{| /* * Sets the type of mouse cursor, to show when the mouse pointer is over the view. */ - cursor?: ?( - | 'alias' - | 'auto' - | 'col-resize' - | 'context-menu' - | 'copy' - | 'crosshair' - | 'default' - | 'disappearing-item' - | 'e-resize' - | 'grab' - | 'grabbing' - | 'n-resize' - | 'no-drop' - | 'not-allowed' - | 'pointer' - | 'row-resize' - | 's-resize' - | 'text' - | 'vertical-text' - | 'w-resize' - ), + cursor?: ?CursorValue, |}>; diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index fd26321ffd7011..832528590a77d7 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -14,6 +14,29 @@ const AnimatedNode = require('../Animated/src/nodes/AnimatedNode'); import type {NativeColorValue} from './PlatformColorValueTypes'; +export type CursorValue = ?( + | 'alias' + | 'auto' + | 'col-resize' + | 'context-menu' + | 'copy' + | 'crosshair' + | 'default' + | 'disappearing-item' + | 'e-resize' + | 'grab' + | 'grabbing' + | 'n-resize' + | 'no-drop' + | 'not-allowed' + | 'pointer' + | 'row-resize' + | 's-resize' + | 'text' + | 'vertical-text' + | 'w-resize' +) + export type ColorValue = null | string | NativeColorValue; export type ColorArrayValue = null | $ReadOnlyArray; @@ -583,28 +606,7 @@ export type ____ViewStyle_Internal = $ReadOnly<{| borderTopWidth?: number | AnimatedNode, opacity?: number | AnimatedNode, elevation?: number, - cursor?: ?( - | 'alias' - | 'auto' - | 'col-resize' - | 'context-menu' - | 'copy' - | 'crosshair' - | 'default' - | 'disappearing-item' - | 'e-resize' - | 'grab' - | 'grabbing' - | 'n-resize' - | 'no-drop' - | 'not-allowed' - | 'pointer' - | 'row-resize' - | 's-resize' - | 'text' - | 'vertical-text' - | 'w-resize' - ), + cursor?: CursorValue, |}>; export type ____FontWeight_Internal = From 3205f54d3b2199ceced8106e9749d68d80d0ff63 Mon Sep 17 00:00:00 2001 From: Liron Yahdav Date: Mon, 19 Apr 2021 13:01:44 -0600 Subject: [PATCH 15/17] Add cursor style to View Summary: This brings in PR https://github.com/microsoft/react-native-macos/pull/760 to our repo. Test Plan: RNTester > View: {F612877442} Reviewers: skyle Reviewed By: skyle Subscribers: necolas, eliwhite Differential Revision: https://phabricator.intern.facebook.com/D28158243 Tasks: T78743077 Signature: 28158243:1620330169:72c6c9e2371f2ac1a9edabedf3fd9d68468ccb8c Remove Cursor for Text Component --- .../Touchable/TouchableWithoutFeedback.js | 2 - .../View/ReactNativeStyleAttributes.js | 1 + Libraries/Components/View/ViewPropTypes.js | 5 + Libraries/StyleSheet/StyleSheetTypes.js | 24 +++++ Libraries/Text/RCTTextAttributes.m | 10 +- React/Base/macOS/RCTUIKit.m | 7 ++ React/Views/RCTCursor.h | 8 ++ React/Views/RCTCursor.m | 71 ++++++++++++++ React/Views/RCTView.h | 5 + React/Views/RCTView.m | 93 ++++--------------- React/Views/RCTViewManager.m | 4 + 11 files changed, 147 insertions(+), 83 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 817f84dbe8516d..adb35b87914909 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -20,7 +20,6 @@ import type { AccessibilityValue, } from '../../Components/View/ViewAccessibility'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; -import type {CursorValue} from '../../StyleSheet/StyleSheetTypes'; import type { BlurEvent, FocusEvent, @@ -49,7 +48,6 @@ type Props = $ReadOnly<{| accessibilityViewIsModal?: ?boolean, accessible?: ?boolean, children?: ?React.Node, - cursor?: ?CursorValue, delayLongPress?: ?number, delayPressIn?: ?number, delayPressOut?: ?number, diff --git a/Libraries/Components/View/ReactNativeStyleAttributes.js b/Libraries/Components/View/ReactNativeStyleAttributes.js index 9525991e831b53..7b4224b86d830c 100644 --- a/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -116,6 +116,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = { borderTopLeftRadius: true, borderTopRightRadius: true, borderTopStartRadius: true, + cursor: true, opacity: true, /** diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index affb190960e820..ebbd5697597fd1 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -634,4 +634,9 @@ export type ViewProps = $ReadOnly<{| * @platform macos */ draggedTypes?: ?DraggedTypesType, // TODO(macOS GH#774) + + /* + * Sets the type of mouse cursor, to show when the mouse pointer is over the view. + */ + cursor?: ?CursorValue, // TODO(macOS GH#774) |}>; diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 220f109d6d5489..57ba92b8154e75 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -16,6 +16,29 @@ import type {NativeColorValue} from './PlatformColorValueTypes'; export type ____ColorValue_Internal = null | string | NativeColorValue; +export type CursorValue = ?( + | 'alias' + | 'auto' + | 'col-resize' + | 'context-menu' + | 'copy' + | 'crosshair' + | 'default' + | 'disappearing-item' + | 'e-resize' + | 'grab' + | 'grabbing' + | 'n-resize' + | 'no-drop' + | 'not-allowed' + | 'pointer' + | 'row-resize' + | 's-resize' + | 'text' + | 'vertical-text' + | 'w-resize' +) + export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>; export type PointValue = {| x: number, @@ -639,6 +662,7 @@ export type ____TextStyle_Internal = $ReadOnly<{| textDecorationColor?: ____ColorValue_Internal, textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase', writingDirection?: 'auto' | 'ltr' | 'rtl', + cursor?: CursorValue, |}>; export type ____ImageStyle_Internal = $ReadOnly<{| diff --git a/Libraries/Text/RCTTextAttributes.m b/Libraries/Text/RCTTextAttributes.m index 0690ea3bdf27b9..38ea5a374842b4 100644 --- a/Libraries/Text/RCTTextAttributes.m +++ b/Libraries/Text/RCTTextAttributes.m @@ -109,27 +109,27 @@ - (NSParagraphStyle *)effectiveParagraphStyle alignment = NSTextAlignmentRight; } } - + paragraphStyle.alignment = alignment; isParagraphStyleUsed = YES; } - + if (_baseWritingDirection != NSWritingDirectionNatural) { paragraphStyle.baseWritingDirection = _baseWritingDirection; isParagraphStyleUsed = YES; } - + if (!isnan(_lineHeight)) { CGFloat lineHeight = _lineHeight * self.effectiveFontSizeMultiplier; paragraphStyle.minimumLineHeight = lineHeight; paragraphStyle.maximumLineHeight = lineHeight; isParagraphStyleUsed = YES; } - + if (isParagraphStyleUsed) { return [paragraphStyle copy]; } - + return nil; } diff --git a/React/Base/macOS/RCTUIKit.m b/React/Base/macOS/RCTUIKit.m index b7ee45c50841eb..3d0ea62bf04c9c 100644 --- a/React/Base/macOS/RCTUIKit.m +++ b/React/Base/macOS/RCTUIKit.m @@ -423,6 +423,13 @@ - (void)setBackgroundColor:(NSColor *)backgroundColor } } +// We purposely don't use RCTCursor for the parameter type here because it would introduce an import cycle: +// RCTUIKit > RCTCursor > RCTConvert > RCTUIKit +- (void)setCursor:(NSInteger)cursor +{ + // This method is required to be defined due to [RCTVirtualTextViewManager view] returning a RCTUIView. +} + @end // RCTUIScrollView diff --git a/React/Views/RCTCursor.h b/React/Views/RCTCursor.h index 6d9de7cafb61ef..34a51ac9cb4aed 100644 --- a/React/Views/RCTCursor.h +++ b/React/Views/RCTCursor.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + #import typedef NS_ENUM(NSInteger, RCTCursor) { @@ -25,5 +32,6 @@ typedef NS_ENUM(NSInteger, RCTCursor) { @interface RCTConvert (RCTCursor) + (RCTCursor)RCTCursor:(id)json; ++ (NSCursor *)NSCursor:(RCTCursor)rctCursor; @end diff --git a/React/Views/RCTCursor.m b/React/Views/RCTCursor.m index 37e6a49e303d29..f70ad56f5bda17 100644 --- a/React/Views/RCTCursor.m +++ b/React/Views/RCTCursor.m @@ -1,3 +1,10 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + #import @implementation RCTConvert (RCTCursor) @@ -29,4 +36,68 @@ @implementation RCTConvert (RCTCursor) RCTCursorAuto, integerValue) ++ (NSCursor *)NSCursor:(RCTCursor)rctCursor +{ + NSCursor *cursor; + + switch (rctCursor) { + case RCTCursorArrow: + cursor = [NSCursor arrowCursor]; + break; + case RCTCursorClosedHand: + cursor = [NSCursor closedHandCursor]; + break; + case RCTCursorContextualMenu: + cursor = [NSCursor contextualMenuCursor]; + break; + case RCTCursorCrosshair: + cursor = [NSCursor crosshairCursor]; + break; + case RCTCursorDisappearingItem: + cursor = [NSCursor disappearingItemCursor]; + break; + case RCTCursorDragCopy: + cursor = [NSCursor dragCopyCursor]; + break; + case RCTCursorDragLink: + cursor = [NSCursor dragLinkCursor]; + break; + case RCTCursorIBeam: + cursor = [NSCursor IBeamCursor]; + break; + case RCTCursorIBeamCursorForVerticalLayout: + cursor = [NSCursor IBeamCursorForVerticalLayout]; + break; + case RCTCursorOpenHand: + cursor = [NSCursor openHandCursor]; + break; + case RCTCursorOperationNotAllowed: + cursor = [NSCursor operationNotAllowedCursor]; + break; + case RCTCursorPointingHand: + cursor = [NSCursor pointingHandCursor]; + break; + case RCTCursorResizeDown: + cursor = [NSCursor resizeDownCursor]; + break; + case RCTCursorResizeLeft: + cursor = [NSCursor resizeLeftCursor]; + break; + case RCTCursorResizeLeftRight: + cursor = [NSCursor resizeLeftRightCursor]; + break; + case RCTCursorResizeRight: + cursor = [NSCursor resizeRightCursor]; + break; + case RCTCursorResizeUp: + cursor = [NSCursor resizeUpCursor]; + break; + case RCTCursorResizeUpDown: + cursor = [NSCursor resizeUpDownCursor]; + break; + } + + return cursor; +} + @end diff --git a/React/Views/RCTView.h b/React/Views/RCTView.h index d1e40a0923c743..6ef286f8952c96 100644 --- a/React/Views/RCTView.h +++ b/React/Views/RCTView.h @@ -12,6 +12,10 @@ #import // TODO(OSS Candidate ISS#2710739) #import +#if TARGET_OS_OSX // TODO(macOS GH#774) +#import +#endif // TODO(macOS GH#774) + #if !TARGET_OS_OSX // TODO(macOS GH#774) extern const UIAccessibilityTraits SwitchAccessibilityTrait; #endif // TODO(macOS GH#774) @@ -119,6 +123,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; /** * macOS Properties */ +@property (nonatomic, assign) RCTCursor cursor; @property (nonatomic, assign) CATransform3D transform3D; diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 072bf148edde6c..66d9c0b09261eb 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -742,16 +742,16 @@ - (void)viewBoundsChanged:(NSNotification*)__unused inNotif // the mouseExited: event does not get called on the view where mouseEntered: was previously called. // This creates an unnatural pairing of mouse enter and exit events and can cause problems. // We therefore explicitly check for this here and handle them by calling the appropriate callbacks. - + if (!_hasMouseOver && self.onMouseEnter) { NSPoint locationInWindow = [[self window] mouseLocationOutsideOfEventStream]; NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil]; - + if (NSPointInRect(locationInView, [self bounds])) { _hasMouseOver = YES; - + [self sendMouseEventWithBlock:self.onMouseEnter locationInfo:[self locationInfoFromDraggingLocation:locationInWindow] modifierFlags:0 @@ -762,11 +762,11 @@ - (void)viewBoundsChanged:(NSNotification*)__unused inNotif { NSPoint locationInWindow = [[self window] mouseLocationOutsideOfEventStream]; NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil]; - + if (!NSPointInRect(locationInView, [self bounds])) { _hasMouseOver = NO; - + [self sendMouseEventWithBlock:self.onMouseLeave locationInfo:[self locationInfoFromDraggingLocation:locationInWindow] modifierFlags:0 @@ -1367,67 +1367,8 @@ - (void)drawFocusRingMask #if TARGET_OS_OSX - (void)resetCursorRects { - NSCursor *cursor; - - switch (self.cursor) { - case RCTCursorArrow: - cursor = [NSCursor arrowCursor]; - break; - case RCTCursorClosedHand: - cursor = [NSCursor closedHandCursor]; - break; - case RCTCursorContextualMenu: - cursor = [NSCursor contextualMenuCursor]; - break; - case RCTCursorCrosshair: - cursor = [NSCursor crosshairCursor]; - break; - case RCTCursorDisappearingItem: - cursor = [NSCursor disappearingItemCursor]; - break; - case RCTCursorDragCopy: - cursor = [NSCursor dragCopyCursor]; - break; - case RCTCursorDragLink: - cursor = [NSCursor dragLinkCursor]; - break; - case RCTCursorIBeam: - cursor = [NSCursor IBeamCursor]; - break; - case RCTCursorIBeamCursorForVerticalLayout: - cursor = [NSCursor IBeamCursorForVerticalLayout]; - break; - case RCTCursorOpenHand: - cursor = [NSCursor openHandCursor]; - break; - case RCTCursorOperationNotAllowed: - cursor = [NSCursor operationNotAllowedCursor]; - break; - case RCTCursorPointingHand: - cursor = [NSCursor pointingHandCursor]; - break; - case RCTCursorResizeDown: - cursor = [NSCursor resizeDownCursor]; - break; - case RCTCursorResizeLeft: - cursor = [NSCursor resizeLeftCursor]; - break; - case RCTCursorResizeLeftRight: - cursor = [NSCursor resizeLeftRightCursor]; - break; - case RCTCursorResizeRight: - cursor = [NSCursor resizeRightCursor]; - break; - case RCTCursorResizeUp: - cursor = [NSCursor resizeUpCursor]; - break; - case RCTCursorResizeUpDown: - cursor = [NSCursor resizeUpDownCursor]; - break; - } - [self discardCursorRects]; - + NSCursor *cursor = [RCTConvert NSCursor:self.cursor]; if (cursor) { [self addCursorRect:self.bounds cursor:cursor]; } @@ -1460,7 +1401,7 @@ - (void)updateTrackingAreas if (_trackingArea) { [self removeTrackingArea:_trackingArea]; } - + if (self.onMouseEnter || self.onMouseLeave) { _trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds options:NSTrackingActiveAlways|NSTrackingMouseEnteredAndExited @@ -1468,7 +1409,7 @@ - (void)updateTrackingAreas userInfo:nil]; [self addTrackingArea:_trackingArea]; } - + [super updateTrackingAreas]; } @@ -1494,7 +1435,7 @@ - (NSDictionary*)locationInfoFromEvent:(NSEvent*)event { NSPoint locationInWindow = event.locationInWindow; NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil]; - + return @{@"screenX": @(locationInWindow.x), @"screenY": @(locationInWindow.y), @"clientX": @(locationInView.x), @@ -1525,15 +1466,15 @@ - (void)sendMouseEventWithBlock:(RCTDirectEventBlock)block if (modifierFlags & NSEventModifierFlagCommand) { body[@"metaKey"] = @YES; } - + if (locationInfo) { [body addEntriesFromDictionary:locationInfo]; } - + if (additionalData) { [body addEntriesFromDictionary:additionalData]; } - + block(body); } @@ -1563,7 +1504,7 @@ - (NSDictionary*)dataTransferInfoFromPastboard:(NSPasteboard*)pastboard MIMETypeString = (__bridge_transfer NSString *)MIMEType; } } - + NSNumber *fileSizeValue = nil; NSError *fileSizeError = nil; BOOL success = [fileURL getResourceValue:&fileSizeValue @@ -1575,11 +1516,11 @@ - (NSDictionary*)dataTransferInfoFromPastboard:(NSPasteboard*)pastboard @"uri": RCTNullIfNil(fileURL.absoluteString), @"size": success ? fileSizeValue : (id)kCFNull }]; - + [items addObject:@{@"kind": @"file", @"type": RCTNullIfNil(MIMETypeString), }]; - + [types addObject:RCTNullIfNil(MIMETypeString)]; } } @@ -1592,7 +1533,7 @@ - (NSDictionary*)dataTransferInfoFromPastboard:(NSPasteboard*)pastboard - (NSDictionary*)locationInfoFromDraggingLocation:(NSPoint)locationInWindow { NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil]; - + return @{@"screenX": @(locationInWindow.x), @"screenY": @(locationInWindow.y), @"clientX": @(locationInView.x), @@ -1604,7 +1545,7 @@ - (NSDragOperation)draggingEntered:(id )sender { NSPasteboard *pboard = sender.draggingPasteboard; NSDragOperation sourceDragMask = sender.draggingSourceOperationMask; - + [self sendMouseEventWithBlock:self.onDragEnter locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation] modifierFlags:0 diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 16d37212237650..c1a1b424505a53 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -21,6 +21,10 @@ #import "RCTView.h" #import "UIView+React.h" +#if TARGET_OS_OSX // TODO(macOS GH#774) +#import "RCTCursor.h" +#endif // TODO(macOS GH774) + #if !TARGET_OS_OSX // TODO(macOS GH#774) @implementation RCTConvert (UIAccessibilityTraits) From 43542f8acb0a6f2eddc466bc41bb882409fe62c8 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Tue, 9 Aug 2022 15:37:40 -0600 Subject: [PATCH 16/17] satisfy linter --- Libraries/Components/View/ReactNativeViewViewConfigMacOS.js | 4 +--- Libraries/Components/View/ViewPropTypes.js | 2 +- Libraries/StyleSheet/StyleSheetTypes.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js b/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js index 407ec9444f5033..0e6692161f691d 100644 --- a/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +++ b/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js @@ -40,6 +40,7 @@ const ReactNativeViewViewConfigMacOS = { cursor: true, draggedTypes: true, enableFocusRing: true, + nextKeyViewTag: true, onBlur: true, onClick: true, onDoubleClick: true, @@ -49,9 +50,6 @@ const ReactNativeViewViewConfigMacOS = { onFocus: true, onKeyDown: true, onKeyUp: true, - validKeysDown: true, - validKeysUp: true, - nextKeyViewTag: true, onMouseEnter: true, onMouseLeave: true, tooltip: true, diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index ebbd5697597fd1..7a19a3083306c7 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -634,7 +634,7 @@ export type ViewProps = $ReadOnly<{| * @platform macos */ draggedTypes?: ?DraggedTypesType, // TODO(macOS GH#774) - + /* * Sets the type of mouse cursor, to show when the mouse pointer is over the view. */ diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 57ba92b8154e75..efe943a0c07081 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -37,7 +37,7 @@ export type CursorValue = ?( | 'text' | 'vertical-text' | 'w-resize' -) +); export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>; export type PointValue = {| From 4eb3cd5585a824813320ba297c5e8a1a3e7a88f4 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 11 Aug 2022 19:38:34 -0600 Subject: [PATCH 17/17] remove view prop and fix build errors --- .../View/ReactNativeViewViewConfigMacOS.js | 1 - Libraries/Components/View/ViewPropTypes.js | 6 -- React/Views/RCTCursor.h | 2 + React/Views/RCTCursor.m | 2 + packages/rn-tester/Podfile.lock | 62 +++++++++---------- packages/rn-tester/RNTester/Info.plist | 24 +++---- 6 files changed, 47 insertions(+), 50 deletions(-) diff --git a/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js b/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js index 0e6692161f691d..af2b5ac0ef9bb7 100644 --- a/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +++ b/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js @@ -37,7 +37,6 @@ const ReactNativeViewViewConfigMacOS = { validAttributes: { acceptsFirstMouse: true, accessibilityTraits: true, - cursor: true, draggedTypes: true, enableFocusRing: true, nextKeyViewTag: true, diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 7a19a3083306c7..22ce4f52121996 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -23,7 +23,6 @@ import type { import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; import type {Node} from 'react'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {CursorValue} from '../../StyleSheet/StyleSheetTypes'; import type { AccessibilityRole, AccessibilityState, @@ -634,9 +633,4 @@ export type ViewProps = $ReadOnly<{| * @platform macos */ draggedTypes?: ?DraggedTypesType, // TODO(macOS GH#774) - - /* - * Sets the type of mouse cursor, to show when the mouse pointer is over the view. - */ - cursor?: ?CursorValue, // TODO(macOS GH#774) |}>; diff --git a/React/Views/RCTCursor.h b/React/Views/RCTCursor.h index 34a51ac9cb4aed..889b523eefc44e 100644 --- a/React/Views/RCTCursor.h +++ b/React/Views/RCTCursor.h @@ -32,6 +32,8 @@ typedef NS_ENUM(NSInteger, RCTCursor) { @interface RCTConvert (RCTCursor) + (RCTCursor)RCTCursor:(id)json; +#if TARGET_OS_OSX // TODO(macOS GH#774) + (NSCursor *)NSCursor:(RCTCursor)rctCursor; +#endif // ]TODO(macOS GH#774) @end diff --git a/React/Views/RCTCursor.m b/React/Views/RCTCursor.m index f70ad56f5bda17..5350523c309610 100644 --- a/React/Views/RCTCursor.m +++ b/React/Views/RCTCursor.m @@ -36,6 +36,7 @@ @implementation RCTConvert (RCTCursor) RCTCursorAuto, integerValue) +#if TARGET_OS_OSX // TODO(macOS GH#774) + (NSCursor *)NSCursor:(RCTCursor)rctCursor { NSCursor *cursor; @@ -99,5 +100,6 @@ + (NSCursor *)NSCursor:(RCTCursor)rctCursor return cursor; } +#endif // ]TODO(macOS GH#774) @end diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 6e5f8f65a1232b..41ebd33863c817 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -568,8 +568,8 @@ SPEC CHECKSUMS: boost-for-react-native: 8f7c9ecfe357664c072ffbe2432569667cbf1f1b CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: ed15e075aa758ac0e4c1f8b830bd4e4d40d669e8 - FBLazyVector: b108c891d75690bc6ea373026fadff60278ba2ba - FBReactNativeSpec: 97fdaebe93fcd802dc6d15f048d3e4ff368c51c5 + FBLazyVector: 7b94bf4fe8fa8fc37e754af90ca67d25e48bc5f2 + FBReactNativeSpec: 609b6508be3aa0a4c04494bf45b8649ee04871fa Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c @@ -585,39 +585,39 @@ SPEC CHECKSUMS: OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c RCT-Folly: 24c6da766832002a4a2aac5f79ee0ca50fbe8507 - RCTRequired: d1c8013645605671f1d985dbda4340461b7b296b - RCTTypeSafety: 8703cdf1e2d03565dd2405805bc3ab95d8d1a4d3 - React: a5429e9b63b6ec8eb89f48b27b7b7f75f9279660 - React-callinvoker: 8073ac13522ce7838a68cbd6a5cf47c0ea36faa4 + RCTRequired: 4706407fae87532509c680b65e330090a1299798 + RCTTypeSafety: 17ff1805826c902e4e91381952f4900a28a6fee7 + React: 3134ceca68fa8e90213c09a96bfcabe02bb12a1b + React-callinvoker: 8ece25302fd8701ee5d41d51fba4e1943ef0b4e0 React-Codegen: b3fbef96f960cb15fc61250078b0700cfd4cd8a1 - React-Core: 3fa6a6c91404a54b7007f201b6a3cecfa1bbbe01 - React-CoreModules: 6cfd337a8ba5537091469d952a38c7c46e7ac252 - React-cxxreact: 21aaaedfc51c3401ef4d32029440cc2f04ad5223 - React-jsi: 693cd702f12fb19280d742885fa1e7c6c4a00fe7 - React-jsiexecutor: 0159ebf6e084b3e308ee5b0d55a99364bd579bd3 - React-jsinspector: f767ca2da6537ed40e0c3596f55c3bd424a57aa8 - React-logger: 634c59ae87045bd453bacf893e3c2e28999bdb88 - React-perflogger: 726a7f95639f3c5f6c17af49d4eb90b68ade141c - React-RCTActionSheet: 0474946a84df5c1f2d172917860801cdada01d50 - React-RCTAnimation: 53e91aa377084358d8980442b00718000e53ebc6 - React-RCTBlob: 4819f7b3dcb81b07b1496a927107e2119c5ff326 - React-RCTImage: 6a55bb79d6991c7163b3dd1aadb1a0ec8573563c - React-RCTLinking: 5d92a811d48477c333df7955cd017c7094659933 - React-RCTNetwork: 81661f0727cfcb3243d1444d413446fd939b28ac - React-RCTPushNotification: 0863b0b0e1a804d670f0a1dca70a094cb3da6e2f - React-RCTSettings: 3c770d256c89984c509e118dd6f18b22cd6ea745 - React-RCTTest: eb624496d14a5486db0f147d21ac5718ce4f2e4b - React-RCTText: ff8a41a7eb7a6c200b5455596779db64e5819e03 - React-RCTVibration: 5c066e3935cfc5ce986823bac69abb68180ede32 - React-runtimeexecutor: 9386159203e96e1598f5ec4979c62d37616f7179 + React-Core: e00c609b15999cd20fc1204d7cb8703a487f1791 + React-CoreModules: c398ee4410de61088e20fae5a62a75c9f315d0be + React-cxxreact: c8d2074107930610c962dfa89b99ed563b606c0e + React-jsi: 1afba7c112a54a0d20d809c29dfa51c92fa11ac7 + React-jsiexecutor: 802a25020d0fe67e4920f089bdb0d392467034f0 + React-jsinspector: 51e58c52aa1fe8a778816a26df3a6689e73f489e + React-logger: 6fbf43fafe8e25b53c195305088a1f8ffe8e6b4d + React-perflogger: 43b596dde60bf15cf8b4053008a2fa10d82926a1 + React-RCTActionSheet: de9dd1793c1b660ed55c8514900a5a87f79d1f90 + React-RCTAnimation: d11b97d2e9bc46fff3c0794b9379a9e16e566243 + React-RCTBlob: d6294e3a84b3c4e48be6c9b4663061103f34f31f + React-RCTImage: c789b0ff95fef0d4d69525acde2a247bb46d4ec1 + React-RCTLinking: 5ad63a2805334e36ea183b2b2aeb76a014c9ad83 + React-RCTNetwork: 4c531d5bd78ca34f845503f52cbd91341e6b3d2b + React-RCTPushNotification: 532147a2cbe281bda07579d5fc6610aff6e7ec79 + React-RCTSettings: b7191d404980767bf068351df0999ca220873983 + React-RCTTest: 99eb16b30306238a15bdc3e10edfd262f7169582 + React-RCTText: a377ec0145c1ce89b15cb9b598f850e3373cd5b1 + React-RCTVibration: 317549dff97581b507ee8fc01b1b1975e2e71945 + React-runtimeexecutor: fc502c0b0f1aa8ff30e013fdb4e8c47dd39aeea1 React-TurboModuleCxx-RNW: f2e32cbfced49190a61d66c993a8975de79a158a - React-TurboModuleCxx-WinRTPort: 2de77e70e91d76bd77708314731fa87829150acb - ReactCommon: f8793021ace6b93a7127ff22c60c7fe4cb44cc57 - ScreenshotManager: db4b25867db6c0d6e5a42037e9c2990e6a558644 + React-TurboModuleCxx-WinRTPort: 2cc7a4a1411069b755b937d9808cf35475f519da + ReactCommon: 3c7eb594c2363463eadb28689689246400f420a9 + ScreenshotManager: cfaf988fbf133b1f2dc9226d6f530e5a97ad46c1 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 5ada9a2c039e30dc56c2a1966a60497dc061e7d2 + Yoga: 0eb02dfb0fe67d34c2743c24f51ee8c2c91ebf3b YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 2887942075d3a45ef7ee8a635fd4e81ce396f6ec +PODFILE CHECKSUM: 269190aa122418d1013ce622d5ca1fdbe3fdf45e COCOAPODS: 1.11.2 diff --git a/packages/rn-tester/RNTester/Info.plist b/packages/rn-tester/RNTester/Info.plist index 788e4d6193c8d5..0b7f1d5d85183d 100644 --- a/packages/rn-tester/RNTester/Info.plist +++ b/packages/rn-tester/RNTester/Info.plist @@ -2,16 +2,6 @@ - LSApplicationQueriesSchemes - - tel - telprompt - http - fb - geo - - UIStatusBarStyle - UIStatusBarStyleBlackTranslucent CFBundleDevelopmentRegion en CFBundleExecutable @@ -43,6 +33,14 @@ CFBundleVersion 1 + LSApplicationQueriesSchemes + + tel + telprompt + http + fb + geo + LSRequiresIPhoneOS NSAppTransportSecurity @@ -52,12 +50,16 @@ NSLocationWhenInUseUsageDescription You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, otherwise it is going to *fail silently*! + NSPhotoLibraryUsageDescription + You need to add NSPhotoLibraryUsageDescription key in Info.plist to enable photo library usage, otherwise it is going to *fail silently*! UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities armv7 + UIStatusBarStyle + UIStatusBarStyleBlackTranslucent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait @@ -66,7 +68,5 @@ UIViewControllerBasedStatusBarAppearance - NSPhotoLibraryUsageDescription - You need to add NSPhotoLibraryUsageDescription key in Info.plist to enable photo library usage, otherwise it is going to *fail silently*!