@lodev09/react-native-true-sheet 3.1.1 → 3.2.1

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 (49) hide show
  1. package/lib/module/navigation/TrueSheetRouter.js +12 -18
  2. package/lib/module/navigation/TrueSheetRouter.js.map +1 -1
  3. package/lib/module/navigation/TrueSheetView.js +30 -128
  4. package/lib/module/navigation/TrueSheetView.js.map +1 -1
  5. package/lib/module/navigation/createTrueSheetNavigator.js +3 -3
  6. package/lib/module/navigation/createTrueSheetNavigator.js.map +1 -1
  7. package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js +56 -0
  8. package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js.map +1 -0
  9. package/lib/module/navigation/screen/TrueSheetScreen.js +49 -0
  10. package/lib/module/navigation/screen/TrueSheetScreen.js.map +1 -0
  11. package/lib/module/navigation/screen/index.js +5 -0
  12. package/lib/module/navigation/screen/index.js.map +1 -0
  13. package/lib/module/navigation/screen/types.js +4 -0
  14. package/lib/module/navigation/screen/types.js.map +1 -0
  15. package/lib/module/navigation/screen/useSheetScreenState.js +77 -0
  16. package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -0
  17. package/lib/module/navigation/useTrueSheetNavigation.js +1 -3
  18. package/lib/module/navigation/useTrueSheetNavigation.js.map +1 -1
  19. package/lib/typescript/src/navigation/TrueSheetRouter.d.ts +4 -4
  20. package/lib/typescript/src/navigation/TrueSheetRouter.d.ts.map +1 -1
  21. package/lib/typescript/src/navigation/TrueSheetView.d.ts +1 -1
  22. package/lib/typescript/src/navigation/TrueSheetView.d.ts.map +1 -1
  23. package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts +1 -1
  24. package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts.map +1 -1
  25. package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts +3 -0
  26. package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts.map +1 -0
  27. package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts +3 -0
  28. package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts.map +1 -0
  29. package/lib/typescript/src/navigation/screen/index.d.ts +4 -0
  30. package/lib/typescript/src/navigation/screen/index.d.ts.map +1 -0
  31. package/lib/typescript/src/navigation/screen/types.d.ts +17 -0
  32. package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -0
  33. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +35 -0
  34. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
  35. package/lib/typescript/src/navigation/types.d.ts +27 -0
  36. package/lib/typescript/src/navigation/types.d.ts.map +1 -1
  37. package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts +1 -1
  38. package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/src/navigation/TrueSheetRouter.ts +6 -12
  41. package/src/navigation/TrueSheetView.tsx +40 -212
  42. package/src/navigation/createTrueSheetNavigator.tsx +3 -3
  43. package/src/navigation/screen/ReanimatedTrueSheetScreen.tsx +61 -0
  44. package/src/navigation/screen/TrueSheetScreen.tsx +54 -0
  45. package/src/navigation/screen/index.ts +3 -0
  46. package/src/navigation/screen/types.ts +19 -0
  47. package/src/navigation/screen/useSheetScreenState.ts +106 -0
  48. package/src/navigation/types.ts +29 -0
  49. package/src/navigation/useTrueSheetNavigation.ts +2 -4
