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

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 (74) hide show
  1. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +20 -20
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +49 -14
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +10 -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} +25 -3
  9. package/ios/TrueSheetView.mm +39 -25
  10. package/ios/TrueSheetViewController.h +7 -1
  11. package/ios/TrueSheetViewController.mm +101 -51
  12. package/ios/core/TrueSheetBlurView.h +24 -0
  13. package/ios/{utils/ConversionUtil.mm → core/TrueSheetBlurView.mm} +65 -3
  14. package/ios/events/TrueSheetDragEvents.h +39 -0
  15. package/ios/events/TrueSheetDragEvents.mm +62 -0
  16. package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -6
  17. package/ios/events/TrueSheetFocusEvents.mm +49 -0
  18. package/ios/events/TrueSheetLifecycleEvents.h +40 -0
  19. package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
  20. package/ios/events/TrueSheetStateEvents.h +35 -0
  21. package/ios/events/TrueSheetStateEvents.mm +49 -0
  22. package/ios/utils/GestureUtil.h +7 -0
  23. package/ios/utils/GestureUtil.mm +12 -0
  24. package/lib/module/TrueSheet.js +12 -0
  25. package/lib/module/TrueSheet.js.map +1 -1
  26. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +8 -1
  27. package/lib/module/reanimated/ReanimatedTrueSheet.js +6 -6
  28. package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
  29. package/lib/typescript/src/TrueSheet.d.ts +2 -0
  30. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  31. package/lib/typescript/src/TrueSheet.types.d.ts +37 -3
  32. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  33. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +6 -1
  34. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/TrueSheet.tsx +16 -0
  37. package/src/TrueSheet.types.ts +42 -3
  38. package/src/fabric/TrueSheetViewNativeComponent.ts +8 -1
  39. package/src/reanimated/ReanimatedTrueSheet.tsx +6 -6
  40. package/android/src/main/java/com/lodev09/truesheet/events/BlurEvent.kt +0 -20
  41. package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -27
  42. package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
  43. package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -27
  44. package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -27
  45. package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -27
  46. package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -27
  47. package/android/src/main/java/com/lodev09/truesheet/events/FocusEvent.kt +0 -20
  48. package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
  49. package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
  50. package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -27
  51. package/ios/events/OnDetentChangeEvent.h +0 -29
  52. package/ios/events/OnDetentChangeEvent.mm +0 -32
  53. package/ios/events/OnDidBlurEvent.h +0 -26
  54. package/ios/events/OnDidBlurEvent.mm +0 -25
  55. package/ios/events/OnDidDismissEvent.h +0 -26
  56. package/ios/events/OnDidDismissEvent.mm +0 -25
  57. package/ios/events/OnDidFocusEvent.h +0 -26
  58. package/ios/events/OnDidFocusEvent.mm +0 -25
  59. package/ios/events/OnDidPresentEvent.h +0 -29
  60. package/ios/events/OnDidPresentEvent.mm +0 -32
  61. package/ios/events/OnDragBeginEvent.h +0 -29
  62. package/ios/events/OnDragBeginEvent.mm +0 -32
  63. package/ios/events/OnDragChangeEvent.h +0 -29
  64. package/ios/events/OnDragChangeEvent.mm +0 -32
  65. package/ios/events/OnDragEndEvent.h +0 -29
  66. package/ios/events/OnDragEndEvent.mm +0 -32
  67. package/ios/events/OnMountEvent.h +0 -26
  68. package/ios/events/OnMountEvent.mm +0 -25
  69. package/ios/events/OnPositionChangeEvent.mm +0 -34
  70. package/ios/events/OnWillDismissEvent.h +0 -26
  71. package/ios/events/OnWillDismissEvent.mm +0 -25
  72. package/ios/events/OnWillPresentEvent.h +0 -29
  73. package/ios/events/OnWillPresentEvent.mm +0 -32
  74. package/ios/utils/ConversionUtil.h +0 -24
@@ -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,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,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,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC,I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ACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CAC3C"}
@@ -9,7 +9,7 @@ export interface PositionChangeEventPayload {
9
9
  index: Double;
10
10
  position: Double;
11
11
  detent: Double;
12
- transitioning: boolean;
12
+ realtime: boolean;
13
13
  }
