@lodev09/react-native-true-sheet 4.0.0-beta.0 → 4.0.0-beta.10
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 +62 -30
- package/RNTrueSheet.podspec +10 -2
- package/android/build.gradle +24 -2
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +189 -47
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +7 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +401 -19
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +18 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +145 -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/TrueSheetOverlayView.kt +106 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayViewManager.kt +45 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +6 -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 +63 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +564 -226
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +1399 -598
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +161 -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 +375 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +299 -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/TrueSheetOverlayRootView.kt +137 -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 +127 -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 +42 -0
- package/android/src/main/jni/CMakeLists.txt +63 -0
- package/android/src/main/jni/TrueSheetSpec.h +20 -0
- package/android/src/main/jni/TrueSheetStateUpdater.cpp +96 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +16 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +68 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +33 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +39 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +24 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +63 -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/TrueSheetLayoutUtils.h +46 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewComponentDescriptor.h +21 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.cpp +17 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.h +36 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +30 -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 +88 -6
- package/ios/TrueSheetContainerView.mm +278 -21
- package/ios/TrueSheetContentView.h +54 -1
- package/ios/TrueSheetContentView.mm +371 -47
- package/ios/TrueSheetFooterView.h +33 -2
- package/ios/TrueSheetFooterView.mm +187 -35
- package/ios/{events/OnWillDismissEvent.h → TrueSheetHeaderView.h} +10 -7
- package/ios/TrueSheetHeaderView.mm +64 -0
- package/ios/TrueSheetModule.h +2 -7
- package/ios/TrueSheetModule.mm +98 -20
- package/ios/TrueSheetOverlayView.h +32 -0
- package/ios/TrueSheetOverlayView.mm +161 -0
- package/ios/TrueSheetPeekView.h +32 -0
- package/ios/TrueSheetPeekView.mm +99 -0
- package/ios/TrueSheetView.h +7 -15
- package/ios/TrueSheetView.mm +775 -215
- package/ios/TrueSheetViewController.h +94 -16
- package/ios/TrueSheetViewController.mm +1316 -331
- 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 +188 -0
- package/ios/core/TrueSheetKeyboardObserver.h +39 -0
- package/ios/core/TrueSheetKeyboardObserver.mm +112 -0
- package/ios/core/TrueSheetOverlayContainerView.h +31 -0
- package/ios/core/TrueSheetOverlayContainerView.mm +35 -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 +42 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +79 -0
- package/ios/events/TrueSheetStateEvents.h +35 -0
- package/ios/events/TrueSheetStateEvents.mm +49 -0
- package/ios/tvos/TrueSheetStubs.mm +166 -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/utils/UIView+ScrollEdgeInteraction.h +26 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +84 -0
- package/ios/utils/WindowUtil.mm +17 -1
- package/lib/module/TrueSheet.js +349 -74
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +1270 -0
- package/lib/module/TrueSheet.web.js.map +1 -0
- package/lib/module/TrueSheetOverlay.js +30 -0
- package/lib/module/TrueSheetOverlay.js.map +1 -0
- package/lib/module/TrueSheetOverlay.web.js +35 -0
- package/lib/module/TrueSheetOverlay.web.js.map +1 -0
- package/lib/module/TrueSheetPeek.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/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/lib/module/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +110 -18
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks/index.js +103 -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/base-types.js +2 -0
- package/lib/module/navigation/base-types.js.map +1 -0
- package/lib/module/navigation/createTrueSheetRouter.js +157 -0
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/expo-router/base-types.js +2 -0
- package/lib/module/navigation/expo-router/base-types.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +50 -0
- package/lib/module/navigation/expo-router/index.js.map +1 -0
- package/lib/module/navigation/expo-router/types.js +4 -0
- package/lib/module/navigation/expo-router/types.js.map +1 -0
- package/lib/module/navigation/index.js +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 +69 -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 +19 -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 +1342 -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 +57 -14
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +535 -55
- 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/TrueSheetOverlay.d.ts +8 -0
- package/lib/typescript/src/TrueSheetOverlay.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetOverlay.web.d.ts +8 -0
- package/lib/typescript/src/TrueSheetOverlay.web.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetPeek.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/TrueSheetOverlayViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.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 +71 -16
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/index.d.ts +47 -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/base-types.d.ts +9 -0
- package/lib/typescript/src/navigation/base-types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +3 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/base-types.d.ts +8 -0
- package/lib/typescript/src/navigation/expo-router/base-types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts +37 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/types.d.ts +44 -0
- package/lib/typescript/src/navigation/expo-router/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +45 -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 +34 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
- package/lib/typescript/src/navigation/types.d.ts +213 -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 +14 -0
- package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/context.d.ts +54 -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 +234 -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 +104 -37
- package/react-native.config.js +10 -2
- package/src/TrueSheet.tsx +424 -70
- package/src/TrueSheet.types.ts +602 -72
- package/src/TrueSheet.web.tsx +1437 -0
- package/src/TrueSheetOverlay.tsx +24 -0
- package/src/TrueSheetOverlay.web.tsx +33 -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/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/src/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +110 -18
- package/src/index.ts +3 -2
- package/src/mocks/index.ts +96 -0
- package/src/mocks/navigation.ts +79 -0
- package/src/mocks/navigationExpoRouter.ts +41 -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/base-types.ts +20 -0
- package/src/navigation/createTrueSheetRouter.ts +194 -0
- package/src/navigation/expo-router/base-types.ts +18 -0
- package/src/navigation/expo-router/index.ts +90 -0
- package/src/navigation/expo-router/types.ts +116 -0
- package/src/navigation/index.ts +80 -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 +102 -0
- package/src/navigation/types.ts +302 -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 +24 -0
- package/src/web/vaul/context.ts +102 -0
- package/src/web/vaul/helpers.ts +131 -0
- package/src/web/vaul/index.tsx +1785 -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.h +0 -26
- 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,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, useEffect } from 'react';
|
|
4
|
+
import { useWindowDimensions } from 'react-native';
|
|
5
|
+
import { TrueSheet } from '../TrueSheet';
|
|
6
|
+
import { useReanimatedTrueSheet } from "./ReanimatedTrueSheetProvider.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Reanimated-enabled version of TrueSheet for web that automatically syncs
|
|
10
|
+
* position with the provider's shared value.
|
|
11
|
+
* Must be used within a ReanimatedTrueSheetProvider.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { ReanimatedTrueSheet, ReanimatedTrueSheetProvider } from '@lodev09/react-native-true-sheet/reanimated'
|
|
16
|
+
*
|
|
17
|
+
* function MyScreen() {
|
|
18
|
+
* const sheetRef = useRef<TrueSheet>(null)
|
|
19
|
+
*
|
|
20
|
+
* return (
|
|
21
|
+
* <ReanimatedTrueSheetProvider>
|
|
22
|
+
* <View>
|
|
23
|
+
* <ReanimatedTrueSheet
|
|
24
|
+
* ref={sheetRef}
|
|
25
|
+
* detents={[0.25, 0.5, 1]}
|
|
26
|
+
* initialDetentIndex={1}
|
|
27
|
+
* >
|
|
28
|
+
* <Text>Sheet Content</Text>
|
|
29
|
+
* </ReanimatedTrueSheet>
|
|
30
|
+
* </View>
|
|
31
|
+
* </ReanimatedTrueSheetProvider>
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const ReanimatedTrueSheet = /*#__PURE__*/forwardRef((props, ref) => {
|
|
37
|
+
const {
|
|
38
|
+
onPositionChange,
|
|
39
|
+
detents = [0.5, 1],
|
|
40
|
+
...rest
|
|
41
|
+
} = props;
|
|
42
|
+
const {
|
|
43
|
+
height: windowHeight
|
|
44
|
+
} = useWindowDimensions();
|
|
45
|
+
const {
|
|
46
|
+
animatedPosition,
|
|
47
|
+
animatedIndex,
|
|
48
|
+
animatedDetent
|
|
49
|
+
} = useReanimatedTrueSheet();
|
|
50
|
+
|
|
51
|
+
// Reset animated values when component unmounts
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
return () => {
|
|
54
|
+
animatedPosition.value = windowHeight;
|
|
55
|
+
animatedIndex.value = -1;
|
|
56
|
+
animatedDetent.value = 0;
|
|
57
|
+
};
|
|
58
|
+
}, [windowHeight]);
|
|
59
|
+
const handlePositionChange = event => {
|
|
60
|
+
const {
|
|
61
|
+
position,
|
|
62
|
+
index,
|
|
63
|
+
detent
|
|
64
|
+
} = event.nativeEvent;
|
|
65
|
+
|
|
66
|
+
// Sync with provider's shared values
|
|
67
|
+
animatedPosition.value = position;
|
|
68
|
+
animatedIndex.value = index;
|
|
69
|
+
animatedDetent.value = detent;
|
|
70
|
+
|
|
71
|
+
// Call user's callback
|
|
72
|
+
onPositionChange?.(event);
|
|
73
|
+
};
|
|
74
|
+
return /*#__PURE__*/_jsx(TrueSheet, {
|
|
75
|
+
ref: ref,
|
|
76
|
+
detents: detents,
|
|
77
|
+
onPositionChange: handlePositionChange,
|
|
78
|
+
...rest
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=ReanimatedTrueSheet.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useEffect","useWindowDimensions","TrueSheet","useReanimatedTrueSheet","jsx","_jsx","ReanimatedTrueSheet","props","ref","onPositionChange","detents","rest","height","windowHeight","animatedPosition","animatedIndex","animatedDetent","value","handlePositionChange","event","position","index","detent","nativeEvent"],"sourceRoot":"../../../src","sources":["reanimated/ReanimatedTrueSheet.web.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7C,SAASC,mBAAmB,QAAQ,cAAc;AAElD,SAASC,SAAS,QAAQ,cAAc;AAExC,SAASC,sBAAsB,QAAQ,kCAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,gBAAGP,UAAU,CAAsC,CAACQ,KAAK,EAAEC,GAAG,KAAK;EACjG,MAAM;IAAEC,gBAAgB;IAAEC,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAAE,GAAGC;EAAK,CAAC,GAAGJ,KAAK;EAC/D,MAAM;IAAEK,MAAM,EAAEC;EAAa,CAAC,GAAGZ,mBAAmB,CAAC,CAAC;EAEtD,MAAM;IAAEa,gBAAgB;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAGb,sBAAsB,CAAC,CAAC;;EAEpF;EACAH,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACXc,gBAAgB,CAACG,KAAK,GAAGJ,YAAY;MACrCE,aAAa,CAACE,KAAK,GAAG,CAAC,CAAC;MACxBD,cAAc,CAACC,KAAK,GAAG,CAAC;IAC1B,CAAC;EACH,CAAC,EAAE,CAACJ,YAAY,CAAC,CAAC;EAElB,MAAMK,oBAAoB,GAAIC,KAA0B,IAAK;IAC3D,MAAM;MAAEC,QAAQ;MAAEC,KAAK;MAAEC;IAAO,CAAC,GAAGH,KAAK,CAACI,WAAW;;IAErD;IACAT,gBAAgB,CAACG,KAAK,GAAGG,QAAQ;IACjCL,aAAa,CAACE,KAAK,GAAGI,KAAK;IAC3BL,cAAc,CAACC,KAAK,GAAGK,MAAM;;IAE7B;IACAb,gBAAgB,GAAGU,KAAK,CAAC;EAC3B,CAAC;EAED,oBACEd,IAAA,CAACH,SAAS;IAACM,GAAG,EAAEA,GAAI;IAACE,OAAO,EAAEA,OAAQ;IAACD,gBAAgB,EAAES,oBAAqB;IAAA,GAAKP;EAAI,CAAG,CAAC;AAE/F,CAAC,CAAC","ignoreList":[]}
|
|
@@ -30,10 +30,12 @@ export const ReanimatedTrueSheetProvider = ({
|
|
|
30
30
|
} = useWindowDimensions();
|
|
31
31
|
const animatedPosition = useSharedValue(height);
|
|
32
32
|
const animatedIndex = useSharedValue(-1);
|
|
33
|
+
const animatedDetent = useSharedValue(0);
|
|
33
34
|
const value = useMemo(() => ({
|
|
34
35
|
animatedPosition,
|
|
35
|
-
animatedIndex
|
|
36
|
-
|
|
36
|
+
animatedIndex,
|
|
37
|
+
animatedDetent
|
|
38
|
+
}), [animatedPosition, animatedIndex, animatedDetent]);
|
|
37
39
|
return /*#__PURE__*/_jsx(ReanimatedTrueSheetContext.Provider, {
|
|
38
40
|
value: value,
|
|
39
41
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","useMemo","useWindowDimensions","useSharedValue","jsx","_jsx","ReanimatedTrueSheetContext","ReanimatedTrueSheetProvider","children","height","animatedPosition","animatedIndex","value","Provider","useReanimatedTrueSheet","context","Error"],"sourceRoot":"../../../src","sources":["reanimated/ReanimatedTrueSheetProvider.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC1E,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,cAAc,QAA0B,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","useWindowDimensions","useSharedValue","jsx","_jsx","ReanimatedTrueSheetContext","ReanimatedTrueSheetProvider","children","height","animatedPosition","animatedIndex","animatedDetent","value","Provider","useReanimatedTrueSheet","context","Error"],"sourceRoot":"../../../src","sources":["reanimated/ReanimatedTrueSheetProvider.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC1E,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,cAAc,QAA0B,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAmB3E,MAAMC,0BAA0B,gBAAGP,aAAa,CAAyC,IAAI,CAAC;AAM9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMQ,2BAA2B,GAAGA,CAAC;EAAEC;AAA2C,CAAC,KAAK;EAC7F,MAAM;IAAEC;EAAO,CAAC,GAAGP,mBAAmB,CAAC,CAAC;EACxC,MAAMQ,gBAAgB,GAAGP,cAAc,CAACM,MAAM,CAAC;EAC/C,MAAME,aAAa,GAAGR,cAAc,CAAC,CAAC,CAAC,CAAC;EACxC,MAAMS,cAAc,GAAGT,cAAc,CAAC,CAAC,CAAC;EAExC,MAAMU,KAAK,GAAGZ,OAAO,CACnB,OAAO;IAAES,gBAAgB;IAAEC,aAAa;IAAEC;EAAe,CAAC,CAAC,EAC3D,CAACF,gBAAgB,EAAEC,aAAa,EAAEC,cAAc,CAClD,CAAC;EAED,oBACEP,IAAA,CAACC,0BAA0B,CAACQ,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAL,QAAA,EAC/CA;EAAQ,CAC0B,CAAC;AAE1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,sBAAsB,GAAGA,CAAA,KAAuC;EAC3E,MAAMC,OAAO,GAAGhB,UAAU,CAACM,0BAA0B,CAAC;EAEtD,IAAI,CAACU,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,4EAA4E,GAC1E,2EACJ,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export * from
|
|
3
|
+
export * from './ReanimatedTrueSheet';
|
|
4
4
|
export * from "./ReanimatedTrueSheetProvider.js";
|
|
5
|
-
export * from
|
|
5
|
+
export * from './useReanimatedPositionChangeHandler';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["reanimated/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["reanimated/index.ts"],"mappings":";;AAAA,cAAc,uBAAuB;AACrC,cAAc,kCAA+B;AAC7C,cAAc,sCAAsC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Web implementation of useReanimatedPositionChangeHandler.
|
|
6
|
+
*
|
|
7
|
+
* Returns a simple callback wrapper. The worklet directive is ignored on web
|
|
8
|
+
* since there's no native UI thread.
|
|
9
|
+
*
|
|
10
|
+
* @param handler - The position change handler function
|
|
11
|
+
* @param _dependencies - Unused on web, kept for API compatibility
|
|
12
|
+
* @returns An event handler compatible with onPositionChange prop
|
|
13
|
+
*/
|
|
14
|
+
export const useReanimatedPositionChangeHandler = (handler, _dependencies = []) => {
|
|
15
|
+
const context = {};
|
|
16
|
+
return useCallback(event => {
|
|
17
|
+
handler(event.nativeEvent, context);
|
|
18
|
+
}, [handler]);
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=useReanimatedPositionChangeHandler.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useReanimatedPositionChangeHandler","handler","_dependencies","context","event","nativeEvent"],"sourceRoot":"../../../src","sources":["reanimated/useReanimatedPositionChangeHandler.web.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAQnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kCAAkC,GAAGA,CAChDC,OAA8B,EAC9BC,aAAwB,GAAG,EAAE,KAC1B;EACH,MAAMC,OAAgC,GAAG,CAAC,CAAC;EAE3C,OAAOJ,WAAW,CACfK,KAA0B,IAAK;IAC9BH,OAAO,CAACG,KAAK,CAACC,WAAW,EAAEF,OAAO,CAAC;EACrC,CAAC,EACD,CAACF,OAAO,CACV,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeTrueSheetModule.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeTrueSheetModule.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;AAsDlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_CORNER_RADIUS = 16;
|
|
4
|
+
export const DEFAULT_MAX_WIDTH = 640;
|
|
5
|
+
export const DEFAULT_FORM_SHEET_WIDTH = 580;
|
|
6
|
+
export const DEFAULT_FORM_SHEET_HEIGHT_RATIO = 0.5;
|
|
7
|
+
export const COLOR_SURFACE_CONTAINER_LOW_LIGHT = '#F7F2FA';
|
|
8
|
+
export const COLOR_SURFACE_CONTAINER_LOW_DARK = '#1D1B20';
|
|
9
|
+
export const DEFAULT_ANCHOR_OFFSET = 16;
|
|
10
|
+
export const DEFAULT_DETACHED_OFFSET = 16;
|
|
11
|
+
export const DEFAULT_GRABBER_COLOR_LIGHT = 'rgba(0, 0, 0, 0.3)';
|
|
12
|
+
export const DEFAULT_GRABBER_COLOR_DARK = 'rgba(255, 255, 255, 0.3)';
|
|
13
|
+
export const DEFAULT_GRABBER_WIDTH = 32;
|
|
14
|
+
export const DEFAULT_GRABBER_HEIGHT = 4;
|
|
15
|
+
export const DEFAULT_GRABBER_TOP_MARGIN = 8;
|
|
16
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_CORNER_RADIUS","DEFAULT_MAX_WIDTH","DEFAULT_FORM_SHEET_WIDTH","DEFAULT_FORM_SHEET_HEIGHT_RATIO","COLOR_SURFACE_CONTAINER_LOW_LIGHT","COLOR_SURFACE_CONTAINER_LOW_DARK","DEFAULT_ANCHOR_OFFSET","DEFAULT_DETACHED_OFFSET","DEFAULT_GRABBER_COLOR_LIGHT","DEFAULT_GRABBER_COLOR_DARK","DEFAULT_GRABBER_WIDTH","DEFAULT_GRABBER_HEIGHT","DEFAULT_GRABBER_TOP_MARGIN"],"sourceRoot":"../../../src","sources":["web/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,qBAAqB,GAAG,EAAE;AACvC,OAAO,MAAMC,iBAAiB,GAAG,GAAG;AACpC,OAAO,MAAMC,wBAAwB,GAAG,GAAG;AAC3C,OAAO,MAAMC,+BAA+B,GAAG,GAAG;AAClD,OAAO,MAAMC,iCAAiC,GAAG,SAAS;AAC1D,OAAO,MAAMC,gCAAgC,GAAG,SAAS;AACzD,OAAO,MAAMC,qBAAqB,GAAG,EAAE;AACvC,OAAO,MAAMC,uBAAuB,GAAG,EAAE;AACzC,OAAO,MAAMC,2BAA2B,GAAG,oBAAoB;AAC/D,OAAO,MAAMC,0BAA0B,GAAG,0BAA0B;AACpE,OAAO,MAAMC,qBAAqB,GAAG,EAAE;AACvC,OAAO,MAAMC,sBAAsB,GAAG,CAAC;AACvC,OAAO,MAAMC,0BAA0B,GAAG,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/// <reference lib="dom" />
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolves a React Native web `View` ref value to its underlying DOM element —
|
|
7
|
+
* RN-web refs expose the host DOM node directly.
|
|
8
|
+
*/
|
|
9
|
+
export const getDOMElement = view => view instanceof HTMLElement ? view : null;
|
|
10
|
+
//# sourceMappingURL=dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getDOMElement","view","HTMLElement"],"sourceRoot":"../../../src","sources":["web/dom.ts"],"mappings":";;AAAA;;AAGA;AACA;AACA;AACA;AACA,OAAO,MAAMA,aAAa,GAAIC,IAAiB,IAC7CA,IAAI,YAAYC,WAAW,GAAGD,IAAI,GAAG,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# vaul
|
|
2
|
+
|
|
3
|
+
Originally forked from [vaul](https://github.com/emilkowalski/vaul) by Emil Kowalski at `v1.1.2`. Upstream is unmaintained; maintained here as part of truesheet's web renderer.
|
|
4
|
+
|
|
5
|
+
Only external runtime dep: `@radix-ui/react-dialog`.
|
|
6
|
+
|
|
7
|
+
## License
|
|
8
|
+
|
|
9
|
+
vaul is MIT-licensed. See the [upstream LICENSE](https://github.com/emilkowalski/vaul/blob/main/LICENSE.md). Original copyright remains with Emil Kowalski.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function isMobileFirefox() {
|
|
4
|
+
const userAgent = navigator.userAgent;
|
|
5
|
+
return typeof window !== 'undefined' && (/Firefox/.test(userAgent) && /Mobile/.test(userAgent) ||
|
|
6
|
+
// Android Firefox
|
|
7
|
+
/FxiOS/.test(userAgent)) // iOS Firefox
|
|
8
|
+
;
|
|
9
|
+
}
|
|
10
|
+
export function isMac() {
|
|
11
|
+
return testPlatform(/^Mac/);
|
|
12
|
+
}
|
|
13
|
+
export function isIPhone() {
|
|
14
|
+
return testPlatform(/^iPhone/);
|
|
15
|
+
}
|
|
16
|
+
export function isSafari() {
|
|
17
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
18
|
+
}
|
|
19
|
+
export function isIPad() {
|
|
20
|
+
return testPlatform(/^iPad/) ||
|
|
21
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
22
|
+
isMac() && navigator.maxTouchPoints > 1;
|
|
23
|
+
}
|
|
24
|
+
export function isIOS() {
|
|
25
|
+
return isIPhone() || isIPad();
|
|
26
|
+
}
|
|
27
|
+
export function testPlatform(re) {
|
|
28
|
+
return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isMobileFirefox","userAgent","navigator","window","test","isMac","testPlatform","isIPhone","isSafari","isIPad","maxTouchPoints","isIOS","re","platform","undefined"],"sourceRoot":"../../../../src","sources":["web/vaul/browser.ts"],"mappings":";;AAAA,OAAO,SAASA,eAAeA,CAAA,EAAwB;EACrD,MAAMC,SAAS,GAAGC,SAAS,CAACD,SAAS;EACrC,OACE,OAAOE,MAAM,KAAK,WAAW,KAC3B,SAAS,CAACC,IAAI,CAACH,SAAS,CAAC,IAAI,QAAQ,CAACG,IAAI,CAACH,SAAS,CAAC;EAAK;EAC1D,OAAO,CAACG,IAAI,CAACH,SAAS,CAAC,CAAC,CAAC;AAAA;AAE/B;AAEA,OAAO,SAASI,KAAKA,CAAA,EAAwB;EAC3C,OAAOC,YAAY,CAAC,MAAM,CAAC;AAC7B;AAEA,OAAO,SAASC,QAAQA,CAAA,EAAwB;EAC9C,OAAOD,YAAY,CAAC,SAAS,CAAC;AAChC;AAEA,OAAO,SAASE,QAAQA,CAAA,EAAwB;EAC9C,OAAO,gCAAgC,CAACJ,IAAI,CAACF,SAAS,CAACD,SAAS,CAAC;AACnE;AAEA,OAAO,SAASQ,MAAMA,CAAA,EAAwB;EAC5C,OACEH,YAAY,CAAC,OAAO,CAAC;EACrB;EACCD,KAAK,CAAC,CAAC,IAAIH,SAAS,CAACQ,cAAc,GAAG,CAAE;AAE7C;AAEA,OAAO,SAASC,KAAKA,CAAA,EAAwB;EAC3C,OAAOJ,QAAQ,CAAC,CAAC,IAAIE,MAAM,CAAC,CAAC;AAC/B;AAEA,OAAO,SAASH,YAAYA,CAACM,EAAU,EAAuB;EAC5D,OAAO,OAAOT,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACD,SAAS,IAAI,IAAI,GAC5DU,EAAE,CAACR,IAAI,CAACD,MAAM,CAACD,SAAS,CAACW,QAAQ,CAAC,GAClCC,SAAS;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const TRANSITIONS = {
|
|
4
|
+
DURATION: 0.5,
|
|
5
|
+
EASE: [0.32, 0.72, 0, 1]
|
|
6
|
+
};
|
|
7
|
+
export const VELOCITY_THRESHOLD = 0.4;
|
|
8
|
+
export const DEFAULT_PEEK_HEIGHT = 150;
|
|
9
|
+
export const CLOSE_THRESHOLD = 0.25;
|
|
10
|
+
|
|
11
|
+
// Minimum downward pull (px) on a non-dismissible drawer at its first snap
|
|
12
|
+
// point before the release counts as a dismiss attempt.
|
|
13
|
+
export const DISMISS_ATTEMPT_THRESHOLD = 24;
|
|
14
|
+
export const SCROLL_LOCK_TIMEOUT = 100;
|
|
15
|
+
export const BORDER_RADIUS = 8;
|
|
16
|
+
export const NESTED_DISPLACEMENT = 16;
|
|
17
|
+
export const WINDOW_TOP_OFFSET = 26;
|
|
18
|
+
export const DRAG_CLASS = 'vaul-dragging';
|
|
19
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TRANSITIONS","DURATION","EASE","VELOCITY_THRESHOLD","DEFAULT_PEEK_HEIGHT","CLOSE_THRESHOLD","DISMISS_ATTEMPT_THRESHOLD","SCROLL_LOCK_TIMEOUT","BORDER_RADIUS","NESTED_DISPLACEMENT","WINDOW_TOP_OFFSET","DRAG_CLASS"],"sourceRoot":"../../../../src","sources":["web/vaul/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,WAAW,GAAG;EACzBC,QAAQ,EAAE,GAAG;EACbC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACzB,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,GAAG;AAErC,OAAO,MAAMC,mBAAmB,GAAG,GAAG;AAEtC,OAAO,MAAMC,eAAe,GAAG,IAAI;;AAEnC;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAG,EAAE;AAE3C,OAAO,MAAMC,mBAAmB,GAAG,GAAG;AAEtC,OAAO,MAAMC,aAAa,GAAG,CAAC;AAE9B,OAAO,MAAMC,mBAAmB,GAAG,EAAE;AAErC,OAAO,MAAMC,iBAAiB,GAAG,EAAE;AAEnC,OAAO,MAAMC,UAAU,GAAG,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export const DrawerContext = /*#__PURE__*/React.createContext({
|
|
5
|
+
drawerRef: {
|
|
6
|
+
current: null
|
|
7
|
+
},
|
|
8
|
+
overlayRef: {
|
|
9
|
+
current: null
|
|
10
|
+
},
|
|
11
|
+
onPress: () => {},
|
|
12
|
+
onRelease: () => {},
|
|
13
|
+
onDrag: () => {},
|
|
14
|
+
onTouchDrag: () => {},
|
|
15
|
+
onTouchRelease: () => {},
|
|
16
|
+
onNestedDrag: () => {},
|
|
17
|
+
onNestedOpenChange: () => {},
|
|
18
|
+
onNestedRelease: () => {},
|
|
19
|
+
openProp: undefined,
|
|
20
|
+
dismissible: false,
|
|
21
|
+
isOpen: false,
|
|
22
|
+
isDragging: false,
|
|
23
|
+
keyboardIsOpen: {
|
|
24
|
+
current: false
|
|
25
|
+
},
|
|
26
|
+
snapPointsOffset: null,
|
|
27
|
+
snapPoints: null,
|
|
28
|
+
handleOnly: false,
|
|
29
|
+
modal: false,
|
|
30
|
+
shouldFade: false,
|
|
31
|
+
activeSnapPoint: null,
|
|
32
|
+
onOpenChange: () => {},
|
|
33
|
+
setActiveSnapPoint: () => {},
|
|
34
|
+
closeDrawer: () => {},
|
|
35
|
+
direction: 'bottom',
|
|
36
|
+
shouldAnimate: {
|
|
37
|
+
current: true
|
|
38
|
+
},
|
|
39
|
+
shouldScaleBackground: false,
|
|
40
|
+
setBackgroundColorOnScale: true,
|
|
41
|
+
noBodyStyles: false,
|
|
42
|
+
container: null,
|
|
43
|
+
autoFocus: false,
|
|
44
|
+
onPositionChangeRef: {
|
|
45
|
+
current: undefined
|
|
46
|
+
},
|
|
47
|
+
setContentHeight: () => {},
|
|
48
|
+
detached: false,
|
|
49
|
+
detachedOffset: 0,
|
|
50
|
+
detachedRadius: 0
|
|
51
|
+
});
|
|
52
|
+
export const useDrawerContext = () => {
|
|
53
|
+
const context = React.useContext(DrawerContext);
|
|
54
|
+
if (!context) {
|
|
55
|
+
throw new Error('useDrawerContext must be used within a Drawer.Root');
|
|
56
|
+
}
|
|
57
|
+
return context;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","DrawerContext","createContext","drawerRef","current","overlayRef","onPress","onRelease","onDrag","onTouchDrag","onTouchRelease","onNestedDrag","onNestedOpenChange","onNestedRelease","openProp","undefined","dismissible","isOpen","isDragging","keyboardIsOpen","snapPointsOffset","snapPoints","handleOnly","modal","shouldFade","activeSnapPoint","onOpenChange","setActiveSnapPoint","closeDrawer","direction","shouldAnimate","shouldScaleBackground","setBackgroundColorOnScale","noBodyStyles","container","autoFocus","onPositionChangeRef","setContentHeight","detached","detachedOffset","detachedRadius","useDrawerContext","context","useContext","Error"],"sourceRoot":"../../../../src","sources":["web/vaul/context.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAwDzB,OAAO,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAqB;EACnEC,SAAS,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EAC5BC,UAAU,EAAE;IAAED,OAAO,EAAE;EAAK,CAAC;EAC7BE,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjBC,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EACnBC,MAAM,EAAEA,CAAA,KAAM,CAAC,CAAC;EAChBC,WAAW,EAAEA,CAAA,KAAM,CAAC,CAAC;EACrBC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;EACxBC,YAAY,EAAEA,CAAA,KAAM,CAAC,CAAC;EACtBC,kBAAkB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC5BC,eAAe,EAAEA,CAAA,KAAM,CAAC,CAAC;EACzBC,QAAQ,EAAEC,SAAS;EACnBC,WAAW,EAAE,KAAK;EAClBC,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,KAAK;EACjBC,cAAc,EAAE;IAAEf,OAAO,EAAE;EAAM,CAAC;EAClCgB,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE,IAAI;EAChBC,UAAU,EAAE,KAAK;EACjBC,KAAK,EAAE,KAAK;EACZC,UAAU,EAAE,KAAK;EACjBC,eAAe,EAAE,IAAI;EACrBC,YAAY,EAAEA,CAAA,KAAM,CAAC,CAAC;EACtBC,kBAAkB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC5BC,WAAW,EAAEA,CAAA,KAAM,CAAC,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,aAAa,EAAE;IAAE1B,OAAO,EAAE;EAAK,CAAC;EAChC2B,qBAAqB,EAAE,KAAK;EAC5BC,yBAAyB,EAAE,IAAI;EAC/BC,YAAY,EAAE,KAAK;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,KAAK;EAChBC,mBAAmB,EAAE;IAAEhC,OAAO,EAAEW;EAAU,CAAC;EAC3CsB,gBAAgB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC1BC,QAAQ,EAAE,KAAK;EACfC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAMC,OAAO,GAAG1C,KAAK,CAAC2C,UAAU,CAAC1C,aAAa,CAAC;EAC/C,IAAI,CAACyC,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CAAC,oDAAoD,CAAC;EACvE;EACA,OAAOF,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// CSSStyleDeclaration has no string index signature, so dynamic camelCase
|
|
4
|
+
// keys are assigned through this writable-record view. Values include
|
|
5
|
+
// undefined: originals captured for unknown keys read back as undefined.
|
|
6
|
+
|
|
7
|
+
const cache = new WeakMap();
|
|
8
|
+
export function isInView(el) {
|
|
9
|
+
const rect = el.getBoundingClientRect();
|
|
10
|
+
if (!window.visualViewport) return false;
|
|
11
|
+
return rect.top >= 0 && rect.left >= 0 &&
|
|
12
|
+
// Need + 40 for safari detection
|
|
13
|
+
rect.bottom <= window.visualViewport.height - 40 && rect.right <= window.visualViewport.width;
|
|
14
|
+
}
|
|
15
|
+
export function set(el, styles, ignoreCache = false) {
|
|
16
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
|
17
|
+
let originalStyles = {};
|
|
18
|
+
const style = el.style;
|
|
19
|
+
Object.entries(styles).forEach(([key, value]) => {
|
|
20
|
+
if (key.startsWith('--')) {
|
|
21
|
+
el.style.setProperty(key, value);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
originalStyles[key] = style[key];
|
|
25
|
+
style[key] = value;
|
|
26
|
+
});
|
|
27
|
+
if (ignoreCache) return;
|
|
28
|
+
cache.set(el, originalStyles);
|
|
29
|
+
}
|
|
30
|
+
export function reset(el, prop) {
|
|
31
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
|
32
|
+
let originalStyles = cache.get(el);
|
|
33
|
+
if (!originalStyles) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const style = el.style;
|
|
37
|
+
if (prop) {
|
|
38
|
+
style[prop] = originalStyles[prop];
|
|
39
|
+
} else {
|
|
40
|
+
Object.entries(originalStyles).forEach(([key, value]) => {
|
|
41
|
+
style[key] = value;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export const isVertical = direction => {
|
|
46
|
+
switch (direction) {
|
|
47
|
+
case 'top':
|
|
48
|
+
case 'bottom':
|
|
49
|
+
return true;
|
|
50
|
+
case 'left':
|
|
51
|
+
case 'right':
|
|
52
|
+
return false;
|
|
53
|
+
default:
|
|
54
|
+
return direction;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export function getTranslate(element, direction) {
|
|
58
|
+
if (!element) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const style = window.getComputedStyle(element);
|
|
62
|
+
const transform =
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
style.transform || style.webkitTransform || style.mozTransform;
|
|
65
|
+
let mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
66
|
+
if (mat) {
|
|
67
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d
|
|
68
|
+
return parseFloat(mat[1].split(', ')[isVertical(direction) ? 13 : 12]);
|
|
69
|
+
}
|
|
70
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix
|
|
71
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
|
72
|
+
return mat ? parseFloat(mat[1].split(', ')[isVertical(direction) ? 5 : 4]) : null;
|
|
73
|
+
}
|
|
74
|
+
export function dampenValue(v) {
|
|
75
|
+
return 8 * (Math.log(v + 1) - 2);
|
|
76
|
+
}
|
|
77
|
+
export function assignStyle(element, style) {
|
|
78
|
+
if (!element) return () => {};
|
|
79
|
+
const prevStyle = element.style.cssText;
|
|
80
|
+
Object.assign(element.style, style);
|
|
81
|
+
return () => {
|
|
82
|
+
element.style.cssText = prevStyle;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Receives functions as arguments and returns a new function that calls all.
|
|
88
|
+
*/
|
|
89
|
+
export function chain(...fns) {
|
|
90
|
+
return (...args) => {
|
|
91
|
+
for (const fn of fns) {
|
|
92
|
+
if (typeof fn === 'function') {
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
fn(...args);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cache","WeakMap","isInView","el","rect","getBoundingClientRect","window","visualViewport","top","left","bottom","height","right","width","set","styles","ignoreCache","HTMLElement","originalStyles","style","Object","entries","forEach","key","value","startsWith","setProperty","reset","prop","get","isVertical","direction","getTranslate","element","getComputedStyle","transform","webkitTransform","mozTransform","mat","match","parseFloat","split","dampenValue","v","Math","log","assignStyle","prevStyle","cssText","assign","chain","fns","args","fn"],"sourceRoot":"../../../../src","sources":["web/vaul/helpers.ts"],"mappings":"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","ignoreList":[]}
|