@lodev09/react-native-true-sheet 3.0.0-beta.8 → 3.0.0
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 +13 -6
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +29 -33
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +3 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +48 -43
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +387 -88
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +22 -4
- package/android/src/main/java/com/lodev09/truesheet/core/RNScreensFragmentObserver.kt +0 -5
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDialogObserver.kt +67 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +44 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +94 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetStateEvents.kt +56 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +37 -33
- package/android/src/main/res/anim/true_sheet_slide_in.xml +13 -0
- package/android/src/main/res/anim/true_sheet_slide_out.xml +13 -0
- package/android/src/main/res/values/styles.xml +13 -1
- package/ios/TrueSheetContainerView.mm +4 -0
- package/ios/TrueSheetContentView.h +2 -1
- package/ios/TrueSheetContentView.mm +91 -11
- package/ios/TrueSheetView.mm +65 -41
- package/ios/TrueSheetViewController.h +21 -10
- package/ios/TrueSheetViewController.mm +330 -165
- package/ios/core/TrueSheetBlurView.h +24 -0
- package/ios/{utils/ConversionUtil.mm → core/TrueSheetBlurView.mm} +65 -3
- package/ios/events/TrueSheetDragEvents.h +39 -0
- package/ios/events/TrueSheetDragEvents.mm +62 -0
- package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
- package/ios/events/TrueSheetFocusEvents.mm +49 -0
- package/ios/events/TrueSheetLifecycleEvents.h +40 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
- package/ios/events/TrueSheetStateEvents.h +35 -0
- package/ios/events/TrueSheetStateEvents.mm +49 -0
- package/ios/utils/GestureUtil.h +7 -0
- package/ios/utils/GestureUtil.mm +12 -0
- package/lib/module/TrueSheet.js +65 -12
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +15 -5
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheet.js +13 -7
- package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +4 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +58 -6
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +14 -5
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheet.tsx +80 -10
- package/src/TrueSheet.types.ts +65 -6
- package/src/__mocks__/index.js +0 -5
- package/src/fabric/TrueSheetViewNativeComponent.ts +15 -5
- package/src/index.ts +0 -1
- package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
- package/src/reanimated/ReanimatedTrueSheetProvider.tsx +11 -3
- package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
- package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
- package/ios/events/OnDetentChangeEvent.h +0 -28
- package/ios/events/OnDetentChangeEvent.mm +0 -30
- package/ios/events/OnDidDismissEvent.h +0 -26
- package/ios/events/OnDidDismissEvent.mm +0 -25
- package/ios/events/OnDidPresentEvent.h +0 -28
- package/ios/events/OnDidPresentEvent.mm +0 -30
- package/ios/events/OnDragBeginEvent.h +0 -28
- package/ios/events/OnDragBeginEvent.mm +0 -30
- package/ios/events/OnDragChangeEvent.h +0 -28
- package/ios/events/OnDragChangeEvent.mm +0 -30
- package/ios/events/OnDragEndEvent.h +0 -28
- package/ios/events/OnDragEndEvent.mm +0 -30
- package/ios/events/OnMountEvent.h +0 -26
- package/ios/events/OnMountEvent.mm +0 -25
- package/ios/events/OnPositionChangeEvent.mm +0 -32
- package/ios/events/OnWillDismissEvent.h +0 -26
- package/ios/events/OnWillDismissEvent.mm +0 -25
- package/ios/events/OnWillPresentEvent.h +0 -28
- package/ios/events/OnWillPresentEvent.mm +0 -30
- package/ios/utils/ConversionUtil.h +0 -24
- package/lib/module/TrueSheetGrabber.js +0 -51
- package/lib/module/TrueSheetGrabber.js.map +0 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
- package/src/TrueSheetGrabber.tsx +0 -82
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
package com.lodev09.truesheet.events
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Arguments
|
|
4
|
-
import com.facebook.react.bridge.WritableMap
|
|
5
|
-
import com.facebook.react.uimanager.events.Event
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Fired before the sheet is dismissed
|
|
9
|
-
*/
|
|
10
|
-
class WillDismissEvent(surfaceId: Int, viewId: Int) : Event<WillDismissEvent>(surfaceId, viewId) {
|
|
11
|
-
|
|
12
|
-
override fun getEventName(): String = EVENT_NAME
|
|
13
|
-
|
|
14
|
-
override fun getEventData(): WritableMap = Arguments.createMap()
|
|
15
|
-
|
|
16
|
-
companion object {
|
|
17
|
-
const val EVENT_NAME = "topWillDismiss"
|
|
18
|
-
const val REGISTRATION_NAME = "onWillDismiss"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
package com.lodev09.truesheet.events
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Arguments
|
|
4
|
-
import com.facebook.react.bridge.WritableMap
|
|
5
|
-
import com.facebook.react.uimanager.events.Event
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Fired before the sheet is presented
|
|
9
|
-
* Payload: { index: number, position: number }
|
|
10
|
-
*/
|
|
11
|
-
class WillPresentEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
|
|
12
|
-
Event<WillPresentEvent>(surfaceId, viewId) {
|
|
13
|
-
|
|
14
|
-
override fun getEventName(): String = EVENT_NAME
|
|
15
|
-
|
|
16
|
-
override fun getEventData(): WritableMap =
|
|
17
|
-
Arguments.createMap().apply {
|
|
18
|
-
putInt("index", index)
|
|
19
|
-
putDouble("position", position.toDouble())
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
companion object {
|
|
23
|
-
const val EVENT_NAME = "topWillPresent"
|
|
24
|
-
const val REGISTRATION_NAME = "onWillPresent"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnDetentChangeEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDetentChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDetentChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDetentChange event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDetentChange(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,26 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnDidDismissEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
25
|
-
|
|
26
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
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 "OnDidDismissEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDidDismissEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
-
if (!eventEmitter)
|
|
17
|
-
return;
|
|
18
|
-
|
|
19
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
-
emitter->onDidDismiss({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnDidPresentEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDidPresentEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDidPresentEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDidPresent event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDidPresent(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnDragBeginEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDragBeginEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDragBeginEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDragBegin event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDragBegin(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnDragChangeEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDragChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDragChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDragChange event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDragChange(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnDragEndEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDragEndEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDragEndEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDragEnd event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDragEnd(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,26 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnMountEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
25
|
-
|
|
26
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
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 "OnMountEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnMountEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
-
if (!eventEmitter)
|
|
17
|
-
return;
|
|
18
|
-
|
|
19
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
-
emitter->onMount({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,32 +0,0 @@
|
|
|
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 "OnPositionChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnPositionChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position
|
|
18
|
-
transitioning:(BOOL)transitioning {
|
|
19
|
-
if (!eventEmitter)
|
|
20
|
-
return;
|
|
21
|
-
|
|
22
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
23
|
-
TrueSheetViewEventEmitter::OnPositionChange event;
|
|
24
|
-
event.index = static_cast<int>(index);
|
|
25
|
-
event.position = static_cast<double>(position);
|
|
26
|
-
event.transitioning = static_cast<bool>(transitioning);
|
|
27
|
-
emitter->onPositionChange(event);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@end
|
|
31
|
-
|
|
32
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,26 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnWillDismissEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
25
|
-
|
|
26
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
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 "OnWillDismissEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnWillDismissEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
-
if (!eventEmitter)
|
|
17
|
-
return;
|
|
18
|
-
|
|
19
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
-
emitter->onWillDismiss({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnWillPresentEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnWillPresentEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnWillPresentEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnWillPresent event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onWillPresent(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
-
|
|
13
|
-
@interface ConversionUtil : NSObject
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Converts a dashed-case blur tint string to UIBlurEffectStyle
|
|
17
|
-
* @param tintString The blur tint string (e.g., "system-thin-material")
|
|
18
|
-
* @return The corresponding UIBlurEffectStyle, defaults to UIBlurEffectStyleLight if not recognized
|
|
19
|
-
*/
|
|
20
|
-
+ (UIBlurEffectStyle)blurEffectStyleFromString:(NSString *)tintString;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
6
|
-
const GRABBER_DEFAULT_WIDTH = 32;
|
|
7
|
-
|
|
8
|
-
// M3 spec: #49454F 0.4 alpha
|
|
9
|
-
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
10
|
-
/**
|
|
11
|
-
* Grabber component.
|
|
12
|
-
* Used by defualt for Android but feel free to re-use.
|
|
13
|
-
*/
|
|
14
|
-
export const TrueSheetGrabber = props => {
|
|
15
|
-
const {
|
|
16
|
-
visible = true,
|
|
17
|
-
color = GRABBER_DEFAULT_COLOR,
|
|
18
|
-
width = GRABBER_DEFAULT_WIDTH,
|
|
19
|
-
height = GRABBER_DEFAULT_HEIGHT,
|
|
20
|
-
topOffset = 0,
|
|
21
|
-
style
|
|
22
|
-
} = props;
|
|
23
|
-
if (!visible) return null;
|
|
24
|
-
return /*#__PURE__*/_jsx(View, {
|
|
25
|
-
style: [styles.wrapper, style, {
|
|
26
|
-
height: GRABBER_DEFAULT_HEIGHT * 4,
|
|
27
|
-
top: topOffset
|
|
28
|
-
}],
|
|
29
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
30
|
-
style: [styles.grabber, {
|
|
31
|
-
height,
|
|
32
|
-
width,
|
|
33
|
-
backgroundColor: color
|
|
34
|
-
}]
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
const styles = StyleSheet.create({
|
|
39
|
-
wrapper: {
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
alignSelf: 'center',
|
|
42
|
-
paddingHorizontal: 12,
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
zIndex: 9999
|
|
46
|
-
},
|
|
47
|
-
grabber: {
|
|
48
|
-
borderRadius: GRABBER_DEFAULT_HEIGHT / 2
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=TrueSheetGrabber.js.map
|