@lodev09/react-native-true-sheet 4.0.0-beta.5 → 4.0.0-beta.7

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 (84) hide show
  1. package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayView.kt +106 -0
  2. package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayViewManager.kt +45 -0
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +2 -1
  4. package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +18 -0
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +3 -25
  6. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetOverlayRootView.kt +137 -0
  7. package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +19 -0
  8. package/android/src/main/jni/TrueSheetSpec.h +1 -0
  9. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetLayoutUtils.h +46 -0
  10. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewComponentDescriptor.h +21 -0
  11. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.cpp +17 -0
  12. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.h +36 -0
  13. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +4 -35
  14. package/ios/TrueSheetContentView.h +3 -1
  15. package/ios/TrueSheetContentView.mm +11 -0
  16. package/ios/TrueSheetOverlayView.h +32 -0
  17. package/ios/TrueSheetOverlayView.mm +141 -0
  18. package/ios/TrueSheetView.mm +17 -0
  19. package/ios/TrueSheetViewController.mm +27 -13
  20. package/ios/core/TrueSheetOverlayContainerView.h +31 -0
  21. package/ios/core/TrueSheetOverlayContainerView.mm +35 -0
  22. package/ios/tvos/TrueSheetStubs.mm +12 -0
  23. package/lib/module/TrueSheetOverlay.js +30 -0
  24. package/lib/module/TrueSheetOverlay.js.map +1 -0
  25. package/lib/module/TrueSheetOverlay.web.js +35 -0
  26. package/lib/module/TrueSheetOverlay.web.js.map +1 -0
  27. package/lib/module/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
  28. package/lib/module/index.js +1 -0
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/module/mocks/index.js +10 -0
  31. package/lib/module/mocks/index.js.map +1 -1
  32. package/lib/module/mocks/navigationExpoRouter.js.map +1 -1
  33. package/lib/module/navigation/base-types.js +2 -0
  34. package/lib/module/navigation/base-types.js.map +1 -0
  35. package/lib/module/navigation/createTrueSheetRouter.js +0 -9
  36. package/lib/module/navigation/createTrueSheetRouter.js.map +1 -1
  37. package/lib/module/navigation/expo-router/base-types.js +2 -0
  38. package/lib/module/navigation/expo-router/base-types.js.map +1 -0
  39. package/lib/module/navigation/expo-router/index.js +5 -3
  40. package/lib/module/navigation/expo-router/index.js.map +1 -1
  41. package/lib/module/navigation/expo-router/types.js +4 -0
  42. package/lib/module/navigation/expo-router/types.js.map +1 -0
  43. package/lib/module/navigation/index.js.map +1 -1
  44. package/lib/typescript/src/TrueSheetOverlay.d.ts +8 -0
  45. package/lib/typescript/src/TrueSheetOverlay.d.ts.map +1 -0
  46. package/lib/typescript/src/TrueSheetOverlay.web.d.ts +8 -0
  47. package/lib/typescript/src/TrueSheetOverlay.web.d.ts.map +1 -0
  48. package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.d.ts +6 -0
  49. package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.d.ts.map +1 -0
  50. package/lib/typescript/src/index.d.ts +1 -0
  51. package/lib/typescript/src/index.d.ts.map +1 -1
  52. package/lib/typescript/src/mocks/index.d.ts +4 -0
  53. package/lib/typescript/src/mocks/index.d.ts.map +1 -1
  54. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +3 -3
  55. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -1
  56. package/lib/typescript/src/navigation/base-types.d.ts +9 -0
  57. package/lib/typescript/src/navigation/base-types.d.ts.map +1 -0
  58. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +2 -13
  59. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -1
  60. package/lib/typescript/src/navigation/expo-router/base-types.d.ts +8 -0
  61. package/lib/typescript/src/navigation/expo-router/base-types.d.ts.map +1 -0
  62. package/lib/typescript/src/navigation/expo-router/index.d.ts +5 -5
  63. package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -1
  64. package/lib/typescript/src/navigation/expo-router/types.d.ts +44 -0
  65. package/lib/typescript/src/navigation/expo-router/types.d.ts.map +1 -0
  66. package/lib/typescript/src/navigation/index.d.ts +3 -4
  67. package/lib/typescript/src/navigation/index.d.ts.map +1 -1
  68. package/lib/typescript/src/navigation/types.d.ts +34 -4
  69. package/lib/typescript/src/navigation/types.d.ts.map +1 -1
  70. package/package.json +9 -1
  71. package/react-native.config.js +1 -0
  72. package/src/TrueSheetOverlay.tsx +24 -0
  73. package/src/TrueSheetOverlay.web.tsx +33 -0
  74. package/src/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
  75. package/src/index.ts +1 -0
  76. package/src/mocks/index.ts +7 -0
  77. package/src/mocks/navigationExpoRouter.ts +6 -5
  78. package/src/navigation/base-types.ts +20 -0
  79. package/src/navigation/createTrueSheetRouter.ts +5 -33
  80. package/src/navigation/expo-router/base-types.ts +18 -0
  81. package/src/navigation/expo-router/index.ts +20 -19
  82. package/src/navigation/expo-router/types.ts +116 -0
  83. package/src/navigation/index.ts +6 -7
  84. package/src/navigation/types.ts +65 -19
