@rn-tools/sheets 0.1.3 → 0.1.4
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
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
An expo module for rendering native bottom sheet components in iOS and Android.
|
|
4
4
|
|
|
5
|
-
Uses SwiftUI's sheet API and Android's BottomSheetDialog
|
|
5
|
+
Uses SwiftUI's sheet API and Android's BottomSheetDialog to render React Native children in a modal bottom sheet
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
https://github.com/user-attachments/assets/426c77e6-74c6-4748-8010-477267fa9433
|
|
9
|
+
|
|
6
10
|
|
|
7
11
|
## Motivation
|
|
8
12
|
|
|
@@ -23,7 +27,7 @@ Update your minimum iOS deployment target to 16 in `app.json`:
|
|
|
23
27
|
"expo-build-properties",
|
|
24
28
|
{
|
|
25
29
|
"ios": {
|
|
26
|
-
"deploymentTarget": "16.
|
|
30
|
+
"deploymentTarget": "16.0"
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
]
|
|
@@ -13,8 +13,8 @@ Pod::Spec.new do |s|
|
|
|
13
13
|
s.author = package['author']
|
|
14
14
|
s.homepage = package['homepage']
|
|
15
15
|
s.platforms = {
|
|
16
|
-
:ios => '16.
|
|
17
|
-
:tvos => '16.
|
|
16
|
+
:ios => '16.0',
|
|
17
|
+
:tvos => '16.0'
|
|
18
18
|
}
|
|
19
19
|
s.swift_version = '5.4'
|
|
20
20
|
s.source = { git: 'https://github.com/ajsmth/rn-tools' }
|
|
@@ -192,10 +192,13 @@ struct ContentView: View {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
)
|
|
195
|
-
.
|
|
195
|
+
.presentationBackground16_4(
|
|
196
196
|
props.backgroundColor != nil
|
|
197
197
|
? Color(hex: props.backgroundColor!) : Color.white
|
|
198
198
|
)
|
|
199
|
+
.presentationCornerRadius16_4(
|
|
200
|
+
props.cornerRadius.map { CGFloat($0) }
|
|
201
|
+
)
|
|
199
202
|
.presentationDragIndicator(
|
|
200
203
|
props.grabberVisible ? .visible : .hidden
|
|
201
204
|
)
|
|
@@ -203,9 +206,7 @@ struct ContentView: View {
|
|
|
203
206
|
Set(detents),
|
|
204
207
|
selection: $selectedDetent
|
|
205
208
|
)
|
|
206
|
-
|
|
207
|
-
props.cornerRadius.map { CGFloat($0) }
|
|
208
|
-
)
|
|
209
|
+
|
|
209
210
|
.onAppear {
|
|
210
211
|
selectedDetent = detent(for: props.openToIndex)
|
|
211
212
|
}
|
|
@@ -296,3 +297,24 @@ extension Color {
|
|
|
296
297
|
}
|
|
297
298
|
}
|
|
298
299
|
|
|
300
|
+
|
|
301
|
+
extension View {
|
|
302
|
+
@ViewBuilder
|
|
303
|
+
func presentationBackground16_4(_ color: Color?) -> some View {
|
|
304
|
+
if #available(iOS 16.4, *) {
|
|
305
|
+
self.presentationBackground(color ?? .white)
|
|
306
|
+
} else {
|
|
307
|
+
self
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
@ViewBuilder
|
|
312
|
+
func presentationCornerRadius16_4(_ radius: CGFloat?) -> some View {
|
|
313
|
+
if #available(iOS 16.4, *) {
|
|
314
|
+
self.presentationCornerRadius(radius)
|
|
315
|
+
} else {
|
|
316
|
+
self
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
// RNTSurfaceTouchHandlerWrapper.mm (Objective‑C++, .mm extension!)
|
|
2
|
+
|
|
3
|
+
|
|
2
4
|
#import "RNTSurfaceTouchHandlerWrapper.h"
|
|
5
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
3
6
|
#import <React/RCTSurfaceTouchHandler.h>
|
|
4
7
|
|
|
8
|
+
|
|
5
9
|
@implementation RNTSurfaceTouchHandlerWrapper {
|
|
10
|
+
|
|
6
11
|
RCTSurfaceTouchHandler *_handler;
|
|
7
12
|
}
|
|
8
13
|
|
|
@@ -17,5 +22,22 @@
|
|
|
17
22
|
[_handler attachToView:view];
|
|
18
23
|
}
|
|
19
24
|
@end
|
|
25
|
+
#else
|
|
26
|
+
|
|
27
|
+
@implementation RNTSurfaceTouchHandlerWrapper {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (instancetype)init {
|
|
31
|
+
if (self = [super init]) {
|
|
32
|
+
}
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)attachToView:(UIView *)view {
|
|
37
|
+
}
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
#endif
|
|
41
|
+
|
|
20
42
|
|
|
21
43
|
|