@patternmode/stacksheet 1.3.3 → 1.3.4
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/dist/Drag/DragGeometry.d.ts +0 -12
- package/dist/Drag/DragGeometry.d.ts.map +1 -1
- package/dist/Drag/DragTypes.d.ts.map +1 -1
- package/dist/Drag/useDrag.d.ts.map +1 -1
- package/dist/SheetPanel/DefaultHeader.d.ts.map +1 -1
- package/dist/SheetPanel/SheetPanel.d.ts.map +1 -1
- package/dist/SheetPanel/SheetPanelContent.d.ts +1 -2
- package/dist/SheetPanel/SheetPanelContent.d.ts.map +1 -1
- package/dist/SheetPanel/SheetPanelFocus.d.ts.map +1 -1
- package/dist/SheetPanel/SheetPanelHandles.d.ts.map +1 -1
- package/dist/SheetPanel/SheetPanelLayout.d.ts +4 -0
- package/dist/SheetPanel/SheetPanelLayout.d.ts.map +1 -0
- package/dist/SheetPanel/SheetPanelTypes.d.ts.map +1 -1
- package/dist/SheetParts/SheetBack.d.ts.map +1 -1
- package/dist/SheetParts/SheetBody.d.ts.map +1 -1
- package/dist/SheetParts/SheetClose.d.ts.map +1 -1
- package/dist/SheetParts/SheetDescription.d.ts.map +1 -1
- package/dist/SheetParts/SheetFooter.d.ts.map +1 -1
- package/dist/SheetParts/SheetHandle.d.ts.map +1 -1
- package/dist/SheetParts/SheetHeader.d.ts.map +1 -1
- package/dist/SheetParts/SheetPartTypes.d.ts.map +1 -1
- package/dist/SheetParts/SheetTitle.d.ts.map +1 -1
- package/dist/Store/StoreArgs.d.ts.map +1 -1
- package/dist/Store/StoreTypes.d.ts.map +1 -1
- package/dist/Store/createSheetStore.d.ts.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/create.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +128 -108
- package/dist/index.mjs.map +1 -1
- package/dist/panel-context.d.ts.map +1 -1
- package/dist/parts.d.ts.map +1 -1
- package/dist/renderer-effects.d.ts.map +1 -1
- package/dist/renderer-helpers.d.ts.map +1 -1
- package/dist/renderer.d.ts.map +1 -1
- package/dist/snap-points.d.ts.map +1 -1
- package/dist/stacking.d.ts.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -4
- package/dist/Drag/index.d.ts +0 -3
- package/dist/Drag/index.d.ts.map +0 -1
- package/dist/SheetPanel/index.d.ts +0 -3
- package/dist/SheetPanel/index.d.ts.map +0 -1
- package/dist/SheetParts/index.d.ts +0 -11
- package/dist/SheetParts/index.d.ts.map +0 -1
- package/dist/Store/index.d.ts +0 -3
- package/dist/Store/index.d.ts.map +0 -1
- package/dist/use-drag.d.ts +0 -3
- package/dist/use-drag.d.ts.map +0 -1
|
@@ -6,12 +6,6 @@ export declare function isInteractiveElement(el: Element): boolean;
|
|
|
6
6
|
* Returns null if nothing is scrollable in the dismiss axis.
|
|
7
7
|
*/
|
|
8
8
|
export declare function findScrollableAncestor(el: Element, axis: DragAxis): Element | null;
|
|
9
|
-
/**
|
|
10
|
-
* Check if a scrollable element is at its edge in the dismiss direction.
|
|
11
|
-
* For bottom sheets (sign=1, axis=y), "at edge" means scrolled to top.
|
|
12
|
-
* For left panels (sign=-1, axis=x), "at edge" means scrolled to right end.
|
|
13
|
-
*/
|
|
14
|
-
export declare function isAtScrollEdge(el: Element, axis: DragAxis, sign: DragSign): boolean;
|
|
15
9
|
/**
|
|
16
10
|
* Get the dismiss direction axis and sign for a given side.
|
|
17
11
|
* - right panel → dismiss by dragging right (+x)
|
|
@@ -22,12 +16,6 @@ export declare function getDismissAxis(side: Side): {
|
|
|
22
16
|
axis: DragAxis;
|
|
23
17
|
sign: DragSign;
|
|
24
18
|
};
|
|
25
|
-
/**
|
|
26
|
-
* Decide whether a gesture past the dead zone qualifies as a dismiss drag.
|
|
27
|
-
* Returns "drag" if it's a valid dismiss gesture, "none" if it's off-axis
|
|
28
|
-
* or moving in the wrong direction.
|
|
29
|
-
*/
|
|
30
|
-
export declare function classifyGesture(dx: number, dy: number, axis: DragAxis, sign: DragSign): "drag" | "none";
|
|
31
19
|
/** Decide whether a pointer gesture commits as a drag or should be ignored. */
|
|
32
20
|
export declare function commitGesture(dx: number, dy: number, axis: DragAxis, sign: DragSign, scrollEl: Element | null): "drag" | "none";
|
|
33
21
|
export declare function getPanelDimension(panel: HTMLDivElement | null, axis: DragAxis): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragGeometry.d.ts","sourceRoot":"","sources":["../../src/Drag/DragGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAezD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"DragGeometry.d.ts","sourceRoot":"","sources":["../../src/Drag/DragGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAezD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,QAAQ,GACb,OAAO,GAAG,IAAI,CAmBhB;AAoBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;CAChB,CAWA;AAqCD,+EAA+E;AAC/E,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,OAAO,GAAG,IAAI,GACvB,MAAM,GAAG,MAAM,CASjB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,GAAG,IAAI,EAC5B,IAAI,EAAE,QAAQ,GACb,MAAM,CAKR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragTypes.d.ts","sourceRoot":"","sources":["../../src/Drag/DragTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,UAAU;
|
|
1
|
+
{"version":3,"file":"DragTypes.d.ts","sourceRoot":"","sources":["../../src/Drag/DragTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kDAAkD;IAClD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,iDAAiD;IACjD,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,qDAAqD;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,IAAI,EAAE,IAAI,CAAC;IACX,oFAAoF;IACpF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gEAAgE;IAChE,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,CAAC;AACjC,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrag.d.ts","sourceRoot":"","sources":["../../src/Drag/useDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;AAUvE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"useDrag.d.ts","sourceRoot":"","sources":["../../src/Drag/useDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;AAUvE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EAC1C,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,QA8MzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultHeader.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/DefaultHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"DefaultHeader.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/DefaultHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,GACV,EAAE,iBAAiB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CA2B5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPanel.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SheetPanel.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanel.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,eAAO,MAAM,UAAU,mSAyBpB,eAAe,6CAoNhB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
-
import type { HeaderRenderProps
|
|
2
|
+
import type { HeaderRenderProps } from "../types";
|
|
3
3
|
export declare const PanelInnerContent: import("react").MemoExoticComponent<({ isComposable, shouldRender, Content, data, renderHeader, headerProps, headerClassName, }: {
|
|
4
4
|
isComposable: boolean;
|
|
5
5
|
shouldRender: boolean;
|
|
@@ -9,5 +9,4 @@ export declare const PanelInnerContent: import("react").MemoExoticComponent<({ i
|
|
|
9
9
|
headerProps: HeaderRenderProps;
|
|
10
10
|
headerClassName: string | undefined;
|
|
11
11
|
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
12
|
-
export declare function resolvePanelLayout(layout: StacksheetLayout | undefined, renderHeader?: false | ((props: HeaderRenderProps) => ReactNode)): StacksheetLayout;
|
|
13
12
|
//# sourceMappingURL=SheetPanelContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPanelContent.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"SheetPanelContent.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,eAAO,MAAM,iBAAiB,mIAQ3B;IACD,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IAEtB,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC;IACjE,WAAW,EAAE,iBAAiB,CAAC;IAC/B,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC,oDAsBC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPanelFocus.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelFocus.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlD,wBAAgB,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetPanelFocus.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelFocus.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC3C,QAAQ,EAAE,SAAS,CAAC;CACrB,2UA8BA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPanelHandles.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelHandles.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAerE;AAED,wBAAgB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetPanelHandles.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelHandles.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAerE;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,SAAS,EACT,SAAS,GACV,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,2CAyBA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { HeaderRenderProps, StacksheetLayout } from "../types";
|
|
3
|
+
export declare function resolvePanelLayout(layout: StacksheetLayout | undefined, renderHeader?: false | ((props: HeaderRenderProps) => ReactNode)): StacksheetLayout;
|
|
4
|
+
//# sourceMappingURL=SheetPanelLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetPanelLayout.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEpE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,GAC/D,gBAAgB,CAKlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPanelTypes.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SheetPanelTypes.d.ts","sourceRoot":"","sources":["../../src/SheetPanel/SheetPanelTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,IAAI,EACJ,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IAExB,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACxC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC;IACjE,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetBack.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetBack.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,wBAAgB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetBack.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetBack.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,6BAA6B,kDAsB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetBody.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetBody.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetBody.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetBody.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,2CAkChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetClose.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetClose.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,wBAAgB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetClose.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetClose.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,6BAA6B,2CAiB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetDescription.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetDescription.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetDescription.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetDescription.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,2CAUhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetFooter.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetFooter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetFooter.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetFooter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,2CAUhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetHandle.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetHandle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,wBAAgB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetHandle.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetHandle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,6BAA6B,2CA4B/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetHeader.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetHeader.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetHeader.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetHeader.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,2CAYhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPartTypes.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetPartTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"SheetPartTypes.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetPartTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC;AAC5C,MAAM,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAC5D,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AACnD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC9C,MAAM,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetTitle.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetTitle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"SheetTitle.d.ts","sourceRoot":"","sources":["../../src/SheetParts/SheetTitle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,2CAahB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreArgs.d.ts","sourceRoot":"","sources":["../../src/Store/StoreArgs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/D,wBAAgB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"StoreArgs.d.ts","sourceRoot":"","sources":["../../src/Store/StoreArgs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/D,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,wBAAwB,GAAG,SAAS,CAYtC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,YAAY,EACvB,iBAAiB,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,EAC5C,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,IAAI,CA8BN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,iBAAiB,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,EAC5C,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACvC,UAAU,EAAE,MAAM,MAAM,EACxB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,OAAO,GACf,YAAY,CAkCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreTypes.d.ts","sourceRoot":"","sources":["../../src/Store/StoreTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGjE,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAE9C,MAAM,MAAM,UAAU,CAAC,IAAI,SAAS,MAAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"StoreTypes.d.ts","sourceRoot":"","sources":["../../src/Store/StoreTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGjE,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAE9C,MAAM,MAAM,UAAU,CAAC,IAAI,SAAS,MAAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,GACpE,YAAY,CAAC,IAAI,CAAC,CAAC;AAErB,yEAAyE;AACzE,MAAM,WAAW,gBAAgB,CAAC,IAAI,SAAS,MAAM;IACnD,2DAA2D;IAC3D,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACxC,6CAA6C;IAC7C,iBAAiB,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC7C,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;CACnC;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSheetStore.d.ts","sourceRoot":"","sources":["../../src/Store/createSheetStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,UAAU,CAAC;AAM1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createSheetStore.d.ts","sourceRoot":"","sources":["../../src/Store/createSheetStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,UAAU,CAAC;AAM1D,OAAO,KAAK,EAGV,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAClD,MAAM,EAAE,cAAc,GACrB,gBAAgB,CAAC,IAAI,CAAC,CAyOxB"}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAKd,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAuCjB,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,MAAM,GAAE,gBAAqB,GAAG,cAAc,CA6B3E"}
|
package/dist/create.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,gBAAgB,EAChB,kBAAkB,EAGnB,MAAM,SAAS,CAAC;AAKjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAClD,MAAM,CAAC,EAAE,gBAAgB,GACxB,kBAAkB,CAAC,IAAI,CAAC,CAmF1B"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAEV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,YAAY,EAEZ,qBAAqB,EAErB,SAAS,EACT,IAAI,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EAEZ,cAAc,EAEd,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAElB,uBAAuB,EAEvB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Portal } from "@radix-ui/react-portal";
|
|
3
|
-
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { createStore, useStore } from "zustand";
|
|
5
5
|
import { useShallow } from "zustand/react/shallow";
|
|
6
|
-
import { AnimatePresence,
|
|
6
|
+
import { AnimatePresence, LazyMotion, domMax, m, useReducedMotion } from "motion/react";
|
|
7
7
|
import { RemoveScroll } from "react-remove-scroll";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { FocusTrap } from "focus-trap-react";
|
|
@@ -142,7 +142,7 @@ function useViewportHeight(active) {
|
|
|
142
142
|
const getHeight = useCallback(() => typeof window === "undefined" ? 0 : window.visualViewport?.height ?? window.innerHeight, []);
|
|
143
143
|
const [height, setHeight] = useState(() => getHeight());
|
|
144
144
|
useEffect(() => {
|
|
145
|
-
if (
|
|
145
|
+
if (typeof window === "undefined") return;
|
|
146
146
|
const update = () => setHeight(getHeight());
|
|
147
147
|
update();
|
|
148
148
|
window.addEventListener("resize", update);
|
|
@@ -151,8 +151,8 @@ function useViewportHeight(active) {
|
|
|
151
151
|
window.removeEventListener("resize", update);
|
|
152
152
|
window.visualViewport?.removeEventListener("resize", update);
|
|
153
153
|
};
|
|
154
|
-
}, [
|
|
155
|
-
return height;
|
|
154
|
+
}, [getHeight]);
|
|
155
|
+
return active ? height : 0;
|
|
156
156
|
}
|
|
157
157
|
function useBodyScale(config, isOpen, prefersReducedMotion) {
|
|
158
158
|
useEffect(() => {
|
|
@@ -216,7 +216,11 @@ function resolveSnapPointPx(point, viewportHeight) {
|
|
|
216
216
|
*/
|
|
217
217
|
function resolveSnapPoints(points, viewportHeight) {
|
|
218
218
|
if (points.length === 0) return [];
|
|
219
|
-
const resolved =
|
|
219
|
+
const resolved = [];
|
|
220
|
+
for (const point of points) {
|
|
221
|
+
const px = resolveSnapPointPx(point, viewportHeight);
|
|
222
|
+
if (px > 0) resolved.push(px);
|
|
223
|
+
}
|
|
220
224
|
resolved.sort((a, b) => a - b);
|
|
221
225
|
const deduped = [];
|
|
222
226
|
for (const px of resolved) {
|
|
@@ -601,27 +605,36 @@ function useDrag(panelRef, config, onDragUpdate) {
|
|
|
601
605
|
isDragging: false
|
|
602
606
|
});
|
|
603
607
|
}, [onDragUpdate]);
|
|
608
|
+
const handlersRef = useRef({
|
|
609
|
+
handlePointerCancel,
|
|
610
|
+
handlePointerDown,
|
|
611
|
+
handlePointerMove,
|
|
612
|
+
handlePointerUp
|
|
613
|
+
});
|
|
614
|
+
handlersRef.current = {
|
|
615
|
+
handlePointerCancel,
|
|
616
|
+
handlePointerDown,
|
|
617
|
+
handlePointerMove,
|
|
618
|
+
handlePointerUp
|
|
619
|
+
};
|
|
604
620
|
useEffect(() => {
|
|
605
621
|
const el = panelRef.current;
|
|
606
622
|
if (!(el && config.enabled)) return;
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
623
|
+
const onPointerDown = (event) => handlersRef.current.handlePointerDown(event);
|
|
624
|
+
const onPointerMove = (event) => handlersRef.current.handlePointerMove(event);
|
|
625
|
+
const onPointerUp = (event) => handlersRef.current.handlePointerUp(event);
|
|
626
|
+
const onPointerCancel = () => handlersRef.current.handlePointerCancel();
|
|
627
|
+
el.addEventListener("pointerdown", onPointerDown);
|
|
628
|
+
el.addEventListener("pointermove", onPointerMove);
|
|
629
|
+
el.addEventListener("pointerup", onPointerUp);
|
|
630
|
+
el.addEventListener("pointercancel", onPointerCancel);
|
|
611
631
|
return () => {
|
|
612
|
-
el.removeEventListener("pointerdown",
|
|
613
|
-
el.removeEventListener("pointermove",
|
|
614
|
-
el.removeEventListener("pointerup",
|
|
615
|
-
el.removeEventListener("pointercancel",
|
|
632
|
+
el.removeEventListener("pointerdown", onPointerDown);
|
|
633
|
+
el.removeEventListener("pointermove", onPointerMove);
|
|
634
|
+
el.removeEventListener("pointerup", onPointerUp);
|
|
635
|
+
el.removeEventListener("pointercancel", onPointerCancel);
|
|
616
636
|
};
|
|
617
|
-
}, [
|
|
618
|
-
panelRef,
|
|
619
|
-
config.enabled,
|
|
620
|
-
handlePointerDown,
|
|
621
|
-
handlePointerMove,
|
|
622
|
-
handlePointerUp,
|
|
623
|
-
handlePointerCancel
|
|
624
|
-
]);
|
|
637
|
+
}, [panelRef, config.enabled]);
|
|
625
638
|
}
|
|
626
639
|
//#endregion
|
|
627
640
|
//#region src/panel-context.tsx
|
|
@@ -813,10 +826,6 @@ const PanelInnerContent = memo(function PanelInnerContent({ isComposable, should
|
|
|
813
826
|
})] });
|
|
814
827
|
});
|
|
815
828
|
PanelInnerContent.displayName = "PanelInnerContent";
|
|
816
|
-
function resolvePanelLayout(layout, renderHeader) {
|
|
817
|
-
if (layout) return layout;
|
|
818
|
-
return renderHeader === false ? "composable" : "classic";
|
|
819
|
-
}
|
|
820
829
|
//#endregion
|
|
821
830
|
//#region src/SheetPanel/SheetPanelFocus.tsx
|
|
822
831
|
const LAYERED_MODAL_SELECTORS = [
|
|
@@ -846,26 +855,20 @@ function ModalFocusTrap({ enabled, active, fallbackRef, children }) {
|
|
|
846
855
|
});
|
|
847
856
|
}
|
|
848
857
|
function useLayeredModalFocused(active) {
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
evaluate();
|
|
864
|
-
const handler = () => evaluate();
|
|
865
|
-
document.addEventListener("focusin", handler, true);
|
|
866
|
-
return () => document.removeEventListener("focusin", handler, true);
|
|
867
|
-
}, [active]);
|
|
868
|
-
return layered;
|
|
858
|
+
const layered = useSyncExternalStore(subscribeToFocusTarget, getLayeredModalFocused, getServerLayeredModalFocused);
|
|
859
|
+
return active && layered;
|
|
860
|
+
}
|
|
861
|
+
function subscribeToFocusTarget(onStoreChange) {
|
|
862
|
+
document.addEventListener("focusin", onStoreChange, true);
|
|
863
|
+
return () => document.removeEventListener("focusin", onStoreChange, true);
|
|
864
|
+
}
|
|
865
|
+
function getServerLayeredModalFocused() {
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
function getLayeredModalFocused() {
|
|
869
|
+
if (typeof document === "undefined") return false;
|
|
870
|
+
const target = document.activeElement;
|
|
871
|
+
return !!target && target !== document.body && target instanceof Element && target.closest(LAYERED_MODAL_SELECTORS) !== null;
|
|
869
872
|
}
|
|
870
873
|
//#endregion
|
|
871
874
|
//#region src/SheetPanel/SheetPanelHandles.tsx
|
|
@@ -884,7 +887,7 @@ function BottomHandle({ onDismiss }) {
|
|
|
884
887
|
}
|
|
885
888
|
function SideHandle({ side, isHovered, onDismiss }) {
|
|
886
889
|
const position = side === "right" ? { right: "100%" } : { left: "100%" };
|
|
887
|
-
return /* @__PURE__ */ jsx(
|
|
890
|
+
return /* @__PURE__ */ jsx(m.div, {
|
|
888
891
|
animate: { opacity: isHovered ? 1 : 0 },
|
|
889
892
|
"aria-label": "Dismiss",
|
|
890
893
|
className: "absolute top-0 bottom-0 flex w-6 cursor-grab touch-none items-center justify-center",
|
|
@@ -910,6 +913,12 @@ function SideHandle({ side, isHovered, onDismiss }) {
|
|
|
910
913
|
});
|
|
911
914
|
}
|
|
912
915
|
//#endregion
|
|
916
|
+
//#region src/SheetPanel/SheetPanelLayout.ts
|
|
917
|
+
function resolvePanelLayout(layout, renderHeader) {
|
|
918
|
+
if (layout) return layout;
|
|
919
|
+
return renderHeader === false ? "composable" : "classic";
|
|
920
|
+
}
|
|
921
|
+
//#endregion
|
|
913
922
|
//#region src/SheetPanel/SheetPanel.tsx
|
|
914
923
|
const SheetPanel = memo(function SheetPanel({ item, index, depth, isTop, isNested, side, config, classNames, Content, shouldRender, pop, close, swipeClose, swipePop, snapHeights, activeSnapIndex, onSnap, layout, renderHeader, slideFrom, slideTarget, spring, stackSpring, prefersReducedMotion }) {
|
|
915
924
|
const panelRef = useRef(null);
|
|
@@ -994,7 +1003,7 @@ const SheetPanel = memo(function SheetPanel({ item, index, depth, isTop, isNeste
|
|
|
994
1003
|
const initialRadius = getInitialRadius(side);
|
|
995
1004
|
const showSideHandle = isTop && side !== "bottom";
|
|
996
1005
|
const showBottomHandle = isTop && side === "bottom";
|
|
997
|
-
const panelContent = /* @__PURE__ */ jsxs(
|
|
1006
|
+
const panelContent = /* @__PURE__ */ jsxs(m.div, {
|
|
998
1007
|
animate: animateTarget,
|
|
999
1008
|
className: classNames.panel || void 0,
|
|
1000
1009
|
exit: {
|
|
@@ -1077,18 +1086,26 @@ function SheetRenderer({ store, config, sheets, componentMap, classNames: classN
|
|
|
1077
1086
|
config.snapPoints,
|
|
1078
1087
|
viewportHeight
|
|
1079
1088
|
]);
|
|
1080
|
-
const
|
|
1089
|
+
const snapContext = isOpen ? stack.map((item) => item.id).join("\0") : "";
|
|
1090
|
+
const defaultSnapIndex = snapHeights.length > 0 ? snapHeights.length - 1 : 0;
|
|
1091
|
+
const [internalSnap, setInternalSnap] = useState({
|
|
1092
|
+
context: "",
|
|
1093
|
+
index: defaultSnapIndex,
|
|
1094
|
+
snapCount: snapHeights.length
|
|
1095
|
+
});
|
|
1096
|
+
const internalSnapIndex = internalSnap.context === snapContext && internalSnap.snapCount === snapHeights.length ? internalSnap.index : defaultSnapIndex;
|
|
1081
1097
|
const activeSnapIndex = config.snapPointIndex ?? internalSnapIndex;
|
|
1082
1098
|
const handleSnap = useCallback((index) => {
|
|
1083
|
-
|
|
1099
|
+
setInternalSnap({
|
|
1100
|
+
context: snapContext,
|
|
1101
|
+
index,
|
|
1102
|
+
snapCount: snapHeights.length
|
|
1103
|
+
});
|
|
1084
1104
|
config.onSnapPointChange?.(index);
|
|
1085
|
-
}, [config.onSnapPointChange, config]);
|
|
1086
|
-
useEffect(() => {
|
|
1087
|
-
if (isOpen && snapHeights.length > 0) setInternalSnapIndex(config.snapPointIndex ?? snapHeights.length - 1);
|
|
1088
1105
|
}, [
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1106
|
+
config,
|
|
1107
|
+
snapContext,
|
|
1108
|
+
snapHeights.length
|
|
1092
1109
|
]);
|
|
1093
1110
|
const closeReasonRef = useRef("programmatic");
|
|
1094
1111
|
const closeWith = useCallback((reason) => {
|
|
@@ -1186,60 +1203,63 @@ function SheetRenderer({ store, config, sheets, componentMap, classNames: classN
|
|
|
1186
1203
|
const swipeClose = useCallback(() => closeWith("swipe"), [closeWith]);
|
|
1187
1204
|
const swipePop = useCallback(() => popWith("swipe"), [popWith]);
|
|
1188
1205
|
const shouldLockScroll = isOpen && isModal && config.lockScroll;
|
|
1189
|
-
return /* @__PURE__ */ jsxs(
|
|
1190
|
-
|
|
1191
|
-
children:
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
children:
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1206
|
+
return /* @__PURE__ */ jsxs(LazyMotion, {
|
|
1207
|
+
features: domMax,
|
|
1208
|
+
children: [showOverlay && /* @__PURE__ */ jsx(AnimatePresence, {
|
|
1209
|
+
onExitComplete: handleBackdropExitComplete,
|
|
1210
|
+
children: isOpen && /* @__PURE__ */ jsx(m.div, {
|
|
1211
|
+
animate: { opacity: 1 },
|
|
1212
|
+
className: `fixed inset-0 ${classNames.backdrop || ""}`,
|
|
1213
|
+
exit: { opacity: 0 },
|
|
1214
|
+
initial: { opacity: 0 },
|
|
1215
|
+
onClick: config.closeOnBackdrop && config.dismissible ? () => closeWith("backdrop") : void 0,
|
|
1216
|
+
style: backdropStyle,
|
|
1217
|
+
transition: spring
|
|
1218
|
+
}, "stacksheet-backdrop")
|
|
1219
|
+
}), /* @__PURE__ */ jsx(RemoveScroll, {
|
|
1220
|
+
enabled: shouldLockScroll,
|
|
1221
|
+
forwardProps: true,
|
|
1222
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1223
|
+
className: "pointer-events-none fixed inset-0 overflow-hidden",
|
|
1224
|
+
style: { zIndex: config.zIndex + 1 },
|
|
1225
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
1226
|
+
onExitComplete: handleExitComplete,
|
|
1227
|
+
children: stack.map((item, index) => {
|
|
1228
|
+
const depth = stack.length - 1 - index;
|
|
1229
|
+
const isTop = depth === 0;
|
|
1230
|
+
const isNested = index > 0;
|
|
1231
|
+
const shouldRender = depth <= config.stacking.renderThreshold;
|
|
1232
|
+
return /* @__PURE__ */ jsx(SheetPanel, {
|
|
1233
|
+
activeSnapIndex,
|
|
1234
|
+
Content: componentMap.get(item.type) ?? sheets[item.type],
|
|
1235
|
+
classNames,
|
|
1236
|
+
close,
|
|
1237
|
+
config,
|
|
1238
|
+
depth,
|
|
1239
|
+
index,
|
|
1240
|
+
isNested,
|
|
1241
|
+
isTop,
|
|
1242
|
+
item,
|
|
1243
|
+
layout,
|
|
1244
|
+
onSnap: handleSnap,
|
|
1245
|
+
pop,
|
|
1246
|
+
prefersReducedMotion,
|
|
1247
|
+
renderHeader,
|
|
1248
|
+
shouldRender,
|
|
1249
|
+
side,
|
|
1250
|
+
slideFrom,
|
|
1251
|
+
slideTarget,
|
|
1252
|
+
snapHeights,
|
|
1253
|
+
spring,
|
|
1254
|
+
stackSpring,
|
|
1255
|
+
swipeClose,
|
|
1256
|
+
swipePop
|
|
1257
|
+
}, item.id);
|
|
1258
|
+
})
|
|
1239
1259
|
})
|
|
1240
1260
|
})
|
|
1241
|
-
})
|
|
1242
|
-
})
|
|
1261
|
+
})]
|
|
1262
|
+
});
|
|
1243
1263
|
}
|
|
1244
1264
|
//#endregion
|
|
1245
1265
|
//#region src/Store/StoreArgs.ts
|