@@ -1,5 +1,6 @@
1
1
  export * from './TrueSheet';
2
2
  export * from './TrueSheet.types';
3
3
  export { TrueSheetPeek } from './TrueSheetPeek';
4
+ export { TrueSheetOverlay } from './TrueSheetOverlay';
4
5
  export { TrueSheetProvider, useTrueSheet } from './TrueSheetProvider';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -29,6 +29,10 @@ export declare class TrueSheet extends React.Component<TrueSheetProps, TrueSheet
29
29
  * Mock TrueSheetPeek component for testing.
30
30
  */
31
31
  export declare function TrueSheetPeek({ children, ...rest }: ViewProps): React.CElement<ViewProps, View>;
32
+ /**
33
+ * Mock TrueSheetOverlay component for testing.
34
+ */
35
+ export declare function TrueSheetOverlay({ children, ...rest }: ViewProps): React.CElement<ViewProps, View>;
32
36
  /**
33
37
  * Mock TrueSheetProvider for testing.
34
38
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,UAAU,cAAc;IACtB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cA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ACpF,MAAM,CAAC,YAAY,kFAAsE;IACzF,MAAM,CAAC,OAAO,+GAEZ;IACF,MAAM,CAAC,MAAM,iEAAiE;IAC9E,MAAM,CAAC,UAAU,mEAAuD;IAExE,OAAO,mEAAuD;IAC9D,YAAY,mEAAuD;IACnE,OAAO,gGAAwE;IAC/E,MAAM,kDAAkD;IAExD,iBAAiB;IAOjB,oBAAoB;IAOpB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,YAAY;IAMpB,MAAM;CAIP;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,mCAE7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,mCAEhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,mBAE5E;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,sBAAsB,CAQrD;AAED,cAAc,oBAAoB,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { ParamListBase } from '@react-navigation/native';
2
- import type { TrueSheetNavigationProp } from '../navigation/types';
1
+ import type { ParamListBase } from '../navigation/expo-router/base-types';
2
+ import type { TrueSheetNavigationProp } from '../navigation/expo-router/types';
3
3
  import { TrueSheetActions } from './navigation';
4
4
  /**
5
5
  * Mock Sheet layout for testing.
@@ -18,5 +18,5 @@ export declare const useTrueSheetNavigation: jest.Mock<TrueSheetNavigationProp<P
18
18
  export { TrueSheetActions };
19
19
  export type { TrueSheetActionType } from '../navigation/actions';
20
20
  export type { DetentInfoEventPayload, PositionChangeEventPayload } from '../TrueSheet.types';
21
- export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from '../navigation/types';
21
+ export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from '../navigation/expo-router/types';
22
22
  //# sourceMappingURL=navigationExpoRouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigationExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/mocks/navigationExpoRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,KAAK;cACmB,KAAK,CAAC,SAAS;;;;CAKnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,4DAGlC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC7F,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"navigationExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/mocks/navigationExpoRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,KAAK;cACmB,KAAK,CAAC,SAAS;;;;CAKnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,4DAKlC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC7F,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Base navigation types for the React Navigation entry point.
3
+ *
4
+ * The Expo Router entry has its own copy sourced from `expo-router/react-navigation`
5
+ * (see `./expo-router/base-types`) because Expo Router apps never install
6
+ * `@react-navigation/*` — importing it there would silently resolve to `any`.
7
+ */
8
+ export type { DefaultNavigatorOptions, Descriptor, NavigationAction, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, Router, StackActionHelpers, StackRouterOptions, } from '@react-navigation/core';
9
+ //# sourceMappingURL=base-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-types.d.ts","sourceRoot":"","sources":["../../../../src/navigation/base-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,YAAY,EACV,uBAAuB,EACvB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC"}
@@ -1,14 +1,3 @@
1
- import type { NavigationAction, NavigationState, ParamListBase, Router, StackRouterOptions } from '@react-navigation/core';
2
- import { type TrueSheetActionType } from './actions';
3
- import type { TrueSheetNavigationState } from './types';
4
- export type TrueSheetRouterOptions = StackRouterOptions;
5
- /**
6
- * The base `StackRouter` factory to wrap, typed generically over the state and
7
- * action types the wrapper threads through — `StackRouter` is structural and
8
- * never touches the sheet-specific fields.
9
- * Injected by each entry point so the shared router never imports
10
- * `@react-navigation/*` at runtime (Expo Router apps don't install it).
11
- */
12
- export type StackRouterFactory = <State extends NavigationState<ParamListBase>, Action extends NavigationAction>(options: TrueSheetRouterOptions) => Router<State, Action>;
13
- export declare const createTrueSheetRouter: (stackRouter: StackRouterFactory) => (routerOptions: TrueSheetRouterOptions) => Router<TrueSheetNavigationState<ParamListBase>, TrueSheetActionType>;
1
+ import type { TrueSheetRouter, TrueSheetRouterFactory, TrueSheetRouterOptions } from './types';
2
+ export declare const createTrueSheetRouter: (stackRouter: TrueSheetRouterFactory) => (routerOptions: TrueSheetRouterOptions) => TrueSheetRouter;
14
3
  //# sourceMappingURL=createTrueSheetRouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTrueSheetRouter.d.ts","sourceRoot":"","sources":["../../../../src/navigation/createTrueSheetRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,MAAM,EACN,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,SAAS,eAAe,CAAC,aAAa,CAAC,EAC5C,MAAM,SAAS,gBAAgB,EAE/B,OAAO,EAAE,sBAAsB,KAC5B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAgC3B,eAAO,MAAM,qBAAqB,GAC/B,aAAa,kBAAkB,MAE9B,eAAe,sBAAsB,KACpC,MAAM,CAAC,wBAAwB,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAgKrE,CAAC"}