@@ -0,0 +1,3 @@
1
+ import type { TrueSheetScreenProps } from './types';
2
+ export declare const TrueSheetScreen: ({ detentIndex, resizeKey, navigation, emit, routeKey, closing, detents, children, positionChangeHandler, ...sheetProps }: TrueSheetScreenProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=TrueSheetScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrueSheetScreen.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/screen/TrueSheetScreen.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,eAAO,MAAM,eAAe,GAAI,0HAW7B,oBAAoB,4CAmCtB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { TrueSheetScreen } from './TrueSheetScreen';
2
+ export { useSheetScreenState } from './useSheetScreenState';
3
+ export type { TrueSheetScreenProps } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ParamListBase } from '@react-navigation/native';
2
+ import type { PositionChangeEventPayload, TrueSheetProps } from '../../TrueSheet.types';
3
+ import type { TrueSheetNavigationHelpers, TrueSheetNavigationProp } from '../types';
4
+ export type PositionChangeHandler = (payload: PositionChangeEventPayload) => void;
5
+ export interface TrueSheetScreenProps {
6
+ detentIndex: number;
7
+ resizeKey?: number;
8
+ navigation: TrueSheetNavigationProp<ParamListBase>;
9
+ emit: TrueSheetNavigationHelpers['emit'];
10
+ routeKey: string;
11
+ closing?: boolean;
12
+ detents: TrueSheetProps['detents'];
13
+ children: React.ReactNode;
14
+ positionChangeHandler?: PositionChangeHandler;
15
+ [key: string]: unknown;
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEpF,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;AAElF,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;IACnD,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -0,0 +1,35 @@
1
+ import { TrueSheet } from '../../TrueSheet';
2
+ import type { DetentChangeEvent, DetentInfoEventPayload, DidBlurEvent, DidFocusEvent, DidPresentEvent, DragBeginEvent, DragChangeEvent, DragEndEvent, PositionChangeEvent, PositionChangeEventPayload, WillBlurEvent, WillDismissEvent, WillFocusEvent, WillPresentEvent } from '../../TrueSheet.types';
3
+ import type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationProp } from '../types';
4
+ import type { ParamListBase } from '@react-navigation/native';
5
+ type EmitFn = TrueSheetNavigationHelpers['emit'];
6
+ interface UseSheetScreenStateProps {
7
+ detentIndex: number;
8
+ resizeKey?: number;
9
+ closing?: boolean;
10
+ navigation: TrueSheetNavigationProp<ParamListBase>;
11
+ routeKey: string;
12
+ emit: EmitFn;
13
+ }
14
+ export declare const useSheetScreenState: (props: UseSheetScreenStateProps) => {
15
+ ref: import("react").RefObject<TrueSheet | null>;
16
+ initialDetentIndex: number;
17
+ emitEvent: (type: keyof TrueSheetNavigationEventMap, data: DetentInfoEventPayload | PositionChangeEventPayload | undefined) => void;
18
+ eventHandlers: {
19
+ onWillPresent: (e: WillPresentEvent) => void;
20
+ onDidPresent: (e: DidPresentEvent) => void;
21
+ onWillDismiss: (_e: WillDismissEvent) => void;
22
+ onDidDismiss: () => void;
23
+ onDetentChange: (e: DetentChangeEvent) => void;
24
+ onDragBegin: (e: DragBeginEvent) => void;
25
+ onDragChange: (e: DragChangeEvent) => void;
26
+ onDragEnd: (e: DragEndEvent) => void;
27
+ onPositionChange: (e: PositionChangeEvent) => void;
28
+ onWillFocus: (_e: WillFocusEvent) => void;
29
+ onDidFocus: (_e: DidFocusEvent) => void;
30
+ onWillBlur: (_e: WillBlurEvent) => void;
31
+ onDidBlur: (_e: DidBlurEvent) => void;
32
+ };
33
+ };
34
+ export {};
35
+ //# sourceMappingURL=useSheetScreenState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSheetScreenState.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/screen/useSheetScreenState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,MAAM,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAEjD,UAAU,wBAAwB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB;;;sBA6BzD,MAAM,2BAA2B,QACjC,sBAAsB,GAAG,0BAA0B,GAAG,SAAS;;2BAsBhD,gBAAgB;0BACjB,eAAe;4BACb,gBAAgB;;4BAEhB,iBAAiB;yBACpB,cAAc;0BACb,eAAe;uBAClB,YAAY;8BACL,mBAAmB;0BACvB,cAAc;yBACf,aAAa;yBACb,aAAa;wBACd,YAAY;;CAGjC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, StackActionHelpers } from '@react-navigation/native';
2
2
  import type { DetentInfoEventPayload, PositionChangeEventPayload, TrueSheetProps } from '../TrueSheet.types';
