@lodev09/react-native-true-sheet 4.0.0-beta.1 → 4.0.0-beta.11
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 +25 -4
- package/android/build.gradle +22 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +24 -7
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +211 -182
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +5 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +14 -19
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayView.kt +106 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayViewManager.kt +45 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +2 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +18 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +82 -39
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +275 -88
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +26 -1
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +75 -3
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +56 -34
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetOverlayRootView.kt +137 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +15 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/KeyboardUtils.kt +1 -1
- package/android/src/main/java/com/lodev09/truesheet/utils/TouchEventDeduper.kt +31 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +19 -7
- package/android/src/main/jni/TrueSheetSpec.h +1 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +0 -8
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +52 -29
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +6 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +1 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +6 -4
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +7 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetLayoutUtils.h +46 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewComponentDescriptor.h +21 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.cpp +17 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.h +36 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +4 -35
- package/ios/TrueSheetContainerView.h +14 -7
- package/ios/TrueSheetContainerView.mm +10 -7
- package/ios/TrueSheetContentView.h +31 -15
- package/ios/TrueSheetContentView.mm +148 -188
- package/ios/TrueSheetFooterView.h +6 -0
- package/ios/TrueSheetFooterView.mm +48 -2
- package/ios/TrueSheetModule.h +2 -7
- package/ios/TrueSheetModule.mm +7 -16
- package/ios/TrueSheetOverlayView.h +32 -0
- package/ios/TrueSheetOverlayView.mm +161 -0
- package/ios/TrueSheetView.mm +171 -29
- package/ios/TrueSheetViewController.h +10 -0
- package/ios/TrueSheetViewController.mm +256 -74
- package/ios/core/TrueSheetGrabberView.mm +13 -3
- package/ios/core/TrueSheetOverlayContainerView.h +31 -0
- package/ios/core/TrueSheetOverlayContainerView.mm +35 -0
- package/ios/events/TrueSheetLifecycleEvents.h +2 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +8 -0
- package/ios/tvos/TrueSheetStubs.mm +12 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.h +1 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +24 -2
- package/lib/module/TrueSheet.js +149 -34
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +122 -53
- package/lib/module/TrueSheet.web.js.map +1 -1
- package/lib/module/TrueSheetOverlay.js +30 -0
- package/lib/module/TrueSheetOverlay.js.map +1 -0
- package/lib/module/TrueSheetOverlay.web.js +35 -0
- package/lib/module/TrueSheetOverlay.web.js.map +1 -0
- package/lib/module/TrueSheetPeek.web.js +3 -3
- package/lib/module/TrueSheetPeek.web.js.map +1 -1
- package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +1 -1
- package/lib/module/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +5 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks/index.js +10 -0
- package/lib/module/mocks/index.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/base-types.js +2 -0
- package/lib/module/navigation/base-types.js.map +1 -0
- package/lib/module/navigation/{TrueSheetRouter.js → createTrueSheetRouter.js} +11 -24
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
- 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 +50 -0
- package/lib/module/navigation/expo-router/index.js.map +1 -0
- 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 +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 +5 -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/constants.js +4 -0
- package/lib/module/web/vaul/constants.js.map +1 -1
- package/lib/module/web/vaul/context.js.map +1 -1
- package/lib/module/web/vaul/helpers.js +10 -4
- package/lib/module/web/vaul/helpers.js.map +1 -1
- package/lib/module/web/vaul/index.js +35 -2
- package/lib/module/web/vaul/index.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +6 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +72 -1
- 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/TrueSheetOverlay.d.ts +8 -0
- package/lib/typescript/src/TrueSheetOverlay.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetOverlay.web.d.ts +8 -0
- package/lib/typescript/src/TrueSheetOverlay.web.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +4 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/index.d.ts +4 -0
- package/lib/typescript/src/mocks/index.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/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 +3 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
- 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 +37 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
- 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 +42 -3
- 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 +5 -6
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -1
- package/lib/typescript/src/navigation/types.d.ts +65 -5
- 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/constants.d.ts +1 -0
- package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/context.d.ts +1 -0
- package/lib/typescript/src/web/vaul/context.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/index.d.ts +7 -1
- package/lib/typescript/src/web/vaul/index.d.ts.map +1 -1
- package/package.json +32 -9
- package/react-native.config.js +1 -0
- package/src/TrueSheet.tsx +184 -46
- package/src/TrueSheet.types.ts +77 -1
- package/src/TrueSheet.web.tsx +135 -64
- package/src/TrueSheetOverlay.tsx +24 -0
- package/src/TrueSheetOverlay.web.tsx +33 -0
- package/src/TrueSheetPeek.web.tsx +4 -3
- package/src/fabric/TrueSheetContentViewNativeComponent.ts +1 -1
- package/src/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +5 -0
- package/src/index.ts +1 -0
- package/src/mocks/index.ts +7 -0
- package/src/mocks/navigation.ts +32 -25
- package/src/mocks/navigationExpoRouter.ts +41 -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/base-types.ts +20 -0
- package/src/navigation/createTrueSheetRouter.ts +194 -0
- package/src/navigation/expo-router/base-types.ts +18 -0
- package/src/navigation/expo-router/index.ts +90 -0
- package/src/navigation/expo-router/types.ts +116 -0
- package/src/navigation/index.ts +68 -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 +10 -15
- package/src/navigation/types.ts +99 -16
- package/src/navigation/useTrueSheetNavigation.ts +1 -1
- package/src/web/dom.ts +9 -0
- package/src/web/vaul/constants.ts +4 -0
- package/src/web/vaul/context.ts +1 -0
- package/src/web/vaul/helpers.ts +13 -6
- package/src/web/vaul/index.tsx +46 -1
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/web/vaul/context.ts"],"names":[],"mappings":"A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B,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,mBAAmB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAC/E,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC5C;AAED,eAAO,MAAM,aAAa,mCAqCxB,CAAC;AAEH,eAAO,MAAM,gBAAgB,0BAM5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/web/vaul/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,UAAU,KAAK;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/web/vaul/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,UAAU,KAAK;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AASD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAYjD;AAED,wBAAgB,GAAG,CACjB,EAAE,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,EAC5C,MAAM,EAAE,KAAK,EACb,WAAW,UAAQ,QAmBpB;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,QAgBpE;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,eAAe,YAWpD,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAgB5F;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,UAEpC;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACvC,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,cAUpC;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,EAAE,IAC1B,GAAG,MAAM,CAAC,SAAS,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,UAQ/D"}
|
|
@@ -64,6 +64,12 @@ export type DialogProps = {
|
|
|
64
64
|
* @default true
|
|
65
65
|
*/
|
|
66
66
|
dismissible?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Called when the user tries to close a non-dismissible drawer — dragging down
|
|
69
|
+
* at the first snap point, pressing escape, or tapping the handle of a
|
|
70
|
+
* single-snap-point drawer. Overlay clicks don't count, mirroring iOS.
|
|
71
|
+
*/
|
|
72
|
+
onDismissAttempt?: () => void;
|
|
67
73
|
/**
|
|
68
74
|
* When `false` the drawer can't be dragged by the user. Programmatic snap-point
|
|
69
75
|
* changes still animate. Defaults to `true`.
|
|
@@ -176,7 +182,7 @@ export type DialogProps = {
|
|
|
176
182
|
*/
|
|
177
183
|
contentHeight?: number;
|
|
178
184
|
} & (WithFadeFromProps | WithoutFadeFromProps);
|
|
179
|
-
export declare function Root({ open: openProp, onOpenChange, children, onDrag: onDragProp, onRelease: onReleaseProp, snapPoints, shouldScaleBackground, setBackgroundColorOnScale, closeThreshold, scrollLockTimeout, dismissible, draggable, handleOnly, fadeFromIndex, activeSnapPoint: activeSnapPointProp, setActiveSnapPoint: setActiveSnapPointProp, fixed, modal, onClose, nested, noBodyStyles, direction, defaultOpen, disablePreventScroll, snapToSequentialPoint, preventScrollRestoration, repositionInputs, onAnimationEnd, onPositionChange, container, autoFocus, detached, detachedOffset, detachedRadius, detachedWrapperStyle, maxContentHeight, peekHeight, initialAnimated, onContentHeightChange, contentHeight: contentHeightProp, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
185
|
+
export declare function Root({ open: openProp, onOpenChange, children, onDrag: onDragProp, onRelease: onReleaseProp, snapPoints, shouldScaleBackground, setBackgroundColorOnScale, closeThreshold, scrollLockTimeout, dismissible, onDismissAttempt, draggable, handleOnly, fadeFromIndex, activeSnapPoint: activeSnapPointProp, setActiveSnapPoint: setActiveSnapPointProp, fixed, modal, onClose, nested, noBodyStyles, direction, defaultOpen, disablePreventScroll, snapToSequentialPoint, preventScrollRestoration, repositionInputs, onAnimationEnd, onPositionChange, container, autoFocus, detached, detachedOffset, detachedRadius, detachedWrapperStyle, maxContentHeight, peekHeight, initialAnimated, onContentHeightChange, contentHeight: contentHeightProp, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
180
186
|
export declare const Overlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
181
187
|
export type ContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
182
188
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/vaul/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../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IARlB;;;;OAIG;uBACgB,KAAK,CAAC,SAAS;wCAoenC,CAAC;AAUF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAChE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAKF,eAAO,MAAM,MAAM;mBANF,OAAO;wCA+GvB,CAAC;AAIF,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,2CA4B5F;AAED,KAAK,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAEjF,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAKxC;AAED,eAAO,MAAM,MAAM;;;;QA9oBjB;;;;WAIG;2BACgB,KAAK,CAAC,SAAS;;;;;;uBA+enB,OAAO;;;;;CAqKvB,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.
|
|
3
|
+
"version": "4.0.0-beta.11",
|
|
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",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"./mock": "./lib/module/mocks/index.js",
|
|
15
15
|
"./navigation/mock": "./lib/module/mocks/navigation.js",
|
|
16
|
+
"./navigation/expo-router/mock": "./lib/module/mocks/navigationExpoRouter.js",
|
|
16
17
|
"./reanimated/mock": "./lib/module/mocks/reanimated.js",
|
|
17
18
|
"./reanimated": {
|
|
18
19
|
"source": "./src/reanimated/index.ts",
|
|
@@ -24,6 +25,11 @@
|
|
|
24
25
|
"types": "./lib/typescript/src/navigation/index.d.ts",
|
|
25
26
|
"default": "./lib/module/navigation/index.js"
|
|
26
27
|
},
|
|
28
|
+
"./navigation/expo-router": {
|
|
29
|
+
"source": "./src/navigation/expo-router/index.ts",
|
|
30
|
+
"types": "./lib/typescript/src/navigation/expo-router/index.d.ts",
|
|
31
|
+
"default": "./lib/module/navigation/expo-router/index.js"
|
|
32
|
+
},
|
|
27
33
|
"./package.json": "./package.json"
|
|
28
34
|
},
|
|
29
35
|
"files": [
|
|
@@ -93,20 +99,21 @@
|
|
|
93
99
|
"@react-native/babel-preset": "^0.86.0",
|
|
94
100
|
"@react-native/eslint-config": "^0.86.0",
|
|
95
101
|
"@react-native/jest-preset": "^0.86.0",
|
|
96
|
-
"@react-navigation/core": "^7.
|
|
97
|
-
"@react-navigation/native": "^7.
|
|
102
|
+
"@react-navigation/core": "^7.21.12",
|
|
103
|
+
"@react-navigation/native": "^7.3.16",
|
|
98
104
|
"@release-it/conventional-changelog": "^11.0.0",
|
|
99
105
|
"@testing-library/react-native": "^13.3.3",
|
|
100
106
|
"@types/babel__core": "^7",
|
|
101
107
|
"@types/jest": "^29.5.14",
|
|
102
108
|
"@types/react": "~19.2.14",
|
|
109
|
+
"@types/react-dom": "~19.2.0",
|
|
103
110
|
"commitlint": "^19.8.1",
|
|
104
111
|
"del-cli": "^6.0.0",
|
|
105
112
|
"eslint": "^9.35.0",
|
|
106
113
|
"eslint-config-prettier": "^10.1.8",
|
|
107
114
|
"eslint-plugin-prettier": "^5.5.4",
|
|
115
|
+
"expo-router": "~57.0.7",
|
|
108
116
|
"jest": "^29.7.0",
|
|
109
|
-
"nanoid": "^5.1.5",
|
|
110
117
|
"prettier": "^3.0.3",
|
|
111
118
|
"react": "19.2.3",
|
|
112
119
|
"react-native": "0.86.0",
|
|
@@ -115,6 +122,7 @@
|
|
|
115
122
|
"react-native-worklets": "0.10.0",
|
|
116
123
|
"react-test-renderer": "19.2.3",
|
|
117
124
|
"release-it": "^20.0.1",
|
|
125
|
+
"standard-navigation": "^0.0.9",
|
|
118
126
|
"turbo": "^2.5.6",
|
|
119
127
|
"typescript": "~6.0.3"
|
|
120
128
|
},
|
|
@@ -126,11 +134,14 @@
|
|
|
126
134
|
"peerDependencies": {
|
|
127
135
|
"@radix-ui/react-dialog": ">=1",
|
|
128
136
|
"@radix-ui/react-presence": ">=1",
|
|
129
|
-
"@react-navigation/
|
|
137
|
+
"@react-navigation/native": ">=7.3.0",
|
|
138
|
+
"expo-router": ">=57.0.0",
|
|
130
139
|
"react": "*",
|
|
140
|
+
"react-dom": "*",
|
|
131
141
|
"react-native": ">=0.82.0",
|
|
132
142
|
"react-native-reanimated": ">=4",
|
|
133
|
-
"react-native-worklets": "*"
|
|
143
|
+
"react-native-worklets": "*",
|
|
144
|
+
"standard-navigation": ">=0.0.9"
|
|
134
145
|
},
|
|
135
146
|
"peerDependenciesMeta": {
|
|
136
147
|
"@radix-ui/react-dialog": {
|
|
@@ -139,7 +150,13 @@
|
|
|
139
150
|
"@radix-ui/react-presence": {
|
|
140
151
|
"optional": true
|
|
141
152
|
},
|
|
142
|
-
"@react-navigation/
|
|
153
|
+
"@react-navigation/native": {
|
|
154
|
+
"optional": true
|
|
155
|
+
},
|
|
156
|
+
"expo-router": {
|
|
157
|
+
"optional": true
|
|
158
|
+
},
|
|
159
|
+
"react-dom": {
|
|
143
160
|
"optional": true
|
|
144
161
|
},
|
|
145
162
|
"react-native-reanimated": {
|
|
@@ -147,6 +164,9 @@
|
|
|
147
164
|
},
|
|
148
165
|
"react-native-worklets": {
|
|
149
166
|
"optional": true
|
|
167
|
+
},
|
|
168
|
+
"standard-navigation": {
|
|
169
|
+
"optional": true
|
|
150
170
|
}
|
|
151
171
|
},
|
|
152
172
|
"workspaces": [
|
|
@@ -162,7 +182,7 @@
|
|
|
162
182
|
"<rootDir>/jest.setup.js"
|
|
163
183
|
],
|
|
164
184
|
"transformIgnorePatterns": [
|
|
165
|
-
"node_modules/(?!(react-native|@react-native|react-native-reanimated|react-native-worklets|react-native-worklets-core)/)"
|
|
185
|
+
"node_modules/(?!(react-native|@react-native|@react-navigation|react-native-reanimated|react-native-worklets|react-native-worklets-core|standard-navigation)/)"
|
|
166
186
|
],
|
|
167
187
|
"modulePathIgnorePatterns": [
|
|
168
188
|
"<rootDir>/example/bare/node_modules",
|
|
@@ -170,7 +190,7 @@
|
|
|
170
190
|
"<rootDir>/example/shared/node_modules",
|
|
171
191
|
"<rootDir>/lib/",
|
|
172
192
|
"<rootDir>/docs/node_modules",
|
|
173
|
-
"<rootDir>/docs
|
|
193
|
+
"<rootDir>/docs/.next"
|
|
174
194
|
],
|
|
175
195
|
"testPathIgnorePatterns": [
|
|
176
196
|
"/node_modules/",
|
|
@@ -268,6 +288,9 @@
|
|
|
268
288
|
},
|
|
269
289
|
"TrueSheetPeekView": {
|
|
270
290
|
"className": "TrueSheetPeekView"
|
|
291
|
+
},
|
|
292
|
+
"TrueSheetOverlayView": {
|
|
293
|
+
"className": "TrueSheetOverlayView"
|
|
271
294
|
}
|
|
272
295
|
}
|
|
273
296
|
}
|
package/react-native.config.js
CHANGED
package/src/TrueSheet.tsx
CHANGED
|
@@ -4,8 +4,10 @@ import {
|
|
|
4
4
|
createRef,
|
|
5
5
|
type ReactNode,
|
|
6
6
|
type ComponentRef,
|
|
7
|
+
type ComponentType,
|
|
7
8
|
isValidElement,
|
|
8
9
|
createElement,
|
|
10
|
+
useEffect,
|
|
9
11
|
} from 'react';
|
|
10
12
|
|
|
11
13
|
import type {
|
|
@@ -21,6 +23,7 @@ import type {
|
|
|
21
23
|
PositionChangeEvent,
|
|
22
24
|
DidDismissEvent,
|
|
23
25
|
WillDismissEvent,
|
|
26
|
+
DismissAttemptEvent,
|
|
24
27
|
MountEvent,
|
|
25
28
|
WillFocusEvent,
|
|
26
29
|
DidFocusEvent,
|
|
@@ -39,12 +42,31 @@ import {
|
|
|
39
42
|
Platform,
|
|
40
43
|
StyleSheet,
|
|
41
44
|
BackHandler,
|
|
45
|
+
RootTagContext,
|
|
42
46
|
findNodeHandle,
|
|
43
47
|
processColor,
|
|
44
48
|
type NativeEventSubscription,
|
|
45
49
|
type GestureResponderEvent,
|
|
50
|
+
type RootTag,
|
|
51
|
+
type StyleProp,
|
|
52
|
+
type ViewStyle,
|
|
46
53
|
} from 'react-native';
|
|
47
54
|
|
|
55
|
+
interface AppContainerProps {
|
|
56
|
+
rootTag: RootTag;
|
|
57
|
+
rootViewStyle?: StyleProp<ViewStyle>;
|
|
58
|
+
internal_excludeLogBox?: boolean;
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// RN has no public API for hosting the element inspector inside a presented view;
|
|
63
|
+
// this is the internal RN's Modal uses. Dev-only so prod bundles never resolve it.
|
|
64
|
+
// The template literal keeps the RN babel preset's deep-import warning off while
|
|
65
|
+
// Metro still resolves the module statically.
|
|
66
|
+
const AppContainer: ComponentType<AppContainerProps> | null = __DEV__
|
|
67
|
+
? require(`react-native/Libraries/ReactNative/AppContainer`).default
|
|
68
|
+
: null;
|
|
69
|
+
|
|
48
70
|
const LINKING_ERROR =
|
|
49
71
|
`The package '@lodev09/react-native-true-sheet' doesn't seem to be linked. Make sure: \n\n` +
|
|
50
72
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
@@ -58,23 +80,49 @@ if (!TrueSheetModule) {
|
|
|
58
80
|
|
|
59
81
|
type NativeRef = ComponentRef<typeof TrueSheetViewNativeComponent>;
|
|
60
82
|
|
|
61
|
-
// Claim touches that no descendant claimed so the responder negotiation
|
|
62
|
-
// doesn't bubble up to touchables outside the sheet
|
|
63
|
-
const absorbUnclaimedTouches = () => true;
|
|
64
|
-
|
|
65
83
|
// Stop raw touch events from bubbling past the sheet to outside ancestors
|
|
66
84
|
const stopTouchPropagation = (event: GestureResponderEvent) => event.stopPropagation();
|
|
67
85
|
|
|
86
|
+
// Stop the responder negotiation at the sheet boundary without claiming the
|
|
87
|
+
// responder. Views inside the sheet are asked before this one, so in-sheet
|
|
88
|
+
// touchables work normally; views outside are asked after, so stopping here
|
|
89
|
+
// keeps unclaimed touches from leaking to touchables behind the sheet.
|
|
90
|
+
// Claiming instead (returning true) would steal the responder from a pressed
|
|
91
|
+
// touchable whenever the negotiation re-runs mid-gesture — e.g. a second
|
|
92
|
+
// finger, or the duplicate touch stream from a nested react-native-screens
|
|
93
|
+
// screen that attaches its own touch handler inside the sheet.
|
|
94
|
+
const stopResponderNegotiation = (event: GestureResponderEvent) => {
|
|
95
|
+
event.stopPropagation();
|
|
96
|
+
return false;
|
|
97
|
+
};
|
|
98
|
+
|
|
68
99
|
interface TrueSheetState {
|
|
69
100
|
shouldRenderNativeView: boolean;
|
|
101
|
+
initialPresentReady: boolean;
|
|
102
|
+
scrollableHandle: number | null;
|
|
70
103
|
}
|
|
71
104
|
|
|
105
|
+
// Gates auto-present (initialDetentIndex) by one commit. Rendered last in the
|
|
106
|
+
// sheet subtree so its mount effect runs after the content's mount effects —
|
|
107
|
+
// updates they schedule (e.g. a navigation footer via setOptions) batch with
|
|
108
|
+
// onReady's, so native receives initialDetentIndex together with the settled
|
|
109
|
+
// tree and presents at the final height instead of resizing mid-flight.
|
|
110
|
+
const InitialPresentGate = ({ onReady }: { onReady: () => void }) => {
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
onReady();
|
|
113
|
+
}, [onReady]);
|
|
114
|
+
|
|
115
|
+
return null;
|
|
116
|
+
};
|
|
117
|
+
|
|
72
118
|
export class TrueSheet
|
|
73
119
|
extends PureComponent<TrueSheetProps, TrueSheetState>
|
|
74
120
|
implements TrueSheetMethods
|
|
75
121
|
{
|
|
76
122
|
displayName = 'TrueSheet';
|
|
77
123
|
|
|
124
|
+
static contextType = RootTagContext;
|
|
125
|
+
|
|
78
126
|
private readonly nativeRef: RefObject<NativeRef | null>;
|
|
79
127
|
|
|
80
128
|
private cachedGrabberOptions: TrueSheetProps['grabberOptions'] | undefined;
|
|
@@ -105,17 +153,21 @@ export class TrueSheet
|
|
|
105
153
|
|
|
106
154
|
this.validateDetents();
|
|
107
155
|
|
|
108
|
-
// Lazy load by default, except when
|
|
156
|
+
// Lazy load by default, except when auto-presenting or when lazy is disabled
|
|
109
157
|
const shouldRenderImmediately =
|
|
110
|
-
props.initialDetentIndex !== undefined && props.initialDetentIndex >= 0
|
|
158
|
+
(props.initialDetentIndex !== undefined && props.initialDetentIndex >= 0) ||
|
|
159
|
+
props.lazy === false;
|
|
111
160
|
|
|
112
161
|
this.state = {
|
|
113
162
|
shouldRenderNativeView: shouldRenderImmediately,
|
|
163
|
+
initialPresentReady: false,
|
|
164
|
+
scrollableHandle: null,
|
|
114
165
|
};
|
|
115
166
|
|
|
116
167
|
this.onMount = this.onMount.bind(this);
|
|
117
168
|
this.onWillDismiss = this.onWillDismiss.bind(this);
|
|
118
169
|
this.onDidDismiss = this.onDidDismiss.bind(this);
|
|
170
|
+
this.onDismissAttempt = this.onDismissAttempt.bind(this);
|
|
119
171
|
this.onWillPresent = this.onWillPresent.bind(this);
|
|
120
172
|
this.onDidPresent = this.onDidPresent.bind(this);
|
|
121
173
|
this.onDetentChange = this.onDetentChange.bind(this);
|
|
@@ -129,6 +181,22 @@ export class TrueSheet
|
|
|
129
181
|
this.onDidBlur = this.onDidBlur.bind(this);
|
|
130
182
|
this.handleBackPress = this.handleBackPress.bind(this);
|
|
131
183
|
this.onVisibilityChange = this.onVisibilityChange.bind(this);
|
|
184
|
+
this.onInitialPresentReady = this.onInitialPresentReady.bind(this);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private onInitialPresentReady(): void {
|
|
188
|
+
this.setState({ initialPresentReady: true });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Resolves after commit (didMount/didUpdate) — the scrollable mounts with the
|
|
192
|
+
// sheet content, so its ref is only populated once the native tree renders.
|
|
193
|
+
private updateScrollableHandle(): void {
|
|
194
|
+
const { scrollableRef } = this.props;
|
|
195
|
+
const scrollableHandle = scrollableRef?.current ? findNodeHandle(scrollableRef.current) : null;
|
|
196
|
+
|
|
197
|
+
if (scrollableHandle !== this.state.scrollableHandle) {
|
|
198
|
+
this.setState({ scrollableHandle });
|
|
199
|
+
}
|
|
132
200
|
}
|
|
133
201
|
|
|
134
202
|
private validateDetents(): void {
|
|
@@ -301,15 +369,18 @@ export class TrueSheet
|
|
|
301
369
|
this.props.onWillDismiss?.(event);
|
|
302
370
|
}
|
|
303
371
|
|
|
372
|
+
private onDismissAttempt(event: DismissAttemptEvent): void {
|
|
373
|
+
this.props.onDismissAttempt?.(event);
|
|
374
|
+
}
|
|
375
|
+
|
|
304
376
|
private onDidDismiss(event: DidDismissEvent): void {
|
|
305
377
|
this.isPresented = false;
|
|
306
378
|
this.isSheetVisible = true;
|
|
307
379
|
this.backHandlerSubscription?.remove();
|
|
308
380
|
this.backHandlerSubscription = null;
|
|
309
381
|
|
|
310
|
-
//
|
|
311
|
-
|
|
312
|
-
if (!this.isPresenting) {
|
|
382
|
+
// Non-lazy content stays mounted; otherwise clean it up unless another presentation is active.
|
|
383
|
+
if (!this.isPresenting && this.props.lazy !== false) {
|
|
313
384
|
this.setState({ shouldRenderNativeView: false });
|
|
314
385
|
}
|
|
315
386
|
|
|
@@ -371,9 +442,12 @@ export class TrueSheet
|
|
|
371
442
|
const nodeHandle = findNodeHandle(this.nativeRef.current);
|
|
372
443
|
if (nodeHandle == null || nodeHandle === -1) return false;
|
|
373
444
|
|
|
374
|
-
// When not dismissible,
|
|
445
|
+
// When not dismissible, report the attempt. An attempt handler consumes the back
|
|
446
|
+
// press; otherwise let it propagate (e.g. navigation goes back to the previous screen)
|
|
375
447
|
if (this.props.dismissible === false) {
|
|
376
|
-
|
|
448
|
+
const { onDismissAttempt, onBackPress } = this.props;
|
|
449
|
+
onDismissAttempt?.({ nativeEvent: null } as DismissAttemptEvent);
|
|
450
|
+
return onBackPress?.() ?? onDismissAttempt != null;
|
|
377
451
|
}
|
|
378
452
|
|
|
379
453
|
TrueSheetModule?.handleBackPress(nodeHandle);
|
|
@@ -434,15 +508,38 @@ export class TrueSheet
|
|
|
434
508
|
|
|
435
509
|
componentDidMount(): void {
|
|
436
510
|
this.registerInstance();
|
|
511
|
+
this.updateScrollableHandle();
|
|
437
512
|
}
|
|
438
513
|
|
|
439
514
|
componentDidUpdate(prevProps: TrueSheetProps): void {
|
|
440
515
|
this.registerInstance();
|
|
516
|
+
this.updateScrollableHandle();
|
|
517
|
+
|
|
518
|
+
if (
|
|
519
|
+
prevProps.lazy !== false &&
|
|
520
|
+
this.props.lazy === false &&
|
|
521
|
+
!this.state.shouldRenderNativeView
|
|
522
|
+
) {
|
|
523
|
+
this.setState({ shouldRenderNativeView: true });
|
|
524
|
+
}
|
|
441
525
|
|
|
442
526
|
// Validate when detents prop changes
|
|
443
527
|
if (prevProps.detents !== this.props.detents) {
|
|
444
528
|
this.validateDetents();
|
|
445
529
|
}
|
|
530
|
+
|
|
531
|
+
// initialDetentIndex set at runtime on a lazily-mounted sheet: render the
|
|
532
|
+
// native tree so InitialPresentGate can deliver the index (constructor
|
|
533
|
+
// only computes this for the initial prop).
|
|
534
|
+
const prevInitialDetentIndex = prevProps.initialDetentIndex ?? -1;
|
|
535
|
+
const initialDetentIndex = this.props.initialDetentIndex ?? -1;
|
|
536
|
+
if (
|
|
537
|
+
prevInitialDetentIndex < 0 &&
|
|
538
|
+
initialDetentIndex >= 0 &&
|
|
539
|
+
!this.state.shouldRenderNativeView
|
|
540
|
+
) {
|
|
541
|
+
this.setState({ shouldRenderNativeView: true });
|
|
542
|
+
}
|
|
446
543
|
}
|
|
447
544
|
|
|
448
545
|
componentWillUnmount(): void {
|
|
@@ -485,6 +582,7 @@ export class TrueSheet
|
|
|
485
582
|
insetAdjustment = 'automatic',
|
|
486
583
|
...rest
|
|
487
584
|
} = this.props;
|
|
585
|
+
delete rest.lazy;
|
|
488
586
|
|
|
489
587
|
// Trim to max 3 detents and clamp fractions
|
|
490
588
|
const resolvedDetents: number[] = detents.slice(0, 3).map((detent) => {
|
|
@@ -498,6 +596,12 @@ export class TrueSheet
|
|
|
498
596
|
return Math.min(1, detent);
|
|
499
597
|
});
|
|
500
598
|
|
|
599
|
+
// Hold initialDetentIndex back from native until the gate's effect flushes
|
|
600
|
+
// (see InitialPresentGate) — native presents when the prop lands.
|
|
601
|
+
const autoPresent = initialDetentIndex >= 0;
|
|
602
|
+
const gatedInitialDetentIndex =
|
|
603
|
+
autoPresent && !this.state.initialPresentReady ? -1 : initialDetentIndex;
|
|
604
|
+
|
|
501
605
|
// Cache grabberOptions to avoid creating a new object every render
|
|
502
606
|
if (grabberOptions !== this.cachedGrabberOptions) {
|
|
503
607
|
this.cachedGrabberOptions = grabberOptions;
|
|
@@ -507,6 +611,42 @@ export class TrueSheet
|
|
|
507
611
|
};
|
|
508
612
|
}
|
|
509
613
|
|
|
614
|
+
const sheetContent = (
|
|
615
|
+
<>
|
|
616
|
+
{header && (
|
|
617
|
+
<TrueSheetHeaderViewNativeComponent
|
|
618
|
+
style={[
|
|
619
|
+
styles.header,
|
|
620
|
+
headerOptions?.position === 'absolute' && styles.absoluteHeader,
|
|
621
|
+
headerStyle,
|
|
622
|
+
]}
|
|
623
|
+
>
|
|
624
|
+
{isValidElement(header) ? header : createElement(header)}
|
|
625
|
+
</TrueSheetHeaderViewNativeComponent>
|
|
626
|
+
)}
|
|
627
|
+
<TrueSheetContentViewNativeComponent style={style}>
|
|
628
|
+
{children}
|
|
629
|
+
</TrueSheetContentViewNativeComponent>
|
|
630
|
+
{footer && (
|
|
631
|
+
<TrueSheetFooterViewNativeComponent
|
|
632
|
+
autoBottomInset={insetAdjustment === 'automatic'}
|
|
633
|
+
style={[
|
|
634
|
+
styles.footer,
|
|
635
|
+
footerOptions?.position === 'absolute'
|
|
636
|
+
? styles.absoluteFooter
|
|
637
|
+
: styles.relativeFooter,
|
|
638
|
+
footerStyle,
|
|
639
|
+
]}
|
|
640
|
+
>
|
|
641
|
+
{isValidElement(footer) ? footer : createElement(footer)}
|
|
642
|
+
</TrueSheetFooterViewNativeComponent>
|
|
643
|
+
)}
|
|
644
|
+
{autoPresent && !this.state.initialPresentReady && (
|
|
645
|
+
<InitialPresentGate onReady={this.onInitialPresentReady} />
|
|
646
|
+
)}
|
|
647
|
+
</>
|
|
648
|
+
);
|
|
649
|
+
|
|
510
650
|
return (
|
|
511
651
|
<TrueSheetViewNativeComponent
|
|
512
652
|
{...rest}
|
|
@@ -522,7 +662,7 @@ export class TrueSheet
|
|
|
522
662
|
accessibilityOptions={accessibilityOptions}
|
|
523
663
|
dimmed={dimmed}
|
|
524
664
|
dimmedDetentIndex={dimmedDetentIndex}
|
|
525
|
-
initialDetentIndex={
|
|
665
|
+
initialDetentIndex={gatedInitialDetentIndex}
|
|
526
666
|
initialDetentAnimated={initialDetentAnimated}
|
|
527
667
|
dismissible={dismissible}
|
|
528
668
|
draggable={draggable}
|
|
@@ -530,6 +670,7 @@ export class TrueSheet
|
|
|
530
670
|
maxContentWidth={maxContentWidth}
|
|
531
671
|
anchor={anchor}
|
|
532
672
|
anchorOffset={anchorOffset}
|
|
673
|
+
scrollableHandle={this.state.scrollableHandle ?? -1}
|
|
533
674
|
scrollableOptions={scrollableOptions}
|
|
534
675
|
headerOptions={headerOptions}
|
|
535
676
|
footerOptions={{
|
|
@@ -543,6 +684,7 @@ export class TrueSheet
|
|
|
543
684
|
onDidPresent={this.onDidPresent}
|
|
544
685
|
onWillDismiss={this.onWillDismiss}
|
|
545
686
|
onDidDismiss={this.onDidDismiss}
|
|
687
|
+
onDismissAttempt={this.onDismissAttempt}
|
|
546
688
|
onDetentChange={this.onDetentChange}
|
|
547
689
|
onDragBegin={this.onDragBegin}
|
|
548
690
|
onDragChange={this.onDragChange}
|
|
@@ -553,43 +695,36 @@ export class TrueSheet
|
|
|
553
695
|
onWillBlur={this.onWillBlur}
|
|
554
696
|
onDidBlur={this.onDidBlur}
|
|
555
697
|
onVisibilityChange={this.onVisibilityChange}
|
|
698
|
+
// These must stay on this host view, not on the container. The container is
|
|
699
|
+
// reparented into the native sheet, so this view is never a native ancestor of
|
|
700
|
+
// the sheet content — this is the React-tree boundary between the sheet and
|
|
701
|
+
// the presenting screen, where both the responder negotiation and raw touch
|
|
702
|
+
// bubbling must stop.
|
|
703
|
+
onStartShouldSetResponder={stopResponderNegotiation}
|
|
704
|
+
onMoveShouldSetResponder={stopResponderNegotiation}
|
|
705
|
+
onTouchStart={stopTouchPropagation}
|
|
706
|
+
onTouchMove={stopTouchPropagation}
|
|
707
|
+
onTouchEnd={stopTouchPropagation}
|
|
708
|
+
onTouchCancel={stopTouchPropagation}
|
|
556
709
|
>
|
|
557
710
|
{this.state.shouldRenderNativeView && (
|
|
558
|
-
<TrueSheetContainerViewNativeComponent
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
headerOptions?.position === 'absolute' && styles.absoluteHeader,
|
|
571
|
-
headerStyle,
|
|
572
|
-
]}
|
|
711
|
+
<TrueSheetContainerViewNativeComponent style={styles.container}>
|
|
712
|
+
{AppContainer ? (
|
|
713
|
+
// Hosts the element inspector inside the sheet, like RN's Modal does —
|
|
714
|
+
// the app-level one sits behind the presented sheet.
|
|
715
|
+
// `display: contents` keeps AppContainer's wrapper views out of both
|
|
716
|
+
// Yoga layout and the native tree, so header/content/footer remain the
|
|
717
|
+
// container's direct native children, while the inspector overlay
|
|
718
|
+
// anchors to the container and lines up with measured frames.
|
|
719
|
+
<AppContainer
|
|
720
|
+
rootTag={this.context as RootTag}
|
|
721
|
+
rootViewStyle={styles.inspectorHost}
|
|
722
|
+
internal_excludeLogBox
|
|
573
723
|
>
|
|
574
|
-
{
|
|
575
|
-
</
|
|
576
|
-
)
|
|
577
|
-
|
|
578
|
-
{children}
|
|
579
|
-
</TrueSheetContentViewNativeComponent>
|
|
580
|
-
{footer && (
|
|
581
|
-
<TrueSheetFooterViewNativeComponent
|
|
582
|
-
autoBottomInset={insetAdjustment === 'automatic'}
|
|
583
|
-
style={[
|
|
584
|
-
styles.footer,
|
|
585
|
-
footerOptions?.position === 'absolute'
|
|
586
|
-
? styles.absoluteFooter
|
|
587
|
-
: styles.relativeFooter,
|
|
588
|
-
footerStyle,
|
|
589
|
-
]}
|
|
590
|
-
>
|
|
591
|
-
{isValidElement(footer) ? footer : createElement(footer)}
|
|
592
|
-
</TrueSheetFooterViewNativeComponent>
|
|
724
|
+
{sheetContent}
|
|
725
|
+
</AppContainer>
|
|
726
|
+
) : (
|
|
727
|
+
sheetContent
|
|
593
728
|
)}
|
|
594
729
|
</TrueSheetContainerViewNativeComponent>
|
|
595
730
|
)}
|
|
@@ -611,6 +746,9 @@ const styles = StyleSheet.create({
|
|
|
611
746
|
container: {
|
|
612
747
|
...StyleSheet.absoluteFill,
|
|
613
748
|
},
|
|
749
|
+
inspectorHost: {
|
|
750
|
+
display: 'contents',
|
|
751
|
+
},
|
|
614
752
|
header: {
|
|
615
753
|
pointerEvents: 'box-none',
|
|
616
754
|
},
|