1
+ {"version":3,"file":"createTrueSheetRouter.d.ts","sourceRoot":"","sources":["../../../../src/navigation/createTrueSheetRouter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAgC/F,eAAO,MAAM,qBAAqB,GAC/B,aAAa,sBAAsB,MACnC,eAAe,sBAAsB,KAAG,eA8JxC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Base navigation types for the Expo Router entry point.
3
+ *
4
+ * Sourced from Expo Router's vendored React Navigation so apps that only install
5
+ * `expo-router` still get real types — see `../base-types` for the React Navigation copy.
6
+ */
7
+ export type { DefaultNavigatorOptions, NavigationAction, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, Router, StackActionHelpers, StackRouterOptions, } from 'expo-router/react-navigation';
8
+ //# sourceMappingURL=base-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-types.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/expo-router/base-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC"}
@@ -1,7 +1,7 @@
1
- import type { ParamListBase } from '@react-navigation/core';
2
- import type { TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetNavigatorContentExtraProps, TrueSheetNavigatorProps, TrueSheetStandardEventMap } from '../types';
3
- declare const SheetNavigator: import("react").ForwardRefExoticComponent<Omit<import("expo-router/build/standard-navigation/types").StandardRouterNavigatorProps<TrueSheetNavigationState<ParamListBase>, TrueSheetNavigationOptions, TrueSheetStandardEventMap, TrueSheetNavigatorContentExtraProps, import("@react-navigation/routers").StackRouterOptions>, "children"> & Partial<Pick<import("expo-router/build/standard-navigation/types").StandardRouterNavigatorProps<TrueSheetNavigationState<ParamListBase>, TrueSheetNavigationOptions, TrueSheetStandardEventMap, TrueSheetNavigatorContentExtraProps, import("@react-navigation/routers").StackRouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
4
- Screen: (props: import("expo-router").ScreenProps<TrueSheetNavigationOptions, TrueSheetNavigationState<ParamListBase>, TrueSheetStandardEventMap & import("expo-router/build/react-navigation").EventMapBase>) => null;
1
+ import type { ParamListBase } from './base-types';
2
+ import type { TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetNavigatorContentExtraProps, TrueSheetNavigatorProps, TrueSheetStandardEventMap } from './types';
3
+ declare const SheetNavigator: import("react").ForwardRefExoticComponent<Omit<import("expo-router/build/standard-navigation/types").StandardRouterNavigatorProps<TrueSheetNavigationState<ParamListBase>, TrueSheetNavigationOptions, TrueSheetStandardEventMap, TrueSheetNavigatorContentExtraProps, import("expo-router").StackRouterOptions>, "children"> & Partial<Pick<import("expo-router/build/standard-navigation/types").StandardRouterNavigatorProps<TrueSheetNavigationState<ParamListBase>, TrueSheetNavigationOptions, TrueSheetStandardEventMap, TrueSheetNavigatorContentExtraProps, import("expo-router").StackRouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
4
+ Screen: (props: import("expo-router").ScreenProps<TrueSheetNavigationOptions, TrueSheetNavigationState<ParamListBase>, TrueSheetStandardEventMap & import("expo-router/react-navigation").EventMapBase>) => null;
5
5
  Protected: typeof import("expo-router/build/views/Protected").Protected;
6
6
  };
7
7
  type SheetProps = Omit<React.ComponentProps<typeof SheetNavigator>, 'screenListeners' | 'routes' | 'dispatch'> & Partial<Pick<React.ComponentProps<typeof SheetNavigator>, 'routes' | 'dispatch'>> & Pick<TrueSheetNavigatorProps, 'screenListeners'>;
@@ -33,5 +33,5 @@ export declare const Sheet: React.ComponentType<SheetProps> & {
33
33
  export declare const useTrueSheetNavigation: <T extends ParamListBase = ParamListBase>() => TrueSheetNavigationProp<T>;
34
34
  export { TrueSheetActions, type TrueSheetActionType } from '../actions';
35
35
  export type { DetentInfoEventPayload, PositionChangeEventPayload } from '../../TrueSheet.types';
36
- export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from '../types';
36
+ export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from './types';
37
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/expo-router/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAS5D,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,mCAAmC,EACnC,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB,QAAA,MAAM,cAAc;;;CAgBnB,CAAC;AAMF,KAAK,UAAU,GAAG,IAAI,CACpB,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,EAC3C,iBAAiB,GAAG,QAAQ,GAAG,UAAU,CAC1C,GACC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,CAAC,GACjF,IAAI,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,EAAqB,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG;IACvE,MAAM,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,OAAO,cAAc,CAAC,SAAS,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,CAAC,SAAS,aAAa,GAAG,aAAa,OACpC,uBAAuB,CAAC,CAAC,CAAgD,CAAC;AAE/E,OAAO,EAAE,gBA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AY,CAAC;AAExE,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEhG,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Expo Router flavour of `../types`: same shapes, but bound to Expo Router's
3
+ * vendored React Navigation types so apps that only install `expo-router` still
4
+ * get real types instead of `any` — see `./base-types`.
5
+ */
6
+ import type { TrueSheetActionType } from '../actions';
7
+ import type { TrueSheetActionHelpersOf, TrueSheetDispatch, TrueSheetNavigationEventMap, TrueSheetNavigationOptions, TrueSheetStateOf } from '../types';
8
+ import type { DefaultNavigatorOptions, NavigationAction, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, Router, StackActionHelpers, StackRouterOptions } from './base-types';
9
+ export type TrueSheetRouterOptions = StackRouterOptions;
10
+ export type TrueSheetNavigationState<ParamList extends ParamListBase> = TrueSheetStateOf<NavigationState<ParamList>>;
11
+ export type TrueSheetRouterState = TrueSheetNavigationState<ParamListBase>;
12
+ export type TrueSheetRouter = Router<TrueSheetRouterState, TrueSheetActionType>;
13
+ export type TrueSheetRouterFactory = (options: TrueSheetRouterOptions) => TrueSheetRouter;
14
+ /**
15
+ * The base `StackRouter` factory to wrap — see `../types` for the shared contract.
16
+ */
17
+ export type StackRouterFactory = <State extends NavigationState<ParamListBase>, Action extends NavigationAction>(options: TrueSheetRouterOptions) => Router<State, Action>;
18
+ export type TrueSheetRoute = TrueSheetNavigationState<ParamListBase>['routes'][number];
19
+ /**
20
+ * Props injected into the navigator content by Expo Router's `createProps`.
21
+ * Raw routes carry the custom fields (`closing`, `resizeIndex`, `resizeKey`)
22
+ * that the standard state strips out.
23
+ */
24
+ export interface TrueSheetNavigatorContentExtraProps {
25
+ routes: TrueSheetRoute[];
26
+ dispatch: TrueSheetDispatch;
27
+ }
28
+ export type TrueSheetActionHelpers<ParamList extends ParamListBase> = TrueSheetActionHelpersOf<StackActionHelpers<ParamList>>;
29
+ export type TrueSheetNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TrueSheetNavigationState<ParamList>, TrueSheetNavigationOptions, TrueSheetNavigationEventMap> & TrueSheetActionHelpers<ParamList>;
30
+ export type TrueSheetScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = {
31
+ navigation: TrueSheetNavigationProp<ParamList, RouteName, NavigatorID>;
32
+ route: RouteProp<ParamList, RouteName>;
33
+ };
34
+ export type TrueSheetNavigationHelpers = NavigationHelpers<ParamListBase, TrueSheetNavigationEventMap>;
35
+ export type TrueSheetNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, TrueSheetNavigationState<ParamListBase>, TrueSheetNavigationOptions, TrueSheetNavigationEventMap, unknown> & {
36
+ /**
37
+ * The name of the route to use as the base screen.
38
+ * This screen will be rendered as a regular screen, while other screens are presented as sheets.
39
+ * Defaults to the first screen defined in the navigator.
40
+ */
41
+ initialRouteName?: string;
42
+ };
43
+ export type { PositionChangeHandler, TrueSheetDispatch, TrueSheetNavigationEventMap, TrueSheetNavigationOptions, TrueSheetNavigationSheetProps, TrueSheetStandardEventMap, } from '../types';
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/navigation/expo-router/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC3B,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAChB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,CAAC,EACnC,0BAA0B,EAC1B,2BAA2B,CAC5B,GACC,sBAAsB,CAAC,SAAS,CAAC,CAAC;AAEpC,MAAM,MAAM,oBAAoB,CAC9B,SAAS,SAAS,aAAa,EAC/B,SAAS,SAAS,MAAM,SAAS,GAAG,MAAM,EAC1C,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,IAChD;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,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,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,UAAU,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { type StandardNavigationTypeBagBase } from '@react-navigation/native';
2
- import type { TrueSheetActionHelpers, TrueSheetNavigationOptions, TrueSheetNavigationEventMap, TrueSheetNavigationState } from './types';
3
- import type { TrueSheetRouterOptions } from './createTrueSheetRouter';
2
+ import type { TrueSheetActionHelpers, TrueSheetNavigationOptions, TrueSheetNavigationEventMap, TrueSheetNavigationState, TrueSheetRouterOptions } from './types';
4
3
  export interface TrueSheetNavigationTypeBag extends StandardNavigationTypeBagBase {
5
4
  State: TrueSheetNavigationState<this['ParamList']>;
6
5
  ActionHelpers: TrueSheetActionHelpers<this['ParamList']>;
@@ -39,8 +38,8 @@ export declare const createTrueSheetScreen: import("@react-navigation/core").Sta
39
38
  Navigator: import("react").ComponentType<{}>;
40
39
  }>;
41
40
  export { TrueSheetActions, type TrueSheetActionType } from './actions';
42
- export { createTrueSheetRouter, type StackRouterFactory, type TrueSheetRouterOptions, } from './createTrueSheetRouter';
41
+ export { createTrueSheetRouter } from './createTrueSheetRouter';
43
42
  export { useTrueSheetNavigation } from './useTrueSheetNavigation';
44
43
  export type { DetentInfoEventPayload, PositionChangeEventPayload } from '../TrueSheet.types';
45
- export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from './types';
44
+ export type { StackRouterFactory, TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetRouterOptions, TrueSheetScreenProps, } from './types';
46
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,WAAW,0BAA2B,SAAQ,6BAA6B;IAC/E,KAAK,EAAE,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACnD,aAAa,EAAE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACzD,aAAa,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,EAAE,2BAA2B,CAAC;IACtC,aAAa,EAAE,sBAAsB,CAAC;CACvC;AAYD;;;;;;;;;;;;;;;;;;;;GAoBG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AM,WAAW,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAE7F,YAAY,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -1,7 +1,7 @@
1
- import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, StackActionHelpers } from '@react-navigation/core';
2
1
  import type { NavigatorArgs } from 'standard-navigation';
3
2
  import type { DetentInfoEventPayload, PositionChangeEventPayload, TrueSheetProps } from '../TrueSheet.types';
4
3
  import type { TrueSheetActionType } from './actions';
4
+ import type { DefaultNavigatorOptions, Descriptor, NavigationAction, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, Router, StackActionHelpers, StackRouterOptions } from './base-types';
5
5
  export type PositionChangeHandler = (payload: PositionChangeEventPayload) => void;
6
6
  export type TrueSheetNavigationEventMap = {
7
7
  /**
@@ -83,14 +83,39 @@ export type TrueSheetNavigationEventMap = {
83
83
  data: undefined;
84
84
  };
85
85
  };
86
- export type TrueSheetNavigationState<ParamList extends ParamListBase> = Omit<NavigationState<ParamList>, 'routes'> & {
86
+ /**
87
+ * A navigation state tagged as `true-sheet`, with the sheet fields the router
88
+ * adds to each route.
89
+ * Generic over the base state so each entry point can bind its own
90
+ * `NavigationState` — see `./base-types`.
91
+ */
92
+ export type TrueSheetStateOf<State extends {
93
+ routes: readonly unknown[];
94
+ }> = Omit<State, 'routes'> & {
87
95
  type: 'true-sheet';
88
- routes: (NavigationState<ParamList>['routes'][number] & {
96
+ routes: (State['routes'][number] & {
89
97
  resizeIndex?: number;
90
98
  resizeKey?: number;
91
99
  closing?: boolean;
92
100
  })[];
93
101
  };
102
+ export type TrueSheetNavigationState<ParamList extends ParamListBase> = TrueSheetStateOf<NavigationState<ParamList>>;
103
+ export type TrueSheetRouterState = TrueSheetNavigationState<ParamListBase>;
104
+ export type TrueSheetRouterOptions = StackRouterOptions;
105
+ export type TrueSheetRouter = Router<TrueSheetRouterState, TrueSheetActionType>;
106
+ /**
107
+ * The wrapped router factory — also the shape `createTrueSheetRouter` accepts,
108
+ * pre-instantiated so either entry point's `StackRouterFactory` fits it.
109
+ */
110
+ export type TrueSheetRouterFactory = (options: TrueSheetRouterOptions) => TrueSheetRouter;
111
+ /**
112
+ * The base `StackRouter` factory to wrap, typed generically over the state and
113
+ * action types the wrapper threads through — `StackRouter` is structural and
114
+ * never touches the sheet-specific fields.
115
+ * Injected by each entry point so the shared router never imports
116
+ * `@react-navigation/*` at runtime (Expo Router apps don't install it).
117
+ */
118
+ export type StackRouterFactory = <State extends NavigationState<ParamListBase>, Action extends NavigationAction>(options: TrueSheetRouterOptions) => Router<State, Action>;
94
119
  /**
95
120
  * `TrueSheetNavigationEventMap` in the `standard-navigation` event-map shape.
96
121
  */
@@ -113,12 +138,17 @@ export interface TrueSheetNavigatorContentExtraProps {
113
138
  routes: TrueSheetRoute[];
114
139
  dispatch: TrueSheetDispatch;
115
140
  }
116
- export type TrueSheetActionHelpers<ParamList extends ParamListBase> = StackActionHelpers<ParamList> & {
141
+ /**
142
+ * Generic over the base helpers so each entry point can bind its own
143
+ * `StackActionHelpers` — see `./base-types`.
144
+ */
145
+ export type TrueSheetActionHelpersOf<Helpers> = Helpers & {
117
146
  /**
118
147
  * Resize the sheet to a specific detent index.
119
148
  */
120
149
  resize(index?: number): void;
121
150
  };
151
+ export type TrueSheetActionHelpers<ParamList extends ParamListBase> = TrueSheetActionHelpersOf<StackActionHelpers<ParamList>>;
122
152
  export type TrueSheetNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TrueSheetNavigationState<ParamList>, TrueSheetNavigationOptions, TrueSheetNavigationEventMap> & TrueSheetActionHelpers<ParamList>;
123
153
  export type TrueSheetScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = {
124
154
  navigation: TrueSheetNavigationProp<ParamList, RouteName, NavigatorID>;
@@ -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,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;AAElF,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;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,GACd,aAAa,GACb,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,sBAAsB,GACtB,QAAQ,GACR,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,OAAO,GACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,QAAQ,GACR,cAAc,GACd,WAAW,GACX,UAAU,GACV,gBAAgB,CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,6BAA6B,GAAG;IACvE;;;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"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc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AC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.7",
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",
@@ -106,6 +106,7 @@
106
106
  "@types/babel__core": "^7",
107
107
  "@types/jest": "^29.5.14",
108
108
  "@types/react": "~19.2.14",
109
+ "@types/react-dom": "~19.2.0",
109
110
  "commitlint": "^19.8.1",
110
111
  "del-cli": "^6.0.0",
111
112
  "eslint": "^9.35.0",
@@ -136,6 +137,7 @@
136
137
  "@react-navigation/native": ">=7.3.0",
137
138
  "expo-router": ">=57.0.0",
138
139
  "react": "*",
140
+ "react-dom": "*",
139
141
  "react-native": ">=0.82.0",
140
142
  "react-native-reanimated": ">=4",
141
143
  "react-native-worklets": "*",
@@ -154,6 +156,9 @@
154
156
  "expo-router": {
155
157
  "optional": true
156
158
  },
159
+ "react-dom": {
160
+ "optional": true
161
+ },
157
162
  "react-native-reanimated": {
158
163
  "optional": true
159
164
  },
@@ -283,6 +288,9 @@
283
288
  },
284
289
  "TrueSheetPeekView": {
285
290
  "className": "TrueSheetPeekView"
291
+ },
292
+ "TrueSheetOverlayView": {
293
+ "className": "TrueSheetOverlayView"
286
294
  }
287
295
  }
288
296
  }
@@ -7,6 +7,7 @@ module.exports = {
7
7
  'TrueSheetViewComponentDescriptor',
8
8
  'TrueSheetContentViewComponentDescriptor',
9
9
  'TrueSheetFooterViewComponentDescriptor',
10
+ 'TrueSheetOverlayViewComponentDescriptor',
10
11
  ],
11
12
  cmakeListsPath: '../android/src/main/jni/CMakeLists.txt',
12
13
  },
@@ -0,0 +1,24 @@
1
+ import { StyleSheet, type ViewProps } from 'react-native';
2
+
3
+ import TrueSheetOverlayViewNativeComponent from './fabric/TrueSheetOverlayViewNativeComponent';
4
+
5
+ /**
6
+ * Renders its children in a native layer above every presented sheet — for
7
+ * toasts, dialogs, and other content a sheet must not cover.
8
+ * Fills the window; touches that miss its children pass through to the views beneath.
9
+ */
10
+ export const TrueSheetOverlay = ({ style, ...rest }: ViewProps) => (
11
+ <TrueSheetOverlayViewNativeComponent {...rest} style={[styles.overlay, style]} />
12
+ );
13
+
14
+ const styles = StyleSheet.create({
15
+ // Sized to the window from native — absolute so it takes no layout space.
16
+ // Children render in a native container, so the host itself must never
17
+ // catch touches (Android forces it visible on layout).
18
+ overlay: {
19
+ position: 'absolute',
20
+ top: 0,
21
+ left: 0,
22
+ pointerEvents: 'none',
23
+ },
24
+ });
@@ -0,0 +1,33 @@
1
+ /// <reference lib="dom" />
2
+ import { useLayoutEffect, useState } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { StyleSheet, View, type ViewProps } from 'react-native';
5
+
6
+ /**
7
+ * Renders its children in a layer above every presented sheet — for
8
+ * toasts, dialogs, and other content a sheet must not cover.
9
+ * Fills the window; touches that miss its children pass through to the views beneath.
10
+ */
11
+ export const TrueSheetOverlay = ({ style, ...rest }: ViewProps) => {
12
+ // Portal target appended to the body so it stacks above the sheets' portal
13
+ const [container] = useState(() =>
14
+ typeof document !== 'undefined' ? document.createElement('div') : null
15
+ );
16
+
17
+ useLayoutEffect(() => {
18
+ if (!container) return;
19
+
20
+ container.style.cssText = 'position:fixed;inset:0;pointer-events:none';
21
+ document.body.appendChild(container);
22
+ return () => {
23
+ container.remove();
24
+ };
25
+ }, [container]);
26
+
27
+ if (!container) return null;
28
+
29
+ return createPortal(
30
+ <View pointerEvents="box-none" {...rest} style={[StyleSheet.absoluteFill, style]} />,
31
+ container
32
+ );
33
+ };
@@ -0,0 +1,12 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import { codegenNativeComponent } from 'react-native';
3
+
4
+ export interface NativeProps extends ViewProps {
5
+ // No props needed - sized to the window from native
6
+ }
7
+
8
+ // interfaceOnly: shadow node/state/descriptor are custom (common/cpp) so the
9
+ // overlay is sized to the window
10
+ export default codegenNativeComponent<NativeProps>('TrueSheetOverlayView', {
11
+ interfaceOnly: true,
12
+ });
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './TrueSheet';
2
2
  export * from './TrueSheet.types';
3
3
  export { TrueSheetPeek } from './TrueSheetPeek';
4
+ export { TrueSheetOverlay } from './TrueSheetOverlay';
4
5
  export { TrueSheetProvider, useTrueSheet } from './TrueSheetProvider';
@@ -66,6 +66,13 @@ export function TrueSheetPeek({ children, ...rest }: ViewProps) {
66
66
  return React.createElement(View, rest, children);
67
67
  }
68
68
 
69
+ /**
70
+ * Mock TrueSheetOverlay component for testing.
71
+ */
72
+ export function TrueSheetOverlay({ children, ...rest }: ViewProps) {
73
+ return React.createElement(View, rest, children);
74
+ }
75
+
69
76
  /**
70
77
  * Mock TrueSheetProvider for testing.
71
78
  */
@@ -1,6 +1,5 @@
1
- import type { ParamListBase } from '@react-navigation/native';
2
-
3
- import type { TrueSheetNavigationProp } from '../navigation/types';
1
+ import type { ParamListBase } from '../navigation/expo-router/base-types';
2
+ import type { TrueSheetNavigationProp } from '../navigation/expo-router/types';
4
3
  import {
5
4
  TrueSheetActions,
6
5
  useTrueSheetNavigation as useTrueSheetNavigationMock,
@@ -22,8 +21,10 @@ export const Sheet = Object.assign(
22
21
  * Mock useTrueSheetNavigation hook for testing.
23
22
  */
24
23
  export const useTrueSheetNavigation = jest.fn(
24
+ // Double cast: the shared mock is typed against React Navigation, this entry
25
+ // against Expo Router's vendored copy — identical shapes, unrelated declarations
25
26
  <T extends ParamListBase = ParamListBase>(): TrueSheetNavigationProp<T> =>
26
- useTrueSheetNavigationMock() as TrueSheetNavigationProp<T>
27
+ useTrueSheetNavigationMock() as unknown as TrueSheetNavigationProp<T>
27
28
  );
28
29
 
29
30
  export { TrueSheetActions };
@@ -37,4 +38,4 @@ export type {
37
38
  TrueSheetNavigationProp,
38
39
  TrueSheetNavigationState,
39
40
  TrueSheetScreenProps,
40
- } from '../navigation/types';
41
+ } from '../navigation/expo-router/types';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Base navigation types for the React Navigation entry point.
3
+ *
4
+ * The Expo Router entry has its own copy sourced from `expo-router/react-navigation`
5
+ * (see `./expo-router/base-types`) because Expo Router apps never install
6
+ * `@react-navigation/*` — importing it there would silently resolve to `any`.
7
+ */
8
+ export type {
9
+ DefaultNavigatorOptions,
10
+ Descriptor,
11
+ NavigationAction,
12
+ NavigationHelpers,
13
+ NavigationProp,
14
+ NavigationState,
15
+ ParamListBase,
16
+ RouteProp,
17
+ Router,
18
+ StackActionHelpers,
19
+ StackRouterOptions,
20
+ } from '@react-navigation/core';
@@ -1,29 +1,5 @@
1
- import type {
2
- NavigationAction,
3
- NavigationState,
4
- ParamListBase,
5
- Router,
6
- StackRouterOptions,
7
- } from '@react-navigation/core';
8
-
9
- import { TrueSheetActions, type TrueSheetActionType } from './actions';
10
- import type { TrueSheetNavigationState } from './types';
11
-
12
- export type TrueSheetRouterOptions = StackRouterOptions;
13
-
14
- /**
15
- * The base `StackRouter` factory to wrap, typed generically over the state and
16
- * action types the wrapper threads through — `StackRouter` is structural and
17
- * never touches the sheet-specific fields.
18
- * Injected by each entry point so the shared router never imports
19
- * `@react-navigation/*` at runtime (Expo Router apps don't install it).
20
- */
21
- export type StackRouterFactory = <
22
- State extends NavigationState<ParamListBase>,
23
- Action extends NavigationAction,
24
- >(
25
- options: TrueSheetRouterOptions
26
- ) => Router<State, Action>;
1
+ import { TrueSheetActions } from './actions';
2
+ import type { TrueSheetRouter, TrueSheetRouterFactory, TrueSheetRouterOptions } from './types';
27
3
 
28
4
  const uid = () => Math.random().toString(36).slice(2, 10);
29
5
 
@@ -56,13 +32,9 @@ const ensureBaseRoute = <T extends { routes: { name: string }[] }>(
56
32
  };
57
33
 
58
34
  export const createTrueSheetRouter =
59
- (stackRouter: StackRouterFactory) =>
60
- (
61
- routerOptions: TrueSheetRouterOptions
62
- ): Router<TrueSheetNavigationState<ParamListBase>, TrueSheetActionType> => {
63
- const baseRouter = stackRouter<TrueSheetNavigationState<ParamListBase>, TrueSheetActionType>(
64
- routerOptions
65
- );
35
+ (stackRouter: TrueSheetRouterFactory) =>
36
+ (routerOptions: TrueSheetRouterOptions): TrueSheetRouter => {
37
+ const baseRouter = stackRouter(routerOptions);
66
38
 
67
39
  return {
68
40
  ...baseRouter,
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Base navigation types for the Expo Router entry point.
3
+ *
4
+ * Sourced from Expo Router's vendored React Navigation so apps that only install
5
+ * `expo-router` still get real types — see `../base-types` for the React Navigation copy.
6
+ */
7
+ export type {
8
+ DefaultNavigatorOptions,
9
+ NavigationAction,
10
+ NavigationHelpers,
11
+ NavigationProp,
12
+ NavigationState,
13
+ ParamListBase,
14
+ RouteProp,
15
+ Router,
16
+ StackActionHelpers,
17
+ StackRouterOptions,
18
+ } from 'expo-router/react-navigation';