@voxel51/voodo 0.0.25 → 0.0.26
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/components/ImageList/ImageList.d.ts +67 -0
- package/dist/components/ImageList/ImageList.d.ts.map +1 -0
- package/dist/components/ImageList/index.d.ts +2 -0
- package/dist/components/ImageList/index.d.ts.map +1 -0
- package/dist/components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/components/Pill/Pill.d.ts.map +1 -1
- package/dist/components/Toolbar/Toolbar.d.ts +16 -7
- package/dist/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3334 -3247
- package/dist/index.js.map +1 -1
- package/dist/util/useDraggable.d.ts +16 -8
- package/dist/util/useDraggable.d.ts.map +1 -1
- package/dist/voodo.css +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface UseDraggableOptions {
|
|
3
|
-
/** Initial
|
|
4
|
-
initialX?: number;
|
|
5
|
-
/** Initial
|
|
6
|
-
initialY?: number;
|
|
3
|
+
/** Initial offset from the left edge of the bounding container. Accepts any CSS length (e.g. `0`, `"10%"`, `"2rem"`). Default `0`. */
|
|
4
|
+
initialX?: string | number;
|
|
5
|
+
/** Initial offset from the top edge of the bounding container. Accepts any CSS length (e.g. `0`, `"10%"`, `"2rem"`). Default `0`. */
|
|
6
|
+
initialY?: string | number;
|
|
7
7
|
/** Lock horizontal (x-axis) movement. Default `false`. */
|
|
8
8
|
lockX?: boolean;
|
|
9
9
|
/** Lock vertical (y-axis) movement. Default `false`. */
|
|
@@ -14,12 +14,20 @@ export interface UseDraggableOptions {
|
|
|
14
14
|
* `position: fixed`. Default `false`.
|
|
15
15
|
*/
|
|
16
16
|
portal?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Called after every drag move with the new pixel position.
|
|
19
|
+
* Always delivers pixel values regardless of what type `initialX`/`initialY` were.
|
|
20
|
+
*/
|
|
21
|
+
onPositionChange?: (pos: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}) => void;
|
|
17
25
|
}
|
|
18
26
|
export interface UseDraggableReturn {
|
|
19
|
-
/** Current `{ x, y }` position
|
|
27
|
+
/** Current `{ x, y }` position. Before the first drag this reflects the initial CSS value; after the first drag it is always a pixel number. */
|
|
20
28
|
position: {
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
29
|
+
x: string | number;
|
|
30
|
+
y: string | number;
|
|
23
31
|
};
|
|
24
32
|
/** `true` while the user is actively dragging. */
|
|
25
33
|
isDragging: boolean;
|
|
@@ -55,5 +63,5 @@ export interface UseDraggableReturn {
|
|
|
55
63
|
* );
|
|
56
64
|
* ```
|
|
57
65
|
*/
|
|
58
|
-
export declare const useDraggable: ({ initialX, initialY, lockX, lockY, portal, }?: UseDraggableOptions) => UseDraggableReturn;
|
|
66
|
+
export declare const useDraggable: ({ initialX, initialY, lockX, lockY, portal, onPositionChange, }?: UseDraggableOptions) => UseDraggableReturn;
|
|
59
67
|
//# sourceMappingURL=useDraggable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDraggable.d.ts","sourceRoot":"","sources":["../../src/util/useDraggable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useDraggable.d.ts","sourceRoot":"","sources":["../../src/util/useDraggable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AASxE,MAAM,WAAW,mBAAmB;IAClC,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,qIAAqI;IACrI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAkB;IACjC,gJAAgJ;IAChJ,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACrD,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAClD;;;OAGG;IACH,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,YAAY,GAAI,kEAO1B,mBAAwB,KAAG,kBA8F7B,CAAC"}
|