3
+ import type { PositionChangeHandler } from './screen/types';
3
4
  export type TrueSheetNavigationEventMap = {
4
5
  /**
5
6
  * Event fired when the sheet is about to be presented.
@@ -109,6 +110,32 @@ export type TrueSheetNavigationOptions = Pick<TrueSheetProps, 'detents' | 'backg
109
110
  * @default 0
110
111
  */
111
112
  detentIndex?: number;
113
+ /**
114
+ * Use ReanimatedTrueSheet for this screen.
115
+ * Enables worklet-based `onPositionChange` events.
116
+ *
117
+ * @default false
118
+ */
119
+ reanimated?: boolean;
120
+ /**
121
+ * A callback that receives position change events.
122
+ * When `reanimated` is enabled, this must be a worklet function.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * <Navigator.Screen
127
+ * name="Sheet"
128
+ * options={{
129
+ * reanimated: true,
130
+ * positionChangeHandler: (payload) => {
131
+ * 'worklet';
132
+ * animatedValue.value = payload.position;
133
+ * },
134
+ * }}
135
+ * />
136
+ * ```
137
+ */
138
+ positionChangeHandler?: PositionChangeHandler;
112
139
  };
113
140
  export type TrueSheetNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, TrueSheetNavigationState<ParamListBase>, TrueSheetNavigationOptions, TrueSheetNavigationEventMap, unknown> & {
114
141
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,gBAAgB,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IACnD;;OAEG;IACH,eAAe,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IAClD;;OAEG;IACH,gBAAgB,EAAE;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IACtC;;OAEG;IACH,eAAe,EAAE;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IACrC;;OAEG;IACH,iBAAiB,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IACpD;;OAEG;IACH,cAAc,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IACjD;;OAEG;IACH,eAAe,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IAClD;;OAEG;IACH,YAAY,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IAC/C;;OAEG;IACH,mBAAmB,EAAE;QAAE,IAAI,EAAE,0BAA0B,CAAA;KAAE,CAAC;IAC1D;;OAEG;IACH,cAAc,EAAE;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IAC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IACF,UAAU,EAAE,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACvE,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CACxD,aAAa,EACb,2BAA2B,CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,cAAc,EACZ,SAAS,GACT,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,QAAQ,GACR,mBAAmB,GACnB,UAAU,GACV,aAAa,GACb,WAAW,GACX,sBAAsB,GACtB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,QAAQ,GACR,QAAQ,CACX,GAAG;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,CAC3D,aAAa,EACb,MAAM,GAAG,SAAS,EAClB,wBAAwB,CAAC,aAAa,CAAC,EACvC,0BAA0B,EAC1B,2BAA2B,EAC3B,OAAO,CACR,GAAG;IACF;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAC1C,0BAA0B,EAC1B,uBAAuB,CAAC,aAAa,CAAC,EACtC,SAAS,CAAC,aAAa,CAAC,CACzB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,kBAAkB,EACnB,MAAM,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c,EACZ,SAAS,GACT,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,QAAQ,GACR,mBAAmB,GACnB,UAAU,GACV,aAAa,GACb,WAAW,GACX,sBAAsB,GACtB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,QAAQ,GACR,QAAQ,CACX,GAAG;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,CAC3D,aAAa,EACb,MAAM,GAAG,SAAS,EAClB,wBAAwB,CAAC,aAAa,CAAC,EACvC,0BAA0B,EAC1B,2BAA2B,EAC3B,OAAO,CACR,GAAG;IACF;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAC1C,0BAA0B,EAC1B,uBAAuB,CAAC,aAAa,CAAC,EACtC,SAAS,CAAC,aAAa,CAAC,CACzB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC,CAAC"}
@@ -19,5 +19,5 @@ import type { TrueSheetNavigationProp } from './types';
19
19
  * }
