@lodev09/react-native-true-sheet 4.0.0-beta.0 → 4.0.0-beta.2
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/LICENSE +1 -1
- package/README.md +42 -31
- package/RNTrueSheet.podspec +10 -2
- package/android/build.gradle +2 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +174 -49
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +7 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +371 -18
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +14 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +156 -21
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterViewManager.kt +14 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetHeaderView.kt +38 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetHeaderViewManager.kt +28 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +84 -24
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +5 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekView.kt +72 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekViewManager.kt +33 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +45 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +526 -231
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +1224 -603
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +136 -29
- package/android/src/main/java/com/lodev09/truesheet/core/RNScreensEventObserver.kt +63 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetBehavior.kt +36 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetView.kt +255 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +303 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +277 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDimView.kt +162 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +180 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetKeyboardObserver.kt +207 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetStackManager.kt +220 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +112 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetStateEvents.kt +56 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/KeyboardUtils.kt +84 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +93 -67
- package/android/src/main/java/com/lodev09/truesheet/utils/TouchEventDeduper.kt +31 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +30 -0
- package/android/src/main/jni/CMakeLists.txt +63 -0
- package/android/src/main/jni/TrueSheetSpec.h +19 -0
- package/android/src/main/jni/TrueSheetStateUpdater.cpp +96 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +24 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +43 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +37 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +24 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +56 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.cpp +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.h +41 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.cpp +18 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.h +16 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +61 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.h +45 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.cpp +23 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.h +52 -0
- package/ios/TrueSheetContainerView.h +81 -6
- package/ios/TrueSheetContainerView.mm +275 -21
- package/ios/TrueSheetContentView.h +38 -1
- package/ios/TrueSheetContentView.mm +413 -43
- package/ios/TrueSheetFooterView.h +27 -2
- package/ios/TrueSheetFooterView.mm +141 -35
- package/ios/{events/OnDidDismissEvent.h → TrueSheetHeaderView.h} +10 -7
- package/ios/TrueSheetHeaderView.mm +64 -0
- package/ios/TrueSheetModule.mm +92 -5
- package/ios/TrueSheetPeekView.h +32 -0
- package/ios/TrueSheetPeekView.mm +99 -0
- package/ios/TrueSheetView.h +7 -15
- package/ios/TrueSheetView.mm +633 -215
- package/ios/TrueSheetViewController.h +84 -16
- package/ios/TrueSheetViewController.mm +1133 -333
- package/ios/core/RNScreensEventObserver.h +46 -0
- package/ios/core/RNScreensEventObserver.mm +280 -0
- package/ios/core/TrueSheetBlurView.h +27 -0
- package/ios/core/TrueSheetBlurView.mm +82 -0
- package/ios/core/TrueSheetDetentCalculator.h +107 -0
- package/ios/core/TrueSheetDetentCalculator.mm +197 -0
- package/ios/core/TrueSheetGrabberView.h +72 -0
- package/ios/core/TrueSheetGrabberView.mm +178 -0
- package/ios/core/TrueSheetKeyboardObserver.h +39 -0
- package/ios/core/TrueSheetKeyboardObserver.mm +112 -0
- package/ios/events/TrueSheetDragEvents.h +39 -0
- package/ios/events/TrueSheetDragEvents.mm +62 -0
- package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
- package/ios/events/TrueSheetFocusEvents.mm +49 -0
- package/ios/events/TrueSheetLifecycleEvents.h +40 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
- package/ios/events/TrueSheetStateEvents.h +35 -0
- package/ios/events/TrueSheetStateEvents.mm +49 -0
- package/ios/tvos/TrueSheetStubs.mm +154 -0
- package/ios/{events/OnMountEvent.h → utils/BlurUtil.h} +5 -7
- package/ios/utils/BlurUtil.mm +69 -0
- package/ios/utils/GestureUtil.h +7 -0
- package/ios/utils/GestureUtil.mm +12 -0
- package/ios/utils/PlatformUtil.h +15 -0
- package/ios/utils/UIView+FirstResponder.h +15 -0
- package/ios/utils/UIView+FirstResponder.mm +26 -0
- package/ios/{events/OnWillDismissEvent.h → utils/UIView+ScrollEdgeInteraction.h} +6 -7
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +62 -0
- package/ios/utils/WindowUtil.mm +17 -1
- package/lib/module/TrueSheet.js +230 -64
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +1203 -0
- package/lib/module/TrueSheet.web.js.map +1 -0
- package/lib/module/TrueSheetPeek.js +15 -0
- package/lib/module/TrueSheetPeek.js.map +1 -0
- package/lib/module/TrueSheetPeek.web.js +55 -0
- package/lib/module/TrueSheetPeek.web.js.map +1 -0
- package/lib/module/TrueSheetProvider.js +28 -0
- package/lib/module/TrueSheetProvider.js.map +1 -0
- package/lib/module/TrueSheetProvider.web.js +157 -0
- package/lib/module/TrueSheetProvider.web.js.map +1 -0
- package/lib/module/fabric/TrueSheetContainerViewNativeComponent.ts +1 -1
- package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +5 -1
- package/lib/module/fabric/TrueSheetFooterViewNativeComponent.ts +10 -2
- package/lib/module/fabric/TrueSheetHeaderViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +105 -18
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks/index.js +93 -0
- package/lib/module/mocks/index.js.map +1 -0
- package/lib/module/mocks/navigation.js +95 -0
- package/lib/module/mocks/navigation.js.map +1 -0
- package/lib/module/mocks/navigationExpoRouter.js +21 -0
- package/lib/module/mocks/navigationExpoRouter.js.map +1 -0
- package/lib/module/mocks/reanimated.js +91 -0
- package/lib/module/mocks/reanimated.js.map +1 -0
- package/lib/module/navigation/TrueSheetNavigatorContent.js +73 -0
- 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/createTrueSheetRouter.js +166 -0
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +48 -0
- package/lib/module/navigation/expo-router/index.js.map +1 -0
- package/lib/module/navigation/index.js +47 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/navigator.js +10 -0
- package/lib/module/navigation/navigator.js.map +1 -0
- package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js +56 -0
- package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js.map +1 -0
- package/lib/module/navigation/screen/TrueSheetScreen.js +49 -0
- package/lib/module/navigation/screen/TrueSheetScreen.js.map +1 -0
- package/lib/module/navigation/screen/index.js +5 -0
- package/lib/module/navigation/screen/index.js.map +1 -0
- package/lib/module/navigation/screen/types.js +4 -0
- package/lib/module/navigation/screen/types.js.map +1 -0
- package/lib/module/navigation/screen/useSheetScreenState.js +68 -0
- package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -0
- package/lib/module/navigation/types.js +4 -0
- package/lib/module/navigation/types.js.map +1 -0
- package/lib/module/navigation/useTrueSheetNavigation.js +24 -0
- package/lib/module/navigation/useTrueSheetNavigation.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTrueSheet.js +15 -9
- package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheet.web.js +81 -0
- package/lib/module/reanimated/ReanimatedTrueSheet.web.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
- package/lib/module/reanimated/index.js +2 -2
- package/lib/module/reanimated/index.js.map +1 -1
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.web.js +20 -0
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.web.js.map +1 -0
- package/lib/module/specs/NativeTrueSheetModule.js.map +1 -1
- package/lib/module/web/constants.js +16 -0
- package/lib/module/web/constants.js.map +1 -0
- package/lib/module/web/dom.js +10 -0
- package/lib/module/web/dom.js.map +1 -0
- package/lib/module/web/vaul/README.md +9 -0
- package/lib/module/web/vaul/browser.js +30 -0
- package/lib/module/web/vaul/browser.js.map +1 -0
- package/lib/module/web/vaul/constants.js +15 -0
- package/lib/module/web/vaul/constants.js.map +1 -0
- package/lib/module/web/vaul/context.js +59 -0
- package/lib/module/web/vaul/context.js.map +1 -0
- package/lib/module/web/vaul/helpers.js +99 -0
- package/lib/module/web/vaul/helpers.js.map +1 -0
- package/lib/module/web/vaul/index.js +1309 -0
- package/lib/module/web/vaul/index.js.map +1 -0
- package/lib/module/web/vaul/style.css +287 -0
- package/lib/module/web/vaul/style.css.d.js +2 -0
- package/lib/module/web/vaul/style.css.d.js.map +1 -0
- package/lib/module/web/vaul/types.js +2 -0
- package/lib/module/web/vaul/types.js.map +1 -0
- package/lib/module/web/vaul/use-composed-refs.js +34 -0
- package/lib/module/web/vaul/use-composed-refs.js.map +1 -0
- package/lib/module/web/vaul/use-controllable-state.js +54 -0
- package/lib/module/web/vaul/use-controllable-state.js.map +1 -0
- package/lib/module/web/vaul/use-position-fixed.js +123 -0
- package/lib/module/web/vaul/use-position-fixed.js.map +1 -0
- package/lib/module/web/vaul/use-prevent-scroll.js +258 -0
- package/lib/module/web/vaul/use-prevent-scroll.js.map +1 -0
- package/lib/module/web/vaul/use-scale-background.js +57 -0
- package/lib/module/web/vaul/use-scale-background.js.map +1 -0
- package/lib/module/web/vaul/use-snap-points.js +305 -0
- package/lib/module/web/vaul/use-snap-points.js.map +1 -0
- package/lib/typescript/src/TrueSheet.d.ts +51 -14
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +463 -54
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.web.d.ts +5 -0
- package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetPeek.d.ts +9 -0
- package/lib/typescript/src/TrueSheetPeek.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetPeek.web.d.ts +28 -0
- package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetProvider.d.ts +18 -0
- package/lib/typescript/src/TrueSheetProvider.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetProvider.web.d.ts +27 -0
- package/lib/typescript/src/TrueSheetProvider.web.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts +2 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetHeaderViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetHeaderViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +67 -16
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/index.d.ts +43 -0
- package/lib/typescript/src/mocks/index.d.ts.map +1 -0
- package/lib/typescript/src/mocks/navigation.d.ts +70 -0
- package/lib/typescript/src/mocks/navigation.d.ts.map +1 -0
- 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 +48 -0
- package/lib/typescript/src/mocks/reanimated.d.ts.map +1 -0
- package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts +5 -0
- package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts.map +1 -0
- package/lib/typescript/src/navigation/actions.d.ts +71 -0
- package/lib/typescript/src/navigation/actions.d.ts.map +1 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +14 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts +37 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +46 -0
- package/lib/typescript/src/navigation/index.d.ts.map +1 -0
- 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 +3 -0
- package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts +3 -0
- package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/index.d.ts +4 -0
- package/lib/typescript/src/navigation/screen/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/types.d.ts +14 -0
- package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +33 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
- package/lib/typescript/src/navigation/types.d.ts +177 -0
- package/lib/typescript/src/navigation/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts +23 -0
- package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.web.d.ts +41 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.web.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.web.d.ts +15 -0
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.web.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts +25 -3
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts.map +1 -1
- package/lib/typescript/src/web/constants.d.ts +14 -0
- package/lib/typescript/src/web/constants.d.ts.map +1 -0
- 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/browser.d.ts +8 -0
- package/lib/typescript/src/web/vaul/browser.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/constants.d.ts +13 -0
- package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/context.d.ts +53 -0
- package/lib/typescript/src/web/vaul/context.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/helpers.d.ts +17 -0
- package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/index.d.ts +228 -0
- package/lib/typescript/src/web/vaul/index.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/types.d.ts +7 -0
- package/lib/typescript/src/web/vaul/types.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-composed-refs.d.ts +14 -0
- package/lib/typescript/src/web/vaul/use-composed-refs.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-controllable-state.d.ts +9 -0
- package/lib/typescript/src/web/vaul/use-controllable-state.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-position-fixed.d.ts +19 -0
- package/lib/typescript/src/web/vaul/use-position-fixed.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-prevent-scroll.d.ts +18 -0
- package/lib/typescript/src/web/vaul/use-prevent-scroll.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-scale-background.d.ts +2 -0
- package/lib/typescript/src/web/vaul/use-scale-background.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-snap-points.d.ts +38 -0
- package/lib/typescript/src/web/vaul/use-snap-points.d.ts.map +1 -0
- package/package.json +95 -36
- package/react-native.config.js +9 -2
- package/src/TrueSheet.tsx +281 -62
- package/src/TrueSheet.types.ts +525 -71
- package/src/TrueSheet.web.tsx +1362 -0
- package/src/TrueSheetPeek.tsx +11 -0
- package/src/TrueSheetPeek.web.tsx +64 -0
- package/src/TrueSheetProvider.tsx +33 -0
- package/src/TrueSheetProvider.web.tsx +220 -0
- package/src/fabric/TrueSheetContainerViewNativeComponent.ts +1 -1
- package/src/fabric/TrueSheetContentViewNativeComponent.ts +5 -1
- package/src/fabric/TrueSheetFooterViewNativeComponent.ts +10 -2
- package/src/fabric/TrueSheetHeaderViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +105 -18
- package/src/index.ts +2 -2
- package/src/mocks/index.ts +89 -0
- package/src/mocks/navigation.ts +79 -0
- package/src/mocks/navigationExpoRouter.ts +40 -0
- package/src/mocks/reanimated.ts +100 -0
- package/src/navigation/TrueSheetNavigatorContent.tsx +106 -0
- package/src/navigation/actions.ts +78 -0
- package/src/navigation/createTrueSheetRouter.ts +222 -0
- package/src/navigation/expo-router/index.ts +89 -0
- package/src/navigation/index.ts +81 -0
- package/src/navigation/navigator.ts +18 -0
- package/src/navigation/screen/ReanimatedTrueSheetScreen.tsx +61 -0
- package/src/navigation/screen/TrueSheetScreen.tsx +54 -0
- package/src/navigation/screen/index.ts +3 -0
- package/src/navigation/screen/types.ts +19 -0
- package/src/navigation/screen/useSheetScreenState.ts +100 -0
- package/src/navigation/types.ts +251 -0
- package/src/navigation/useTrueSheetNavigation.ts +26 -0
- package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
- package/src/reanimated/ReanimatedTrueSheet.web.tsx +75 -0
- package/src/reanimated/ReanimatedTrueSheetProvider.tsx +12 -8
- package/src/reanimated/useReanimatedPositionChangeHandler.web.ts +31 -0
- package/src/specs/NativeTrueSheetModule.ts +28 -3
- package/src/web/constants.ts +13 -0
- package/src/web/dom.ts +9 -0
- package/src/web/vaul/README.md +9 -0
- package/src/web/vaul/browser.ts +38 -0
- package/src/web/vaul/constants.ts +20 -0
- package/src/web/vaul/context.ts +101 -0
- package/src/web/vaul/helpers.ts +131 -0
- package/src/web/vaul/index.tsx +1740 -0
- package/src/web/vaul/style.css +287 -0
- package/src/web/vaul/style.css.d.ts +1 -0
- package/src/web/vaul/types.ts +7 -0
- package/src/web/vaul/use-composed-refs.ts +35 -0
- package/src/web/vaul/use-controllable-state.ts +66 -0
- package/src/web/vaul/use-position-fixed.ts +147 -0
- package/src/web/vaul/use-prevent-scroll.ts +309 -0
- package/src/web/vaul/use-scale-background.ts +64 -0
- package/src/web/vaul/use-snap-points.ts +455 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
- package/android/src/main/java/com/lodev09/truesheet/events/SizeChangeEvent.kt +0 -27
- package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
- package/android/src/main/res/values/styles.xml +0 -8
- package/ios/events/OnDetentChangeEvent.h +0 -28
- package/ios/events/OnDetentChangeEvent.mm +0 -30
- package/ios/events/OnDidDismissEvent.mm +0 -25
- package/ios/events/OnDidPresentEvent.h +0 -28
- package/ios/events/OnDidPresentEvent.mm +0 -30
- package/ios/events/OnDragBeginEvent.h +0 -28
- package/ios/events/OnDragBeginEvent.mm +0 -30
- package/ios/events/OnDragChangeEvent.h +0 -28
- package/ios/events/OnDragChangeEvent.mm +0 -30
- package/ios/events/OnDragEndEvent.h +0 -28
- package/ios/events/OnDragEndEvent.mm +0 -30
- package/ios/events/OnMountEvent.mm +0 -25
- package/ios/events/OnPositionChangeEvent.mm +0 -32
- package/ios/events/OnSizeChangeEvent.h +0 -28
- package/ios/events/OnSizeChangeEvent.mm +0 -30
- package/ios/events/OnWillDismissEvent.mm +0 -25
- package/ios/events/OnWillPresentEvent.h +0 -28
- package/ios/events/OnWillPresentEvent.mm +0 -30
- package/ios/utils/LayoutUtil.h +0 -44
- package/ios/utils/LayoutUtil.mm +0 -50
- package/lib/module/TrueSheetGrabber.js +0 -51
- package/lib/module/TrueSheetGrabber.js.map +0 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
- package/src/TrueSheetGrabber.tsx +0 -82
- package/src/__mocks__/index.js +0 -67
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper component that marks its children as the sheet's peek content.
|
|
4
|
+
* When rendered within a `TrueSheet`, the `"peek"` detent reveals everything
|
|
5
|
+
* from the top of the sheet through the bottom of this component — content
|
|
6
|
+
* below it stays hidden until the sheet is expanded.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TrueSheetPeek: (props: ViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=TrueSheetPeek.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetPeek.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetPeek.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,SAAS,4CAAoD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Reports the measured peek content height to the owning TrueSheet.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface TrueSheetPeekContextValue {
|
|
8
|
+
contentRef: RefObject<View | null>;
|
|
9
|
+
peekRef: RefObject<View | null>;
|
|
10
|
+
setPeekContentHeight: (height: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const TrueSheetPeekContext: import("react").Context<TrueSheetPeekContextValue | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Distance from the top of the content view to the bottom of the peek view,
|
|
15
|
+
* so the peek view's offset within the content (padding, views above it)
|
|
16
|
+
* counts toward the peek detent. Both rects live in the drawer's transformed
|
|
17
|
+
* subtree, so an in-flight translate cancels out of the delta.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare const measurePeekContentHeight: (peekElement: HTMLElement, contentElement: HTMLElement) => number;
|
|
21
|
+
/**
|
|
22
|
+
* Wrapper component that marks its children as the sheet's peek content.
|
|
23
|
+
* When rendered within a `TrueSheet`, the `"peek"` detent reveals everything
|
|
24
|
+
* from the top of the sheet through the bottom of this component — content
|
|
25
|
+
* below it stays hidden until the sheet is expanded.
|
|
26
|
+
*/
|
|
27
|
+
export declare const TrueSheetPeek: ({ onLayout, ...rest }: ViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=TrueSheetPeek.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetPeek.web.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetPeek.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAiC,MAAM,OAAO,CAAC;AACrF,OAAO,EAA0B,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI5E;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACnC,OAAO,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAChC,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,oBAAoB,2DAAwD,CAAC;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,aAAa,WAAW,EACxB,gBAAgB,WAAW,KAC1B,MACsF,CAAC;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,uBAAuB,SAAS,4CA2B7D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TrueSheetStaticMethods } from './TrueSheet.types';
|
|
3
|
+
export type { TrueSheetStaticMethods };
|
|
4
|
+
export interface TrueSheetProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Provider for TrueSheet on native platforms.
|
|
9
|
+
* This is a pass-through component - no context is needed on native
|
|
10
|
+
* since TrueSheet uses static instance methods internally.
|
|
11
|
+
*/
|
|
12
|
+
export declare function TrueSheetProvider({ children }: TrueSheetProviderProps): ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Hook to control TrueSheet instances by name.
|
|
15
|
+
* On native, this maps directly to TrueSheet static methods.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTrueSheet(): TrueSheetStaticMethods;
|
|
18
|
+
//# sourceMappingURL=TrueSheetProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetProvider.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,aAErE;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,sBAAsB,CAQrD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import type { TrueSheetMethods, TrueSheetStaticMethods } from './TrueSheet.types';
|
|
3
|
+
type SheetRef = RefObject<TrueSheetMethods | null>;
|
|
4
|
+
type NodeRef = RefObject<HTMLDivElement | null>;
|
|
5
|
+
interface StackEntry {
|
|
6
|
+
ref: SheetRef;
|
|
7
|
+
nodeRef: NodeRef;
|
|
8
|
+
isFormSheetRef: RefObject<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export interface TrueSheetProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function TrueSheetProvider({ children }: TrueSheetProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function usePortalContainer(): HTMLElement | null;
|
|
15
|
+
export declare function useTrueSheet(): TrueSheetStaticMethods;
|
|
16
|
+
export declare function useRegisterSheet(name: string | undefined, ref: SheetRef): void;
|
|
17
|
+
/**
|
|
18
|
+
* Registers the sheet in the open stack while `isOpen` is true and returns
|
|
19
|
+
* live data used by each sheet to render stacked visuals and dismiss children.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useSheetStack(ref: SheetRef, nodeRef: NodeRef, isOpen: boolean, isFormSheet: boolean): {
|
|
22
|
+
descendants: readonly StackEntry[];
|
|
23
|
+
isNested: boolean;
|
|
24
|
+
dismissAbove: (animated?: boolean) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=TrueSheetProvider.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetProvider.web.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetProvider.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAElF,KAAK,QAAQ,GAAG,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;AACnD,KAAK,OAAO,GAAG,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;AAEhD,UAAU,UAAU;IAClB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CACpC;AAmBD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CAyErE;AAED,wBAAgB,kBAAkB,IAAI,WAAW,GAAG,IAAI,CAGvD;AAED,wBAAgB,YAAY,IAAI,sBAAsB,CA8BrD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAM9E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,OAAO;;;8BAkCA,OAAO;EAY5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetContainerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetContainerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,
|
|
1
|
+
{"version":3,"file":"TrueSheetContainerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetContainerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAA6E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetContentViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetContentViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;
|
|
1
|
+
{"version":3,"file":"TrueSheetContentViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetContentViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAID,wBAEG"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
2
3
|
export interface NativeProps extends ViewProps {
|
|
4
|
+
autoBottomInset?: WithDefault<boolean, false>;
|
|
3
5
|
}
|
|
4
6
|
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
5
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetFooterViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetFooterViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TrueSheetFooterViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetFooterViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAG7E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAI5C,eAAe,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;CAC/C;;AAID,wBAEG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=TrueSheetHeaderViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetHeaderViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetHeaderViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAA8E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=TrueSheetPeekViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetPeekViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetPeekViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAA4E"}
|
|
@@ -1,32 +1,77 @@
|
|
|
1
|
-
import type { ViewProps } from 'react-native';
|
|
2
|
-
import type { DirectEventHandler, Double, Int32, WithDefault
|
|
1
|
+
import type { ColorValue, ProcessedColorValue, ViewProps } from 'react-native';
|
|
2
|
+
import type { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
type GrabberOptionsType = Readonly<{
|
|
4
|
+
width?: Double;
|
|
5
|
+
height?: Double;
|
|
6
|
+
topMargin?: Double;
|
|
7
|
+
cornerRadius?: WithDefault<Double, -1>;
|
|
8
|
+
color?: ProcessedColorValue | null;
|
|
9
|
+
adaptive?: WithDefault<boolean, true>;
|
|
10
|
+
}>;
|
|
11
|
+
type AccessibilityOptionsType = Readonly<{
|
|
12
|
+
grabberLabel?: WithDefault<string, 'Sheet Grabber'>;
|
|
13
|
+
grabberHint?: WithDefault<string, 'Double-tap to expand. Swipe up or down to resize the sheet'>;
|
|
14
|
+
expandedValue?: WithDefault<string, 'Expanded'>;
|
|
15
|
+
collapsedValue?: WithDefault<string, 'Collapsed'>;
|
|
16
|
+
detentValue?: WithDefault<string, 'Detent {index} of {count}'>;
|
|
17
|
+
expandActionLabel?: WithDefault<string, 'Expand'>;
|
|
18
|
+
collapseActionLabel?: WithDefault<string, 'Collapse'>;
|
|
19
|
+
paneTitle?: WithDefault<string, 'Bottom sheet'>;
|
|
20
|
+
}>;
|
|
21
|
+
type BlurOptionsType = Readonly<{
|
|
22
|
+
intensity?: WithDefault<Double, -1>;
|
|
23
|
+
interaction?: WithDefault<boolean, true>;
|
|
24
|
+
}>;
|
|
25
|
+
type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
26
|
+
type ScrollableOptionsType = Readonly<{
|
|
27
|
+
keyboardScrollOffset?: WithDefault<Double, 0>;
|
|
28
|
+
scrollingExpandsSheet?: WithDefault<boolean, true>;
|
|
29
|
+
topScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
30
|
+
bottomScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
31
|
+
}>;
|
|
32
|
+
type FooterOptionsType = Readonly<{
|
|
33
|
+
footerPosition?: WithDefault<'relative' | 'absolute', 'relative'>;
|
|
34
|
+
keyboardOffset?: WithDefault<Double, 0>;
|
|
35
|
+
}>;
|
|
36
|
+
type HeaderOptionsType = Readonly<{
|
|
37
|
+
position?: WithDefault<'relative' | 'absolute', 'relative'>;
|
|
38
|
+
}>;
|
|
3
39
|
export interface DetentInfoEventPayload {
|
|
4
40
|
index: Int32;
|
|
5
41
|
position: Double;
|
|
42
|
+
detent: Double;
|
|
6
43
|
}
|
|
7
44
|
export interface PositionChangeEventPayload {
|
|
8
|
-
index:
|
|
45
|
+
index: Double;
|
|
9
46
|
position: Double;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export interface SizeChangeEventPayload {
|
|
13
|
-
width: Double;
|
|
14
|
-
height: Double;
|
|
47
|
+
detent: Double;
|
|
48
|
+
realtime: boolean;
|
|
15
49
|
}
|
|
16
50
|
export interface NativeProps extends ViewProps {
|
|
17
|
-
detents?: ReadonlyArray<
|
|
18
|
-
|
|
19
|
-
|
|
51
|
+
detents?: ReadonlyArray<Double>;
|
|
52
|
+
maxContentHeight?: WithDefault<Double, 0>;
|
|
53
|
+
maxContentWidth?: WithDefault<Double, 0>;
|
|
20
54
|
cornerRadius?: WithDefault<Double, -1>;
|
|
55
|
+
elevation?: WithDefault<Double, -1>;
|
|
56
|
+
backgroundColor?: ColorValue;
|
|
21
57
|
initialDetentIndex?: WithDefault<Int32, -1>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
58
|
+
dimmedDetentIndex?: WithDefault<Int32, 0>;
|
|
59
|
+
backgroundBlur?: WithDefault<'none' | 'light' | 'dark' | 'default' | 'extra-light' | 'regular' | 'prominent' | 'system-ultra-thin-material' | 'system-thin-material' | 'system-material' | 'system-thick-material' | 'system-chrome-material' | 'system-ultra-thin-material-light' | 'system-thin-material-light' | 'system-material-light' | 'system-thick-material-light' | 'system-chrome-material-light' | 'system-ultra-thin-material-dark' | 'system-thin-material-dark' | 'system-material-dark' | 'system-thick-material-dark' | 'system-chrome-material-dark', 'none'>;
|
|
60
|
+
anchor?: WithDefault<'left' | 'center' | 'right', 'center'>;
|
|
61
|
+
anchorOffset?: WithDefault<Double, 16>;
|
|
62
|
+
insetAdjustment?: WithDefault<'automatic' | 'never', 'automatic'>;
|
|
63
|
+
blurOptions?: BlurOptionsType;
|
|
25
64
|
grabber?: WithDefault<boolean, true>;
|
|
65
|
+
grabberOptions?: GrabberOptionsType;
|
|
66
|
+
accessibilityOptions?: AccessibilityOptionsType;
|
|
26
67
|
dismissible?: WithDefault<boolean, true>;
|
|
68
|
+
draggable?: WithDefault<boolean, true>;
|
|
27
69
|
dimmed?: WithDefault<boolean, true>;
|
|
28
70
|
initialDetentAnimated?: WithDefault<boolean, true>;
|
|
29
|
-
|
|
71
|
+
scrollableOptions?: ScrollableOptionsType;
|
|
72
|
+
headerOptions?: HeaderOptionsType;
|
|
73
|
+
footerOptions?: FooterOptionsType;
|
|
74
|
+
presentation?: WithDefault<'page' | 'form', 'page'>;
|
|
30
75
|
onMount?: DirectEventHandler<null>;
|
|
31
76
|
onWillPresent?: DirectEventHandler<DetentInfoEventPayload>;
|
|
32
77
|
onDidPresent?: DirectEventHandler<DetentInfoEventPayload>;
|
|
@@ -37,7 +82,13 @@ export interface NativeProps extends ViewProps {
|
|
|
37
82
|
onDragChange?: DirectEventHandler<DetentInfoEventPayload>;
|
|
38
83
|
onDragEnd?: DirectEventHandler<DetentInfoEventPayload>;
|
|
39
84
|
onPositionChange?: DirectEventHandler<PositionChangeEventPayload>;
|
|
40
|
-
|
|
85
|
+
onWillFocus?: DirectEventHandler<null>;
|
|
86
|
+
onDidFocus?: DirectEventHandler<null>;
|
|
87
|
+
onWillBlur?: DirectEventHandler<null>;
|
|
88
|
+
onDidBlur?: DirectEventHandler<null>;
|
|
89
|
+
onVisibilityChange?: DirectEventHandler<Readonly<{
|
|
90
|
+
visible: boolean;
|
|
91
|
+
}>>;
|
|
41
92
|
}
|
|
42
93
|
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
43
94
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TrueSheetViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAGnD,KAAK,kBAAkB,GAAG,QAAQ,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;CACvC,CAAC,CAAC;AAEH,KAAK,wBAAwB,GAAG,QAAQ,CAAC;IACvC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACpD,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,4DAA4D,CAAC,CAAC;IAChG,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChD,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IAC/D,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClD,mBAAmB,CAAC,EAA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AgB,CAAC,EAAE,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;IAClE,WAAW,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACrC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;CACzE;;AAED,wBAEG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './TrueSheet';
|
|
2
2
|
export * from './TrueSheet.types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export { TrueSheetPeek } from './TrueSheetPeek';
|
|
4
|
+
export { TrueSheetProvider, useTrueSheet } from './TrueSheetProvider';
|
|
5
5
|
//# 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,
|
|
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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
import type { TrueSheetProps, TrueSheetStaticMethods } from '../TrueSheet.types';
|
|
4
|
+
interface TrueSheetState {
|
|
5
|
+
shouldRenderNativeView: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Mock TrueSheet component for testing.
|
|
9
|
+
* Import from '@lodev09/react-native-true-sheet/mock' in your test setup.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TrueSheet extends React.Component<TrueSheetProps, TrueSheetState> {
|
|
12
|
+
static instances: Record<string, TrueSheet>;
|
|
13
|
+
static dismiss: jest.Mock<Promise<void>, [_name: string, _animated?: boolean | undefined], any>;
|
|
14
|
+
static dismissStack: jest.Mock<Promise<void>, [_name: string, _animated?: boolean | undefined], any>;
|
|
15
|
+
static present: jest.Mock<Promise<void>, [_name: string, _index?: number | undefined, _animated?: boolean | undefined], any>;
|
|
16
|
+
static resize: jest.Mock<Promise<void>, [_name: string, _index: number], any>;
|
|
17
|
+
static dismissAll: jest.Mock<Promise<void>, [_animated?: boolean | undefined], any>;
|
|
18
|
+
dismiss: jest.Mock<Promise<void>, [_animated?: boolean | undefined], any>;
|
|
19
|
+
dismissStack: jest.Mock<Promise<void>, [_animated?: boolean | undefined], any>;
|
|
20
|
+
present: jest.Mock<Promise<void>, [_index?: number | undefined, _animated?: boolean | undefined], any>;
|
|
21
|
+
resize: jest.Mock<Promise<void>, [_index: number], any>;
|
|
22
|
+
componentDidMount(): void;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
private renderHeader;
|
|
25
|
+
private renderFooter;
|
|
26
|
+
render(): React.CElement<ViewProps, View>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Mock TrueSheetPeek component for testing.
|
|
30
|
+
*/
|
|
31
|
+
export declare function TrueSheetPeek({ children, ...rest }: ViewProps): React.CElement<ViewProps, View>;
|
|
32
|
+
/**
|
|
33
|
+
* Mock TrueSheetProvider for testing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function TrueSheetProvider({ children }: {
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}): React.ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Mock useTrueSheet hook for testing.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useTrueSheet(): TrueSheetStaticMethods;
|
|
42
|
+
export * from '../TrueSheet.types';
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,cAAc,CAAC;IAC5E,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAM;IAEjD,MAAM,CAAC,OAAO,kFAAsE;IACpF,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,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"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ParamListBase } from '@react-navigation/native';
|
|
2
|
+
import type { TrueSheetNavigationProp } from '../navigation/types';
|
|
3
|
+
/**
|
|
4
|
+
* Mock createTrueSheetNavigator for testing.
|
|
5
|
+
* Import from '@lodev09/react-native-true-sheet/navigation/mock' in your test setup.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createTrueSheetNavigator: jest.Mock<{
|
|
8
|
+
Navigator: jest.Mock<import("react").ReactNode, [{
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}], any>;
|
|
11
|
+
Screen: jest.Mock<null, [], any>;
|
|
12
|
+
Group: jest.Mock<null, [], any>;
|
|
13
|
+
}, [], any>;
|
|
14
|
+
/**
|
|
15
|
+
* Mock createTrueSheetScreen for testing the static API.
|
|
16
|
+
*/
|
|
17
|
+
export declare const createTrueSheetScreen: jest.Mock<object, [config: object], any>;
|
|
18
|
+
/**
|
|
19
|
+
* Mock TrueSheetActions for testing.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TrueSheetActions: {
|
|
22
|
+
push: jest.Mock<{
|
|
23
|
+
type: string;
|
|
24
|
+
payload: {
|
|
25
|
+
name: string;
|
|
26
|
+
params: object | undefined;
|
|
27
|
+
};
|
|
28
|
+
}, [name: string, params?: object | undefined], any>;
|
|
29
|
+
pop: jest.Mock<{
|
|
30
|
+
type: string;
|
|
31
|
+
payload: {
|
|
32
|
+
count: number | undefined;
|
|
33
|
+
};
|
|
34
|
+
}, [count?: number | undefined], any>;
|
|
35
|
+
popTo: jest.Mock<{
|
|
36
|
+
type: string;
|
|
37
|
+
payload: {
|
|
38
|
+
name: string;
|
|
39
|
+
params: object | undefined;
|
|
40
|
+
};
|
|
41
|
+
}, [name: string, params?: object | undefined], any>;
|
|
42
|
+
popToTop: jest.Mock<{
|
|
43
|
+
type: string;
|
|
44
|
+
}, [], any>;
|
|
45
|
+
replace: jest.Mock<{
|
|
46
|
+
type: string;
|
|
47
|
+
payload: {
|
|
48
|
+
name: string;
|
|
49
|
+
params: object | undefined;
|
|
50
|
+
};
|
|
51
|
+
}, [name: string, params?: object | undefined], any>;
|
|
52
|
+
resize: jest.Mock<{
|
|
53
|
+
type: string;
|
|
54
|
+
index: number;
|
|
55
|
+
}, [index: number], any>;
|
|
56
|
+
dismiss: jest.Mock<{
|
|
57
|
+
type: string;
|
|
58
|
+
}, [], any>;
|
|
59
|
+
remove: jest.Mock<{
|
|
60
|
+
type: string;
|
|
61
|
+
}, [], any>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Mock useTrueSheetNavigation hook for testing.
|
|
65
|
+
*/
|
|
66
|
+
export declare const useTrueSheetNavigation: jest.Mock<TrueSheetNavigationProp<ParamListBase>, [], any>;
|
|
67
|
+
export type { TrueSheetActionType } from '../navigation/actions';
|
|
68
|
+
export type { DetentInfoEventPayload, PositionChangeEventPayload } from '../TrueSheet.types';
|
|
69
|
+
export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from '../navigation/types';
|
|
70
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../src/mocks/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;kBACW,KAAK,CAAC,SAAS;;;;WAG5D,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,qBAAqB,0CAAsC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,4DAyBjC,CAAC;AAEH,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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ParamListBase } from '@react-navigation/native';
|
|
2
|
+
import type { TrueSheetNavigationProp } from '../navigation/types';
|
|
3
|
+
import { TrueSheetActions } from './navigation';
|
|
4
|
+
/**
|
|
5
|
+
* Mock Sheet layout for testing.
|
|
6
|
+
* Import from '@lodev09/react-native-true-sheet/navigation/expo-router/mock' in your test setup.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Sheet: jest.Mock<import("react").ReactNode, [{
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}], any> & {
|
|
11
|
+
Screen: jest.Mock<null, [], any>;
|
|
12
|
+
Protected: jest.Mock<null, [], any>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Mock useTrueSheetNavigation hook for testing.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useTrueSheetNavigation: jest.Mock<TrueSheetNavigationProp<ParamListBase>, [], any>;
|
|
18
|
+
export { TrueSheetActions };
|
|
19
|
+
export type { TrueSheetActionType } from '../navigation/actions';
|
|
20
|
+
export type { DetentInfoEventPayload, PositionChangeEventPayload } from '../TrueSheet.types';
|
|
21
|
+
export type { TrueSheetNavigationEventMap, TrueSheetNavigationHelpers, TrueSheetNavigationOptions, TrueSheetNavigationProp, TrueSheetNavigationState, TrueSheetScreenProps, } from '../navigation/types';
|
|
22
|
+
//# sourceMappingURL=navigationExpoRouter.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import type { TrueSheetProps, PositionChangeEventPayload } from '../TrueSheet.types';
|
|
5
|
+
interface TrueSheetState {
|
|
6
|
+
shouldRenderNativeView: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface MockReanimatedTrueSheetContextValue {
|
|
9
|
+
animatedPosition: SharedValue<number>;
|
|
10
|
+
animatedIndex: SharedValue<number>;
|
|
11
|
+
animatedDetent: SharedValue<number>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Mock ReanimatedTrueSheet component for testing.
|
|
15
|
+
* Import from '@lodev09/react-native-true-sheet/reanimated/mock' in your test setup.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ReanimatedTrueSheet extends React.Component<TrueSheetProps, TrueSheetState> {
|
|
18
|
+
static instances: Record<string, ReanimatedTrueSheet>;
|
|
19
|
+
static dismiss: jest.Mock<Promise<void>, [_name: string, _animated?: boolean | undefined], any>;
|
|
20
|
+
static dismissStack: jest.Mock<Promise<void>, [_name: string, _animated?: boolean | undefined], any>;
|
|
21
|
+
static present: jest.Mock<Promise<void>, [_name: string, _index?: number | undefined, _animated?: boolean | undefined], any>;
|
|
22
|
+
static resize: jest.Mock<Promise<void>, [_name: string, _index: number], any>;
|
|
23
|
+
dismiss: jest.Mock<Promise<void>, [_animated?: boolean | undefined], any>;
|
|
24
|
+
dismissStack: jest.Mock<Promise<void>, [_animated?: boolean | undefined], any>;
|
|
25
|
+
present: jest.Mock<Promise<void>, [_index?: number | undefined, _animated?: boolean | undefined], any>;
|
|
26
|
+
resize: jest.Mock<Promise<void>, [_index: number], any>;
|
|
27
|
+
componentDidMount(): void;
|
|
28
|
+
componentWillUnmount(): void;
|
|
29
|
+
private renderHeader;
|
|
30
|
+
private renderFooter;
|
|
31
|
+
render(): React.CElement<import("react-native").ViewProps, View>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Mock ReanimatedTrueSheetProvider for testing.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ReanimatedTrueSheetProvider({ children }: {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
}): React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Mock useReanimatedTrueSheet hook for testing.
|
|
41
|
+
*/
|
|
42
|
+
export declare const useReanimatedTrueSheet: jest.Mock<MockReanimatedTrueSheetContextValue, [], any>;
|
|
43
|
+
/**
|
|
44
|
+
* Mock useReanimatedPositionChangeHandler hook for testing.
|
|
45
|
+
*/
|
|
46
|
+
export declare const useReanimatedPositionChangeHandler: jest.Mock<jest.Mock<any, any, any>, [_handler: (payload: PositionChangeEventPayload) => void, _dependencies?: unknown[] | undefined], any>;
|
|
47
|
+
export {};
|
|
48
|
+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C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,2DACxB,0BAA0B,KAAK,IAAI,8CACzD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NavigatorArgs } from 'standard-navigation';
|
|
2
|
+
import type { TrueSheetNavigationOptions, TrueSheetNavigatorContentExtraProps, TrueSheetStandardEventMap } from './types';
|
|
3
|
+
export type TrueSheetNavigatorContentProps = NavigatorArgs<TrueSheetNavigationOptions, TrueSheetStandardEventMap> & TrueSheetNavigatorContentExtraProps;
|
|
4
|
+
export declare const TrueSheetNavigatorContent: ({ routes, dispatch, descriptors, emitter, }: TrueSheetNavigatorContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=TrueSheetNavigatorContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetNavigatorContent.d.ts","sourceRoot":"","sources":["../../../../src/navigation/TrueSheetNavigatorContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EACV,0BAA0B,EAC1B,mCAAmC,EACnC,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAkBjB,MAAM,MAAM,8BAA8B,GAAG,aAAa,CACxD,0BAA0B,EAC1B,yBAAyB,CAC1B,GACC,mCAAmC,CAAC;AAEtC,eAAO,MAAM,yBAAyB,GAAI,6CAKvC,8BAA8B,4CAsEhC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export type TrueSheetActionType = {
|
|
2
|
+
type: 'PUSH';
|
|
3
|
+
payload: {
|
|
4
|
+
name: string;
|
|
5
|
+
params?: object;
|
|
6
|
+
};
|
|
7
|
+
source?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'POP';
|
|
11
|
+
payload: {
|
|
12
|
+
count: number;
|
|
13
|
+
};
|
|
14
|
+
source?: string;
|
|
15
|
+
target?: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'POP_TO';
|
|
18
|
+
payload: {
|
|
19
|
+
name: string;
|
|
20
|
+
params?: object;
|
|
21
|
+
merge?: boolean;
|
|
22
|
+
};
|
|
23
|
+
source?: string;
|
|
24
|
+
target?: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'POP_TO_TOP';
|
|
27
|
+
source?: string;
|
|
28
|
+
target?: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'REPLACE';
|
|
31
|
+
payload: {
|
|
32
|
+
name: string;
|
|
33
|
+
params?: object;
|
|
34
|
+
};
|
|
35
|
+
source?: string;
|
|
36
|
+
target?: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'GO_BACK';
|
|
39
|
+
source?: string;
|
|
40
|
+
target?: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'RESIZE';
|
|
43
|
+
index: number;
|
|
44
|
+
source?: string;
|
|
45
|
+
target?: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'DISMISS';
|
|
48
|
+
source?: string;
|
|
49
|
+
target?: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'REMOVE';
|
|
52
|
+
source?: string;
|
|
53
|
+
target?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Action creators for the TrueSheet navigator.
|
|
57
|
+
* Plain objects matching `StackActions` shapes, plus sheet-specific actions.
|
|
58
|
+
*/
|
|
59
|
+
export declare const TrueSheetActions: {
|
|
60
|
+
push: (name: string, params?: object) => TrueSheetActionType;
|
|
61
|
+
pop: (count?: number) => TrueSheetActionType;
|
|
62
|
+
popTo: (name: string, params?: object, options?: {
|
|
63
|
+
merge?: boolean;
|
|
64
|
+
}) => TrueSheetActionType;
|
|
65
|
+
popToTop: () => TrueSheetActionType;
|
|
66
|
+
replace: (name: string, params?: object) => TrueSheetActionType;
|
|
67
|
+
resize: (index: number) => TrueSheetActionType;
|
|
68
|
+
dismiss: () => TrueSheetActionType;
|
|
69
|
+
remove: () => TrueSheetActionType;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/navigation/actions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAC3B;IACE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,gBAAgB;iBACd,MAAM,WAAW,MAAM,KAAG,mBAAmB;kBAI7C,MAAM,KAAO,mBAAmB;kBAI/B,MAAM,WAAW,MAAM,YAAY;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAG,mBAAmB;oBAI5E,mBAAmB;oBACjB,MAAM,WAAW,MAAM,KAAG,mBAAmB;oBAI7C,MAAM,KAAG,mBAAmB;mBAC/B,mBAAmB;kBACpB,mBAAmB;CAChC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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>;
|
|
14
|
+
//# sourceMappingURL=createTrueSheetRouter.d.ts.map
|
|
@@ -0,0 +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"}
|