@lodev09/react-native-true-sheet 4.0.0-beta.1 → 4.0.0-beta.3

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 (118) hide show
  1. package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +8 -2
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +23 -6
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +9 -2
  4. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +1 -0
  5. package/android/src/main/java/com/lodev09/truesheet/utils/TouchEventDeduper.kt +31 -0
  6. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +7 -0
  7. package/ios/TrueSheetContainerView.h +5 -0
  8. package/ios/TrueSheetContainerView.mm +4 -0
  9. package/ios/TrueSheetFooterView.h +6 -0
  10. package/ios/TrueSheetFooterView.mm +31 -2
  11. package/ios/TrueSheetView.mm +82 -17
  12. package/ios/TrueSheetViewController.h +9 -0
  13. package/ios/TrueSheetViewController.mm +109 -29
  14. package/lib/module/TrueSheet.js +53 -9
  15. package/lib/module/TrueSheet.js.map +1 -1
  16. package/lib/module/TrueSheet.web.js +11 -9
  17. package/lib/module/TrueSheet.web.js.map +1 -1
  18. package/lib/module/TrueSheetPeek.web.js +3 -3
  19. package/lib/module/TrueSheetPeek.web.js.map +1 -1
  20. package/lib/module/mocks/navigation.js +31 -21
  21. package/lib/module/mocks/navigation.js.map +1 -1
  22. package/lib/module/mocks/navigationExpoRouter.js +21 -0
  23. package/lib/module/mocks/navigationExpoRouter.js.map +1 -0
  24. package/lib/module/mocks/reanimated.js +1 -1
  25. package/lib/module/mocks/reanimated.js.map +1 -1
  26. package/lib/module/navigation/{TrueSheetView.js → TrueSheetNavigatorContent.js} +14 -12
  27. package/lib/module/navigation/TrueSheetNavigatorContent.js.map +1 -0
  28. package/lib/module/navigation/actions.js +50 -0
  29. package/lib/module/navigation/actions.js.map +1 -0
  30. package/lib/module/navigation/{TrueSheetRouter.js → createTrueSheetRouter.js} +20 -24
  31. package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
  32. package/lib/module/navigation/expo-router/index.js +48 -0
  33. package/lib/module/navigation/expo-router/index.js.map +1 -0
  34. package/lib/module/navigation/index.js +43 -2
  35. package/lib/module/navigation/index.js.map +1 -1
  36. package/lib/module/navigation/navigator.js +10 -0
  37. package/lib/module/navigation/navigator.js.map +1 -0
  38. package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js +2 -2
  39. package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js.map +1 -1
  40. package/lib/module/navigation/screen/TrueSheetScreen.js +2 -2
  41. package/lib/module/navigation/screen/TrueSheetScreen.js.map +1 -1
  42. package/lib/module/navigation/screen/useSheetScreenState.js +4 -4
  43. package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -1
  44. package/lib/module/navigation/useTrueSheetNavigation.js +1 -1
  45. package/lib/module/navigation/useTrueSheetNavigation.js.map +1 -1
  46. package/lib/module/web/dom.js +10 -0
  47. package/lib/module/web/dom.js.map +1 -0
  48. package/lib/module/web/vaul/helpers.js +10 -4
  49. package/lib/module/web/vaul/helpers.js.map +1 -1
  50. package/lib/typescript/src/TrueSheet.d.ts +2 -0
  51. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  52. package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
  53. package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -1
  54. package/lib/typescript/src/mocks/navigation.d.ts +5 -1
  55. package/lib/typescript/src/mocks/navigation.d.ts.map +1 -1
  56. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +22 -0
  57. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -0
  58. package/lib/typescript/src/mocks/reanimated.d.ts.map +1 -1
  59. package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts +5 -0
  60. package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts.map +1 -0
  61. package/lib/typescript/src/navigation/actions.d.ts +71 -0
  62. package/lib/typescript/src/navigation/actions.d.ts.map +1 -0
  63. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +14 -0
  64. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
  65. package/lib/typescript/src/navigation/expo-router/index.d.ts +37 -0
  66. package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
  67. package/lib/typescript/src/navigation/index.d.ts +42 -2
  68. package/lib/typescript/src/navigation/index.d.ts.map +1 -1
  69. package/lib/typescript/src/navigation/navigator.d.ts +7 -0
  70. package/lib/typescript/src/navigation/navigator.d.ts.map +1 -0
  71. package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts +1 -1
  72. package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts.map +1 -1
  73. package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts +1 -1
  74. package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts.map +1 -1
  75. package/lib/typescript/src/navigation/screen/types.d.ts +3 -4
  76. package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -1
  77. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +3 -5
  78. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -1
  79. package/lib/typescript/src/navigation/types.d.ts +24 -0
  80. package/lib/typescript/src/navigation/types.d.ts.map +1 -1
  81. package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts +1 -1
  82. package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts.map +1 -1
  83. package/lib/typescript/src/web/dom.d.ts +7 -0
  84. package/lib/typescript/src/web/dom.d.ts.map +1 -0
  85. package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -1
  86. package/package.json +23 -8
  87. package/src/TrueSheet.tsx +55 -9
  88. package/src/TrueSheet.web.tsx +14 -18
  89. package/src/TrueSheetPeek.web.tsx +4 -3
  90. package/src/mocks/navigation.ts +32 -25
  91. package/src/mocks/navigationExpoRouter.ts +40 -0
  92. package/src/mocks/reanimated.ts +8 -9
  93. package/src/navigation/{TrueSheetView.tsx → TrueSheetNavigatorContent.tsx} +24 -17
  94. package/src/navigation/actions.ts +78 -0
  95. package/src/navigation/createTrueSheetRouter.ts +222 -0
  96. package/src/navigation/expo-router/index.ts +89 -0
  97. package/src/navigation/index.ts +69 -2
  98. package/src/navigation/navigator.ts +18 -0
  99. package/src/navigation/screen/ReanimatedTrueSheetScreen.tsx +2 -2
  100. package/src/navigation/screen/TrueSheetScreen.tsx +2 -2
  101. package/src/navigation/screen/types.ts +4 -6
  102. package/src/navigation/screen/useSheetScreenState.ts +8 -15
  103. package/src/navigation/types.ts +32 -0
  104. package/src/navigation/useTrueSheetNavigation.ts +1 -1
  105. package/src/web/dom.ts +9 -0
  106. package/src/web/vaul/helpers.ts +13 -6
  107. package/lib/module/navigation/TrueSheetRouter.js.map +0 -1
  108. package/lib/module/navigation/TrueSheetView.js.map +0 -1
  109. package/lib/module/navigation/createTrueSheetNavigator.js +0 -63
  110. package/lib/module/navigation/createTrueSheetNavigator.js.map +0 -1
  111. package/lib/typescript/src/navigation/TrueSheetRouter.d.ts +0 -57
  112. package/lib/typescript/src/navigation/TrueSheetRouter.d.ts.map +0 -1
  113. package/lib/typescript/src/navigation/TrueSheetView.d.ts +0 -10
  114. package/lib/typescript/src/navigation/TrueSheetView.d.ts.map +0 -1
  115. package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts +0 -35
  116. package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts.map +0 -1
  117. package/src/navigation/TrueSheetRouter.ts +0 -234
  118. package/src/navigation/createTrueSheetNavigator.tsx +0 -93
