@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.
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +8 -2
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +23 -6
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +9 -2
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +1 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/TouchEventDeduper.kt +31 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +7 -0
- package/ios/TrueSheetContainerView.h +5 -0
- package/ios/TrueSheetContainerView.mm +4 -0
- package/ios/TrueSheetFooterView.h +6 -0
- package/ios/TrueSheetFooterView.mm +31 -2
- package/ios/TrueSheetView.mm +82 -17
- package/ios/TrueSheetViewController.h +9 -0
- package/ios/TrueSheetViewController.mm +109 -29
- package/lib/module/TrueSheet.js +53 -9
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +11 -9
- package/lib/module/TrueSheet.web.js.map +1 -1
- package/lib/module/TrueSheetPeek.web.js +3 -3
- package/lib/module/TrueSheetPeek.web.js.map +1 -1
- package/lib/module/mocks/navigation.js +31 -21
- package/lib/module/mocks/navigation.js.map +1 -1
- package/lib/module/mocks/navigationExpoRouter.js +21 -0
- package/lib/module/mocks/navigationExpoRouter.js.map +1 -0
- package/lib/module/mocks/reanimated.js +1 -1
- package/lib/module/mocks/reanimated.js.map +1 -1
- package/lib/module/navigation/{TrueSheetView.js → TrueSheetNavigatorContent.js} +14 -12
- package/lib/module/navigation/TrueSheetNavigatorContent.js.map +1 -0
- package/lib/module/navigation/actions.js +50 -0
- package/lib/module/navigation/actions.js.map +1 -0
- package/lib/module/navigation/{TrueSheetRouter.js → createTrueSheetRouter.js} +20 -24
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +48 -0
- package/lib/module/navigation/expo-router/index.js.map +1 -0
- package/lib/module/navigation/index.js +43 -2
- package/lib/module/navigation/index.js.map +1 -1
- package/lib/module/navigation/navigator.js +10 -0
- package/lib/module/navigation/navigator.js.map +1 -0
- package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js +2 -2
- package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js.map +1 -1
- package/lib/module/navigation/screen/TrueSheetScreen.js +2 -2
- package/lib/module/navigation/screen/TrueSheetScreen.js.map +1 -1
- package/lib/module/navigation/screen/useSheetScreenState.js +4 -4
- package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -1
- package/lib/module/navigation/useTrueSheetNavigation.js +1 -1
- package/lib/module/navigation/useTrueSheetNavigation.js.map +1 -1
- package/lib/module/web/dom.js +10 -0
- package/lib/module/web/dom.js.map +1 -0
- package/lib/module/web/vaul/helpers.js +10 -4
- package/lib/module/web/vaul/helpers.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +2 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -1
- package/lib/typescript/src/mocks/navigation.d.ts +5 -1
- package/lib/typescript/src/mocks/navigation.d.ts.map +1 -1
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +22 -0
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -0
- package/lib/typescript/src/mocks/reanimated.d.ts.map +1 -1
- package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts +5 -0
- package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts.map +1 -0
- package/lib/typescript/src/navigation/actions.d.ts +71 -0
- package/lib/typescript/src/navigation/actions.d.ts.map +1 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +14 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts +37 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +42 -2
- package/lib/typescript/src/navigation/index.d.ts.map +1 -1
- package/lib/typescript/src/navigation/navigator.d.ts +7 -0
- package/lib/typescript/src/navigation/navigator.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts +1 -1
- package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts.map +1 -1
- package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts +1 -1
- package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts.map +1 -1
- package/lib/typescript/src/navigation/screen/types.d.ts +3 -4
- package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -1
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +3 -5
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -1
- package/lib/typescript/src/navigation/types.d.ts +24 -0
- package/lib/typescript/src/navigation/types.d.ts.map +1 -1
- package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts +1 -1
- package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts.map +1 -1
- package/lib/typescript/src/web/dom.d.ts +7 -0
- package/lib/typescript/src/web/dom.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -1
- package/package.json +23 -8
- package/src/TrueSheet.tsx +55 -9
- package/src/TrueSheet.web.tsx +14 -18
- package/src/TrueSheetPeek.web.tsx +4 -3
- package/src/mocks/navigation.ts +32 -25
- package/src/mocks/navigationExpoRouter.ts +40 -0
- package/src/mocks/reanimated.ts +8 -9
- package/src/navigation/{TrueSheetView.tsx → TrueSheetNavigatorContent.tsx} +24 -17
- package/src/navigation/actions.ts +78 -0
- package/src/navigation/createTrueSheetRouter.ts +222 -0
- package/src/navigation/expo-router/index.ts +89 -0
- package/src/navigation/index.ts +69 -2
- package/src/navigation/navigator.ts +18 -0
- package/src/navigation/screen/ReanimatedTrueSheetScreen.tsx +2 -2
- package/src/navigation/screen/TrueSheetScreen.tsx +2 -2
- package/src/navigation/screen/types.ts +4 -6
- package/src/navigation/screen/useSheetScreenState.ts +8 -15
- package/src/navigation/types.ts +32 -0
- package/src/navigation/useTrueSheetNavigation.ts +1 -1
- package/src/web/dom.ts +9 -0
- package/src/web/vaul/helpers.ts +13 -6
- package/lib/module/navigation/TrueSheetRouter.js.map +0 -1
- package/lib/module/navigation/TrueSheetView.js.map +0 -1
- package/lib/module/navigation/createTrueSheetNavigator.js +0 -63
- package/lib/module/navigation/createTrueSheetNavigator.js.map +0 -1
- package/lib/typescript/src/navigation/TrueSheetRouter.d.ts +0 -57
- package/lib/typescript/src/navigation/TrueSheetRouter.d.ts.map +0 -1
- package/lib/typescript/src/navigation/TrueSheetView.d.ts +0 -10
- package/lib/typescript/src/navigation/TrueSheetView.d.ts.map +0 -1
- package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts +0 -35
- package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts.map +0 -1
- package/src/navigation/TrueSheetRouter.ts +0 -234
- 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
|
-
};
|