@lodev09/react-native-true-sheet 3.0.0-beta.13 → 3.0.0-beta.14

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 (66) hide show
  1. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +14 -18
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +31 -3
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +5 -1
  4. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDialogObserver.kt +17 -43
  5. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
  6. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
  7. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +94 -0
  8. package/android/src/main/java/com/lodev09/truesheet/events/{PositionChangeEvent.kt → TrueSheetStateEvents.kt} +22 -0
  9. package/ios/TrueSheetView.mm +34 -24
  10. package/ios/TrueSheetViewController.h +2 -0
  11. package/ios/TrueSheetViewController.mm +24 -6
  12. package/ios/events/TrueSheetDragEvents.h +39 -0
  13. package/ios/events/TrueSheetDragEvents.mm +62 -0
  14. package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -6
  15. package/ios/events/TrueSheetFocusEvents.mm +49 -0
  16. package/ios/events/TrueSheetLifecycleEvents.h +40 -0
  17. package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
  18. package/ios/events/TrueSheetStateEvents.h +35 -0
  19. package/ios/events/TrueSheetStateEvents.mm +49 -0
  20. package/lib/module/TrueSheet.js +10 -0
  21. package/lib/module/TrueSheet.js.map +1 -1
  22. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +2 -0
  23. package/lib/typescript/src/TrueSheet.d.ts +2 -0
  24. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  25. package/lib/typescript/src/TrueSheet.types.d.ts +10 -0
  26. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  27. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +2 -0
  28. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/TrueSheet.tsx +14 -0
  31. package/src/TrueSheet.types.ts +12 -0
  32. package/src/fabric/TrueSheetViewNativeComponent.ts +2 -0
  33. package/android/src/main/java/com/lodev09/truesheet/events/BlurEvent.kt +0 -20
  34. package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -27
  35. package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
  36. package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -27
  37. package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -27
  38. package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -27
  39. package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -27
  40. package/android/src/main/java/com/lodev09/truesheet/events/FocusEvent.kt +0 -20
  41. package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
  42. package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
  43. package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -27
  44. package/ios/events/OnDetentChangeEvent.h +0 -29
  45. package/ios/events/OnDetentChangeEvent.mm +0 -32
  46. package/ios/events/OnDidBlurEvent.h +0 -26
  47. package/ios/events/OnDidBlurEvent.mm +0 -25
  48. package/ios/events/OnDidDismissEvent.h +0 -26
  49. package/ios/events/OnDidDismissEvent.mm +0 -25
  50. package/ios/events/OnDidFocusEvent.h +0 -26
  51. package/ios/events/OnDidFocusEvent.mm +0 -25
  52. package/ios/events/OnDidPresentEvent.h +0 -29
  53. package/ios/events/OnDidPresentEvent.mm +0 -32
  54. package/ios/events/OnDragBeginEvent.h +0 -29
  55. package/ios/events/OnDragBeginEvent.mm +0 -32
  56. package/ios/events/OnDragChangeEvent.h +0 -29
  57. package/ios/events/OnDragChangeEvent.mm +0 -32
  58. package/ios/events/OnDragEndEvent.h +0 -29
  59. package/ios/events/OnDragEndEvent.mm +0 -32
  60. package/ios/events/OnMountEvent.h +0 -26
  61. package/ios/events/OnMountEvent.mm +0 -25
  62. package/ios/events/OnPositionChangeEvent.mm +0 -34
  63. package/ios/events/OnWillDismissEvent.h +0 -26
  64. package/ios/events/OnWillDismissEvent.mm +0 -25
  65. package/ios/events/OnWillPresentEvent.h +0 -29
  66. package/ios/events/OnWillPresentEvent.mm +0 -32
@@ -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 OnDidFocusEvent : 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 "OnDidFocusEvent.h"
12
-
13
- @implementation OnDidFocusEvent
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->onDidFocus({});
21
- }
22
-
23
- @end
24
-
25
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,29 +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
- detent:(CGFloat)detent;
24
-
25
- @end
26
-
27
- NS_ASSUME_NONNULL_END
28
-
29
- #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 "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
- detent:(CGFloat)detent {
19
- if (!eventEmitter)
20
- return;
21
-
22
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
23
- TrueSheetViewEventEmitter::OnDidPresent event;
24
- event.index = static_cast<int>(index);
25
- event.position = static_cast<double>(position);
26
- event.detent = static_cast<double>(detent);
27
- emitter->onDidPresent(event);
28
- }
29
-
30
- @end
31
-
32
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,29 +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
- detent:(CGFloat)detent;
24
-
25
- @end
26
-
27
- NS_ASSUME_NONNULL_END
28
-
29
- #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 "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
- detent:(CGFloat)detent {
19
- if (!eventEmitter)
20
- return;
21
-
22
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
23
- TrueSheetViewEventEmitter::OnDragBegin event;
24
- event.index = static_cast<int>(index);
25
- event.position = static_cast<double>(position);
26
- event.detent = static_cast<double>(detent);
27
- emitter->onDragBegin(event);
28
- }
29
-
30
- @end
31
-
32
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,29 +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
- detent:(CGFloat)detent;
24
-
25
- @end
26
-
27
- NS_ASSUME_NONNULL_END
28
-
29
- #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 "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
- detent:(CGFloat)detent {
19
- if (!eventEmitter)
20
- return;
21
-
22
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
23
- TrueSheetViewEventEmitter::OnDragChange event;
24
- event.index = static_cast<int>(index);
25
- event.position = static_cast<double>(position);
26
- event.detent = static_cast<double>(detent);
27
- emitter->onDragChange(event);
28
- }
29
-
30
- @end
31
-
32
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,29 +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
- detent:(CGFloat)detent;
24
-
25
- @end
26
-
27
- NS_ASSUME_NONNULL_END
28
-
29
- #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 "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
- detent:(CGFloat)detent {
19
- if (!eventEmitter)
20
- return;
21
-
22
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
23
- TrueSheetViewEventEmitter::OnDragEnd event;
24
- event.index = static_cast<int>(index);
25
- event.position = static_cast<double>(position);
26
- event.detent = static_cast<double>(detent);
27
- emitter->onDragEnd(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 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,34 +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:(CGFloat)index
17
- position:(CGFloat)position
18
- detent:(CGFloat)detent
19
- transitioning:(BOOL)transitioning {
20
- if (!eventEmitter)
21
- return;
22
-
23
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
24
- TrueSheetViewEventEmitter::OnPositionChange event;
25
- event.index = static_cast<double>(index);
26
- event.position = static_cast<double>(position);
27
- event.detent = static_cast<double>(detent);
28
- event.transitioning = static_cast<bool>(transitioning);
29
- emitter->onPositionChange(event);
30
- }
31
-
32
- @end
33
-
34
- #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,29 +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
- detent:(CGFloat)detent;
24
-
25
- @end
26
-
27
- NS_ASSUME_NONNULL_END
28
-
29
- #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 "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
- detent:(CGFloat)detent {
19
- if (!eventEmitter)
20
- return;
21
-
22
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
23
- TrueSheetViewEventEmitter::OnWillPresent event;
24
- event.index = static_cast<int>(index);
25
- event.position = static_cast<double>(position);
26
- event.detent = static_cast<double>(detent);
27
- emitter->onWillPresent(event);
28
- }
29
-
30
- @end
31
-
32
- #endif // RCT_NEW_ARCH_ENABLED