@lodev09/react-native-true-sheet 3.0.0-beta.9 → 3.0.1

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.
Files changed (101) hide show
  1. package/README.md +16 -6
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +29 -33
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +3 -1
  4. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +53 -43
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +390 -89
  6. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +42 -4
  7. package/android/src/main/java/com/lodev09/truesheet/core/RNScreensFragmentObserver.kt +0 -5
  8. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDialogObserver.kt +67 -0
  9. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +70 -0
  10. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
  11. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
  12. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +94 -0
  13. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetStateEvents.kt +56 -0
  14. package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +37 -33
  15. package/android/src/main/res/anim/true_sheet_slide_in.xml +13 -0
  16. package/android/src/main/res/anim/true_sheet_slide_out.xml +13 -0
  17. package/android/src/main/res/values/styles.xml +13 -1
  18. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +5 -3
  19. package/ios/TrueSheetContainerView.mm +4 -0
  20. package/ios/TrueSheetContentView.h +2 -1
  21. package/ios/TrueSheetContentView.mm +91 -11
  22. package/ios/TrueSheetView.mm +94 -41
  23. package/ios/TrueSheetViewController.h +22 -10
  24. package/ios/TrueSheetViewController.mm +360 -173
  25. package/ios/core/TrueSheetBlurView.h +26 -0
  26. package/ios/{utils/ConversionUtil.mm → core/TrueSheetBlurView.mm} +64 -3
  27. package/ios/core/TrueSheetGrabberView.h +42 -0
  28. package/ios/core/TrueSheetGrabberView.mm +107 -0
  29. package/ios/events/TrueSheetDragEvents.h +39 -0
  30. package/ios/events/TrueSheetDragEvents.mm +62 -0
  31. package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
  32. package/ios/events/TrueSheetFocusEvents.mm +49 -0
  33. package/ios/events/TrueSheetLifecycleEvents.h +40 -0
  34. package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
  35. package/ios/events/TrueSheetStateEvents.h +35 -0
  36. package/ios/events/TrueSheetStateEvents.mm +49 -0
  37. package/ios/utils/GestureUtil.h +7 -0
  38. package/ios/utils/GestureUtil.mm +12 -0
  39. package/lib/module/TrueSheet.js +72 -12
  40. package/lib/module/TrueSheet.js.map +1 -1
  41. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +28 -5
  42. package/lib/module/index.js +0 -1
  43. package/lib/module/index.js.map +1 -1
  44. package/lib/module/reanimated/ReanimatedTrueSheet.js +13 -7
  45. package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
  46. package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
  47. package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
  48. package/lib/typescript/src/TrueSheet.d.ts +4 -0
  49. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  50. package/lib/typescript/src/TrueSheet.types.d.ts +105 -6
  51. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  52. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +25 -5
  53. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  54. package/lib/typescript/src/index.d.ts +0 -1
  55. package/lib/typescript/src/index.d.ts.map +1 -1
  56. package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
  57. package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
  58. package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
  59. package/package.json +8 -2
  60. package/src/TrueSheet.tsx +87 -10
  61. package/src/TrueSheet.types.ts +114 -6
  62. package/src/__mocks__/index.js +0 -5
  63. package/src/fabric/TrueSheetViewNativeComponent.ts +28 -5
  64. package/src/index.ts +0 -1
  65. package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
  66. package/src/reanimated/ReanimatedTrueSheetProvider.tsx +11 -3
  67. package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
  68. package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
  69. package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
  70. package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
  71. package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
  72. package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
  73. package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
  74. package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
  75. package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
  76. package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
  77. package/ios/events/OnDetentChangeEvent.h +0 -28
  78. package/ios/events/OnDetentChangeEvent.mm +0 -30
  79. package/ios/events/OnDidDismissEvent.h +0 -26
  80. package/ios/events/OnDidDismissEvent.mm +0 -25
  81. package/ios/events/OnDidPresentEvent.h +0 -28
  82. package/ios/events/OnDidPresentEvent.mm +0 -30
  83. package/ios/events/OnDragBeginEvent.h +0 -28
  84. package/ios/events/OnDragBeginEvent.mm +0 -30
  85. package/ios/events/OnDragChangeEvent.h +0 -28
  86. package/ios/events/OnDragChangeEvent.mm +0 -30
  87. package/ios/events/OnDragEndEvent.h +0 -28
  88. package/ios/events/OnDragEndEvent.mm +0 -30
  89. package/ios/events/OnMountEvent.h +0 -26
  90. package/ios/events/OnMountEvent.mm +0 -25
  91. package/ios/events/OnPositionChangeEvent.mm +0 -32
  92. package/ios/events/OnWillDismissEvent.h +0 -26
  93. package/ios/events/OnWillDismissEvent.mm +0 -25
  94. package/ios/events/OnWillPresentEvent.h +0 -28
  95. package/ios/events/OnWillPresentEvent.mm +0 -30
  96. package/ios/utils/ConversionUtil.h +0 -24
  97. package/lib/module/TrueSheetGrabber.js +0 -51
  98. package/lib/module/TrueSheetGrabber.js.map +0 -1
  99. package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
  100. package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
  101. package/src/TrueSheetGrabber.tsx +0 -82
