@photoroom/ui 0.1.299 → 0.1.301
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/hooks/useDragToScroll.d.ts +9 -7
- package/hooks/useDragToScroll.d.ts.map +1 -1
- package/index.mjs +11773 -11768
- package/package.json +2 -2
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export type UseDragToScrollOptions = {
|
|
1
|
+
export type UseDragToScrollOptions<T extends HTMLElement = HTMLDivElement> = {
|
|
2
2
|
disabled?: boolean;
|
|
3
|
+
ref?: React.RefObject<T | null>;
|
|
3
4
|
};
|
|
4
|
-
export type UseDragToScroll = {
|
|
5
|
-
ref: React.RefObject<
|
|
6
|
-
onPointerDown: (e: React.PointerEvent<
|
|
7
|
-
onClickCapture: (e: React.MouseEvent<
|
|
5
|
+
export type UseDragToScroll<T extends HTMLElement = HTMLDivElement> = {
|
|
6
|
+
ref: React.RefObject<T | null>;
|
|
7
|
+
onPointerDown: (e: React.PointerEvent<T>) => void;
|
|
8
|
+
onClickCapture: (e: React.MouseEvent<T>) => void;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* Click-and-drag horizontal scrolling for an overflow-x container. Spread the
|
|
11
12
|
* returned `ref`, `onPointerDown` and `onClickCapture` onto the scroller. Pair
|
|
12
|
-
* with `touch-action: pan-x` so touch panning still works.
|
|
13
|
+
* with `touch-action: pan-x` so touch panning still works. Pass an existing
|
|
14
|
+
* `ref` to attach to a scroller the caller already references.
|
|
13
15
|
*/
|
|
14
|
-
export declare const useDragToScroll: ({ disabled, }?: UseDragToScrollOptions) => UseDragToScroll
|
|
16
|
+
export declare const useDragToScroll: <T extends HTMLElement = HTMLDivElement>({ disabled, ref: externalRef, }?: UseDragToScrollOptions<T>) => UseDragToScroll<T>;
|
|
15
17
|
//# sourceMappingURL=useDragToScroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDragToScroll.d.ts","sourceRoot":"","sources":["../../src/hooks/useDragToScroll.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,GAAG;
|
|
1
|
+
{"version":3,"file":"useDragToScroll.d.ts","sourceRoot":"","sources":["../../src/hooks/useDragToScroll.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,WAAW,GAAG,cAAc,IAAI;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,cAAc,IAAI;IACpE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/B,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,GAAG,cAAc,EAAE,kCAGrE,sBAAsB,CAAC,CAAC,CAAM,KAAG,eAAe,CAAC,CAAC,CAwDpD,CAAC"}
|