Skip to content

Commit

Permalink
Update react-native-screens to 3.20.0 (#21186)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsapeta committed Feb 14, 2023
1 parent 33b3072 commit 0681cd7
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 190 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -25,7 +25,7 @@ Package-specific changes not released in any SDK will be added here just before
- Updated `react-native-reanimated` from `2.12.0` to `2.14.4`. ([#20798](https://github.com/expo/expo/pull/20798) by [@kudo](https://github.com/kudo), [#20990](https://github.com/expo/expo/pull/20990) by [@tsapeta](https://github.com/tsapeta))
- Updated `@shopify/react-native-skia` from `0.1.157` to `0.1.172`. ([#20857](https://github.com/expo/expo/pull/20857), [#21014](https://github.com/expo/expo/pull/21014) by [@kudo](https://github.com/kudo))
- Updated `react-native-safe-area-context` from `4.4.1` to `4.5.0`. ([#20899](https://github.com/expo/expo/pull/20899) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Updated `react-native-screens` from `3.18.0` to `3.19.0`. ([#20938](https://github.com/expo/expo/pull/20938) by [@lukmccall](https://github.com/lukmccall))
- Updated `react-native-screens` from `3.18.0` to `3.20.0`. ([#20938](https://github.com/expo/expo/pull/20938) by [@lukmccall](https://github.com/lukmccall), [#21186](https://github.com/expo/expo/pull/21186) by [@tsapeta](https://github.com/tsapeta))
- Updated `react-native-pager-view` from `6.0.1` to `6.1.2`. ([#20932](https://github.com/expo/expo/pull/20932) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Updated `@react-native-community/slider` from `4.2.4` to `4.4.2`. ([#20903](https://github.com/expo/expo/pull/20903) by [@gabrieldonadel](https://github.com/gabrieldonadel), [#21055](https://github.com/expo/expo/pull/21055) by [@kudo](https://github.com/kudo))
- Updated `react-native-shared-element` from `0.8.7` to `0.8.8`. ([#20929](https://github.com/expo/expo/pull/20929) by [@byCedric](https://github.com/byCedric))
Expand Down
Expand Up @@ -156,16 +156,6 @@ class ScreenViewManager : ViewGroupManager<Screen>(), RNSScreenManagerInterface<

override fun setSwipeDirection(view: Screen?, value: String?) = Unit

override fun setSheetAllowedDetents(view: Screen, value: String?) = Unit

override fun setSheetLargestUndimmedDetent(view: Screen, value: String?) = Unit

override fun setSheetGrabberVisible(view: Screen?, value: Boolean) = Unit

override fun setSheetCornerRadius(view: Screen?, value: Float) = Unit

override fun setSheetExpandsWhenScrolledToEdge(view: Screen?, value: Boolean) = Unit

override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any> {
return MapBuilder.of(
ScreenDismissedEvent.EVENT_NAME,
Expand Down
Expand Up @@ -23,21 +23,6 @@ public RNSScreenManagerDelegate(U viewManager) {
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "sheetAllowedDetents":
mViewManager.setSheetAllowedDetents(view, (String) value);
break;
case "sheetLargestUndimmedDetent":
mViewManager.setSheetLargestUndimmedDetent(view, (String) value);
break;
case "sheetGrabberVisible":
mViewManager.setSheetGrabberVisible(view, value == null ? false : (boolean) value);
break;
case "sheetCornerRadius":
mViewManager.setSheetCornerRadius(view, value == null ? -1f : ((Double) value).floatValue());
break;
case "sheetExpandsWhenScrolledToEdge":
mViewManager.setSheetExpandsWhenScrolledToEdge(view, value == null ? false : (boolean) value);
break;
case "customAnimationOnSwipe":
mViewManager.setCustomAnimationOnSwipe(view, value == null ? false : (boolean) value);
break;
Expand Down
Expand Up @@ -14,11 +14,6 @@
import com.facebook.react.bridge.ReadableMap;

public interface RNSScreenManagerInterface<T extends View> {
void setSheetAllowedDetents(T view, @Nullable String value);
void setSheetLargestUndimmedDetent(T view, @Nullable String value);
void setSheetGrabberVisible(T view, boolean value);
void setSheetCornerRadius(T view, float value);
void setSheetExpandsWhenScrolledToEdge(T view, boolean value);
void setCustomAnimationOnSwipe(T view, boolean value);
void setFullScreenSwipeEnabled(T view, boolean value);
void setHomeIndicatorHidden(T view, boolean value);
Expand Down
4 changes: 2 additions & 2 deletions apps/bare-expo/ios/Podfile.lock
Expand Up @@ -721,7 +721,7 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.19.0):
- RNScreens (3.20.0):
- React-Core
- React-RCTImage
- RNSharedElement (0.8.8):
Expand Down Expand Up @@ -1354,7 +1354,7 @@ SPEC CHECKSUMS:
RNFlashList: 399bf6a0db68f594ad2c86aaff3ea39564f39f8a
RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39
RNReanimated: addc4900bf47882118d0a1b21747fa6705fa8cff
RNScreens: ea4cd3a853063cda19a4e3c28d2e52180c80f4eb
RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f
RNSharedElement: 504fa28a235b12505b6daedbb452a9ec96809bd0
RNSVG: 07dbd870b0dcdecc99b3a202fa37c8ca163caec2
SDWebImage: 9bec4c5cdd9579e1f57104735ee0c37df274d593
Expand Down
2 changes: 1 addition & 1 deletion apps/bare-expo/package.json
Expand Up @@ -84,7 +84,7 @@
"react-native-pager-view": "6.1.2",
"react-native-reanimated": "~2.14.4",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.19.0",
"react-native-screens": "~3.20.0",
"react-native-shared-element": "0.8.8",
"react-native-svg": "13.4.0",
"react-native-view-shot": "3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/native-component-list/package.json
Expand Up @@ -148,7 +148,7 @@
"react-native-paper": "^4.0.1",
"react-native-reanimated": "~2.14.4",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.19.0",
"react-native-screens": "~3.20.0",
"react-native-shared-element": "0.8.8",
"react-native-svg": "13.4.0",
"react-native-view-shot": "3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion home/package.json
Expand Up @@ -65,7 +65,7 @@
"react-native-paper": "^4.0.1",
"react-native-reanimated": "~2.14.4",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.19.0",
"react-native-screens": "~3.20.0",
"react-redux": "^7.2.0",
"react-string-replace": "^0.4.4",
"reanimated-bottom-sheet": "^1.0.0-alpha.18",
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Expand Up @@ -2897,7 +2897,7 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.19.0):
- RNScreens (3.20.0):
- React-Core
- React-RCTImage
- RNSVG (13.4.0):
Expand Down Expand Up @@ -4876,7 +4876,7 @@ SPEC CHECKSUMS:
RNFlashList: 399bf6a0db68f594ad2c86aaff3ea39564f39f8a
RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39
RNReanimated: 2757554a90c8eb038535bb1fce12c49cc027a934
RNScreens: ea4cd3a853063cda19a4e3c28d2e52180c80f4eb
RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f
RNSVG: 07dbd870b0dcdecc99b3a202fa37c8ca163caec2
SDWebImage: 9bec4c5cdd9579e1f57104735ee0c37df274d593
SDWebImageAVIFCoder: 5bf07409ab8a02f0a8e0ac976719b321d8fce209
Expand Down
@@ -1,6 +1,6 @@
{
"name": "RNScreens",
"version": "3.19.0",
"version": "3.20.0",
"summary": "Native navigation primitives for your React Native app.",
"description": "RNScreens - first incomplete navigation solution for your React Native app",
"homepage": "https://github.com/software-mansion/react-native-screens",
Expand All @@ -14,7 +14,7 @@
},
"source": {
"git": "https://github.com/software-mansion/react-native-screens.git",
"tag": "3.19.0"
"tag": "3.20.0"
},
"source_files": "ios/**/*.{h,m,mm}",
"requires_arc": true,
Expand Down
Expand Up @@ -19,12 +19,6 @@
+ (RNSScreenSwipeDirection)RNSScreenSwipeDirectionFromCppEquivalent:
(facebook::react::RNSScreenSwipeDirection)swipeDirection;

+ (RNSScreenDetentType)RNSScreenDetentTypeFromAllowedDetents:
(facebook::react::RNSScreenSheetAllowedDetents)allowedDetents;

+ (RNSScreenDetentType)RNSScreenDetentTypeFromLargestUndimmedDetent:
(facebook::react::RNSScreenSheetLargestUndimmedDetent)detent;

+ (NSDictionary *)gestureResponseDistanceDictFromCppStruct:
(const facebook::react::RNSScreenGestureResponseDistanceStruct &)gestureResponseDistance;

Expand Down
26 changes: 0 additions & 26 deletions ios/vendored/unversioned/react-native-screens/ios/RNSConvert.mm
Expand Up @@ -89,32 +89,6 @@ + (RNSScreenSwipeDirection)RNSScreenSwipeDirectionFromCppEquivalent:
}
}

+ (RNSScreenDetentType)RNSScreenDetentTypeFromAllowedDetents:
(facebook::react::RNSScreenSheetAllowedDetents)allowedDetents
{
switch (allowedDetents) {
case facebook::react::RNSScreenSheetAllowedDetents::All:
return RNSScreenDetentTypeAll;
case facebook::react::RNSScreenSheetAllowedDetents::Large:
return RNSScreenDetentTypeLarge;
case facebook::react::RNSScreenSheetAllowedDetents::Medium:
return RNSScreenDetentTypeMedium;
}
}

+ (RNSScreenDetentType)RNSScreenDetentTypeFromLargestUndimmedDetent:
(facebook::react::RNSScreenSheetLargestUndimmedDetent)detent
{
switch (detent) {
case facebook::react::RNSScreenSheetLargestUndimmedDetent::All:
return RNSScreenDetentTypeAll;
case facebook::react::RNSScreenSheetLargestUndimmedDetent::Large:
return RNSScreenDetentTypeLarge;
case facebook::react::RNSScreenSheetLargestUndimmedDetent::Medium:
return RNSScreenDetentTypeMedium;
}
}

+ (NSDictionary *)gestureResponseDistanceDictFromCppStruct:
(const facebook::react::RNSScreenGestureResponseDistanceStruct &)gestureResponseDistance
{
Expand Down
6 changes: 0 additions & 6 deletions ios/vendored/unversioned/react-native-screens/ios/RNSEnums.h
Expand Up @@ -57,9 +57,3 @@ typedef NS_ENUM(NSInteger, RNSScreenStackHeaderSubviewType) {
RNSScreenStackHeaderSubviewTypeCenter,
RNSScreenStackHeaderSubviewTypeSearchBar,
};

typedef NS_ENUM(NSInteger, RNSScreenDetentType) {
RNSScreenDetentTypeMedium,
RNSScreenDetentTypeLarge,
RNSScreenDetentTypeAll,
};
7 changes: 0 additions & 7 deletions ios/vendored/unversioned/react-native-screens/ios/RNSScreen.h
Expand Up @@ -75,13 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) UIInterfaceOrientationMask screenOrientation;
@property (nonatomic) BOOL statusBarHidden;
@property (nonatomic) BOOL homeIndicatorHidden;

// Props controlling UISheetPresentationController
@property (nonatomic) RNSScreenDetentType sheetAllowedDetents;
@property (nonatomic) RNSScreenDetentType sheetLargestUndimmedDetent;
@property (nonatomic) BOOL sheetGrabberVisible;
@property (nonatomic) CGFloat sheetCornerRadius;
@property (nonatomic) BOOL sheetExpandsWhenScrolledToEdge;
#endif // !TARGET_OS_TV

#ifdef RN_FABRIC_ENABLED
Expand Down
99 changes: 0 additions & 99 deletions ios/vendored/unversioned/react-native-screens/ios/RNSScreen.mm
Expand Up @@ -82,9 +82,6 @@ - (void)initCommonProps
_hasStatusBarHiddenSet = NO;
_hasOrientationSet = NO;
_hasHomeIndicatorHiddenSet = NO;
#if !TARGET_OS_TV
_sheetExpandsWhenScrolledToEdge = YES;
#endif // !TARGET_OS_TV
}

- (UIViewController *)reactViewController
Expand Down Expand Up @@ -517,60 +514,6 @@ - (BOOL)isModal
return self.stackPresentation != RNSScreenStackPresentationPush;
}

#if !TARGET_OS_TV
/**
* Updates settings for sheet presentation controller.
* Note that this method should not be called inside `stackPresentation` setter, because on Paper we don't have
* guarantee that values of all related props had been updated earlier.
*/
- (void)updatePresentationStyle
{
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_15_0) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0
if (@available(iOS 15.0, *)) {
UISheetPresentationController *sheet = _controller.sheetPresentationController;
if (_stackPresentation == RNSScreenStackPresentationFormSheet && sheet != nil) {
sheet.prefersScrollingExpandsWhenScrolledToEdge = _sheetExpandsWhenScrolledToEdge;
sheet.prefersGrabberVisible = _sheetGrabberVisible;
sheet.preferredCornerRadius =
_sheetCornerRadius < 0 ? UISheetPresentationControllerAutomaticDimension : _sheetCornerRadius;

if (_sheetLargestUndimmedDetent == RNSScreenDetentTypeMedium) {
sheet.largestUndimmedDetentIdentifier = UISheetPresentationControllerDetentIdentifierMedium;
} else if (_sheetLargestUndimmedDetent == RNSScreenDetentTypeLarge) {
sheet.largestUndimmedDetentIdentifier = UISheetPresentationControllerDetentIdentifierLarge;
} else if (_sheetLargestUndimmedDetent == RNSScreenDetentTypeAll) {
sheet.largestUndimmedDetentIdentifier = nil;
} else {
RCTLogError(@"Unhandled value of sheetLargestUndimmedDetent passed");
}

if (_sheetAllowedDetents == RNSScreenDetentTypeMedium) {
sheet.detents = @[ UISheetPresentationControllerDetent.mediumDetent ];
if (sheet.selectedDetentIdentifier != UISheetPresentationControllerDetentIdentifierMedium) {
[sheet animateChanges:^{
sheet.selectedDetentIdentifier = UISheetPresentationControllerDetentIdentifierMedium;
}];
}
} else if (_sheetAllowedDetents == RNSScreenDetentTypeLarge) {
sheet.detents = @[ UISheetPresentationControllerDetent.largeDetent ];
if (sheet.selectedDetentIdentifier != UISheetPresentationControllerDetentIdentifierLarge) {
[sheet animateChanges:^{
sheet.selectedDetentIdentifier = UISheetPresentationControllerDetentIdentifierLarge;
}];
}
} else if (_sheetAllowedDetents == RNSScreenDetentTypeAll) {
sheet.detents =
@[ UISheetPresentationControllerDetent.mediumDetent, UISheetPresentationControllerDetent.largeDetent ];
} else {
RCTLogError(@"Unhandled value of sheetAllowedDetents passed");
}
}
}
#endif // Check for max allowed iOS version
}
#endif // !TARGET_OS_TV

#pragma mark - Fabric specific
#ifdef RN_FABRIC_ENABLED

Expand Down Expand Up @@ -670,19 +613,6 @@ - (void)updateProps:(facebook::react::Props::Shared const &)props
if (newScreenProps.homeIndicatorHidden != oldScreenProps.homeIndicatorHidden) {
[self setHomeIndicatorHidden:newScreenProps.homeIndicatorHidden];
}

[self setSheetGrabberVisible:newScreenProps.sheetGrabberVisible];
[self setSheetCornerRadius:newScreenProps.sheetCornerRadius];
[self setSheetExpandsWhenScrolledToEdge:newScreenProps.sheetExpandsWhenScrolledToEdge];

if (newScreenProps.sheetAllowedDetents != oldScreenProps.sheetAllowedDetents) {
[self setSheetAllowedDetents:[RNSConvert RNSScreenDetentTypeFromAllowedDetents:newScreenProps.sheetAllowedDetents]];
}

if (newScreenProps.sheetLargestUndimmedDetent != oldScreenProps.sheetLargestUndimmedDetent) {
[self setSheetLargestUndimmedDetent:
[RNSConvert RNSScreenDetentTypeFromLargestUndimmedDetent:newScreenProps.sheetLargestUndimmedDetent]];
}
#endif // !TARGET_OS_TV

// Notice that we compare against _stackPresentation, not oldScreenProps.stackPresentation.
Expand All @@ -693,11 +623,6 @@ - (void)updateProps:(facebook::react::Props::Shared const &)props
[self setStackPresentation:newStackPresentation];
}

#if !TARGET_OS_TV
// This must be called after setter for stackPresentation
[self updatePresentationStyle];
#endif // !TARGET_OS_TV

if (newScreenProps.stackAnimation != oldScreenProps.stackAnimation) {
[self setStackAnimation:[RNSConvert RNSScreenStackAnimationFromCppEquivalent:newScreenProps.stackAnimation]];
}
Expand Down Expand Up @@ -736,14 +661,6 @@ - (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetric
#pragma mark - Paper specific
#else

- (void)didSetProps:(NSArray<NSString *> *)changedProps
{
[super didSetProps:changedProps];
#if !TARGET_OS_TV
[self updatePresentationStyle];
#endif // !TARGET_OS_TV
}

- (void)setPointerEvents:(RCTPointerEvents)pointerEvents
{
// pointer events settings are managed by the parent screen container, we ignore
Expand Down Expand Up @@ -1280,12 +1197,6 @@ @implementation RNSScreenManager
RCT_EXPORT_VIEW_PROPERTY(statusBarHidden, BOOL)
RCT_EXPORT_VIEW_PROPERTY(statusBarStyle, RNSStatusBarStyle)
RCT_EXPORT_VIEW_PROPERTY(homeIndicatorHidden, BOOL)

RCT_EXPORT_VIEW_PROPERTY(sheetAllowedDetents, RNSScreenDetentType);
RCT_EXPORT_VIEW_PROPERTY(sheetLargestUndimmedDetent, RNSScreenDetentType);
RCT_EXPORT_VIEW_PROPERTY(sheetGrabberVisible, BOOL);
RCT_EXPORT_VIEW_PROPERTY(sheetCornerRadius, CGFloat);
RCT_EXPORT_VIEW_PROPERTY(sheetExpandsWhenScrolledToEdge, BOOL);
#endif

#if !TARGET_OS_TV
Expand Down Expand Up @@ -1398,16 +1309,6 @@ @implementation RCTConvert (RNSScreen)
RNSStatusBarStyleAuto,
integerValue)

RCT_ENUM_CONVERTER(
RNSScreenDetentType,
(@{
@"large" : @(RNSScreenDetentTypeLarge),
@"medium" : @(RNSScreenDetentTypeMedium),
@"all" : @(RNSScreenDetentTypeAll),
}),
RNSScreenDetentTypeAll,
integerValue)

+ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(id)json
{
json = [self NSString:json];
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-stories/package.json
Expand Up @@ -32,7 +32,7 @@
"glob": "^7.1.7",
"react-native-gesture-handler": "~2.9.0",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.19.0",
"react-native-screens": "~3.20.0",
"react-native-svg": "13.4.0",
"sane": "^5.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/expo/bundledNativeModules.json
Expand Up @@ -92,7 +92,7 @@
"react-native-maps": "1.3.2",
"react-native-pager-view": "6.1.2",
"react-native-reanimated": "~2.14.4",
"react-native-screens": "~3.19.0",
"react-native-screens": "~3.20.0",
"react-native-safe-area-context": "4.5.0",
"react-native-shared-element": "0.8.8",
"react-native-svg": "13.4.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -15740,10 +15740,10 @@ react-native-safe-modules@^1.0.3:
dependencies:
dedent "^0.6.0"

react-native-screens@~3.19.0:
version "3.19.0"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.19.0.tgz#ec68685e04b074ebce4641b3a0ae7e2571629b75"
integrity sha512-Ehsmy7jr3H3j5pmN+/FqsAaIAD+k+xkcdePfLcg4rYRbN5X7fJPgaqhcmiCcZ0YxsU8ttsstP9IvRLNQuIkRRA==
react-native-screens@~3.20.0:
version "3.20.0"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.20.0.tgz#4d154177395e5541387d9a05bc2e12e54d2fb5b1"
integrity sha512-joWUKWAVHxymP3mL9gYApFHAsbd9L6ZcmpoZa6Sl3W/82bvvNVMqcfP7MeNqVCg73qZ8yL4fW+J/syusHleUgg==
dependencies:
react-freeze "^1.0.0"
warn-once "^0.1.0"
Expand Down

0 comments on commit 0681cd7

Please sign in to comment.