14
14
  export interface NativeProps extends ViewProps {
15
15
  detents?: ReadonlyArray<Float>;
@@ -20,8 +20,11 @@ export interface NativeProps extends ViewProps {
20
20
  dimmedDetentIndex?: WithDefault<Int32, 0>;
21
21
  blurTint?: WithDefault<string, ''>;
22
22
  keyboardMode?: WithDefault<'resize' | 'pan', 'resize'>;
23
+ blurIntensity?: WithDefault<Double, -1>;
24
+ blurInteraction?: WithDefault<boolean, true>;
23
25
  grabber?: WithDefault<boolean, true>;
24
26
  dismissible?: WithDefault<boolean, true>;
27
+ draggable?: WithDefault<boolean, true>;
25
28
  dimmed?: WithDefault<boolean, true>;
26
29
  initialDetentAnimated?: WithDefault<boolean, true>;
27
30
  edgeToEdgeFullScreen?: WithDefault<boolean, false>;
@@ -37,7 +40,9 @@ export interface NativeProps extends ViewProps {
37
40
  onDragChange?: DirectEventHandler<DetentInfoEventPayload>;
38
41
  onDragEnd?: DirectEventHandler<DetentInfoEventPayload>;
39
42
  onPositionChange?: DirectEventHandler<PositionChangeEventPayload>;
43
+ onWillFocus?: DirectEventHandler<null>;
40
44
  onDidFocus?: DirectEventHandler<null>;
45
+ onWillBlur?: DirectEventHandler<null>;
41
46
  onDidBlur?: DirectEventHandler<null>;
42
47
  }
43
48
  declare const _default: import("react-native").HostComponent<NativeProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"TrueSheetViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,WAAW,EAC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ACnD,oBAAoB,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAGxC,OAAO,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAC1D,aAAa,CAAC,EAAE,kBAAkB,CAAC,IAAI,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;CACtC;;AAED,wBAEG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.0.0-beta.13",
3
+ "version": "3.0.0-beta.15",
4
4
  "description": "The true native bottom sheet experience for your React Native Apps.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",
package/src/TrueSheet.tsx CHANGED
@@ -20,7 +20,9 @@ import type {
20
20
  DidDismissEvent,
21
21
  WillDismissEvent,
22
22
  MountEvent,
23
+ WillFocusEvent,
23
24
  DidFocusEvent,
25
+ WillBlurEvent,
24
26
  DidBlurEvent,
25
27
  } from './TrueSheet.types';
26
28
  import TrueSheetViewNativeComponent from './fabric/TrueSheetViewNativeComponent';
@@ -90,7 +92,9 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
90
92
  this.onDragChange = this.onDragChange.bind(this);
91
93
  this.onDragEnd = this.onDragEnd.bind(this);
92
94
  this.onPositionChange = this.onPositionChange.bind(this);
95
+ this.onWillFocus = this.onWillFocus.bind(this);
93
96
  this.onDidFocus = this.onDidFocus.bind(this);
97
+ this.onWillBlur = this.onWillBlur.bind(this);
94
98
  this.onDidBlur = this.onDidBlur.bind(this);
95
99
  }
96
100
 
@@ -254,10 +258,18 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
254
258
  this.props.onPositionChange?.(event);
255
259
  }
256
260
 
261
+ private onWillFocus(event: WillFocusEvent): void {
262
+ this.props.onWillFocus?.(event);
263
+ }
264
+
257
265
  private onDidFocus(event: DidFocusEvent): void {
258
266
  this.props.onDidFocus?.(event);
259
267
  }
260
268
 
269
+ private onWillBlur(event: WillBlurEvent): void {
270
+ this.props.onWillBlur?.(event);
271
+ }
272
+
261
273
  private onDidBlur(event: DidBlurEvent): void {
262
274
  this.props.onDidBlur?.(event);
263
275
  }
@@ -325,6 +337,7 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
325
337
  detents = [0.5, 1],
326
338
  backgroundColor,
327
339
  dismissible = true,
340
+ draggable = true,
328
341
  grabber = true,
329
342
  dimmed = true,
330
343
  initialDetentIndex = -1,
@@ -383,6 +396,7 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
383
396
  initialDetentIndex={initialDetentIndex}
384
397
  initialDetentAnimated={initialDetentAnimated}
385
398
  dismissible={dismissible}
399
+ draggable={draggable}
386
400
  maxHeight={maxHeight}
387
401
  edgeToEdgeFullScreen={edgeToEdgeFullScreen}
388
402
  scrollable={scrollable}
@@ -397,7 +411,9 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
397
411
  onDragChange={this.onDragChange}
398
412
  onDragEnd={this.onDragEnd}
399
413
  onPositionChange={this.onPositionChange}
414
+ onWillFocus={this.onWillFocus}
400
415
  onDidFocus={this.onDidFocus}
416
+ onWillBlur={this.onWillBlur}
401
417
  onDidBlur={this.onDidBlur}
402
418
  >
