@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
package/ios/utils/LayoutUtil.mm
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import "LayoutUtil.h"
|
|
12
|
-
|
|
13
|
-
@implementation LayoutUtil
|
|
14
|
-
|
|
15
|
-
+ (void)pinView:(UIView *)view toParentView:(UIView *)parentView edges:(UIRectEdge)edges {
|
|
16
|
-
[self pinView:view toParentView:parentView edges:edges height:0];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
+ (void)pinView:(UIView *)view toParentView:(UIView *)parentView edges:(UIRectEdge)edges height:(CGFloat)height {
|
|
20
|
-
view.translatesAutoresizingMaskIntoConstraints = NO;
|
|
21
|
-
|
|
22
|
-
if (edges & UIRectEdgeTop) {
|
|
23
|
-
[view.topAnchor constraintEqualToAnchor:parentView.topAnchor].active = YES;
|
|
24
|
-
}
|
|
25
|
-
if (edges & UIRectEdgeBottom) {
|
|
26
|
-
[view.bottomAnchor constraintEqualToAnchor:parentView.bottomAnchor].active = YES;
|
|
27
|
-
}
|
|
28
|
-
if (edges & UIRectEdgeLeft) {
|
|
29
|
-
[view.leadingAnchor constraintEqualToAnchor:parentView.leadingAnchor].active = YES;
|
|
30
|
-
}
|
|
31
|
-
if (edges & UIRectEdgeRight) {
|
|
32
|
-
[view.trailingAnchor constraintEqualToAnchor:parentView.trailingAnchor].active = YES;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Apply height constraint if provided
|
|
36
|
-
if (height > 0) {
|
|
37
|
-
[view.heightAnchor constraintEqualToConstant:height].active = YES;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
+ (void)unpinView:(UIView *)view {
|
|
42
|
-
if (!view)
|
|
43
|
-
return;
|
|
44
|
-
view.translatesAutoresizingMaskIntoConstraints = YES;
|
|
45
|
-
[view removeConstraints:view.constraints];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@end
|
|
49
|
-
|
|
50
|
-
#endif
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
6
|
-
const GRABBER_DEFAULT_WIDTH = 32;
|
|
7
|
-
|
|
8
|
-
// M3 spec: #49454F 0.4 alpha
|
|
9
|
-
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
10
|
-
/**
|
|
11
|
-
* Grabber component.
|
|
12
|
-
* Used by defualt for Android but feel free to re-use.
|
|
13
|
-
*/
|
|
14
|
-
export const TrueSheetGrabber = props => {
|
|
15
|
-
const {
|
|
16
|
-
visible = true,
|
|
17
|
-
color = GRABBER_DEFAULT_COLOR,
|
|
18
|
-
width = GRABBER_DEFAULT_WIDTH,
|
|
19
|
-
height = GRABBER_DEFAULT_HEIGHT,
|
|
20
|
-
topOffset = 0,
|
|
21
|
-
style
|
|
22
|
-
} = props;
|
|
23
|
-
if (!visible) return null;
|
|
24
|
-
return /*#__PURE__*/_jsx(View, {
|
|
25
|
-
style: [styles.wrapper, style, {
|
|
26
|
-
height: GRABBER_DEFAULT_HEIGHT * 4,
|
|
27
|
-
top: topOffset
|
|
28
|
-
}],
|
|
29
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
30
|
-
style: [styles.grabber, {
|
|
31
|
-
height,
|
|
32
|
-
width,
|
|
33
|
-
backgroundColor: color
|
|
34
|
-
}]
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
const styles = StyleSheet.create({
|
|
39
|
-
wrapper: {
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
alignSelf: 'center',
|
|
42
|
-
paddingHorizontal: 12,
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
zIndex: 9999
|
|
46
|
-
},
|
|
47
|
-
grabber: {
|
|
48
|
-
borderRadius: GRABBER_DEFAULT_HEIGHT / 2
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=TrueSheetGrabber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","View","jsx","_jsx","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","styles","wrapper","top","children","grabber","backgroundColor","create","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAyD,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjG,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACEN,IAAA,CAACF,IAAI;IAACa,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAEF,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEa,GAAG,EAAEJ;IAAU,CAAC,CAAE;IAAAK,QAAA,eAC3Ff,IAAA,CAACF,IAAI;MAACa,KAAK,EAAE,CAACC,MAAM,CAACI,OAAO,EAAE;QAAEP,MAAM;QAAED,KAAK;QAAES,eAAe,EAAEV;MAAM,CAAC;IAAE,CAAE;EAAC,CACxE,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAGf,UAAU,CAACqB,MAAM,CAAC;EAC/BL,OAAO,EAAE;IACPM,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE;EACV,CAAC;EACDR,OAAO,EAAE;IACPS,YAAY,EAAExB,sBAAsB,GAAG;EACzC;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
-
export interface TrueSheetGrabberProps {
|
|
3
|
-
/**
|
|
4
|
-
* Is grabber visible.
|
|
5
|
-
* @default true
|
|
6
|
-
*/
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Optional style that overrides the default style.
|
|
10
|
-
*/
|
|
11
|
-
style?: StyleProp<ViewStyle>;
|
|
12
|
-
/**
|
|
13
|
-
* Grabber color according to M3 specs.
|
|
14
|
-
* @default rgba(73,69,79,0.4)
|
|
15
|
-
*/
|
|
16
|
-
color?: ColorValue;
|
|
17
|
-
/**
|
|
18
|
-
* Grabber height according to M3 specs.
|
|
19
|
-
* @default 4
|
|
20
|
-
*/
|
|
21
|
-
height?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Grabber top position offset.
|
|
24
|
-
*
|
|
25
|
-
* @default 6
|
|
26
|
-
*/
|
|
27
|
-
topOffset?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Grabber width according to M3 specs.
|
|
30
|
-
* @default 32
|
|
31
|
-
*/
|
|
32
|
-
width?: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Grabber component.
|
|
36
|
-
* Used by defualt for Android but feel free to re-use.
|
|
37
|
-
*/
|
|
38
|
-
export declare const TrueSheetGrabber: (props: TrueSheetGrabberProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
-
//# sourceMappingURL=TrueSheetGrabber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQjG,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,mDAiB5D,CAAC"}
|
package/src/TrueSheetGrabber.tsx
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, View, type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
4
|
-
const GRABBER_DEFAULT_WIDTH = 32;
|
|
5
|
-
|
|
6
|
-
// M3 spec: #49454F 0.4 alpha
|
|
7
|
-
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
8
|
-
|
|
9
|
-
export interface TrueSheetGrabberProps {
|
|
10
|
-
/**
|
|
11
|
-
* Is grabber visible.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
visible?: boolean;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Optional style that overrides the default style.
|
|
18
|
-
*/
|
|
19
|
-
style?: StyleProp<ViewStyle>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Grabber color according to M3 specs.
|
|
23
|
-
* @default rgba(73,69,79,0.4)
|
|
24
|
-
*/
|
|
25
|
-
color?: ColorValue;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Grabber height according to M3 specs.
|
|
29
|
-
* @default 4
|
|
30
|
-
*/
|
|
31
|
-
height?: number;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Grabber top position offset.
|
|
35
|
-
*
|
|
36
|
-
* @default 6
|
|
37
|
-
*/
|
|
38
|
-
topOffset?: number;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Grabber width according to M3 specs.
|
|
42
|
-
* @default 32
|
|
43
|
-
*/
|
|
44
|
-
width?: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Grabber component.
|
|
49
|
-
* Used by defualt for Android but feel free to re-use.
|
|
50
|
-
*/
|
|
51
|
-
export const TrueSheetGrabber = (props: TrueSheetGrabberProps) => {
|
|
52
|
-
const {
|
|
53
|
-
visible = true,
|
|
54
|
-
color = GRABBER_DEFAULT_COLOR,
|
|
55
|
-
width = GRABBER_DEFAULT_WIDTH,
|
|
56
|
-
height = GRABBER_DEFAULT_HEIGHT,
|
|
57
|
-
topOffset = 0,
|
|
58
|
-
style,
|
|
59
|
-
} = props;
|
|
60
|
-
|
|
61
|
-
if (!visible) return null;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<View style={[styles.wrapper, style, { height: GRABBER_DEFAULT_HEIGHT * 4, top: topOffset }]}>
|
|
65
|
-
<View style={[styles.grabber, { height, width, backgroundColor: color }]} />
|
|
66
|
-
</View>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const styles = StyleSheet.create({
|
|
71
|
-
wrapper: {
|
|
72
|
-
position: 'absolute',
|
|
73
|
-
alignSelf: 'center',
|
|
74
|
-
paddingHorizontal: 12,
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
justifyContent: 'center',
|
|
77
|
-
zIndex: 9999,
|
|
78
|
-
},
|
|
79
|
-
grabber: {
|
|
80
|
-
borderRadius: GRABBER_DEFAULT_HEIGHT / 2,
|
|
81
|
-
},
|
|
82
|
-
});
|
package/src/__mocks__/index.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
// Mock TrueSheet class component
|
|
5
|
-
export class TrueSheet extends React.Component {
|
|
6
|
-
static instances = {};
|
|
7
|
-
|
|
8
|
-
// Static methods
|
|
9
|
-
static dismiss = jest.fn((name) => Promise.resolve());
|
|
10
|
-
static present = jest.fn((name, index = 0) => Promise.resolve());
|
|
11
|
-
static resize = jest.fn((name, index) => Promise.resolve());
|
|
12
|
-
|
|
13
|
-
// Instance methods
|
|
14
|
-
dismiss = jest.fn(() => Promise.resolve());
|
|
15
|
-
present = jest.fn((index = 0) => Promise.resolve());
|
|
16
|
-
resize = jest.fn((index) => Promise.resolve());
|
|
17
|
-
|
|
18
|
-
componentDidMount() {
|
|
19
|
-
const { name } = this.props;
|
|
20
|
-
if (name) {
|
|
21
|
-
TrueSheet.instances[name] = this;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
componentWillUnmount() {
|
|
26
|
-
const { name } = this.props;
|
|
27
|
-
if (name) {
|
|
28
|
-
delete TrueSheet.instances[name];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
render() {
|
|
33
|
-
const { children, footer, style, ...rest } = this.props;
|
|
34
|
-
return (
|
|
35
|
-
<View style={style} {...rest}>
|
|
36
|
-
{children}
|
|
37
|
-
{footer}
|
|
38
|
-
</View>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Mock ReanimatedTrueSheet
|
|
44
|
-
export class ReanimatedTrueSheet extends TrueSheet {
|
|
45
|
-
render() {
|
|
46
|
-
return <TrueSheet {...this.props} />;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Mock TrueSheetGrabber
|
|
51
|
-
export const TrueSheetGrabber = ({ style, ...props }) => (
|
|
52
|
-
<View style={style} {...props} testID="true-sheet-grabber" />
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
// Mock ReanimatedTrueSheetProvider
|
|
56
|
-
export const ReanimatedTrueSheetProvider = ({ children }) => <>{children}</>;
|
|
57
|
-
|
|
58
|
-
// Mock hooks
|
|
59
|
-
export const useReanimatedTrueSheet = jest.fn(() => ({
|
|
60
|
-
animatedPosition: { value: 0 },
|
|
61
|
-
animatedIndex: { value: -1 },
|
|
62
|
-
}));
|
|
63
|
-
|
|
64
|
-
export const useReanimatedPositionChangeHandler = jest.fn((callback) => jest.fn());
|
|
65
|
-
|
|
66
|
-
// Re-export types (these will be no-ops in JS but useful for TS consumers)
|
|
67
|
-
export * from '../TrueSheet.types';
|