@lodev09/react-native-true-sheet 3.10.0-beta.0 → 3.10.0-beta.2
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.
- package/README.md +1 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +2 -8
- package/ios/TrueSheetContainerView.h +2 -0
- package/ios/TrueSheetContainerView.mm +32 -0
- package/ios/TrueSheetContentView.h +6 -0
- package/ios/TrueSheetContentView.mm +53 -7
- package/ios/TrueSheetFooterView.mm +6 -10
- package/ios/TrueSheetHeaderView.mm +4 -1
- package/ios/TrueSheetView.mm +22 -15
- package/ios/TrueSheetViewController.mm +1 -1
- package/ios/utils/UIView+ScrollEdgeInteraction.h +25 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +57 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +4 -0
- package/lib/typescript/src/TrueSheet.types.d.ts +21 -0
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +3 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheet.types.ts +24 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +4 -0
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ The true native bottom sheet experience for your React Native Apps. 💩
|
|
|
15
15
|
* 🚀 **Fully Native** - Implemented in the native realm, zero JS hacks
|
|
16
16
|
* ♿ **Accessible** - Native accessibility and screen reader support out of the box
|
|
17
17
|
* 🔄 **Flexible API** - Use [imperative methods](https://sheet.lodev09.com/reference/methods#ref-methods) or [lifecycle events](https://sheet.lodev09.com/reference/events)
|
|
18
|
+
* ⌨️ **Keyboard Handling** - Built-in [keyboard handling](https://sheet.lodev09.com/guides/keyboard) with automatic adjustment
|
|
18
19
|
* 📐 **Side Sheets** - Native [side sheet](https://sheet.lodev09.com/guides/side-sheets) support for iPad and Android tablets
|
|
19
20
|
* 🪟 **Liquid Glass** - [iOS 26+ Liquid Glass](https://sheet.lodev09.com/guides/liquid-glass) support out of the box, featured in [Expo Blog](https://expo.dev/blog/how-to-create-apple-maps-style-liquid-glass-sheets)
|
|
20
21
|
* 🐎 **Reanimated** - First-class support for [react-native-reanimated](https://sheet.lodev09.com/guides/reanimated)
|
|
@@ -119,9 +119,6 @@ class TrueSheetView(private val reactContext: ThemedReactContext) :
|
|
|
119
119
|
|
|
120
120
|
if (child is TrueSheetContainerView) {
|
|
121
121
|
child.delegate = this
|
|
122
|
-
viewController.createSheet()
|
|
123
|
-
setupScrollable()
|
|
124
|
-
|
|
125
122
|
val surfaceId = UIManagerHelper.getSurfaceId(this)
|
|
126
123
|
eventDispatcher?.dispatchEvent(MountEvent(surfaceId, id))
|
|
127
124
|
}
|
|
@@ -349,11 +346,8 @@ class TrueSheetView(private val reactContext: ThemedReactContext) :
|
|
|
349
346
|
return
|
|
350
347
|
}
|
|
351
348
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
promiseCallback()
|
|
355
|
-
return
|
|
356
|
-
}
|
|
349
|
+
viewController.createSheet()
|
|
350
|
+
setupScrollable()
|
|
357
351
|
|
|
358
352
|
// Dismiss keyboard if focused view is within a sheet or if target detent will be dimmed
|
|
359
353
|
val parentSheet = TrueSheetStackManager.getTopmostSheet()
|
|
@@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
17
17
|
|
|
18
18
|
@property (nonatomic, assign) CGFloat keyboardScrollOffset;
|
|
19
19
|
@property (nonatomic, assign) BOOL scrollingExpandsSheet;
|
|
20
|
+
@property (nonatomic, assign) NSInteger topScrollEdgeEffect;
|
|
21
|
+
@property (nonatomic, assign) NSInteger bottomScrollEdgeEffect;
|
|
20
22
|
|
|
21
23
|
@end
|
|
22
24
|
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
10
|
|
|
11
11
|
#import "TrueSheetContainerView.h"
|
|
12
|
+
#import <React/RCTScrollViewComponentView.h>
|
|
12
13
|
#import "TrueSheetContentView.h"
|
|
13
14
|
#import "TrueSheetFooterView.h"
|
|
14
15
|
#import "TrueSheetHeaderView.h"
|
|
15
16
|
#import "TrueSheetViewController.h"
|
|
16
17
|
#import "core/TrueSheetKeyboardObserver.h"
|
|
18
|
+
#import "utils/UIView+ScrollEdgeInteraction.h"
|
|
17
19
|
#import "utils/WindowUtil.h"
|
|
18
20
|
|
|
19
21
|
#import <react/renderer/components/TrueSheetSpec/ComponentDescriptors.h>
|
|
@@ -33,6 +35,8 @@ using namespace facebook::react;
|
|
|
33
35
|
if (self = [super init]) {
|
|
34
36
|
_keyboardScrollOffset = 0;
|
|
35
37
|
_scrollingExpandsSheet = YES;
|
|
38
|
+
_topScrollEdgeEffect = (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hidden;
|
|
39
|
+
_bottomScrollEdgeEffect = (NSInteger)TrueSheetViewBottomScrollEdgeEffect::Hidden;
|
|
36
40
|
}
|
|
37
41
|
return self;
|
|
38
42
|
}
|
|
@@ -111,6 +115,34 @@ using namespace facebook::react;
|
|
|
111
115
|
bottomInset = [WindowUtil keyWindow].safeAreaInsets.bottom;
|
|
112
116
|
}
|
|
113
117
|
[_contentView setupScrollable:_scrollableEnabled bottomInset:bottomInset];
|
|
118
|
+
[_contentView applyScrollEdgeEffects:_scrollableOptions];
|
|
119
|
+
if (@available(iOS 26.0, *)) {
|
|
120
|
+
[self setupEdgeInteractions];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
- (void)setupEdgeInteractions API_AVAILABLE(ios(26.0)) {
|
|
126
|
+
if (!_contentView) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
NSInteger topEffect =
|
|
131
|
+
_scrollableOptions ? _scrollableOptions.topScrollEdgeEffect : (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hidden;
|
|
132
|
+
NSInteger bottomEffect = _scrollableOptions ? _scrollableOptions.bottomScrollEdgeEffect
|
|
133
|
+
: (NSInteger)TrueSheetViewBottomScrollEdgeEffect::Hidden;
|
|
134
|
+
|
|
135
|
+
BOOL topHidden = topEffect == (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hidden;
|
|
136
|
+
BOOL bottomHidden = bottomEffect == (NSInteger)TrueSheetViewBottomScrollEdgeEffect::Hidden;
|
|
137
|
+
|
|
138
|
+
RCTScrollViewComponentView *scrollViewComponent = [_contentView findScrollView];
|
|
139
|
+
UIScrollView *scrollView = scrollViewComponent.scrollView;
|
|
140
|
+
|
|
141
|
+
if (_headerView) {
|
|
142
|
+
[_headerView setupEdgeInteractionWithScrollView:topHidden ? nil : scrollView edge:UIRectEdgeTop];
|
|
143
|
+
}
|
|
144
|
+
if (_footerView) {
|
|
145
|
+
[_footerView setupEdgeInteractionWithScrollView:bottomHidden ? nil : scrollView edge:UIRectEdgeBottom];
|
|
114
146
|
}
|
|
115
147
|
}
|
|
116
148
|
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
@class TrueSheetViewController;
|
|
18
18
|
@class RCTScrollViewComponentView;
|
|
19
|
+
@class ScrollableOptions;
|
|
19
20
|
|
|
20
21
|
NS_ASSUME_NONNULL_BEGIN
|
|
21
22
|
|
|
@@ -46,6 +47,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
46
47
|
*/
|
|
47
48
|
- (void)updateScrollViewHeight;
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Apply scroll edge effects to the pinned scroll view (iOS 26+)
|
|
52
|
+
*/
|
|
53
|
+
- (void)applyScrollEdgeEffects:(nullable ScrollableOptions *)options;
|
|
54
|
+
|
|
49
55
|
@end
|
|
50
56
|
|
|
51
57
|
NS_ASSUME_NONNULL_END
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
15
15
|
#import <react/renderer/components/TrueSheetSpec/Props.h>
|
|
16
16
|
#import <react/renderer/components/TrueSheetSpec/RCTComponentViewHelpers.h>
|
|
17
|
+
#import "TrueSheetContainerView.h"
|
|
17
18
|
#import "TrueSheetView.h"
|
|
18
19
|
#import "TrueSheetViewController.h"
|
|
20
|
+
#import "utils/PlatformUtil.h"
|
|
19
21
|
#import "utils/UIView+FirstResponder.h"
|
|
20
22
|
|
|
21
23
|
using namespace facebook::react;
|
|
@@ -200,6 +202,47 @@ using namespace facebook::react;
|
|
|
200
202
|
return nil;
|
|
201
203
|
}
|
|
202
204
|
|
|
205
|
+
#pragma mark - Scroll Edge Effects
|
|
206
|
+
|
|
207
|
+
- (void)applyScrollEdgeEffects:(nullable ScrollableOptions *)options {
|
|
208
|
+
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_0)
|
|
209
|
+
if (!_pinnedScrollView)
|
|
210
|
+
return;
|
|
211
|
+
|
|
212
|
+
if (@available(iOS 26.0, *)) {
|
|
213
|
+
UIScrollView *scrollView = _pinnedScrollView.scrollView;
|
|
214
|
+
NSInteger topEffect = options ? options.topScrollEdgeEffect : (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hidden;
|
|
215
|
+
NSInteger bottomEffect =
|
|
216
|
+
options ? options.bottomScrollEdgeEffect : (NSInteger)TrueSheetViewBottomScrollEdgeEffect::Hidden;
|
|
217
|
+
|
|
218
|
+
[self applyEdgeEffect:topEffect toEdge:scrollView.topEdgeEffect];
|
|
219
|
+
[self applyEdgeEffect:bottomEffect toEdge:scrollView.bottomEdgeEffect];
|
|
220
|
+
}
|
|
221
|
+
#endif
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_0)
|
|
225
|
+
- (void)applyEdgeEffect:(NSInteger)effect toEdge:(UIScrollEdgeEffect *)edgeEffect API_AVAILABLE(ios(26.0)) {
|
|
226
|
+
switch (effect) {
|
|
227
|
+
case (NSInteger)TrueSheetViewTopScrollEdgeEffect::Automatic:
|
|
228
|
+
edgeEffect.hidden = NO;
|
|
229
|
+
edgeEffect.style = UIScrollEdgeEffectStyle.automaticStyle;
|
|
230
|
+
break;
|
|
231
|
+
case (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hard:
|
|
232
|
+
edgeEffect.hidden = NO;
|
|
233
|
+
edgeEffect.style = UIScrollEdgeEffectStyle.hardStyle;
|
|
234
|
+
break;
|
|
235
|
+
case (NSInteger)TrueSheetViewTopScrollEdgeEffect::Soft:
|
|
236
|
+
edgeEffect.hidden = NO;
|
|
237
|
+
edgeEffect.style = UIScrollEdgeEffectStyle.softStyle;
|
|
238
|
+
break;
|
|
239
|
+
case (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hidden:
|
|
240
|
+
edgeEffect.hidden = YES;
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
#endif
|
|
245
|
+
|
|
203
246
|
#pragma mark - TrueSheetKeyboardObserverDelegate
|
|
204
247
|
|
|
205
248
|
- (void)keyboardWillShow:(CGFloat)height duration:(NSTimeInterval)duration curve:(UIViewAnimationOptions)curve {
|
|
@@ -216,15 +259,18 @@ using namespace facebook::react;
|
|
|
216
259
|
animations:^{
|
|
217
260
|
[self setScrollViewContentInset:height
|
|
218
261
|
indicatorInset:self->_originalIndicatorBottomInset + height];
|
|
219
|
-
|
|
220
|
-
if (firstResponder) {
|
|
221
|
-
CGRect responderFrame = [firstResponder convertRect:firstResponder.bounds
|
|
222
|
-
toView:self->_pinnedScrollView.scrollView];
|
|
223
|
-
responderFrame.size.height += self.keyboardScrollOffset;
|
|
224
|
-
[self->_pinnedScrollView.scrollView scrollRectToVisible:responderFrame animated:NO];
|
|
225
|
-
}
|
|
226
262
|
}
|
|
227
263
|
completion:nil];
|
|
264
|
+
|
|
265
|
+
// Defer scroll until the next run loop so content insets are applied first
|
|
266
|
+
if (firstResponder) {
|
|
267
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
268
|
+
CGRect responderFrame = [firstResponder convertRect:firstResponder.bounds
|
|
269
|
+
toView:self->_pinnedScrollView.scrollView];
|
|
270
|
+
responderFrame.size.height += self.keyboardScrollOffset;
|
|
271
|
+
[self->_pinnedScrollView.scrollView scrollRectToVisible:responderFrame animated:YES];
|
|
272
|
+
});
|
|
273
|
+
}
|
|
228
274
|
}
|
|
229
275
|
|
|
230
276
|
- (void)keyboardWillHide:(NSTimeInterval)duration curve:(UIViewAnimationOptions)curve {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
#import <react/renderer/components/TrueSheetSpec/RCTComponentViewHelpers.h>
|
|
16
16
|
#import "TrueSheetViewController.h"
|
|
17
17
|
#import "utils/LayoutUtil.h"
|
|
18
|
+
#import "utils/UIView+ScrollEdgeInteraction.h"
|
|
18
19
|
|
|
19
20
|
using namespace facebook::react;
|
|
20
21
|
|
|
@@ -34,7 +35,6 @@ using namespace facebook::react;
|
|
|
34
35
|
static const auto defaultProps = std::make_shared<const TrueSheetFooterViewProps>();
|
|
35
36
|
_props = defaultProps;
|
|
36
37
|
|
|
37
|
-
// Set background color to clear by default
|
|
38
38
|
self.backgroundColor = [UIColor clearColor];
|
|
39
39
|
|
|
40
40
|
_lastHeight = 0;
|
|
@@ -45,28 +45,26 @@ using namespace facebook::react;
|
|
|
45
45
|
return self;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
#pragma mark - Layout
|
|
49
|
+
|
|
48
50
|
- (void)setupConstraintsWithHeight:(CGFloat)height {
|
|
49
51
|
UIView *parentView = self.superview;
|
|
50
52
|
if (!parentView) {
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
// Remove existing constraints before applying new ones
|
|
55
56
|
[LayoutUtil unpinView:self fromParentView:parentView];
|
|
56
57
|
_bottomConstraint = nil;
|
|
57
58
|
|
|
58
59
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
|
59
60
|
|
|
60
|
-
// Pin footer to sides of container
|
|
61
61
|
[self.leadingAnchor constraintEqualToAnchor:parentView.leadingAnchor].active = YES;
|
|
62
62
|
[self.trailingAnchor constraintEqualToAnchor:parentView.trailingAnchor].active = YES;
|
|
63
63
|
|
|
64
|
-
// Store bottom constraint for keyboard adjustment, preserving current keyboard offset
|
|
65
64
|
_bottomConstraint = [self.bottomAnchor constraintEqualToAnchor:parentView.bottomAnchor
|
|
66
65
|
constant:-_currentKeyboardOffset];
|
|
67
66
|
_bottomConstraint.active = YES;
|
|
68
67
|
|
|
69
|
-
// Apply height constraint
|
|
70
68
|
if (height > 0) {
|
|
71
69
|
[self.heightAnchor constraintEqualToConstant:height].active = YES;
|
|
72
70
|
}
|
|
@@ -77,7 +75,6 @@ using namespace facebook::react;
|
|
|
77
75
|
- (void)didMoveToSuperview {
|
|
78
76
|
[super didMoveToSuperview];
|
|
79
77
|
|
|
80
|
-
// Setup footer constraints when added to container
|
|
81
78
|
if (self.superview) {
|
|
82
79
|
CGFloat initialHeight = self.frame.size.height;
|
|
83
80
|
[self setupConstraintsWithHeight:initialHeight];
|
|
@@ -88,14 +85,11 @@ using namespace facebook::react;
|
|
|
88
85
|
oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics {
|
|
89
86
|
CGFloat height = layoutMetrics.frame.size.height;
|
|
90
87
|
|
|
91
|
-
// On initial layout, call super to let React Native position the view
|
|
92
|
-
// After that, we use Auto Layout constraints instead
|
|
93
88
|
if (!_didInitialLayout) {
|
|
94
89
|
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
|
|
95
90
|
_didInitialLayout = YES;
|
|
96
91
|
}
|
|
97
92
|
|
|
98
|
-
// Update footer constraints when height changes
|
|
99
93
|
if (height != _lastHeight) {
|
|
100
94
|
[self setupConstraintsWithHeight:height];
|
|
101
95
|
}
|
|
@@ -104,8 +98,10 @@ using namespace facebook::react;
|
|
|
104
98
|
- (void)prepareForRecycle {
|
|
105
99
|
[super prepareForRecycle];
|
|
106
100
|
|
|
107
|
-
// Remove footer constraints
|
|
108
101
|
[LayoutUtil unpinView:self fromParentView:self.superview];
|
|
102
|
+
if (@available(iOS 26.0, *)) {
|
|
103
|
+
[self cleanupEdgeInteraction];
|
|
104
|
+
}
|
|
109
105
|
|
|
110
106
|
_lastHeight = 0;
|
|
111
107
|
_didInitialLayout = NO;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#import <react/renderer/components/TrueSheetSpec/Props.h>
|
|
15
15
|
#import <react/renderer/components/TrueSheetSpec/RCTComponentViewHelpers.h>
|
|
16
16
|
#import "utils/LayoutUtil.h"
|
|
17
|
+
#import "utils/UIView+ScrollEdgeInteraction.h"
|
|
17
18
|
|
|
18
19
|
using namespace facebook::react;
|
|
19
20
|
|
|
@@ -41,7 +42,6 @@ using namespace facebook::react;
|
|
|
41
42
|
|
|
42
43
|
CGSize newSize = CGSizeMake(layoutMetrics.frame.size.width, layoutMetrics.frame.size.height);
|
|
43
44
|
|
|
44
|
-
// Notify delegate when header size changes
|
|
45
45
|
if (!CGSizeEqualToSize(newSize, _lastSize)) {
|
|
46
46
|
_lastSize = newSize;
|
|
47
47
|
[self.delegate headerViewDidChangeSize:newSize];
|
|
@@ -51,6 +51,9 @@ using namespace facebook::react;
|
|
|
51
51
|
- (void)prepareForRecycle {
|
|
52
52
|
[super prepareForRecycle];
|
|
53
53
|
_lastSize = CGSizeZero;
|
|
54
|
+
if (@available(iOS 26.0, *)) {
|
|
55
|
+
[self cleanupEdgeInteraction];
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
@end
|
package/ios/TrueSheetView.mm
CHANGED
|
@@ -245,12 +245,18 @@ using namespace facebook::react;
|
|
|
245
245
|
|
|
246
246
|
const auto &scrollableOpts = newProps.scrollableOptions;
|
|
247
247
|
BOOL scrollingExpandsSheet = scrollableOpts.scrollingExpandsSheet;
|
|
248
|
-
|
|
248
|
+
NSInteger topEdgeEffect = (NSInteger)scrollableOpts.topScrollEdgeEffect;
|
|
249
|
+
NSInteger bottomEdgeEffect = (NSInteger)scrollableOpts.bottomScrollEdgeEffect;
|
|
250
|
+
BOOL hasScrollableOptions = scrollableOpts.keyboardScrollOffset > 0 || !scrollingExpandsSheet ||
|
|
251
|
+
topEdgeEffect != (NSInteger)TrueSheetViewTopScrollEdgeEffect::Hidden ||
|
|
252
|
+
bottomEdgeEffect != (NSInteger)TrueSheetViewBottomScrollEdgeEffect::Hidden;
|
|
249
253
|
|
|
250
254
|
if (hasScrollableOptions) {
|
|
251
255
|
ScrollableOptions *options = [[ScrollableOptions alloc] init];
|
|
252
256
|
options.keyboardScrollOffset = scrollableOpts.keyboardScrollOffset;
|
|
253
257
|
options.scrollingExpandsSheet = scrollingExpandsSheet;
|
|
258
|
+
options.topScrollEdgeEffect = topEdgeEffect;
|
|
259
|
+
options.bottomScrollEdgeEffect = bottomEdgeEffect;
|
|
254
260
|
_scrollableOptions = options;
|
|
255
261
|
} else {
|
|
256
262
|
_scrollableOptions = nil;
|
|
@@ -261,11 +267,7 @@ using namespace facebook::react;
|
|
|
261
267
|
_insetAdjustment = (NSInteger)newProps.insetAdjustment;
|
|
262
268
|
_controller.insetAdjustment = _insetAdjustment;
|
|
263
269
|
|
|
264
|
-
|
|
265
|
-
_containerView.scrollableEnabled = _scrollable;
|
|
266
|
-
_containerView.insetAdjustment = _insetAdjustment;
|
|
267
|
-
_containerView.scrollableOptions = _scrollableOptions;
|
|
268
|
-
}
|
|
270
|
+
[self setupScrollable];
|
|
269
271
|
}
|
|
270
272
|
|
|
271
273
|
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState {
|
|
@@ -314,9 +316,7 @@ using namespace facebook::react;
|
|
|
314
316
|
if (!(updateMask & RNComponentViewUpdateMaskProps) || !_controller)
|
|
315
317
|
return;
|
|
316
318
|
|
|
317
|
-
|
|
318
|
-
[_containerView setupScrollable];
|
|
319
|
-
}
|
|
319
|
+
[self setupScrollable];
|
|
320
320
|
|
|
321
321
|
if (_controller.isPresented) {
|
|
322
322
|
[self applySheetPropsUpdate];
|
|
@@ -384,11 +384,6 @@ using namespace facebook::react;
|
|
|
384
384
|
_controller.headerHeight = @(headerHeight);
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
_containerView.scrollableEnabled = _scrollable;
|
|
388
|
-
_containerView.insetAdjustment = _insetAdjustment;
|
|
389
|
-
_containerView.scrollableOptions = _scrollableOptions;
|
|
390
|
-
[_containerView setupScrollable];
|
|
391
|
-
|
|
392
387
|
if (_eventEmitter) {
|
|
393
388
|
[TrueSheetLifecycleEvents emitMount:_eventEmitter];
|
|
394
389
|
} else {
|
|
@@ -449,6 +444,8 @@ using namespace facebook::react;
|
|
|
449
444
|
[_controller setupSheetDetents];
|
|
450
445
|
[_controller setupActiveDetentWithIndex:index];
|
|
451
446
|
|
|
447
|
+
[self setupScrollable];
|
|
448
|
+
|
|
452
449
|
[_screensEventObserver capturePresenterScreenFromView:self];
|
|
453
450
|
[_screensEventObserver startObservingWithState:_state.get()->getData()];
|
|
454
451
|
|
|
@@ -575,7 +572,7 @@ using namespace facebook::react;
|
|
|
575
572
|
|
|
576
573
|
// When the ScrollView changes (e.g. conditional remount), re-pin the new ScrollView.
|
|
577
574
|
- (void)containerViewScrollViewDidChange {
|
|
578
|
-
[
|
|
575
|
+
[self setupScrollable];
|
|
579
576
|
}
|
|
580
577
|
|
|
581
578
|
#pragma mark - TrueSheetViewControllerDelegate
|
|
@@ -697,6 +694,16 @@ using namespace facebook::react;
|
|
|
697
694
|
|
|
698
695
|
#pragma mark - Private Helpers
|
|
699
696
|
|
|
697
|
+
- (void)setupScrollable {
|
|
698
|
+
if (!_containerView)
|
|
699
|
+
return;
|
|
700
|
+
|
|
701
|
+
_containerView.scrollableEnabled = _scrollable;
|
|
702
|
+
_containerView.insetAdjustment = _insetAdjustment;
|
|
703
|
+
_containerView.scrollableOptions = _scrollableOptions;
|
|
704
|
+
[_containerView setupScrollable];
|
|
705
|
+
}
|
|
706
|
+
|
|
700
707
|
- (void)applySheetPropsUpdate {
|
|
701
708
|
BOOL pendingLayoutUpdate = _pendingLayoutUpdate;
|
|
702
709
|
_pendingLayoutUpdate = NO;
|
|
@@ -234,7 +234,7 @@ static BOOL TrueSheetPositionStateEquals(TrueSheetPositionState a, TrueSheetPosi
|
|
|
234
234
|
[self.delegate viewControllerDidPresentAtIndex:index position:self.currentPosition detent:detent];
|
|
235
235
|
[self.delegate viewControllerDidFocus];
|
|
236
236
|
|
|
237
|
-
[_grabberView updateAccessibilityValueWithIndex:index detentCount:_detents.count];
|
|
237
|
+
[self->_grabberView updateAccessibilityValueWithIndex:index detentCount:self->_detents.count];
|
|
238
238
|
[self emitChangePositionDelegateWithPosition:self.currentPosition realtime:NO debug:@"did present"];
|
|
239
239
|
});
|
|
240
240
|
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
@interface UIView (ScrollEdgeInteraction)
|
|
16
|
+
|
|
17
|
+
- (void)setupEdgeInteractionWithScrollView:(nullable UIScrollView *)scrollView
|
|
18
|
+
edge:(UIRectEdge)edge API_AVAILABLE(ios(26.0));
|
|
19
|
+
- (void)cleanupEdgeInteraction API_AVAILABLE(ios(26.0));
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
24
|
+
|
|
25
|
+
#endif
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import <objc/runtime.h>
|
|
12
|
+
#import "UIView+ScrollEdgeInteraction.h"
|
|
13
|
+
|
|
14
|
+
static const void *kEdgeEffectHintKey = &kEdgeEffectHintKey;
|
|
15
|
+
|
|
16
|
+
@implementation UIView (ScrollEdgeInteraction)
|
|
17
|
+
|
|
18
|
+
- (void)cleanupEdgeInteraction API_AVAILABLE(ios(26.0)) {
|
|
19
|
+
for (id<UIInteraction> interaction in [self.interactions copy]) {
|
|
20
|
+
if ([interaction isKindOfClass:[UIScrollEdgeElementContainerInteraction class]]) {
|
|
21
|
+
[self removeInteraction:interaction];
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
UILabel *hint = objc_getAssociatedObject(self, kEdgeEffectHintKey);
|
|
27
|
+
[hint removeFromSuperview];
|
|
28
|
+
objc_setAssociatedObject(self, kEdgeEffectHintKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
- (void)setupEdgeInteractionWithScrollView:(nullable UIScrollView *)scrollView
|
|
32
|
+
edge:(UIRectEdge)edge API_AVAILABLE(ios(26.0)) {
|
|
33
|
+
[self cleanupEdgeInteraction];
|
|
34
|
+
|
|
35
|
+
if (!scrollView) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// UIScrollEdgeElementContainerInteraction requires standard UIKit element
|
|
40
|
+
// descendants (UILabel, UIControl, etc.) to trigger the edge effect.
|
|
41
|
+
// RCTViewComponentView subviews are not recognized, so we add a
|
|
42
|
+
// non-visible UILabel as an element hint.
|
|
43
|
+
UILabel *hint = [[UILabel alloc] initWithFrame:self.bounds];
|
|
44
|
+
hint.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
45
|
+
hint.userInteractionEnabled = NO;
|
|
46
|
+
[self addSubview:hint];
|
|
47
|
+
objc_setAssociatedObject(self, kEdgeEffectHintKey, hint, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
48
|
+
|
|
49
|
+
UIScrollEdgeElementContainerInteraction *interaction = [[UIScrollEdgeElementContainerInteraction alloc] init];
|
|
50
|
+
interaction.scrollView = scrollView;
|
|
51
|
+
interaction.edge = edge;
|
|
52
|
+
[self addInteraction:interaction];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@end
|
|
56
|
+
|
|
57
|
+
#endif
|
|
@@ -21,9 +21,13 @@ type BlurOptionsType = Readonly<{
|
|
|
21
21
|
interaction?: WithDefault<boolean, true>;
|
|
22
22
|
}>;
|
|
23
23
|
|
|
24
|
+
type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
25
|
+
|
|
24
26
|
type ScrollableOptionsType = Readonly<{
|
|
25
27
|
keyboardScrollOffset?: WithDefault<Double, 0>;
|
|
26
28
|
scrollingExpandsSheet?: WithDefault<boolean, true>;
|
|
29
|
+
topScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
30
|
+
bottomScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
27
31
|
}>;
|
|
28
32
|
|
|
29
33
|
export interface DetentInfoEventPayload {
|
|
@@ -77,6 +77,13 @@ export interface GrabberOptions {
|
|
|
77
77
|
*/
|
|
78
78
|
adaptive?: boolean;
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Scroll edge effect style for iOS 26+.
|
|
82
|
+
* Controls the blur/gradient overlay applied to scroll view edges.
|
|
83
|
+
*
|
|
84
|
+
* @platform ios 26+
|
|
85
|
+
*/
|
|
86
|
+
export type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
80
87
|
/**
|
|
81
88
|
* Options for scrollable behavior.
|
|
82
89
|
*/
|
|
@@ -94,6 +101,20 @@ export interface ScrollableOptions {
|
|
|
94
101
|
* @default true
|
|
95
102
|
*/
|
|
96
103
|
scrollingExpandsSheet?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The scroll edge effect applied to the top edge of the scroll view.
|
|
106
|
+
*
|
|
107
|
+
* @platform ios 26+
|
|
108
|
+
* @default 'hidden'
|
|
109
|
+
*/
|
|
110
|
+
topScrollEdgeEffect?: ScrollEdgeEffect;
|
|
111
|
+
/**
|
|
112
|
+
* The scroll edge effect applied to the bottom edge of the scroll view.
|
|
113
|
+
*
|
|
114
|
+
* @platform ios 26+
|
|
115
|
+
* @default 'hidden'
|
|
116
|
+
*/
|
|
117
|
+
bottomScrollEdgeEffect?: ScrollEdgeEffect;
|
|
97
118
|
}
|
|
98
119
|
/**
|
|
99
120
|
* Options for customizing the blur effect.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheet.types.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACxE;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,oBAAoB,CA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: WithDefault<boolean, true>;
|
|
14
14
|
}>;
|
|
15
|
+
type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
15
16
|
type ScrollableOptionsType = Readonly<{
|
|
16
17
|
keyboardScrollOffset?: WithDefault<Double, 0>;
|
|
17
18
|
scrollingExpandsSheet?: WithDefault<boolean, true>;
|
|
19
|
+
topScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
20
|
+
bottomScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
18
21
|
}>;
|
|
19
22
|
export interface DetentInfoEventPayload {
|
|
20
23
|
index: Int32;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAGnD,KAAK,kBAAkB,GAAG,QAAQ,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;CACvC,CAAC,CAAC;AAEH,KAAK,eAAe,GAAG,QAAQ,CAAC;IAC9B,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IA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AAI,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACzD,YAAY,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAC1D,SAAS,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACvD,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;IAClE,WAAW,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACrC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;CACzE;;AAED,wBAEG"}
|
package/package.json
CHANGED
package/src/TrueSheet.types.ts
CHANGED
|
@@ -88,6 +88,14 @@ export interface GrabberOptions {
|
|
|
88
88
|
adaptive?: boolean;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Scroll edge effect style for iOS 26+.
|
|
93
|
+
* Controls the blur/gradient overlay applied to scroll view edges.
|
|
94
|
+
*
|
|
95
|
+
* @platform ios 26+
|
|
96
|
+
*/
|
|
97
|
+
export type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
98
|
+
|
|
91
99
|
/**
|
|
92
100
|
* Options for scrollable behavior.
|
|
93
101
|
*/
|
|
@@ -106,6 +114,22 @@ export interface ScrollableOptions {
|
|
|
106
114
|
* @default true
|
|
107
115
|
*/
|
|
108
116
|
scrollingExpandsSheet?: boolean;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The scroll edge effect applied to the top edge of the scroll view.
|
|
120
|
+
*
|
|
121
|
+
* @platform ios 26+
|
|
122
|
+
* @default 'hidden'
|
|
123
|
+
*/
|
|
124
|
+
topScrollEdgeEffect?: ScrollEdgeEffect;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The scroll edge effect applied to the bottom edge of the scroll view.
|
|
128
|
+
*
|
|
129
|
+
* @platform ios 26+
|
|
130
|
+
* @default 'hidden'
|
|
131
|
+
*/
|
|
132
|
+
bottomScrollEdgeEffect?: ScrollEdgeEffect;
|
|
109
133
|
}
|
|
110
134
|
|
|
111
135
|
/**
|
|
@@ -21,9 +21,13 @@ type BlurOptionsType = Readonly<{
|
|
|
21
21
|
interaction?: WithDefault<boolean, true>;
|
|
22
22
|
}>;
|
|
23
23
|
|
|
24
|
+
type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
25
|
+
|
|
24
26
|
type ScrollableOptionsType = Readonly<{
|
|
25
27
|
keyboardScrollOffset?: WithDefault<Double, 0>;
|
|
26
28
|
scrollingExpandsSheet?: WithDefault<boolean, true>;
|
|
29
|
+
topScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
30
|
+
bottomScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
27
31
|
}>;
|
|
28
32
|
|
|
29
33
|
export interface DetentInfoEventPayload {
|