@lodev09/react-native-true-sheet 3.6.1 → 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(
|
|
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,21 +670,31 @@
|
|
|
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;
|
|
675
677
|
}
|
|
676
678
|
|
|
677
679
|
// iOS 26.1+: use native backgroundEffect when only backgroundBlur is set (no backgroundColor)
|
|
680
|
+
// Fall back to TrueSheetBlurView when blur intensity is set (not 100%) since
|
|
681
|
+
// sheet.backgroundEffect doesn't support intensity control
|
|
678
682
|
if (@available(iOS 26.1, *)) {
|
|
679
683
|
if (useBackgroundEffect) {
|
|
684
|
+
BOOL hasCustomIntensity = self.blurIntensity && [self.blurIntensity floatValue] < 100;
|
|
680
685
|
if (!self.backgroundColor && self.backgroundBlur && self.backgroundBlur.length > 0) {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
686
|
+
if (hasCustomIntensity) {
|
|
687
|
+
// Clear native effect to allow custom blur view with intensity
|
|
688
|
+
self.sheet.backgroundEffect = [UIColorEffect effectWithColor:[UIColor clearColor]];
|
|
689
|
+
} else {
|
|
690
|
+
UIBlurEffectStyle style = [BlurUtil blurEffectStyleFromString:self.backgroundBlur];
|
|
691
|
+
self.sheet.backgroundEffect = [UIBlurEffect effectWithStyle:style];
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
684
694
|
}
|
|
685
695
|
}
|
|
686
696
|
}
|
|
697
|
+
#endif
|
|
687
698
|
|
|
688
699
|
NSString *effectiveBackgroundBlur = self.backgroundBlur;
|
|
689
700
|
if (@available(iOS 26.0, *)) {
|
|
@@ -710,12 +721,14 @@
|
|
|
710
721
|
[_blurView applyBlurEffect];
|
|
711
722
|
}
|
|
712
723
|
|
|
724
|
+
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1)
|
|
713
725
|
if (@available(iOS 26.1, *)) {
|
|
714
726
|
if (useBackgroundEffect && self.backgroundColor) {
|
|
715
727
|
self.sheet.backgroundEffect = [UIColorEffect effectWithColor:self.backgroundColor];
|
|
716
728
|
return;
|
|
717
729
|
}
|
|
718
730
|
}
|
|
731
|
+
#endif
|
|
719
732
|
|
|
720
733
|
self.view.backgroundColor = self.backgroundColor;
|
|
721
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