@@ -4,13 +4,19 @@ import { useSharedValue, type SharedValue } from 'react-native-reanimated';
4
4
 
5
5
  export interface ReanimatedTrueSheetContextValue {
6
6
  /**
7
- * Shared value representing the current sheet position (Y offset from bottom)
7
+ * Shared value representing the current sheet position (Y offset from top of screen)
8
8
  */
9
9
  animatedPosition: SharedValue<number>;
10
10
  /**
11
- * Shared value representing the current detent index
11
+ * Shared value representing the current detent index as a continuous float.
12
+ * Interpolates smoothly between -1 (off-screen) and the target detent index.
12
13
  */
13
14
  animatedIndex: SharedValue<number>;
15
+ /**
16
+ * Shared value representing the current detent value (0-1 fraction of screen height).
17
+ * Interpolates smoothly between detent values as the sheet is dragged.
18
+ */
19
+ animatedDetent: SharedValue<number>;
14
20
  }
15
21
 
16
22
  const ReanimatedTrueSheetContext = createContext<ReanimatedTrueSheetContextValue | null>(null);
@@ -40,13 +46,15 @@ export const ReanimatedTrueSheetProvider = ({ children }: ReanimatedTrueSheetPro
40
46
  const { height } = useWindowDimensions();
41
47
  const animatedPosition = useSharedValue(height);
42
48
  const animatedIndex = useSharedValue(-1);
49
+ const animatedDetent = useSharedValue(0);
43
50
 
44
51
  const value = useMemo(
45
52
  () => ({
46
53
  animatedPosition,
47
54
  animatedIndex,
55
+ animatedDetent,
48
56
  }),
49
- [animatedPosition, animatedIndex]
57
+ [animatedPosition, animatedIndex, animatedDetent]
50
58
  );
51
59
 
52
60
  return (
@@ -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 when the active detent changes
9
- * Payload: { index: number, position: number }
10
- */
11
- class DetentChangeEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
12
- Event<DetentChangeEvent>(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 = "topDetentChange"
24
- const val REGISTRATION_NAME = "onDetentChange"
25
- }
26
- }
@@ -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 after the sheet dismissal is complete
9
- */
10
- class DidDismissEvent(surfaceId: Int, viewId: Int) : Event<DidDismissEvent>(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 = "topDidDismiss"
18
- const val REGISTRATION_NAME = "onDidDismiss"
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 after the sheet presentation is complete
9
- * Payload: { index: number, position: number }
10
- */
11
- class DidPresentEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
12
- Event<DidPresentEvent>(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 = "topDidPresent"
24
- const val REGISTRATION_NAME = "onDidPresent"
25
- }
26
- }
@@ -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 when user starts dragging the sheet
9
- * Payload: { index: number, position: number }
10
- */
11
- class DragBeginEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
12
- Event<DragBeginEvent>(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 = "topDragBegin"
24
- const val REGISTRATION_NAME = "onDragBegin"
25
- }
26
- }
@@ -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 continuously while user is dragging the sheet
9
- * Payload: { index: number, position: number }
10
- */
11
- class DragChangeEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
12
- Event<DragChangeEvent>(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 = "topDragChange"
24
- const val REGISTRATION_NAME = "onDragChange"
25
- }
26
- }
@@ -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 when user stops dragging the sheet
9
- * Payload: { index: number, position: number }
10
- */
11
- class DragEndEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
12
- Event<DragEndEvent>(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 = "topDragEnd"
24
- const val REGISTRATION_NAME = "onDragEnd"
25
- }
26
- }
@@ -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 when the sheet component is mounted and ready
9
- */
10
- class MountEvent(surfaceId: Int, viewId: Int) : Event<MountEvent>(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 = "topMount"
18
- const val REGISTRATION_NAME = "onMount"
19
- }
20
- }
@@ -1,32 +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 continuously for position updates during drag and animation
9
- * Payload: { index: number, position: number, transitioning: boolean }
10
- */
11
- class PositionChangeEvent(
12
- surfaceId: Int,
13
- viewId: Int,
14
- private val index: Int,
15
- private val position: Float,
16
- private val transitioning: Boolean = false
17
- ) : Event<PositionChangeEvent>(surfaceId, viewId) {
18
-
19
- override fun getEventName(): String = EVENT_NAME
20
-
21
- override fun getEventData(): WritableMap =
22
- Arguments.createMap().apply {
23
- putInt("index", index)
24
- putDouble("position", position.toDouble())
25
- putBoolean("transitioning", transitioning)
26
- }
27
-
28
- companion object {
29
- const val EVENT_NAME = "topPositionChange"
30
- const val REGISTRATION_NAME = "onPositionChange"
31
- }
32
- }
@@ -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