20
20
  * ```
21
21
  */
22
- export declare function useTrueSheetNavigation<T extends ParamListBase = ParamListBase>(): TrueSheetNavigationProp<T>;
22
+ export declare const useTrueSheetNavigation: <T extends ParamListBase = ParamListBase>() => TrueSheetNavigationProp<T>;
23
23
  //# sourceMappingURL=useTrueSheetNavigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTrueSheetNavigation.d.ts","sourceRoot":"","sources":["../../../../src/navigation/useTrueSheetNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,SAAS,aAAa,GAAG,aAAa,KACpC,uBAAuB,CAAC,CAAC,CAAC,CAE9B"}
1
+ {"version":3,"file":"useTrueSheetNavigation.d.ts","sourceRoot":"","sources":["../../../../src/navigation/useTrueSheetNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,GACjC,CAAC,SAAS,aAAa,GAAG,aAAa,OACpC,uBAAuB,CAAC,CAAC,CAAgD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.1.1",
3
+ "version": "3.2.1",
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",
@@ -35,20 +35,14 @@ export type TrueSheetActionType =
35
35
 
36
36
  export const TrueSheetActions = {
37
37
  ...StackActions,
38
- resize(index: number): TrueSheetActionType {
39
- return { type: 'RESIZE', index };
40
- },
41
- dismiss(): TrueSheetActionType {
42
- return { type: 'DISMISS' };
43
- },
44
- remove(): TrueSheetActionType {
45
- return { type: 'REMOVE' };
46
- },
38
+ resize: (index: number): TrueSheetActionType => ({ type: 'RESIZE', index }),
39
+ dismiss: (): TrueSheetActionType => ({ type: 'DISMISS' }),
40
+ remove: (): TrueSheetActionType => ({ type: 'REMOVE' }),
47
41
  };
48
42
 
49
- export function TrueSheetRouter(
43
+ export const TrueSheetRouter = (
50
44
  routerOptions: StackRouterOptions
51
- ): Router<TrueSheetNavigationState<ParamListBase>, TrueSheetActionType> {
45
+ ): Router<TrueSheetNavigationState<ParamListBase>, TrueSheetActionType> => {
52
46
  const baseRouter = StackRouter(routerOptions) as unknown as Router<
53
47
  TrueSheetNavigationState<ParamListBase>,
54
48
  TrueSheetActionType
@@ -169,4 +163,4 @@ export function TrueSheetRouter(
169
163
 
170
164
  actionCreators: TrueSheetActions,
171
165
  };
172
- }
166
+ };
@@ -1,225 +1,26 @@
1
1
  import type { ParamListBase } from '@react-navigation/native';
2
- import React, { useCallback, useEffect, useRef } from 'react';
3
2
 
4
- import { TrueSheet } from '../TrueSheet';
5
- import type {
6
- DetentChangeEvent,
7
- DetentInfoEventPayload,
8
- DidBlurEvent,
9
- DidFocusEvent,
10
- DidPresentEvent,
11
- DragBeginEvent,
12
- DragChangeEvent,
13
- DragEndEvent,
14
- PositionChangeEvent,
15
- PositionChangeEventPayload,
16
- WillBlurEvent,
17
- WillDismissEvent,
18
- WillFocusEvent,
19
- WillPresentEvent,
20
- } from '../TrueSheet.types';
21
3
  import type {
22
4
  TrueSheetDescriptorMap,
23
- TrueSheetNavigationEventMap,
24
5
  TrueSheetNavigationHelpers,
25
- TrueSheetNavigationOptions,
26
- TrueSheetNavigationProp,
27
6
  TrueSheetNavigationState,
28
7
  } from './types';
29
- import { TrueSheetActions } from './TrueSheetRouter';
8
+ import { TrueSheetScreen, type TrueSheetScreenProps } from './screen';
30
9
 
31
- type EmitFn = TrueSheetNavigationHelpers['emit'];
10
+ let ReanimatedTrueSheetScreen: React.ComponentType<TrueSheetScreenProps> | null = null;
32
11
 
33
- type TrueSheetScreenProps = Omit<TrueSheetNavigationOptions, 'detentIndex'> & {
34
- detentIndex: number;
35
- resizeKey?: number;
36
- navigation: TrueSheetNavigationProp<ParamListBase>;
37
- emit: EmitFn;
38
- routeKey: string;
39
- closing?: boolean;
40
- children: React.ReactNode;
12
+ const getReanimatedScreen = (): React.ComponentType<TrueSheetScreenProps> => {
13
+ if (!ReanimatedTrueSheetScreen) {
14
+ ReanimatedTrueSheetScreen =
15
+ require('./screen/ReanimatedTrueSheetScreen').ReanimatedTrueSheetScreen;
16
+ }
17
+ return ReanimatedTrueSheetScreen!;
41
18
  };
42
19
 
43
- function TrueSheetScreen({
44
- detentIndex,
45
- resizeKey,
46
- navigation,
47
- emit,
48
- routeKey,
49
- closing,
50
- detents,
51
- children,
52
- ...sheetProps
53
- }: TrueSheetScreenProps) {
54
- const ref = useRef<TrueSheet>(null);
55
- const isDismissedRef = useRef(false);
56
- const isFirstRenderRef = useRef(true);
57
- // Capture initial detent index only once
58
- const initialDetentIndexRef = useRef(detentIndex);
59
-
60
- // Handle closing state change - dismiss the sheet and wait for animation
61
- useEffect(() => {
62
- if (closing && !isDismissedRef.current) {
63
- isDismissedRef.current = true;
64
- (async () => {
65
- await ref.current?.dismiss();
66
- navigation.dispatch({ ...TrueSheetActions.remove(), source: routeKey });
67
- })();
68
- } else if (closing && isDismissedRef.current) {
69
- // Sheet was already dismissed by user swipe, just remove
70
- navigation.dispatch({ ...TrueSheetActions.remove(), source: routeKey });
71
- }
72
- }, [closing, navigation, routeKey]);
73
-
74
- // Handle resize - resizeKey ensures effect runs even when resizing to same index
75
- useEffect(() => {
76
- // Skip first render - initialDetentIndex handles initial presentation
77
- if (isFirstRenderRef.current) {
78
- isFirstRenderRef.current = false;
79
- return;
80
- }
81
-
82
- ref.current?.resize(detentIndex);
83
- }, [detentIndex, resizeKey]);
84
-
85
- const emitEvent = useCallback(
86
- (
87
- type: keyof TrueSheetNavigationEventMap,
88
- data: DetentInfoEventPayload | PositionChangeEventPayload | undefined
89
- ) => {
90
- emit({
91
- type,
92
- target: routeKey,
93
- data,
94
- } as Parameters<EmitFn>[0]);
95
- },
96
- [emit, routeKey]
97
- );
98
-
99
- const onWillPresent = useCallback(
100
- (e: WillPresentEvent) => {
101
- emitEvent('sheetWillPresent', e.nativeEvent);
102
- },
103
- [emitEvent]
104
- );
105
-
106
- const onDidPresent = useCallback(
107
- (e: DidPresentEvent) => {
108
- emitEvent('sheetDidPresent', e.nativeEvent);
109
- },
110
- [emitEvent]
111
- );
112
-
113
- const onWillDismiss = useCallback(
114
- (_e: WillDismissEvent) => {
115
- emitEvent('sheetWillDismiss', undefined);
116
- },
117
- [emitEvent]
118
- );
119
-
120
- const onDidDismiss = useCallback(() => {
121
- emitEvent('sheetDidDismiss', undefined);
122
- // User dismissed the sheet by swiping down
123
- if (!isDismissedRef.current) {
124
- isDismissedRef.current = true;
125
- navigation.goBack();
126
- }
127
- }, [emitEvent, navigation]);
128
-
129
- const onDetentChange = useCallback(
130
- (e: DetentChangeEvent) => {
131
- emitEvent('sheetDetentChange', e.nativeEvent);
132
- },
133
- [emitEvent]
134
- );
135
-
136
- const onDragBegin = useCallback(
137
- (e: DragBeginEvent) => {
138
- emitEvent('sheetDragBegin', e.nativeEvent);
139
- },
140
- [emitEvent]
141
- );
142
-
143
- const onDragChange = useCallback(
144
- (e: DragChangeEvent) => {
145
- emitEvent('sheetDragChange', e.nativeEvent);
146
- },
147
- [emitEvent]
148
- );
149
-
150
- const onDragEnd = useCallback(
151
- (e: DragEndEvent) => {
152
- emitEvent('sheetDragEnd', e.nativeEvent);
153
- },
154
- [emitEvent]
155
- );
156
-
157
- const onPositionChange = useCallback(
158
- (e: PositionChangeEvent) => {
159
- emitEvent('sheetPositionChange', e.nativeEvent);
160
- },
161
- [emitEvent]
162
- );
163
-
164
- const onWillFocus = useCallback(
165
- (_e: WillFocusEvent) => {
166
- emitEvent('sheetWillFocus', undefined);
167
- },
168
- [emitEvent]
169
- );
170
-
171
- const onDidFocus = useCallback(
172
- (_e: DidFocusEvent) => {
173
- emitEvent('sheetDidFocus', undefined);
174
- },
175
- [emitEvent]
176
- );
177
-
178
- const onWillBlur = useCallback(
179
- (_e: WillBlurEvent) => {
180
- emitEvent('sheetWillBlur', undefined);
181
- },
182
- [emitEvent]
183
- );
184
-
185
- const onDidBlur = useCallback(
186
- (_e: DidBlurEvent) => {
187
- emitEvent('sheetDidBlur', undefined);
188
- },
189
- [emitEvent]
190
- );
191
-
192
- return (
193
- <TrueSheet
194
- ref={ref}
195
- name={`navigation-sheet-${routeKey}`}
196
- initialDetentIndex={initialDetentIndexRef.current}
197
- detents={detents}
198
- onWillPresent={onWillPresent}
199
- onDidPresent={onDidPresent}
200
- onWillDismiss={onWillDismiss}
201
- onDidDismiss={onDidDismiss}
202
- onDetentChange={onDetentChange}
203
- onDragBegin={onDragBegin}
204
- onDragChange={onDragChange}
205
- onDragEnd={onDragEnd}
206
- onPositionChange={onPositionChange}
207
- onWillFocus={onWillFocus}
208
- onDidFocus={onDidFocus}
209
- onWillBlur={onWillBlur}
210
- onDidBlur={onDidBlur}
211
- {...sheetProps}
212
- >
213
- {children}
214
- </TrueSheet>
215
- );
216
- }
217
-
218
20
  const DEFAULT_DETENTS: ('auto' | number)[] = ['auto'];
219
21
 
220
- function clampDetentIndex(index: number, detentsLength: number): number {
221
- return Math.min(index, Math.max(detentsLength - 1, 0));
222
- }
22
+ const clampDetentIndex = (index: number, detentsLength: number): number =>
23
+ Math.min(index, Math.max(detentsLength - 1, 0));
223
24
 
224
25
  interface TrueSheetViewProps {
225
26
  state: TrueSheetNavigationState<ParamListBase>;
@@ -227,7 +28,7 @@ interface TrueSheetViewProps {
227
28
  descriptors: TrueSheetDescriptorMap;
228
29
  }
229
30
 
230
- export function TrueSheetView({ state, navigation, descriptors }: TrueSheetViewProps) {
31
+ export const TrueSheetView = ({ state, navigation, descriptors }: TrueSheetViewProps) => {
231
32
  // First route is the base screen, rest are sheets
232
33
  const [baseRoute, ...sheetRoutes] = state.routes;
233
34
 
@@ -247,9 +48,35 @@ export function TrueSheetView({ state, navigation, descriptors }: TrueSheetViewP
247
48
  }
248
49
 
249
50
  const { options, navigation: screenNavigation, render } = descriptor;
250
- const { detentIndex = 0, detents = DEFAULT_DETENTS, ...sheetProps } = options;
51
+ const {
52
+ detentIndex = 0,
53
+ detents = DEFAULT_DETENTS,
54
+ reanimated,
55
+ positionChangeHandler,
56
+ ...sheetProps
57
+ } = options;
251
58
  const resolvedIndex = clampDetentIndex(route.resizeIndex ?? detentIndex, detents.length);
252
59
 
60
+ if (reanimated) {
61
+ const ReanimatedScreen = getReanimatedScreen();
62
+ return (
63
+ <ReanimatedScreen
64
+ key={route.key}
65
+ routeKey={route.key}
66
+ closing={route.closing}
67
+ detentIndex={resolvedIndex}
68
+ resizeKey={route.resizeKey}
69
+ detents={detents}
70
+ navigation={screenNavigation}
71
+ emit={navigation.emit}
72
+ positionChangeHandler={positionChangeHandler}
73
+ {...sheetProps}
74
+ >
75
+ {render()}
76
+ </ReanimatedScreen>
77
+ );
78
+ }
79
+
253
80
  return (
254
81
  <TrueSheetScreen
255
82
  key={route.key}
@@ -260,6 +87,7 @@ export function TrueSheetView({ state, navigation, descriptors }: TrueSheetViewP
260
87
  detents={detents}
261
88
  navigation={screenNavigation}
262
89
  emit={navigation.emit}
90
+ positionChangeHandler={positionChangeHandler}
263
91
  {...sheetProps}
264
92
  >
265
93
  {render()}
@@ -268,4 +96,4 @@ export function TrueSheetView({ state, navigation, descriptors }: TrueSheetViewP
268
96
  })}
269
97
  </>
270
98
  );
271
- }
99
+ };
@@ -18,13 +18,13 @@ import type {
18
18
  TrueSheetNavigatorProps,
19
19
  } from './types';
20
20
 
21
- function TrueSheetNavigator({
21
+ const TrueSheetNavigator = ({
22
22
  id,
23
23
  initialRouteName,
24
24
  children,
25
25
  screenListeners,
26
26
  screenOptions,
27
- }: TrueSheetNavigatorProps) {
27
+ }: TrueSheetNavigatorProps) => {
28
28
  const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<
29
29
  TrueSheetNavigationState<ParamListBase>,
30
30
  TrueSheetRouterOptions,
@@ -44,7 +44,7 @@ function TrueSheetNavigator({
44
44
  <TrueSheetView state={state} navigation={navigation} descriptors={descriptors} />
45
45
  </NavigationContent>
46
46
  );
47
- }
47
+ };
48
48
 
49
49
  /**
50
50
  * Creates a TrueSheet navigator.
@@ -0,0 +1,61 @@
1
+ import Animated from 'react-native-reanimated';
2
+ import { scheduleOnRN } from 'react-native-worklets';
3
+
4
+ import { useReanimatedPositionChangeHandler } from '../../reanimated';
5
+ import { TrueSheet } from '../../TrueSheet';
6
+ import type { PositionChangeEvent } from '../../TrueSheet.types';
7
+ import type { TrueSheetScreenProps } from './types';
8
+ import { useSheetScreenState } from './useSheetScreenState';
9
+
10
+ const AnimatedTrueSheet = Animated.createAnimatedComponent(TrueSheet);
11
+
12
+ export const ReanimatedTrueSheetScreen = ({
13
+ detentIndex,
14
+ resizeKey,
15
+ navigation,
16
+ emit,
17
+ routeKey,
18
+ closing,
19
+ detents,
20
+ children,
21
+ positionChangeHandler,
22
+ ...sheetProps
23
+ }: TrueSheetScreenProps) => {
24
+ const {
25
+ ref,
26
+ initialDetentIndex,
27
+ eventHandlers: { onPositionChange, ...eventHandlers },
28
+ } = useSheetScreenState({
29
+ detentIndex,
30
+ resizeKey,
31
+ closing,
32
+ navigation,
33
+ routeKey,
34
+ emit,
35
+ });
36
+
37
+ const reanimatedPositionChangeHandler = useReanimatedPositionChangeHandler(
38
+ (payload) => {
39
+ 'worklet';
40
+ positionChangeHandler?.(payload);
41
+ scheduleOnRN(onPositionChange, {
42
+ nativeEvent: payload,
43
+ } as PositionChangeEvent);
44
+ },
45
+ [onPositionChange, positionChangeHandler]
46
+ );
47
+
48
+ return (
49
+ <AnimatedTrueSheet
50
+ ref={ref}
51
+ name={`navigation-sheet-${routeKey}`}
52
+ initialDetentIndex={initialDetentIndex}
53
+ detents={detents}
54
+ onPositionChange={reanimatedPositionChangeHandler}
55
+ {...eventHandlers}
56
+ {...sheetProps}
57
+ >
58
+ {children}
59
+ </AnimatedTrueSheet>
60
+ );
61
+ };
@@ -0,0 +1,54 @@
1
+ import { useCallback } from 'react';
2
+
3
+ import { TrueSheet } from '../../TrueSheet';
4
+ import type { PositionChangeEvent } from '../../TrueSheet.types';
5
+ import type { TrueSheetScreenProps } from './types';
6
+ import { useSheetScreenState } from './useSheetScreenState';
7
+
8
+ export const TrueSheetScreen = ({
9
+ detentIndex,
10
+ resizeKey,
11
+ navigation,
12
+ emit,
13
+ routeKey,
14
+ closing,
15
+ detents,
16
+ children,
17
+ positionChangeHandler,
18
+ ...sheetProps
19
+ }: TrueSheetScreenProps) => {
20
+ const {
21
+ ref,
22
+ initialDetentIndex,
23
+ eventHandlers: { onPositionChange, ...eventHandlers },
24
+ } = useSheetScreenState({
25
+ detentIndex,
26
+ resizeKey,
27
+ closing,
28
+ navigation,
29
+ routeKey,
30
+ emit,
31
+ });
32
+
33
+ const handlePositionChange = useCallback(
34
+ (e: PositionChangeEvent) => {
35
+ onPositionChange(e);
36
+ positionChangeHandler?.(e.nativeEvent);
37
+ },
38
+ [onPositionChange, positionChangeHandler]
39
+ );
40
+
41
+ return (
42
+ <TrueSheet
43
+ ref={ref}
44
+ name={`navigation-sheet-${routeKey}`}
45
+ initialDetentIndex={initialDetentIndex}
46
+ detents={detents}
47
+ onPositionChange={handlePositionChange}
48
+ {...eventHandlers}
49
+ {...sheetProps}
50
+ >
51
+ {children}
52
+ </TrueSheet>
53
+ );
54
+ };
@@ -0,0 +1,3 @@
1
+ export { TrueSheetScreen } from './TrueSheetScreen';
2
+ export { useSheetScreenState } from './useSheetScreenState';
3
+ export type { TrueSheetScreenProps } from './types';
@@ -0,0 +1,19 @@
1
+ import type { ParamListBase } from '@react-navigation/native';
2
+
3
+ import type { PositionChangeEventPayload, TrueSheetProps } from '../../TrueSheet.types';
4
+ import type { TrueSheetNavigationHelpers, TrueSheetNavigationProp } from '../types';
5
+
6
+ export type PositionChangeHandler = (payload: PositionChangeEventPayload) => void;
7
+
8
+ export interface TrueSheetScreenProps {
9
+ detentIndex: number;
10
+ resizeKey?: number;
11
+ navigation: TrueSheetNavigationProp<ParamListBase>;
12
+ emit: TrueSheetNavigationHelpers['emit'];
13
+ routeKey: string;
14
+ closing?: boolean;
15
+ detents: TrueSheetProps['detents'];
16
+ children: React.ReactNode;
17
+ positionChangeHandler?: PositionChangeHandler;
18
+ [key: string]: unknown;
19
+ }