@lodev09/react-native-true-sheet 4.0.0-beta.4 → 4.0.0-beta.6
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/README.md +21 -2
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +0 -7
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +0 -36
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +0 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +0 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +0 -8
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +17 -38
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +0 -2
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +1 -2
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +1 -7
- package/ios/TrueSheetContainerView.h +0 -6
- package/ios/TrueSheetContainerView.mm +0 -1
- package/ios/TrueSheetContentView.h +0 -7
- package/ios/TrueSheetContentView.mm +0 -32
- package/ios/TrueSheetView.mm +0 -6
- package/ios/TrueSheetViewController.mm +35 -27
- package/lib/module/TrueSheet.js +10 -5
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js.map +1 -1
- package/lib/module/mocks/navigationExpoRouter.js.map +1 -1
- package/lib/module/navigation/base-types.js +2 -0
- package/lib/module/navigation/base-types.js.map +1 -0
- package/lib/module/navigation/createTrueSheetRouter.js +0 -9
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -1
- package/lib/module/navigation/expo-router/base-types.js +2 -0
- package/lib/module/navigation/expo-router/base-types.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +5 -3
- package/lib/module/navigation/expo-router/index.js.map +1 -1
- package/lib/module/navigation/expo-router/types.js +4 -0
- package/lib/module/navigation/expo-router/types.js.map +1 -0
- package/lib/module/navigation/index.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +14 -0
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +3 -3
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -1
- package/lib/typescript/src/navigation/base-types.d.ts +9 -0
- package/lib/typescript/src/navigation/base-types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +2 -13
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -1
- package/lib/typescript/src/navigation/expo-router/base-types.d.ts +8 -0
- package/lib/typescript/src/navigation/expo-router/base-types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts +5 -5
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -1
- package/lib/typescript/src/navigation/expo-router/types.d.ts +44 -0
- package/lib/typescript/src/navigation/expo-router/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +3 -4
- package/lib/typescript/src/navigation/index.d.ts.map +1 -1
- package/lib/typescript/src/navigation/types.d.ts +34 -4
- package/lib/typescript/src/navigation/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheet.tsx +14 -5
- package/src/TrueSheet.types.ts +15 -0
- package/src/TrueSheet.web.tsx +2 -1
- package/src/mocks/navigationExpoRouter.ts +6 -5
- package/src/navigation/base-types.ts +20 -0
- package/src/navigation/createTrueSheetRouter.ts +5 -33
- package/src/navigation/expo-router/base-types.ts +18 -0
- package/src/navigation/expo-router/index.ts +20 -19
- package/src/navigation/expo-router/types.ts +116 -0
- package/src/navigation/index.ts +6 -7
- package/src/navigation/types.ts +65 -19
package/src/navigation/types.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import type { NavigatorArgs } from 'standard-navigation';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
DetentInfoEventPayload,
|
|
5
|
+
PositionChangeEventPayload,
|
|
6
|
+
TrueSheetProps,
|
|
7
|
+
} from '../TrueSheet.types';
|
|
8
|
+
import type { TrueSheetActionType } from './actions';
|
|
1
9
|
import type {
|
|
2
10
|
DefaultNavigatorOptions,
|
|
3
11
|
Descriptor,
|
|
12
|
+
NavigationAction,
|
|
4
13
|
NavigationHelpers,
|
|
5
14
|
NavigationProp,
|
|
6
15
|
NavigationState,
|
|
7
16
|
ParamListBase,
|
|
8
17
|
RouteProp,
|
|
18
|
+
Router,
|
|
9
19
|
StackActionHelpers,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import type {
|
|
14
|
-
DetentInfoEventPayload,
|
|
15
|
-
PositionChangeEventPayload,
|
|
16
|
-
TrueSheetProps,
|
|
17
|
-
} from '../TrueSheet.types';
|
|
18
|
-
import type { TrueSheetActionType } from './actions';
|
|
20
|
+
StackRouterOptions,
|
|
21
|
+
} from './base-types';
|
|
19
22
|
|
|
20
23
|
export type PositionChangeHandler = (payload: PositionChangeEventPayload) => void;
|
|
21
24
|
|
|
@@ -74,18 +77,54 @@ export type TrueSheetNavigationEventMap = {
|
|
|
74
77
|
sheetDidBlur: { data: undefined };
|
|
75
78
|
};
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
/**
|
|
81
|
+
* A navigation state tagged as `true-sheet`, with the sheet fields the router
|
|
82
|
+
* adds to each route.
|
|
83
|
+
* Generic over the base state so each entry point can bind its own
|
|
84
|
+
* `NavigationState` — see `./base-types`.
|
|
85
|
+
*/
|
|
86
|
+
export type TrueSheetStateOf<State extends { routes: readonly unknown[] }> = Omit<
|
|
87
|
+
State,
|
|
79
88
|
'routes'
|
|
80
89
|
> & {
|
|
81
90
|
type: 'true-sheet';
|
|
82
|
-
routes: (
|
|
91
|
+
routes: (State['routes'][number] & {
|
|
83
92
|
resizeIndex?: number;
|
|
84
93
|
resizeKey?: number;
|
|
85
94
|
closing?: boolean;
|
|
86
95
|
})[];
|
|
87
96
|
};
|
|
88
97
|
|
|
98
|
+
export type TrueSheetNavigationState<ParamList extends ParamListBase> = TrueSheetStateOf<
|
|
99
|
+
NavigationState<ParamList>
|
|
100
|
+
>;
|
|
101
|
+
|
|
102
|
+
export type TrueSheetRouterState = TrueSheetNavigationState<ParamListBase>;
|
|
103
|
+
|
|
104
|
+
export type TrueSheetRouterOptions = StackRouterOptions;
|
|
105
|
+
|
|
106
|
+
export type TrueSheetRouter = Router<TrueSheetRouterState, TrueSheetActionType>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The wrapped router factory — also the shape `createTrueSheetRouter` accepts,
|
|
110
|
+
* pre-instantiated so either entry point's `StackRouterFactory` fits it.
|
|
111
|
+
*/
|
|
112
|
+
export type TrueSheetRouterFactory = (options: TrueSheetRouterOptions) => TrueSheetRouter;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The base `StackRouter` factory to wrap, typed generically over the state and
|
|
116
|
+
* action types the wrapper threads through — `StackRouter` is structural and
|
|
117
|
+
* never touches the sheet-specific fields.
|
|
118
|
+
* Injected by each entry point so the shared router never imports
|
|
119
|
+
* `@react-navigation/*` at runtime (Expo Router apps don't install it).
|
|
120
|
+
*/
|
|
121
|
+
export type StackRouterFactory = <
|
|
122
|
+
State extends NavigationState<ParamListBase>,
|
|
123
|
+
Action extends NavigationAction,
|
|
124
|
+
>(
|
|
125
|
+
options: TrueSheetRouterOptions
|
|
126
|
+
) => Router<State, Action>;
|
|
127
|
+
|
|
89
128
|
/**
|
|
90
129
|
* `TrueSheetNavigationEventMap` in the `standard-navigation` event-map shape.
|
|
91
130
|
*/
|
|
@@ -116,13 +155,20 @@ export interface TrueSheetNavigatorContentExtraProps {
|
|
|
116
155
|
dispatch: TrueSheetDispatch;
|
|
117
156
|
}
|
|
118
157
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Generic over the base helpers so each entry point can bind its own
|
|
160
|
+
* `StackActionHelpers` — see `./base-types`.
|
|
161
|
+
*/
|
|
162
|
+
export type TrueSheetActionHelpersOf<Helpers> = Helpers & {
|
|
163
|
+
/**
|
|
164
|
+
* Resize the sheet to a specific detent index.
|
|
165
|
+
*/
|
|
166
|
+
resize(index?: number): void;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export type TrueSheetActionHelpers<ParamList extends ParamListBase> = TrueSheetActionHelpersOf<
|
|
170
|
+
StackActionHelpers<ParamList>
|
|
171
|
+
>;
|
|
126
172
|
|
|
127
173
|
export type TrueSheetNavigationProp<
|
|
128
174
|
ParamList extends ParamListBase,
|