@lodev09/react-native-true-sheet 3.6.2 → 3.6.3

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.
@@ -154,7 +154,7 @@ class TrueSheetView(private val reactContext: ThemedReactContext) :
154
154
  TrueSheetStackManager.removeSheet(this)
155
155
 
156
156
  if (viewController.isPresented) {
157
- viewController.dismiss()
157
+ viewController.dismiss(animated = false)
158
158
  }
159
159
  viewController.delegate = null
160
160
  }
@@ -757,7 +757,6 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
757
757
 
758
758
  val adjustedHalfExpandedHeight = minOf(halfExpandedDetentHeight, maxAvailableHeight)
759
759
  val halfExpandedRatio = (adjustedHalfExpandedHeight.toFloat() / realScreenHeight.toFloat())
760
- .coerceIn(0f, 0.999f)
761
760
 
762
761
  val expandedOffset = realScreenHeight - maxDetentHeight
763
762
 
@@ -802,7 +801,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
802
801
  isFitToContents = fitToContents
803
802
  skipCollapsed = false
804
803
  setPeekHeight(peekHeight, animate)
805
- this.halfExpandedRatio = halfExpandedRatio.coerceIn(0f, 0.999f)
804
+ this.halfExpandedRatio = halfExpandedRatio.coerceIn(0.01f, 0.999f)
806
805
  this.expandedOffset = expandedOffset
807
806
  }
808
807
  }
@@ -13,6 +13,7 @@
13
13
  #import "core/TrueSheetGrabberView.h"
14
14
  #import "utils/BlurUtil.h"
15
15
  #import "utils/GestureUtil.h"
16
+ #import "utils/PlatformUtil.h"
16
17
  #import "utils/WindowUtil.h"
17
18
 
18
19
  #import <React/RCTLog.h>
@@ -669,6 +670,7 @@
669
670
  }
670
671
 
671
672
  - (void)setupBackground {
673
+ #if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1)
672
674
  BOOL useBackgroundEffect = NO;
673
675
  if (@available(iOS 26.1, *)) {
674
676
  useBackgroundEffect = !self.isDesignCompatibilityMode;
@@ -692,6 +694,7 @@
692
694
  }
693
695
  }
694
696
  }
697
+ #endif
695
698
 
696
699
  NSString *effectiveBackgroundBlur = self.backgroundBlur;
697
700
  if (@available(iOS 26.0, *)) {
@@ -718,12 +721,14 @@
718
721
  [_blurView applyBlurEffect];
719
722
  }
720
723
 
724
+ #if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1)
721
725
  if (@available(iOS 26.1, *)) {
722
726
  if (useBackgroundEffect && self.backgroundColor) {
723
727
  self.sheet.backgroundEffect = [UIColorEffect effectWithColor:self.backgroundColor];
724
728
  return;
725
729
  }
726
730
  }
731
+ #endif
727
732
 
728
733
  self.view.backgroundColor = self.backgroundColor;
729
734
  }
@@ -0,0 +1,15 @@
1
+ //
2
+ // Created by Jovanni Lo (@lodev09)
3
+ // Copyright (c) 2024-present. All rights reserved.
4
+ //
5
+ // This source code is licensed under the MIT license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
8
+
9
+ #ifndef PlatformUtil_h
10
+ #define PlatformUtil_h
11
+
12
+ #define RNTS_IPHONE_OS_VERSION_AVAILABLE(v) \
13
+ (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_##v) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_##v)
14
+
15
+ #endif /* PlatformUtil_h */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.6.2",
3
+ "version": "3.6.3",
4
4
  "description": "The true native bottom sheet experience for your React Native Apps.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",