@hanzogui/sheet 7.0.0 → 7.3.0
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 +40 -19
- package/dist/cjs/GestureDetectorWrapper.cjs +54 -0
- package/dist/cjs/GestureDetectorWrapper.native.js +58 -0
- package/dist/cjs/GestureDetectorWrapper.native.js.map +1 -0
- package/dist/cjs/GestureSheetContext.cjs +54 -0
- package/dist/cjs/GestureSheetContext.native.js +58 -0
- package/dist/cjs/GestureSheetContext.native.js.map +1 -0
- package/dist/cjs/Sheet.cjs +119 -0
- package/dist/cjs/Sheet.native.js +122 -0
- package/dist/cjs/Sheet.native.js.map +1 -0
- package/dist/cjs/SheetContext.cjs +34 -0
- package/dist/cjs/SheetContext.native.js +37 -0
- package/dist/cjs/SheetContext.native.js.map +1 -0
- package/dist/cjs/SheetController.cjs +73 -0
- package/dist/cjs/SheetController.native.js +79 -0
- package/dist/cjs/SheetController.native.js.map +1 -0
- package/dist/cjs/SheetImplementationCustom.cjs +589 -0
- package/dist/cjs/SheetImplementationCustom.native.js +615 -0
- package/dist/cjs/SheetImplementationCustom.native.js.map +1 -0
- package/dist/cjs/SheetScrollView.cjs +216 -0
- package/dist/cjs/SheetScrollView.native.js +223 -0
- package/dist/cjs/SheetScrollView.native.js.map +1 -0
- package/dist/cjs/constants.cjs +34 -0
- package/dist/cjs/constants.native.js +37 -0
- package/dist/cjs/constants.native.js.map +1 -0
- package/dist/cjs/contexts.cjs +44 -0
- package/dist/cjs/contexts.native.js +47 -0
- package/dist/cjs/contexts.native.js.map +1 -0
- package/dist/cjs/controller.cjs +31 -0
- package/dist/cjs/controller.native.js +34 -0
- package/dist/cjs/controller.native.js.map +1 -0
- package/dist/cjs/createSheet.cjs +190 -0
- package/dist/cjs/createSheet.native.js +200 -0
- package/dist/cjs/createSheet.native.js.map +1 -0
- package/dist/cjs/gestureState.cjs +41 -0
- package/dist/cjs/gestureState.native.js +44 -0
- package/dist/cjs/gestureState.native.js.map +1 -0
- package/dist/cjs/helpers.cjs +35 -0
- package/dist/cjs/helpers.native.js +39 -0
- package/dist/cjs/helpers.native.js.map +1 -0
- package/dist/cjs/index.cjs +30 -0
- package/dist/cjs/index.native.js +33 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/nativeSheet.cjs +96 -0
- package/dist/cjs/nativeSheet.native.js +106 -0
- package/dist/cjs/nativeSheet.native.js.map +1 -0
- package/dist/cjs/setupGestureHandler.cjs +52 -0
- package/dist/cjs/setupGestureHandler.native.js +55 -0
- package/dist/cjs/setupGestureHandler.native.js.map +1 -0
- package/dist/cjs/types.cjs +18 -0
- package/dist/cjs/types.native.js +21 -0
- package/dist/cjs/types.native.js.map +1 -0
- package/dist/cjs/useGestureHandlerPan.cjs +206 -0
- package/dist/cjs/useGestureHandlerPan.native.js +213 -0
- package/dist/cjs/useGestureHandlerPan.native.js.map +1 -0
- package/dist/cjs/useKeyboardControllerSheet.cjs +40 -0
- package/dist/cjs/useKeyboardControllerSheet.native.js +132 -0
- package/dist/cjs/useKeyboardControllerSheet.native.js.map +1 -0
- package/dist/cjs/useSheet.cjs +29 -0
- package/dist/cjs/useSheet.native.js +34 -0
- package/dist/cjs/useSheet.native.js.map +1 -0
- package/dist/cjs/useSheetController.cjs +52 -0
- package/dist/cjs/useSheetController.native.js +55 -0
- package/dist/cjs/useSheetController.native.js.map +1 -0
- package/dist/cjs/useSheetOffscreenSize.cjs +63 -0
- package/dist/cjs/useSheetOffscreenSize.native.js +70 -0
- package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -0
- package/dist/cjs/useSheetOpenState.cjs +52 -0
- package/dist/cjs/useSheetOpenState.native.js +58 -0
- package/dist/cjs/useSheetOpenState.native.js.map +1 -0
- package/dist/cjs/useSheetProviderProps.cjs +181 -0
- package/dist/cjs/useSheetProviderProps.native.js +196 -0
- package/dist/cjs/useSheetProviderProps.native.js.map +1 -0
- package/dist/cjs/useSheetScrollViewGestures.cjs +166 -0
- package/dist/cjs/useSheetScrollViewGestures.native.js +159 -0
- package/dist/cjs/useSheetScrollViewGestures.native.js.map +1 -0
- package/dist/esm/GestureDetectorWrapper.mjs +29 -0
- package/dist/esm/GestureDetectorWrapper.mjs.map +1 -0
- package/dist/esm/GestureDetectorWrapper.native.js +30 -0
- package/dist/esm/GestureDetectorWrapper.native.js.map +1 -0
- package/dist/esm/GestureSheetContext.mjs +28 -0
- package/dist/esm/GestureSheetContext.mjs.map +1 -0
- package/dist/esm/GestureSheetContext.native.js +29 -0
- package/dist/esm/GestureSheetContext.native.js.map +1 -0
- package/dist/esm/Sheet.mjs +89 -0
- package/dist/esm/Sheet.mjs.map +1 -0
- package/dist/esm/Sheet.native.js +89 -0
- package/dist/esm/Sheet.native.js.map +1 -0
- package/dist/esm/SheetContext.mjs +6 -0
- package/dist/esm/SheetContext.mjs.map +1 -0
- package/dist/esm/SheetContext.native.js +6 -0
- package/dist/esm/SheetContext.native.js.map +1 -0
- package/dist/esm/SheetController.mjs +37 -0
- package/dist/esm/SheetController.mjs.map +1 -0
- package/dist/esm/SheetController.native.js +40 -0
- package/dist/esm/SheetController.native.js.map +1 -0
- package/dist/esm/SheetImplementationCustom.mjs +552 -0
- package/dist/esm/SheetImplementationCustom.mjs.map +1 -0
- package/dist/esm/SheetImplementationCustom.native.js +572 -0
- package/dist/esm/SheetImplementationCustom.native.js.map +1 -0
- package/dist/esm/SheetScrollView.mjs +180 -0
- package/dist/esm/SheetScrollView.mjs.map +1 -0
- package/dist/esm/SheetScrollView.native.js +184 -0
- package/dist/esm/SheetScrollView.native.js.map +1 -0
- package/dist/esm/constants.mjs +6 -0
- package/dist/esm/constants.mjs.map +1 -0
- package/dist/esm/constants.native.js +6 -0
- package/dist/esm/constants.native.js.map +1 -0
- package/dist/esm/contexts.mjs +7 -0
- package/dist/esm/contexts.mjs.map +1 -0
- package/dist/esm/contexts.native.js +7 -0
- package/dist/esm/contexts.native.js.map +1 -0
- package/dist/esm/controller.mjs +4 -0
- package/dist/esm/controller.mjs.map +1 -0
- package/dist/esm/controller.native.js +4 -0
- package/dist/esm/controller.native.js.map +1 -0
- package/dist/esm/createSheet.mjs +165 -0
- package/dist/esm/createSheet.mjs.map +1 -0
- package/dist/esm/createSheet.native.js +172 -0
- package/dist/esm/createSheet.native.js.map +1 -0
- package/dist/esm/gestureState.mjs +13 -0
- package/dist/esm/gestureState.mjs.map +1 -0
- package/dist/esm/gestureState.native.js +13 -0
- package/dist/esm/gestureState.native.js.map +1 -0
- package/dist/esm/helpers.mjs +10 -0
- package/dist/esm/helpers.mjs.map +1 -0
- package/dist/esm/helpers.native.js +11 -0
- package/dist/esm/helpers.native.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +12 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +12 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/nativeSheet.mjs +70 -0
- package/dist/esm/nativeSheet.mjs.map +1 -0
- package/dist/esm/nativeSheet.native.js +77 -0
- package/dist/esm/nativeSheet.native.js.map +1 -0
- package/dist/esm/setupGestureHandler.mjs +26 -0
- package/dist/esm/setupGestureHandler.mjs.map +1 -0
- package/dist/esm/setupGestureHandler.native.js +26 -0
- package/dist/esm/setupGestureHandler.native.js.map +1 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/types.mjs.map +1 -0
- package/dist/esm/types.native.js +2 -0
- package/dist/esm/types.native.js.map +1 -0
- package/dist/esm/useGestureHandlerPan.mjs +181 -0
- package/dist/esm/useGestureHandlerPan.mjs.map +1 -0
- package/dist/esm/useGestureHandlerPan.native.js +185 -0
- package/dist/esm/useGestureHandlerPan.native.js.map +1 -0
- package/dist/esm/useKeyboardControllerSheet.mjs +15 -0
- package/dist/esm/useKeyboardControllerSheet.mjs.map +1 -0
- package/dist/esm/useKeyboardControllerSheet.native.js +104 -0
- package/dist/esm/useKeyboardControllerSheet.native.js.map +1 -0
- package/dist/esm/useSheet.mjs +4 -0
- package/dist/esm/useSheet.mjs.map +1 -0
- package/dist/esm/useSheet.native.js +6 -0
- package/dist/esm/useSheet.native.js.map +1 -0
- package/dist/esm/useSheetController.mjs +15 -0
- package/dist/esm/useSheetController.mjs.map +1 -0
- package/dist/esm/useSheetController.native.js +15 -0
- package/dist/esm/useSheetController.native.js.map +1 -0
- package/dist/esm/useSheetOffscreenSize.mjs +38 -0
- package/dist/esm/useSheetOffscreenSize.mjs.map +1 -0
- package/dist/esm/useSheetOffscreenSize.native.js +42 -0
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -0
- package/dist/esm/useSheetOpenState.mjs +27 -0
- package/dist/esm/useSheetOpenState.mjs.map +1 -0
- package/dist/esm/useSheetOpenState.native.js +30 -0
- package/dist/esm/useSheetOpenState.native.js.map +1 -0
- package/dist/esm/useSheetProviderProps.mjs +145 -0
- package/dist/esm/useSheetProviderProps.mjs.map +1 -0
- package/dist/esm/useSheetProviderProps.native.js +157 -0
- package/dist/esm/useSheetProviderProps.native.js.map +1 -0
- package/dist/esm/useSheetScrollViewGestures.mjs +141 -0
- package/dist/esm/useSheetScrollViewGestures.mjs.map +1 -0
- package/dist/esm/useSheetScrollViewGestures.native.js +131 -0
- package/dist/esm/useSheetScrollViewGestures.native.js.map +1 -0
- package/dist/jsx/GestureDetectorWrapper.mjs +29 -0
- package/dist/jsx/GestureDetectorWrapper.mjs.map +1 -0
- package/dist/jsx/GestureDetectorWrapper.native.js +58 -0
- package/dist/jsx/GestureDetectorWrapper.native.js.map +1 -0
- package/dist/jsx/GestureSheetContext.mjs +28 -0
- package/dist/jsx/GestureSheetContext.mjs.map +1 -0
- package/dist/jsx/GestureSheetContext.native.js +58 -0
- package/dist/jsx/GestureSheetContext.native.js.map +1 -0
- package/dist/jsx/Sheet.mjs +89 -0
- package/dist/jsx/Sheet.mjs.map +1 -0
- package/dist/jsx/Sheet.native.js +122 -0
- package/dist/jsx/Sheet.native.js.map +1 -0
- package/dist/jsx/SheetContext.mjs +6 -0
- package/dist/jsx/SheetContext.mjs.map +1 -0
- package/dist/jsx/SheetContext.native.js +37 -0
- package/dist/jsx/SheetContext.native.js.map +1 -0
- package/dist/jsx/SheetController.mjs +37 -0
- package/dist/jsx/SheetController.mjs.map +1 -0
- package/dist/jsx/SheetController.native.js +79 -0
- package/dist/jsx/SheetController.native.js.map +1 -0
- package/dist/jsx/SheetImplementationCustom.mjs +552 -0
- package/dist/jsx/SheetImplementationCustom.mjs.map +1 -0
- package/dist/jsx/SheetImplementationCustom.native.js +615 -0
- package/dist/jsx/SheetImplementationCustom.native.js.map +1 -0
- package/dist/jsx/SheetScrollView.mjs +180 -0
- package/dist/jsx/SheetScrollView.mjs.map +1 -0
- package/dist/jsx/SheetScrollView.native.js +223 -0
- package/dist/jsx/SheetScrollView.native.js.map +1 -0
- package/dist/jsx/constants.mjs +6 -0
- package/dist/jsx/constants.mjs.map +1 -0
- package/dist/jsx/constants.native.js +37 -0
- package/dist/jsx/constants.native.js.map +1 -0
- package/dist/jsx/contexts.mjs +7 -0
- package/dist/jsx/contexts.mjs.map +1 -0
- package/dist/jsx/contexts.native.js +47 -0
- package/dist/jsx/contexts.native.js.map +1 -0
- package/dist/jsx/controller.mjs +4 -0
- package/dist/jsx/controller.mjs.map +1 -0
- package/dist/jsx/controller.native.js +34 -0
- package/dist/jsx/controller.native.js.map +1 -0
- package/dist/jsx/createSheet.mjs +165 -0
- package/dist/jsx/createSheet.mjs.map +1 -0
- package/dist/jsx/createSheet.native.js +200 -0
- package/dist/jsx/createSheet.native.js.map +1 -0
- package/dist/jsx/gestureState.mjs +13 -0
- package/dist/jsx/gestureState.mjs.map +1 -0
- package/dist/jsx/gestureState.native.js +44 -0
- package/dist/jsx/gestureState.native.js.map +1 -0
- package/dist/jsx/helpers.mjs +10 -0
- package/dist/jsx/helpers.mjs.map +1 -0
- package/dist/jsx/helpers.native.js +39 -0
- package/dist/jsx/helpers.native.js.map +1 -0
- package/dist/jsx/index.js +12 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +12 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +33 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/dist/jsx/nativeSheet.mjs +70 -0
- package/dist/jsx/nativeSheet.mjs.map +1 -0
- package/dist/jsx/nativeSheet.native.js +106 -0
- package/dist/jsx/nativeSheet.native.js.map +1 -0
- package/dist/jsx/setupGestureHandler.mjs +26 -0
- package/dist/jsx/setupGestureHandler.mjs.map +1 -0
- package/dist/jsx/setupGestureHandler.native.js +55 -0
- package/dist/jsx/setupGestureHandler.native.js.map +1 -0
- package/dist/jsx/types.mjs +2 -0
- package/dist/jsx/types.mjs.map +1 -0
- package/dist/jsx/types.native.js +21 -0
- package/dist/jsx/types.native.js.map +1 -0
- package/dist/jsx/useGestureHandlerPan.mjs +181 -0
- package/dist/jsx/useGestureHandlerPan.mjs.map +1 -0
- package/dist/jsx/useGestureHandlerPan.native.js +213 -0
- package/dist/jsx/useGestureHandlerPan.native.js.map +1 -0
- package/dist/jsx/useKeyboardControllerSheet.mjs +15 -0
- package/dist/jsx/useKeyboardControllerSheet.mjs.map +1 -0
- package/dist/jsx/useKeyboardControllerSheet.native.js +132 -0
- package/dist/jsx/useKeyboardControllerSheet.native.js.map +1 -0
- package/dist/jsx/useSheet.mjs +4 -0
- package/dist/jsx/useSheet.mjs.map +1 -0
- package/dist/jsx/useSheet.native.js +34 -0
- package/dist/jsx/useSheet.native.js.map +1 -0
- package/dist/jsx/useSheetController.mjs +15 -0
- package/dist/jsx/useSheetController.mjs.map +1 -0
- package/dist/jsx/useSheetController.native.js +55 -0
- package/dist/jsx/useSheetController.native.js.map +1 -0
- package/dist/jsx/useSheetOffscreenSize.mjs +38 -0
- package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -0
- package/dist/jsx/useSheetOffscreenSize.native.js +70 -0
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -0
- package/dist/jsx/useSheetOpenState.mjs +27 -0
- package/dist/jsx/useSheetOpenState.mjs.map +1 -0
- package/dist/jsx/useSheetOpenState.native.js +58 -0
- package/dist/jsx/useSheetOpenState.native.js.map +1 -0
- package/dist/jsx/useSheetProviderProps.mjs +145 -0
- package/dist/jsx/useSheetProviderProps.mjs.map +1 -0
- package/dist/jsx/useSheetProviderProps.native.js +196 -0
- package/dist/jsx/useSheetProviderProps.native.js.map +1 -0
- package/dist/jsx/useSheetScrollViewGestures.mjs +141 -0
- package/dist/jsx/useSheetScrollViewGestures.mjs.map +1 -0
- package/dist/jsx/useSheetScrollViewGestures.native.js +159 -0
- package/dist/jsx/useSheetScrollViewGestures.native.js.map +1 -0
- package/package.json +36 -26
- package/src/Sheet.tsx +3 -3
- package/src/SheetImplementationCustom.tsx +5 -5
- package/src/createSheet.tsx +9 -9
- package/src/setupGestureHandler.ts +2 -2
- package/src/useSheetProviderProps.tsx +4 -4
- package/types/GestureDetectorWrapper.d.ts +1 -1
- package/types/GestureDetectorWrapper.d.ts.map +1 -0
- package/types/GestureSheetContext.d.ts +1 -1
- package/types/GestureSheetContext.d.ts.map +1 -0
- package/types/Sheet.d.ts +15 -15
- package/types/Sheet.d.ts.map +1 -0
- package/types/SheetContext.d.ts +4 -4
- package/types/SheetContext.d.ts.map +1 -0
- package/types/SheetController.d.ts +2 -1
- package/types/SheetController.d.ts.map +1 -0
- package/types/SheetImplementationCustom.d.ts.map +1 -0
- package/types/SheetScrollView.d.ts +1 -1
- package/types/SheetScrollView.d.ts.map +1 -0
- package/types/constants.d.ts.map +1 -0
- package/types/contexts.d.ts.map +1 -0
- package/types/controller.d.ts.map +1 -0
- package/types/createSheet.d.ts +11 -11
- package/types/createSheet.d.ts.map +1 -0
- package/types/gestureState.d.ts.map +1 -0
- package/types/helpers.d.ts.map +1 -0
- package/types/index.d.ts.map +1 -0
- package/types/nativeSheet.d.ts.map +1 -0
- package/types/setupGestureHandler.d.ts.map +1 -0
- package/types/types.d.ts.map +1 -0
- package/types/useGestureHandlerPan.d.ts.map +1 -0
- package/types/useKeyboardControllerSheet.d.ts.map +1 -0
- package/types/useKeyboardControllerSheet.native.d.ts.map +1 -0
- package/types/useSheet.d.ts.map +1 -0
- package/types/useSheetController.d.ts.map +1 -0
- package/types/useSheetOffscreenSize.d.ts.map +1 -0
- package/types/useSheetOpenState.d.ts.map +1 -0
- package/types/useSheetProviderProps.d.ts +3 -3
- package/types/useSheetProviderProps.d.ts.map +1 -0
- package/types/useSheetScrollViewGestures.d.ts.map +1 -0
- package/types/useSheetScrollViewGestures.native.d.ts.map +1 -0
- package/controller/index.cjs +0 -2
- package/controller/index.d.ts +0 -5
- package/controller/index.js +0 -2
- package/controller/index.native.cjs +0 -2
- package/controller/index.native.js +0 -2
- package/next.md +0 -78
- package/setup-gesture-handler/index.cjs +0 -2
- package/setup-gesture-handler/index.js +0 -2
- package/setup-gesture-handler/index.native.cjs +0 -2
- package/setup-gesture-handler/index.native.js +0 -2
- package/tsconfig.json +0 -56
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useComposedRefs } from "@hanzogui/compose-refs";
|
|
2
|
+
import { useIsomorphicLayoutEffect } from "@hanzogui/constants";
|
|
3
|
+
import { View } from "@hanzogui/core";
|
|
4
|
+
import { composeEventHandlers, withStaticProperties } from "@hanzogui/helpers";
|
|
5
|
+
import { resolveViewZIndex } from "@hanzogui/portal";
|
|
6
|
+
import { RemoveScroll } from "@hanzogui/remove-scroll";
|
|
7
|
+
import { useDidFinishSSR } from "@hanzogui/use-did-finish-ssr";
|
|
8
|
+
import { StackZIndexContext } from "@hanzogui/z-index-stack";
|
|
9
|
+
import { forwardRef, useMemo, useEffect, useRef } from "react";
|
|
10
|
+
import { Platform } from "react-native-web";
|
|
11
|
+
import { SHEET_HANDLE_NAME, SHEET_NAME, SHEET_OVERLAY_NAME } from "./constants.mjs";
|
|
12
|
+
import { getNativeSheet } from "./nativeSheet.mjs";
|
|
13
|
+
import { useSheetContext } from "./SheetContext.mjs";
|
|
14
|
+
import { SheetImplementationCustom } from "./SheetImplementationCustom.mjs";
|
|
15
|
+
import { SheetScrollView } from "./SheetScrollView.mjs";
|
|
16
|
+
import { useSheetController } from "./useSheetController.mjs";
|
|
17
|
+
import { useSheetOffscreenSize } from "./useSheetOffscreenSize.mjs";
|
|
18
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function createSheet({
|
|
20
|
+
Handle,
|
|
21
|
+
Frame,
|
|
22
|
+
Overlay
|
|
23
|
+
}) {
|
|
24
|
+
const SheetHandle = Handle.styleable(({
|
|
25
|
+
__scopeSheet,
|
|
26
|
+
...props
|
|
27
|
+
}, forwardedRef) => {
|
|
28
|
+
const context = useSheetContext(SHEET_HANDLE_NAME, __scopeSheet);
|
|
29
|
+
const composedRef = useComposedRefs(context.handleRef, forwardedRef);
|
|
30
|
+
const wasDraggingRef = useRef(false);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!context.scrollBridge) return;
|
|
33
|
+
return context.scrollBridge.onParentDragging(isDragging => {
|
|
34
|
+
if (isDragging) wasDraggingRef.current = true;
|
|
35
|
+
});
|
|
36
|
+
}, [context.scrollBridge]);
|
|
37
|
+
if (context.onlyShowFrame) return null;
|
|
38
|
+
return /* @__PURE__ */jsx(Handle, {
|
|
39
|
+
ref: composedRef,
|
|
40
|
+
onPressIn: () => {
|
|
41
|
+
wasDraggingRef.current = false;
|
|
42
|
+
},
|
|
43
|
+
onPress: () => {
|
|
44
|
+
if (wasDraggingRef.current) {
|
|
45
|
+
wasDraggingRef.current = false;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);
|
|
49
|
+
const nextPos = (context.position + 1) % max;
|
|
50
|
+
context.setPosition(nextPos);
|
|
51
|
+
},
|
|
52
|
+
open: context.open,
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const SheetOverlay = Overlay.styleable((propsIn, ref) => {
|
|
57
|
+
const {
|
|
58
|
+
__scopeSheet,
|
|
59
|
+
...props
|
|
60
|
+
} = propsIn;
|
|
61
|
+
const context = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet);
|
|
62
|
+
const element = useMemo(() => {
|
|
63
|
+
return /* @__PURE__ */jsx(Overlay, {
|
|
64
|
+
...props,
|
|
65
|
+
onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? () => {
|
|
66
|
+
context.setOpen(false);
|
|
67
|
+
} : void 0)
|
|
68
|
+
});
|
|
69
|
+
}, [props.onPress, props.opacity, context.dismissOnOverlayPress]);
|
|
70
|
+
useIsomorphicLayoutEffect(() => {
|
|
71
|
+
context.onOverlayComponent?.(element);
|
|
72
|
+
}, [element]);
|
|
73
|
+
if (context.onlyShowFrame) return null;
|
|
74
|
+
return null;
|
|
75
|
+
});
|
|
76
|
+
const SheetFrame = Frame.styleable(({
|
|
77
|
+
__scopeSheet,
|
|
78
|
+
adjustPaddingForOffscreenContent,
|
|
79
|
+
disableHideBottomOverflow,
|
|
80
|
+
children,
|
|
81
|
+
...props
|
|
82
|
+
}, forwardedRef) => {
|
|
83
|
+
const context = useSheetContext(SHEET_NAME, __scopeSheet);
|
|
84
|
+
const {
|
|
85
|
+
hasFit,
|
|
86
|
+
disableRemoveScroll,
|
|
87
|
+
frameSize,
|
|
88
|
+
contentRef,
|
|
89
|
+
open
|
|
90
|
+
} = context;
|
|
91
|
+
const composedContentRef = useComposedRefs(forwardedRef, contentRef);
|
|
92
|
+
const offscreenSize = useSheetOffscreenSize(context);
|
|
93
|
+
const stableFrameSize = useRef(frameSize);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (open && frameSize) stableFrameSize.current = frameSize;
|
|
96
|
+
}, [open, frameSize]);
|
|
97
|
+
const sheetContents = useMemo(() => {
|
|
98
|
+
const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
|
|
99
|
+
return /* @__PURE__ */jsxs(Frame, {
|
|
100
|
+
ref: composedContentRef,
|
|
101
|
+
flex: hasFit && open ? 0 : 1,
|
|
102
|
+
flexBasis: hasFit ? "auto" : void 0,
|
|
103
|
+
height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
|
|
104
|
+
pointerEvents: open ? "auto" : "none",
|
|
105
|
+
"data-state": open ? "open" : "closed",
|
|
106
|
+
...props,
|
|
107
|
+
children: [/* @__PURE__ */jsx(StackZIndexContext, {
|
|
108
|
+
zIndex: resolveViewZIndex(props.zIndex),
|
|
109
|
+
children
|
|
110
|
+
}), adjustPaddingForOffscreenContent && /* @__PURE__ */jsx(View, {
|
|
111
|
+
"data-sheet-offscreen-pad": true,
|
|
112
|
+
height: offscreenSize,
|
|
113
|
+
width: "100%"
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
}, [open, props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
117
|
+
return /* @__PURE__ */jsxs(Fragment, {
|
|
118
|
+
children: [/* @__PURE__ */jsx(RemoveScroll, {
|
|
119
|
+
enabled: !disableRemoveScroll && context.open,
|
|
120
|
+
children: sheetContents
|
|
121
|
+
}), !disableHideBottomOverflow && /* @__PURE__ */jsx(Frame, {
|
|
122
|
+
...props,
|
|
123
|
+
componentName: "SheetCover",
|
|
124
|
+
children: null,
|
|
125
|
+
testID: void 0,
|
|
126
|
+
id: void 0,
|
|
127
|
+
position: "absolute",
|
|
128
|
+
bottom: "-100%",
|
|
129
|
+
zIndex: -1,
|
|
130
|
+
height: context.frameSize,
|
|
131
|
+
left: 0,
|
|
132
|
+
right: 0,
|
|
133
|
+
borderWidth: 0,
|
|
134
|
+
borderRadius: 0,
|
|
135
|
+
shadowOpacity: 0
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
const Sheet = forwardRef(function Sheet2(props, ref) {
|
|
140
|
+
const hydrated = useDidFinishSSR();
|
|
141
|
+
const {
|
|
142
|
+
isShowingNonSheet
|
|
143
|
+
} = useSheetController();
|
|
144
|
+
let SheetImplementation = SheetImplementationCustom;
|
|
145
|
+
if (props.native && Platform.OS === "ios") {}
|
|
146
|
+
if (isShowingNonSheet || !hydrated) return null;
|
|
147
|
+
return /* @__PURE__ */jsx(SheetImplementation, {
|
|
148
|
+
ref,
|
|
149
|
+
...props
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
const components = {
|
|
153
|
+
Frame: SheetFrame,
|
|
154
|
+
Overlay: SheetOverlay,
|
|
155
|
+
Handle: SheetHandle,
|
|
156
|
+
ScrollView: SheetScrollView
|
|
157
|
+
};
|
|
158
|
+
const Controlled = withStaticProperties(Sheet, components);
|
|
159
|
+
return withStaticProperties(Sheet, {
|
|
160
|
+
...components,
|
|
161
|
+
Controlled
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export { createSheet };
|
|
165
|
+
//# sourceMappingURL=createSheet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useComposedRefs","useIsomorphicLayoutEffect","View","composeEventHandlers","withStaticProperties","resolveViewZIndex","RemoveScroll","useDidFinishSSR","StackZIndexContext","forwardRef","useMemo","useEffect","useRef","Platform","SHEET_HANDLE_NAME","SHEET_NAME","SHEET_OVERLAY_NAME","getNativeSheet","useSheetContext","SheetImplementationCustom","SheetScrollView","useSheetController","useSheetOffscreenSize","Fragment","jsx","jsxs","createSheet","Handle","Frame","Overlay","SheetHandle","styleable","__scopeSheet","props","forwardedRef","context","composedRef","handleRef","wasDraggingRef","scrollBridge","onParentDragging","isDragging","current","onlyShowFrame","ref","onPressIn","onPress","max","snapPoints","length","dismissOnSnapToBottom","nextPos","position","setPosition","open","SheetOverlay","propsIn","element","dismissOnOverlayPress","setOpen","opacity","onOverlayComponent","SheetFrame","adjustPaddingForOffscreenContent","disableHideBottomOverflow","children","hasFit","disableRemoveScroll","frameSize","contentRef","composedContentRef","offscreenSize","stableFrameSize","sheetContents","shouldUseFixedHeight","flex","flexBasis","height","pointerEvents","zIndex","width","enabled","componentName","testID","id","bottom","left","right","borderWidth","borderRadius","shadowOpacity","Sheet","Sheet2","hydrated","isShowingNonSheet","SheetImplementation","native","OS","components","ScrollView","Controlled"],"sources":["../../src/createSheet.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,SAASC,yBAAA,QAAiC;AAQ1C,SAASC,IAAA,QAAY;AACrB,SAASC,oBAAA,EAAsBC,oBAAA,QAA4B;AAC3D,SAASC,iBAAA,QAAyB;AAClC,SAASC,YAAA,QAAoB;AAC7B,SAASC,eAAA,QAAuB;AAChC,SAASC,kBAAA,QAA0B;AAEnC,SAASC,UAAA,EAAkBC,OAAA,EAASC,SAAA,EAAWC,MAAA,QAAc;AAE7D,SAASC,QAAA,QAAgB;AACzB,SAASC,iBAAA,EAAmBC,UAAA,EAAYC,kBAAA,QAA0B;AAClE,SAASC,cAAA,QAAsB;AAC/B,SAASC,eAAA,QAAuB;AAChC,SAASC,yBAAA,QAAiC;AAC1C,SAASC,eAAA,QAAuB;AAEhC,SAASC,kBAAA,QAA0B;AACnC,SAASC,qBAAA,QAA6B;AA0C9B,SAoJAC,QAAA,EApJAC,GAAA,EAkHEC,IAAA,QAlHF;AAhCD,SAASC,YAId;EAAEC,MAAA;EAAQC,KAAA;EAAOC;AAAQ,GAAwC;EACjE,MAAAC,WAAM,GAAAH,MAAc,CAAAI,SAAO;IAAAC,YAAA;IAAA,GAAAC;EAAA,GAAAC,YAAA;IAAA,MAErBC,OAAA,GAAAjB,eACF,CAAAJ,iBACG,EAAAkB,YAAA;IACH,MAAAI,WAAM,GAAUpC,eAAA,CAAgBmC,OAAA,CAAAE,SAAA,EAAmBH,YAAY;IAC/D,MAAAI,cAAM,GAAA1B,MAAc;IAGpBD,SAAA,CAAM;MAGN,KAAAwB,OAAA,CAAUI,YAAM;MACd,OAAAJ,OAAK,CAAAI,YAAQ,CAAAC,gBAAc,CAAAC,UAAA;QAC3B,IAAA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ACK;AACF,SAAA1E,WACC","ignoreList":[]}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var createSheet_exports = {};
|
|
26
|
+
__export(createSheet_exports, {
|
|
27
|
+
createSheet: () => createSheet
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(createSheet_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_compose_refs = require("@hanzogui/compose-refs");
|
|
32
|
+
var import_constants = require("@hanzogui/constants");
|
|
33
|
+
var import_core = require("@hanzogui/core");
|
|
34
|
+
var import_helpers = require("@hanzogui/helpers");
|
|
35
|
+
var import_portal = require("@hanzogui/portal");
|
|
36
|
+
var import_remove_scroll = require("@hanzogui/remove-scroll");
|
|
37
|
+
var import_use_did_finish_ssr = require("@hanzogui/use-did-finish-ssr");
|
|
38
|
+
var import_z_index_stack = require("@hanzogui/z-index-stack");
|
|
39
|
+
var import_react = require("react");
|
|
40
|
+
var import_react_native = require("react-native");
|
|
41
|
+
var import_constants2 = require("./constants.native.js");
|
|
42
|
+
var import_nativeSheet = require("./nativeSheet.native.js");
|
|
43
|
+
var import_SheetContext = require("./SheetContext.native.js");
|
|
44
|
+
var import_SheetImplementationCustom = require("./SheetImplementationCustom.native.js");
|
|
45
|
+
var import_SheetScrollView = require("./SheetScrollView.native.js");
|
|
46
|
+
var import_useSheetController = require("./useSheetController.native.js");
|
|
47
|
+
var import_useSheetOffscreenSize = require("./useSheetOffscreenSize.native.js");
|
|
48
|
+
function createSheet(param) {
|
|
49
|
+
var {
|
|
50
|
+
Handle,
|
|
51
|
+
Frame,
|
|
52
|
+
Overlay
|
|
53
|
+
} = param;
|
|
54
|
+
var SheetHandle = Handle.styleable(function (param2, forwardedRef) {
|
|
55
|
+
var {
|
|
56
|
+
__scopeSheet,
|
|
57
|
+
...props
|
|
58
|
+
} = param2;
|
|
59
|
+
var context = (0, import_SheetContext.useSheetContext)(import_constants2.SHEET_HANDLE_NAME, __scopeSheet);
|
|
60
|
+
var composedRef = (0, import_compose_refs.useComposedRefs)(context.handleRef, forwardedRef);
|
|
61
|
+
var wasDraggingRef = (0, import_react.useRef)(false);
|
|
62
|
+
(0, import_react.useEffect)(function () {
|
|
63
|
+
if (!context.scrollBridge) return;
|
|
64
|
+
return context.scrollBridge.onParentDragging(function (isDragging) {
|
|
65
|
+
if (isDragging) wasDraggingRef.current = true;
|
|
66
|
+
});
|
|
67
|
+
}, [context.scrollBridge]);
|
|
68
|
+
if (context.onlyShowFrame) return null;
|
|
69
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(Handle, {
|
|
70
|
+
ref: composedRef,
|
|
71
|
+
onPressIn: function () {
|
|
72
|
+
wasDraggingRef.current = false;
|
|
73
|
+
},
|
|
74
|
+
onPress: function () {
|
|
75
|
+
if (wasDraggingRef.current) {
|
|
76
|
+
wasDraggingRef.current = false;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);
|
|
80
|
+
var nextPos = (context.position + 1) % max;
|
|
81
|
+
context.setPosition(nextPos);
|
|
82
|
+
},
|
|
83
|
+
open: context.open,
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
var SheetOverlay = Overlay.styleable(function (propsIn, ref) {
|
|
88
|
+
var {
|
|
89
|
+
__scopeSheet,
|
|
90
|
+
...props
|
|
91
|
+
} = propsIn;
|
|
92
|
+
var context = (0, import_SheetContext.useSheetContext)(import_constants2.SHEET_OVERLAY_NAME, __scopeSheet);
|
|
93
|
+
var element = (0, import_react.useMemo)(function () {
|
|
94
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(Overlay, {
|
|
95
|
+
...props,
|
|
96
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.dismissOnOverlayPress ? function () {
|
|
97
|
+
context.setOpen(false);
|
|
98
|
+
} : void 0)
|
|
99
|
+
});
|
|
100
|
+
}, [props.onPress, props.opacity, context.dismissOnOverlayPress]);
|
|
101
|
+
(0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
102
|
+
var _context_onOverlayComponent;
|
|
103
|
+
(_context_onOverlayComponent = context.onOverlayComponent) === null || _context_onOverlayComponent === void 0 || _context_onOverlayComponent.call(context, element);
|
|
104
|
+
}, [element]);
|
|
105
|
+
if (context.onlyShowFrame) return null;
|
|
106
|
+
return null;
|
|
107
|
+
});
|
|
108
|
+
var SheetFrame = Frame.styleable(function (param2, forwardedRef) {
|
|
109
|
+
var {
|
|
110
|
+
__scopeSheet,
|
|
111
|
+
adjustPaddingForOffscreenContent,
|
|
112
|
+
disableHideBottomOverflow,
|
|
113
|
+
children,
|
|
114
|
+
...props
|
|
115
|
+
} = param2;
|
|
116
|
+
var context = (0, import_SheetContext.useSheetContext)(import_constants2.SHEET_NAME, __scopeSheet);
|
|
117
|
+
var {
|
|
118
|
+
hasFit,
|
|
119
|
+
disableRemoveScroll,
|
|
120
|
+
frameSize,
|
|
121
|
+
contentRef,
|
|
122
|
+
open
|
|
123
|
+
} = context;
|
|
124
|
+
var composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);
|
|
125
|
+
var offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context);
|
|
126
|
+
var stableFrameSize = (0, import_react.useRef)(frameSize);
|
|
127
|
+
(0, import_react.useEffect)(function () {
|
|
128
|
+
if (open && frameSize) stableFrameSize.current = frameSize;
|
|
129
|
+
}, [open, frameSize]);
|
|
130
|
+
var sheetContents = (0, import_react.useMemo)(function () {
|
|
131
|
+
var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
|
|
132
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(Frame, {
|
|
133
|
+
ref: composedContentRef,
|
|
134
|
+
flex: hasFit && open ? 0 : 1,
|
|
135
|
+
flexBasis: hasFit ? "auto" : void 0,
|
|
136
|
+
height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
|
|
137
|
+
pointerEvents: open ? "auto" : "none",
|
|
138
|
+
"data-state": open ? "open" : "closed",
|
|
139
|
+
...props,
|
|
140
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_z_index_stack.StackZIndexContext, {
|
|
141
|
+
zIndex: (0, import_portal.resolveViewZIndex)(props.zIndex),
|
|
142
|
+
children
|
|
143
|
+
}), adjustPaddingForOffscreenContent && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
144
|
+
"data-sheet-offscreen-pad": true,
|
|
145
|
+
height: offscreenSize,
|
|
146
|
+
width: "100%"
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
}, [open, props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
150
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
151
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_remove_scroll.RemoveScroll, {
|
|
152
|
+
enabled: !disableRemoveScroll && context.open,
|
|
153
|
+
children: sheetContents
|
|
154
|
+
}), !disableHideBottomOverflow && /* @__PURE__ */(0, import_jsx_runtime.jsx)(Frame, {
|
|
155
|
+
...props,
|
|
156
|
+
componentName: "SheetCover",
|
|
157
|
+
children: null,
|
|
158
|
+
testID: void 0,
|
|
159
|
+
id: void 0,
|
|
160
|
+
position: "absolute",
|
|
161
|
+
bottom: "-100%",
|
|
162
|
+
zIndex: -1,
|
|
163
|
+
height: context.frameSize,
|
|
164
|
+
left: 0,
|
|
165
|
+
right: 0,
|
|
166
|
+
borderWidth: 0,
|
|
167
|
+
borderRadius: 0,
|
|
168
|
+
shadowOpacity: 0
|
|
169
|
+
})]
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
var Sheet = /* @__PURE__ */(0, import_react.forwardRef)(function Sheet2(props, ref) {
|
|
173
|
+
var hydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
174
|
+
var {
|
|
175
|
+
isShowingNonSheet
|
|
176
|
+
} = (0, import_useSheetController.useSheetController)();
|
|
177
|
+
var SheetImplementation = import_SheetImplementationCustom.SheetImplementationCustom;
|
|
178
|
+
if (props.native && import_react_native.Platform.OS === "ios") {
|
|
179
|
+
var impl = (0, import_nativeSheet.getNativeSheet)("ios");
|
|
180
|
+
if (impl) SheetImplementation = impl;
|
|
181
|
+
}
|
|
182
|
+
if (isShowingNonSheet || !hydrated) return null;
|
|
183
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(SheetImplementation, {
|
|
184
|
+
ref,
|
|
185
|
+
...props
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
var components = {
|
|
189
|
+
Frame: SheetFrame,
|
|
190
|
+
Overlay: SheetOverlay,
|
|
191
|
+
Handle: SheetHandle,
|
|
192
|
+
ScrollView: import_SheetScrollView.SheetScrollView
|
|
193
|
+
};
|
|
194
|
+
var Controlled = (0, import_helpers.withStaticProperties)(Sheet, components);
|
|
195
|
+
return (0, import_helpers.withStaticProperties)(Sheet, {
|
|
196
|
+
...components,
|
|
197
|
+
Controlled
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=createSheet.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","createSheet_exports","createSheet","module","exports","import_jsx_runtime","require","import_compose_refs","import_constants","import_core","import_helpers","import_portal","import_remove_scroll","import_use_did_finish_ssr","import_z_index_stack","import_react","import_react_native","import_constants2","import_nativeSheet","import_SheetContext","import_SheetImplementationCustom","import_SheetScrollView","import_useSheetController","import_useSheetOffscreenSize","param","Handle","Frame","Overlay","SheetHandle","styleable","param2","forwardedRef","__scopeSheet","props","context","useSheetContext","SHEET_HANDLE_NAME","composedRef","useComposedRefs","handleRef","wasDraggingRef","useRef","useEffect","scrollBridge","onParentDragging","isDragging","current","onlyShowFrame","jsx","ref","onPressIn","onPress","max","snapPoints","length","dismissOnSnapToBottom","nextPos","position","setPosition","open","SheetOverlay","propsIn","SHEET_OVERLAY_NAME","element","useMemo","composeEventHandlers","dismissOnOverlayPress","setOpen","opacity","useIsomorphicLayoutEffect","_context_onOverlayComponent","onOverlayComponent","SheetFrame","adjustPaddingForOffscreenContent","disableHideBottomOverflow","children","SHEET_NAME","hasFit","disableRemoveScroll","frameSize","contentRef","composedContentRef","offscreenSize","useSheetOffscreenSize","stableFrameSize","sheetContents","shouldUseFixedHeight","jsxs","flex","flexBasis","height","pointerEvents","StackZIndexContext","zIndex","resolveViewZIndex","View","width","Fragment","RemoveScroll","enabled","componentName","testID","id","bottom","left","right","borderWidth","borderRadius","shadowOpacity","Sheet","forwardRef","Sheet2","hydrated","useDidFinishSSR","isShowingNonSheet","useSheetController","SheetImplementation","SheetImplementationCustom","native","Platform","OS","impl","getNativeSheet","components","ScrollView","SheetScrollView","Controlled","withStaticProperties"],"sources":["../../src/createSheet.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,SAAS,GAAAC,MAAA,CAAAC,cAAA;AAQT,IAAAC,gBAAS,GAAYF,MAAA,CAAAG,wBAAA;AACrB,IAAAC,iBAAS,GAAAJ,MAAA,CAAsBK,mBAAA;AAC/B,IAAAC,YAAS,GAAAN,MAAA,CAAAO,SAAyB,CAAAC,cAAA;AAClC,IAAAC,QAAS,GAAAA,CAAAC,MAAA,EAAAC,GAAA,KAAoB;EAC7B,SAASC,IAAA,IAAAD,GAAA,EAAAZ,SAAuB,CAAAW,MAAA,EAAAE,IAAA;IAChCC,GAAA,EAAAF,GAAS,CAAAC,IAAA;IAETE,UAAS;EAET;AACA;AACA,IAAAC,WAAS,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAsB,EAAAC,IAAA;EAC/B,IAAAF,IAAS,WAAAA,IAAA,aAAuB,WAAAA,IAAA;IAChC,SAASG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,GAAiC,KAAAX,YAAA,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EAAAnB,SAAA,CAAAiB,EAAA,EAAAI,GAAA;MAC1CP,GAAA,EAAAA,CAAA,KAASI,IAAA,CAAAG,GAAA;MAETN,UAAS,IAAAK,IAAA,GAAAjB,gBAA0B,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IACnC;EA0CQ;EAhCD,OAAAE,EAAS;AAKd;AAA2B,IACzBM,YACI,GAAAC,GAAc,IAAGR,WACnB,CAAAhB,SAAA,CACG;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AACH,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,SAAA;QAAAyB,IAAA;QACKC,KAAA;QACFC,WACP;QAAQC,YACR;QAAgBC,aAChB,EAAM;MAAA;IAAA;EACC;EACM,IAAAC,KAAA,GACb,eAAc,IAAA9F,YAAA,CAAA+F,UAAA,WAAAC,OAAA9E,KAAA,EAAAgB,GAAA;IAAA,IAAA+D,QACd,OAAAnG,yBAAe,CAAAoG,eAAA;IAAA;MAAAC;IAAA,QAAA5F,yBAAA,CAAA6F,kBAAA;IAAA,IAAAC,mBACjB,GAAAhG,gCAAA,CAAAiG,yBAAA;IAAA,IAAApF,KAEJ,CAAAqF,MAAA,IAAAtG,mBAAA,CAAAuG,QAAA,CAAAC,EAAA;MAAA,IAEJC,IAAA,OAAAvG,kBAAA,CAAAwG,cAAA;MACF,IAAAD,IAAA,EAAAL,mBAAA,GAAAK,IAAA;IAMA;IACE,IAAAP,iBAAiB,KAAAF,QAAA,EAAgB;IACjC,sBAAQ,IAAA3G,kBAAsB,CAAA2C,GAAA,EAAmBoE,mBAAA;MAEjDnE,GAAA;MAEA,GAAAhB;IACE;EACE;EACA,IAAA0F,UAAI,GAAM;IAERjG,KAAA,EAAA8C,UAAA;IAAsB7C,OACxB,EAAAiC,YAAA;IAAAnC,MACF,EAAAG,WAAA;IAAAgG,UACF,EAAAvG,sBAAA,CAAAwG;EAKA;EACE,IAAAC,UAAO,OAAApH,cAAA,CAAAqH,oBAAA,EAAAlB,KAAA,EAAAc,UAAA;EAAA,OACT,IAAAjH,cAAA,CAAAqH,oBAAA,EAAAlB,KAAA;IAEA,GAAAc,UAAO;IACTG;EAEA;AAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getGestureHandler } from "@hanzogui/native";
|
|
2
|
+
function isGestureHandlerEnabled() {
|
|
3
|
+
return getGestureHandler().isEnabled;
|
|
4
|
+
}
|
|
5
|
+
function getGestureHandlerState() {
|
|
6
|
+
return getGestureHandler().state;
|
|
7
|
+
}
|
|
8
|
+
function setGestureHandlerState(updates) {
|
|
9
|
+
getGestureHandler().set(updates);
|
|
10
|
+
}
|
|
11
|
+
const setGestureState = setGestureHandlerState;
|
|
12
|
+
export { getGestureHandlerState, isGestureHandlerEnabled, setGestureHandlerState, setGestureState };
|
|
13
|
+
//# sourceMappingURL=gestureState.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getGestureHandler","isGestureHandlerEnabled","isEnabled","getGestureHandlerState","state","setGestureHandlerState","updates","set","setGestureState"],"sources":["../../src/gestureState.ts"],"sourcesContent":[null],"mappings":"AAKA,SAASA,iBAAA,QAA4C;AAK9C,SAASC,wBAAA,EAAmC;EACjD,OAAOD,iBAAA,CAAkB,EAAEE,SAAA;AAC7B;AAEO,SAASC,uBAAA,EAAuC;EACrD,OAAOH,iBAAA,CAAkB,EAAEI,KAAA;AAC7B;AAEO,SAASC,uBAAuBC,OAAA,EAAsC;EAC3EN,iBAAA,CAAkB,EAAEO,GAAA,CAAID,OAAO;AACjC;AAGO,MAAME,eAAA,GAAkBH,sBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var gestureState_exports = {};
|
|
26
|
+
__export(gestureState_exports, {
|
|
27
|
+
getGestureHandlerState: () => getGestureHandlerState,
|
|
28
|
+
isGestureHandlerEnabled: () => isGestureHandlerEnabled,
|
|
29
|
+
setGestureHandlerState: () => setGestureHandlerState,
|
|
30
|
+
setGestureState: () => setGestureState
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(gestureState_exports);
|
|
33
|
+
var import_native = require("@hanzogui/native");
|
|
34
|
+
function isGestureHandlerEnabled() {
|
|
35
|
+
return (0, import_native.getGestureHandler)().isEnabled;
|
|
36
|
+
}
|
|
37
|
+
function getGestureHandlerState() {
|
|
38
|
+
return (0, import_native.getGestureHandler)().state;
|
|
39
|
+
}
|
|
40
|
+
function setGestureHandlerState(updates) {
|
|
41
|
+
(0, import_native.getGestureHandler)().set(updates);
|
|
42
|
+
}
|
|
43
|
+
var setGestureState = setGestureHandlerState;
|
|
44
|
+
//# sourceMappingURL=gestureState.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc"],"sources":["../../src/gestureState.ts"],"sourcesContent":[null],"mappings":"AAKA,YAAS;;AAKF,IAAAA,SAAS,GAAAC,MAAA,CAAAC,cAAmC;AACjD,IAAAC,gBAAO,GAAAF,MAAoB,CAAAG,wBAAA;AAC7B,IAAAC,iBAAA,GAAAJ,MAAA,CAAAK,mBAAA;AAEO,IAAAC,YAAS,GAAAN,MAAA,CAAAO,SAAuC,CAAAC,cAAA;AACrD,IAAAC,QAAO,GAAAA,CAAAC,MAAA,EAAAC,GAAkB,KAAE;EAC7B,SAAAC,IAAA,IAAAD,GAAA,EAEOZ,SAAS,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAuB,EAAAF,GAAA,CAAAC,IAAsC;IAAAE,UAAA;EAAA;AAC3E;AACF,IAAAC,WAAA,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EAGO,IAAMF,IAAA,WAAAA,IAAkB,wBAAAA,IAAA","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function resisted(y, minY, maxOverflow = 25) {
|
|
2
|
+
if (y >= minY) {
|
|
3
|
+
return y;
|
|
4
|
+
}
|
|
5
|
+
const pastBoundary = minY - y;
|
|
6
|
+
const resistedDistance = Math.sqrt(pastBoundary) * 2;
|
|
7
|
+
return minY - resistedDistance;
|
|
8
|
+
}
|
|
9
|
+
export { resisted };
|
|
10
|
+
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resisted","y","minY","maxOverflow","pastBoundary","resistedDistance","Math","sqrt"],"sources":["../../src/helpers.tsx"],"sourcesContent":[null],"mappings":"AAAO,SAASA,SAASC,CAAA,EAAWC,IAAA,EAAcC,WAAA,GAAc,IAAI;EAElE,IAAIF,CAAA,IAAKC,IAAA,EAAM;IACb,OAAOD,CAAA;EACT;EAGA,MAAMG,YAAA,GAAeF,IAAA,GAAOD,CAAA;EAK5B,MAAMI,gBAAA,GAAmBC,IAAA,CAAKC,IAAA,CAAKH,YAAY,IAAI;EAGnD,OAAOF,IAAA,GAAOG,gBAAA;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var helpers_exports = {};
|
|
26
|
+
__export(helpers_exports, {
|
|
27
|
+
resisted: () => resisted
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
30
|
+
function resisted(y, minY) {
|
|
31
|
+
var maxOverflow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 25;
|
|
32
|
+
if (y >= minY) {
|
|
33
|
+
return y;
|
|
34
|
+
}
|
|
35
|
+
var pastBoundary = minY - y;
|
|
36
|
+
var resistedDistance = Math.sqrt(pastBoundary) * 2;
|
|
37
|
+
return minY - resistedDistance;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=helpers.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable"],"sources":["../../src/helpers.tsx"],"sourcesContent":[null],"mappings":"AAAO,YAAS;;AAEd,IAAAA,SAAS,GAAAC,MAAM,CAAAC,cAAA;AACb,IAAAC,gBAAO,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IACTC,iBAAA,GAAAJ,MAAA,CAAAK,mBAAA;AAGA,IAAAC,YAAM,GAAAN,MAAe,CAAAO,SAAO,CAAAC,cAAA;AAK5B,IAAAC,QAAM,GAAAA,CAAAC,MAAA,EAAAC,GAAmB,KAAK;EAG9B,SAAOC,IAAA,IAAOD,GAAA,EAChBZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./Sheet.mjs";
|
|
2
|
+
export * from "./useSheet.mjs";
|
|
3
|
+
export * from "./createSheet.mjs";
|
|
4
|
+
export * from "./SheetController.mjs";
|
|
5
|
+
export * from "./useSheetController.mjs";
|
|
6
|
+
export * from "./useSheetOpenState.mjs";
|
|
7
|
+
export * from "./useSheetOffscreenSize.mjs";
|
|
8
|
+
export * from "./SheetScrollView.mjs";
|
|
9
|
+
export * from "./nativeSheet.mjs";
|
|
10
|
+
export * from "./types.mjs";
|
|
11
|
+
export * from "./contexts.mjs";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./Sheet.mjs";
|
|
2
|
+
export * from "./useSheet.mjs";
|
|
3
|
+
export * from "./createSheet.mjs";
|
|
4
|
+
export * from "./SheetController.mjs";
|
|
5
|
+
export * from "./useSheetController.mjs";
|
|
6
|
+
export * from "./useSheetOpenState.mjs";
|
|
7
|
+
export * from "./useSheetOffscreenSize.mjs";
|
|
8
|
+
export * from "./SheetScrollView.mjs";
|
|
9
|
+
export * from "./nativeSheet.mjs";
|
|
10
|
+
export * from "./types.mjs";
|
|
11
|
+
export * from "./contexts.mjs";
|
|
12
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
+
value: true
|
|
19
|
+
}), mod);
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
module.exports = __toCommonJS(index_exports);
|
|
22
|
+
__reExport(index_exports, require("./Sheet.native.js"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./useSheet.native.js"), module.exports);
|
|
24
|
+
__reExport(index_exports, require("./createSheet.native.js"), module.exports);
|
|
25
|
+
__reExport(index_exports, require("./SheetController.native.js"), module.exports);
|
|
26
|
+
__reExport(index_exports, require("./useSheetController.native.js"), module.exports);
|
|
27
|
+
__reExport(index_exports, require("./useSheetOpenState.native.js"), module.exports);
|
|
28
|
+
__reExport(index_exports, require("./useSheetOffscreenSize.native.js"), module.exports);
|
|
29
|
+
__reExport(index_exports, require("./SheetScrollView.native.js"), module.exports);
|
|
30
|
+
__reExport(index_exports, require("./nativeSheet.native.js"), module.exports);
|
|
31
|
+
__reExport(index_exports, require("./types.native.js"), module.exports);
|
|
32
|
+
__reExport(index_exports, require("./contexts.native.js"), module.exports);
|
|
33
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA;AACd,IAAAC,gBAAc,GAAAF,MAAA,CAAAG,wBAAA;AACd,IAAAC,iBAAc,GAAAJ,MAAA,CAAAK,mBAAA;AACd,IAAAC,YAAc,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AACd,IAAAC,WAAc,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EACd,IAAAF,IAAA,IAAc,OAAAA,IAAA,wBAAAA,IAAA;IACd,SAAAG,GAAc,IAAAV,iBAAA,CAAAO,IAAA,GACd,KAAAL,YAAc,CAAAS,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EACdb,SAAc,CAAAW,EAAA,EAAAI,GAAA;MAAAE,GAAA,EAAAA,CAAA,KAAAL,IAAA,CAAAG,GAAA;MAAAG,UAAA,IAAAJ,IAAA,GAAAX,gBAAA,CAAAS,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAI;IAAA;EACd","ignoreList":[]}
|