@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.
Files changed (98) hide show
  1. package/README.md +13 -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 +48 -43
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +387 -88
  6. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +22 -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 +44 -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/ios/TrueSheetContainerView.mm +4 -0
  19. package/ios/TrueSheetContentView.h +2 -1
  20. package/ios/TrueSheetContentView.mm +91 -11
  21. package/ios/TrueSheetView.mm +65 -41
  22. package/ios/TrueSheetViewController.h +21 -10
  23. package/ios/TrueSheetViewController.mm +330 -165
  24. package/ios/core/TrueSheetBlurView.h +24 -0
  25. package/ios/{utils/ConversionUtil.mm → core/TrueSheetBlurView.mm} +65 -3
  26. package/ios/events/TrueSheetDragEvents.h +39 -0
  27. package/ios/events/TrueSheetDragEvents.mm +62 -0
  28. package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
  29. package/ios/events/TrueSheetFocusEvents.mm +49 -0
  30. package/ios/events/TrueSheetLifecycleEvents.h +40 -0
  31. package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
  32. package/ios/events/TrueSheetStateEvents.h +35 -0
  33. package/ios/events/TrueSheetStateEvents.mm +49 -0
  34. package/ios/utils/GestureUtil.h +7 -0
  35. package/ios/utils/GestureUtil.mm +12 -0
  36. package/lib/module/TrueSheet.js +65 -12
  37. package/lib/module/TrueSheet.js.map +1 -1
  38. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +15 -5
  39. package/lib/module/index.js +0 -1
  40. package/lib/module/index.js.map +1 -1
  41. package/lib/module/reanimated/ReanimatedTrueSheet.js +13 -7
  42. package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
  43. package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
  44. package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
  45. package/lib/typescript/src/TrueSheet.d.ts +4 -0
  46. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  47. package/lib/typescript/src/TrueSheet.types.d.ts +58 -6
  48. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  49. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +14 -5
  50. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  51. package/lib/typescript/src/index.d.ts +0 -1
  52. package/lib/typescript/src/index.d.ts.map +1 -1
  53. package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
  54. package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
  55. package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/TrueSheet.tsx +80 -10
  58. package/src/TrueSheet.types.ts +65 -6
  59. package/src/__mocks__/index.js +0 -5
  60. package/src/fabric/TrueSheetViewNativeComponent.ts +15 -5
  61. package/src/index.ts +0 -1
  62. package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
  63. package/src/reanimated/ReanimatedTrueSheetProvider.tsx +11 -3
  64. package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
  65. package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
  66. package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
  67. package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
  68. package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
  69. package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
  70. package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
  71. package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
  72. package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
  73. package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
  74. package/ios/events/OnDetentChangeEvent.h +0 -28
  75. package/ios/events/OnDetentChangeEvent.mm +0 -30
  76. package/ios/events/OnDidDismissEvent.h +0 -26
  77. package/ios/events/OnDidDismissEvent.mm +0 -25
  78. package/ios/events/OnDidPresentEvent.h +0 -28
  79. package/ios/events/OnDidPresentEvent.mm +0 -30
  80. package/ios/events/OnDragBeginEvent.h +0 -28
  81. package/ios/events/OnDragBeginEvent.mm +0 -30
  82. package/ios/events/OnDragChangeEvent.h +0 -28
  83. package/ios/events/OnDragChangeEvent.mm +0 -30
  84. package/ios/events/OnDragEndEvent.h +0 -28
  85. package/ios/events/OnDragEndEvent.mm +0 -30
  86. package/ios/events/OnMountEvent.h +0 -26
  87. package/ios/events/OnMountEvent.mm +0 -25
  88. package/ios/events/OnPositionChangeEvent.mm +0 -32
  89. package/ios/events/OnWillDismissEvent.h +0 -26
  90. package/ios/events/OnWillDismissEvent.mm +0 -25
  91. package/ios/events/OnWillPresentEvent.h +0 -28
  92. package/ios/events/OnWillPresentEvent.mm +0 -30
  93. package/ios/utils/ConversionUtil.h +0 -24
  94. package/lib/module/TrueSheetGrabber.js +0 -51
  95. package/lib/module/TrueSheetGrabber.js.map +0 -1
  96. package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
  97. package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
  98. package/src/TrueSheetGrabber.tsx +0 -82
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleSheet","View","jsx","_jsx","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","styles","wrapper","top","children","grabber","backgroundColor","create","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAyD,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjG,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACEN,IAAA,CAACF,IAAI;IAACa,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAEF,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEa,GAAG,EAAEJ;IAAU,CAAC,CAAE;IAAAK,QAAA,eAC3Ff,IAAA,CAACF,IAAI;MAACa,KAAK,EAAE,CAACC,MAAM,CAACI,OAAO,EAAE;QAAEP,MAAM;QAAED,KAAK;QAAES,eAAe,EAAEV;MAAM,CAAC;IAAE,CAAE;EAAC,CACxE,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAGf,UAAU,CAACqB,MAAM,CAAC;EAC/BL,OAAO,EAAE;IACPM,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE;EACV,CAAC;EACDR,OAAO,EAAE;IACPS,YAAY,EAAExB,sBAAsB,GAAG;EACzC;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,39 +0,0 @@
1
- import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
2
- export interface TrueSheetGrabberProps {
3
- /**
4
- * Is grabber visible.
5
- * @default true
6
- */
7
- visible?: boolean;
8
- /**
9
- * Optional style that overrides the default style.
10
- */
11
- style?: StyleProp<ViewStyle>;
12
- /**
13
- * Grabber color according to M3 specs.
14
- * @default rgba(73,69,79,0.4)
15
- */
16
- color?: ColorValue;
17
- /**
18
- * Grabber height according to M3 specs.
19
- * @default 4
20
- */
21
- height?: number;
22
- /**
23
- * Grabber top position offset.
24
- *
25
- * @default 6
26
- */
27
- topOffset?: number;
28
- /**
29
- * Grabber width according to M3 specs.
30
- * @default 32
31
- */
32
- width?: number;
33
- }
34
- /**
35
- * Grabber component.
36
- * Used by defualt for Android but feel free to re-use.
37
- */
38
- export declare const TrueSheetGrabber: (props: TrueSheetGrabberProps) => import("react/jsx-runtime").JSX.Element | null;
39
- //# sourceMappingURL=TrueSheetGrabber.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQjG,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,mDAiB5D,CAAC"}
@@ -1,82 +0,0 @@
1
- import { StyleSheet, View, type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
2
-
3
- const GRABBER_DEFAULT_HEIGHT = 4;
4
- const GRABBER_DEFAULT_WIDTH = 32;
5
-
6
- // M3 spec: #49454F 0.4 alpha
7
- const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
8
-
9
- export interface TrueSheetGrabberProps {
10
- /**
11
- * Is grabber visible.
12
- * @default true
13
- */
14
- visible?: boolean;
15
-
16
- /**
17
- * Optional style that overrides the default style.
18
- */
19
- style?: StyleProp<ViewStyle>;
20
-
21
- /**
22
- * Grabber color according to M3 specs.
23
- * @default rgba(73,69,79,0.4)
24
- */
25
- color?: ColorValue;
26
-
27
- /**
28
- * Grabber height according to M3 specs.
29
- * @default 4
30
- */
31
- height?: number;
32
-
33
- /**
34
- * Grabber top position offset.
35
- *
36
- * @default 6
37
- */
38
- topOffset?: number;
39
-
40
- /**
41
- * Grabber width according to M3 specs.
42
- * @default 32
43
- */
44
- width?: number;
45
- }
46
-
47
- /**
48
- * Grabber component.
49
- * Used by defualt for Android but feel free to re-use.
50
- */
51
- export const TrueSheetGrabber = (props: TrueSheetGrabberProps) => {
52
- const {
53
- visible = true,
54
- color = GRABBER_DEFAULT_COLOR,
55
- width = GRABBER_DEFAULT_WIDTH,
56
- height = GRABBER_DEFAULT_HEIGHT,
57
- topOffset = 0,
58
- style,
59
- } = props;
60
-
61
- if (!visible) return null;
62
-
63
- return (
64
- <View style={[styles.wrapper, style, { height: GRABBER_DEFAULT_HEIGHT * 4, top: topOffset }]}>
65
- <View style={[styles.grabber, { height, width, backgroundColor: color }]} />
66
- </View>
67
- );
68
- };
69
-
70
- const styles = StyleSheet.create({
71
- wrapper: {
72
- position: 'absolute',
73
- alignSelf: 'center',
74
- paddingHorizontal: 12,
75
- alignItems: 'center',
76
- justifyContent: 'center',
77
- zIndex: 9999,
78
- },
79
- grabber: {
80
- borderRadius: GRABBER_DEFAULT_HEIGHT / 2,
81
- },
82
- });