403
419
  {this.state.shouldRenderNativeView && (
@@ -18,10 +18,10 @@ export interface DetentInfoEventPayload {
18
18
 
19
19
  export interface PositionChangeEventPayload extends DetentInfoEventPayload {
20
20
  /**
21
- * Workaround for cases where we can't get real-time position from native.
22
- * When true, manually animate the position in JS.
21
+ * Indicates whether the position value is real-time (e.g., during drag or animation tracking).
22
+ * When false, the position should be animated in JS.
23
23
  */
24
- transitioning: boolean;
24
+ realtime: boolean;
25
25
  }
26
26
 
27
27
  export type MountEvent = NativeSyntheticEvent<null>;
@@ -36,6 +36,8 @@ export type DragEndEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
36
36
  export type PositionChangeEvent = NativeSyntheticEvent<PositionChangeEventPayload>;
37
37
  export type DidFocusEvent = NativeSyntheticEvent<null>;
38
38
  export type DidBlurEvent = NativeSyntheticEvent<null>;
39
+ export type WillFocusEvent = NativeSyntheticEvent<null>;
40
+ export type WillBlurEvent = NativeSyntheticEvent<null>;
39
41
 
40
42
  /**
41
43
  * Blur style mapped to native values in IOS.
@@ -158,6 +160,14 @@ export interface TrueSheetProps extends ViewProps {
158
160
  */
159
161
  dismissible?: boolean;
160
162
 
163
+ /**
164
+ * Enables or disables dragging the sheet to resize it.
165
+ * When disabled, the sheet becomes static and can only be resized programmatically.
166
+ *
167
+ * @default true
168
+ */
169
+ draggable?: boolean;
170
+
161
171
  /**
162
172
  * Main sheet background color.
163
173
  * Uses system default when not provided.
@@ -201,6 +211,25 @@ export interface TrueSheetProps extends ViewProps {
201
211
  */
202
212
  blurTint?: BlurTint;
203
213
 
214
+ /**
215
+ * The intensity of the blur effect (0-100).
216
+ * Only applies when `blurTint` is set.
217
+ * Uses system default if not provided.
218
+ *
219
+ * @platform ios
220
+ */
221
+ blurIntensity?: number;
222
+
223
+ /**
224
+ * Enables or disables user interaction on the blur view.
225
+ * Disabling this can help with visual artifacts (flash) on iOS 18+
226
+ * when touching the sheet content with blur enabled.
227
+ * Uses system default (true) if not provided.
228
+ *
229
+ * @platform ios
230
+ */
231
+ blurInteraction?: boolean;
232
+
204
233
  /**
205
234
  * Overrides `large` or `100%` height.
206
235
  * Also sets the maximum height for 'auto' detents.
@@ -304,11 +333,21 @@ export interface TrueSheetProps extends ViewProps {
304
333
  */
305
334
  onPositionChange?: (event: PositionChangeEvent) => void;
306
335
 
336
+ /**
337
+ * Called when the sheet is about to regain focus because a sheet presented on top of it is being dismissed.
338
+ */
339
+ onWillFocus?: (event: WillFocusEvent) => void;
340
+
307
341
  /**
308
342
  * Called when the sheet regains focus after a sheet presented on top of it is dismissed.
309
343
  */
310
344
  onDidFocus?: (event: DidFocusEvent) => void;
311
345
 
346
+ /**
347
+ * Called when the sheet is about to lose focus because another sheet is being presented on top of it.
348
+ */
349
+ onWillBlur?: (event: WillBlurEvent) => void;
350
+
312
351
  /**
313
352
  * Called when the sheet loses focus because another sheet is presented on top of it.
314
353
  */
@@ -18,7 +18,7 @@ export interface PositionChangeEventPayload {
18
18
  index: Double;
19
19
  position: Double;
20
20
  detent: Double;
21
- transitioning: boolean;
21
+ realtime: boolean;
22
22
  }
23
23
 
24
24
  export interface NativeProps extends ViewProps {
@@ -36,9 +36,14 @@ export interface NativeProps extends ViewProps {
36
36
  blurTint?: WithDefault<string, ''>;
37
37
  keyboardMode?: WithDefault<'resize' | 'pan', 'resize'>;
38
38
 
39
+ // Blur properties - use -1 as default to indicate "not set" (use system default)
40
+ blurIntensity?: WithDefault<Double, -1>;
41
+ blurInteraction?: WithDefault<boolean, true>;
42
+
39
43
  // Boolean properties - match defaults from TrueSheet.types.ts
40
44
  grabber?: WithDefault<boolean, true>;
41
45
  dismissible?: WithDefault<boolean, true>;
46
+ draggable?: WithDefault<boolean, true>;
42
47
  dimmed?: WithDefault<boolean, true>;
43
48
  initialDetentAnimated?: WithDefault<boolean, true>;
44
49
  edgeToEdgeFullScreen?: WithDefault<boolean, false>;
@@ -56,7 +61,9 @@ export interface NativeProps extends ViewProps {
56
61
  onDragChange?: DirectEventHandler<DetentInfoEventPayload>;
57
62
  onDragEnd?: DirectEventHandler<DetentInfoEventPayload>;
58
63
  onPositionChange?: DirectEventHandler<PositionChangeEventPayload>;
64
+ onWillFocus?: DirectEventHandler<null>;
59
65
  onDidFocus?: DirectEventHandler<null>;
66
+ onWillBlur?: DirectEventHandler<null>;
60
67
  onDidBlur?: DirectEventHandler<null>;
61
68
  }
62
69
 
@@ -78,8 +78,12 @@ export const ReanimatedTrueSheet = forwardRef<TrueSheet, ReanimatedTrueSheetProp
78
78
  // Update detent directly (discrete value, not animated)
79
79
  detent.value = payload.detent;
80
80
 
81
- if (payload.transitioning) {
82
- // Animate position and index when transitioning
81
+ if (payload.realtime) {
82
+ // Update directly when we have real-time values (during drag or animation tracking)
83
+ animatedPosition.value = payload.position;
84
+ animatedIndex.value = payload.index;
85
+ } else {
86
+ // Animate position and index when not real-time
83
87
  if (Platform.OS === 'android') {
84
88
  animatedPosition.value = withTiming(payload.position, TIMING_CONFIG);
85
89
  animatedIndex.value = withTiming(payload.index, TIMING_CONFIG);
@@ -87,10 +91,6 @@ export const ReanimatedTrueSheet = forwardRef<TrueSheet, ReanimatedTrueSheetProp
87
91
  animatedPosition.value = withSpring(payload.position, SPRING_CONFIG);
88
92
  animatedIndex.value = withSpring(payload.index, SPRING_CONFIG);
89
93
  }
90
- } else {
91
- // Update directly during drag
92
- animatedPosition.value = payload.position;
93
- animatedIndex.value = payload.index;
94
94
  }
95
95
 
96
96
  onPositionChange?.({ nativeEvent: payload } as PositionChangeEvent);
@@ -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 loses focus because another sheet is presented on top of it
9
- */
10
- class BlurEvent(surfaceId: Int, viewId: Int) : Event<BlurEvent>(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 = "topDidBlur"
18
- const val REGISTRATION_NAME = "onDidBlur"
19
- }
20
- }
@@ -1,27 +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, private val detent: 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
- putDouble("detent", detent.toDouble())
21
- }
22
-
23
- companion object {
24
- const val EVENT_NAME = "topDetentChange"
25
- const val REGISTRATION_NAME = "onDetentChange"
26
- }
27
- }
@@ -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,27 +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, private val detent: 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
- putDouble("detent", detent.toDouble())
21
- }
22
-
23
- companion object {
24
- const val EVENT_NAME = "topDidPresent"
25
- const val REGISTRATION_NAME = "onDidPresent"
26
- }
27
- }
@@ -1,27 +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, private val detent: 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
- putDouble("detent", detent.toDouble())
21
- }
22
-
23
- companion object {
24
- const val EVENT_NAME = "topDragBegin"
25
- const val REGISTRATION_NAME = "onDragBegin"
26
- }
27
- }
@@ -1,27 +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, private val detent: 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
- putDouble("detent", detent.toDouble())
21
- }
22
-
23
- companion object {
24
- const val EVENT_NAME = "topDragChange"
25
- const val REGISTRATION_NAME = "onDragChange"
26
- }
27
- }
@@ -1,27 +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, private val detent: 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
- putDouble("detent", detent.toDouble())
21
- }
22
-
23
- companion object {
24
- const val EVENT_NAME = "topDragEnd"
25
- const val REGISTRATION_NAME = "onDragEnd"
26
- }
27
- }
@@ -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 regains focus after a sheet on top of it is dismissed
9
- */
10
- class FocusEvent(surfaceId: Int, viewId: Int) : Event<FocusEvent>(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 = "topDidFocus"
18
- const val REGISTRATION_NAME = "onDidFocus"
19
- }
20
- }
@@ -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,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,27 +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, private val detent: 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
- putDouble("detent", detent.toDouble())
21
- }
22
-
23
- companion object {
24
- const val EVENT_NAME = "topWillPresent"
25
- const val REGISTRATION_NAME = "onWillPresent"
26
- }
27
- }
@@ -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 OnDetentChangeEvent : 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 "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
- detent:(CGFloat)detent {
19
- if (!eventEmitter)
20
- return;
21
-
22
- auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
23
- TrueSheetViewEventEmitter::OnDetentChange event;
24
- event.index = static_cast<int>(index);
25
- event.position = static_cast<double>(position);
26
- event.detent = static_cast<double>(detent);
27
- emitter->onDetentChange(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 OnDidBlurEvent : 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