@@ -1,93 +0,0 @@
1
- import {
2
- createNavigatorFactory,
3
- type NavigatorTypeBagBase,
4
- type ParamListBase,
5
- type StaticConfig,
6
- type TypedNavigator,
7
- useNavigationBuilder,
8
- } from '@react-navigation/core';
9
-
10
- import { TrueSheetRouter, type TrueSheetRouterOptions } from './TrueSheetRouter';
11
- import { TrueSheetView } from './TrueSheetView';
12
- import type {
13
- TrueSheetActionHelpers,
14
- TrueSheetNavigationEventMap,
15
- TrueSheetNavigationOptions,
16
- TrueSheetNavigationProp,
17
- TrueSheetNavigationState,
18
- TrueSheetNavigatorProps,
19
- } from './types';
20
-
21
- const TrueSheetNavigator = ({
22
- id,
23
- initialRouteName,
24
- children,
25
- layout,
26
- screenListeners,
27
- screenOptions,
28
- screenLayout,
29
- }: TrueSheetNavigatorProps) => {
30
- const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<
31
- TrueSheetNavigationState<ParamListBase>,
32
- TrueSheetRouterOptions,
33
- TrueSheetActionHelpers<ParamListBase>,
34
- TrueSheetNavigationOptions,
35
- TrueSheetNavigationEventMap
36
- >(TrueSheetRouter, {
37
- id,
38
- initialRouteName,
39
- children,
40
- layout,
41
- screenListeners,
42
- screenOptions,
43
- screenLayout,
44
- });
45
-
46
- return (
47
- <NavigationContent>
48
- <TrueSheetView state={state} navigation={navigation} descriptors={descriptors} />
49
- </NavigationContent>
50
- );
51
- };
52
-
53
- /**
54
- * Creates a TrueSheet navigator.
55
- *
56
- * @example
57
- * ```tsx
58
- * const Sheet = createTrueSheetNavigator();
59
- *
60
- * function App() {
61
- * return (
62
- * <Sheet.Navigator>
63
- * <Sheet.Screen name="Home" component={HomeScreen} />
64
- * <Sheet.Screen
65
- * name="Details"
66
- * component={DetailsSheet}
67
- * options={{ detents: [0.5, 1] }}
68
- * />
69
- * </Sheet.Navigator>
70
- * );
71
- * }
72
- * ```
73
- */
74
- export const createTrueSheetNavigator = <
75
- const ParamList extends ParamListBase,
76
- const NavigatorID extends string | undefined = undefined,
77
- const TypeBag extends NavigatorTypeBagBase = {
78
- ParamList: ParamList;
79
- NavigatorID: NavigatorID;
80
- State: TrueSheetNavigationState<ParamList>;
81
- ScreenOptions: TrueSheetNavigationOptions;
82
- EventMap: TrueSheetNavigationEventMap;
83
- NavigationList: {
84
- [RouteName in keyof ParamList]: TrueSheetNavigationProp<ParamList, RouteName, NavigatorID>;
85
- };
86
- Navigator: typeof TrueSheetNavigator;
87
- },
88
- const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>,
89
- >(
90
- config?: Config
91
- ): TypedNavigator<TypeBag, Config> => {
92
- return createNavigatorFactory(TrueSheetNavigator)(config);
93
- };