@abhishekzambare/react-grid-dnd 0.0.5 → 0.0.7

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.
@@ -0,0 +1,85 @@
1
+ import { Context } from 'react';
2
+ import { JSX } from 'react/jsx-runtime';
3
+ import * as React_2 from 'react';
4
+ import { ReactNode } from 'react';
5
+
6
+ declare interface Bounds {
7
+ left: number;
8
+ height: number;
9
+ top: number;
10
+ right: number;
11
+ bottom: number;
12
+ width: number;
13
+ }
14
+
15
+ export declare const GridContext: Context<GridContextType>;
16
+
17
+ export declare function GridContextProvider({ children, onChange, }: GridContextProviderProps): JSX.Element;
18
+
19
+ declare interface GridContextProviderProps {
20
+ children: ReactNode;
21
+ onChange: (sourceId: string, sourceIndex: number, targetIndex: number, targetId?: string) => void;
22
+ }
23
+
24
+ declare interface GridContextType {
25
+ register: (id: string, options: RegisterOptions) => void;
26
+ remove: (id: string) => void;
27
+ measureAll: () => void;
28
+ getActiveDropId: (sourceId: string, x: number, y: number) => string | null;
29
+ startTraverse: (sourceId: string, targetId: string, x: number, y: number, sourceIndex: number) => void;
30
+ traverse: TraverseType | null;
31
+ endTraverse: () => void;
32
+ onChange: (sourceId: string, sourceIndex: number, targetIndex: number, targetId?: string) => void;
33
+ }
34
+
35
+ export declare function GridDropZone({ id, boxesPerRow, children, style, disableDrag, disableDrop, rowHeight, ...other }: GridDropZoneProps): JSX.Element;
36
+
37
+ export declare interface GridDropZoneProps extends React_2.HTMLAttributes<HTMLDivElement> {
38
+ boxesPerRow: number;
39
+ rowHeight: number;
40
+ id: string;
41
+ children: React_2.ReactNode[];
42
+ disableDrag?: boolean;
43
+ disableDrop?: boolean;
44
+ style?: React_2.CSSProperties;
45
+ }
46
+
47
+ export declare function GridItem({ children, style, className, ...other }: any): JSX.Element;
48
+
49
+ declare interface GridSettings {
50
+ boxesPerRow: number;
51
+ rowHeight: number;
52
+ columnWidth: number;
53
+ }
54
+
55
+ export declare function move<T>(source: T[], destination: T[], droppableSource: number, droppableDestination: number): T[][];
56
+
57
+ declare interface RegisterOptions extends Bounds {
58
+ /** The number of documents in each grid */
59
+ count: number;
60
+ /** grid info (boxes per row) */
61
+ grid: GridSettings;
62
+ /** whether the dropzone is disabled for dropping */
63
+ disableDrop: boolean;
64
+ remeasure: () => void;
65
+ }
66
+
67
+ export declare function swap<T>(array: T[], moveIndex: number, toIndex: number): T[];
68
+
69
+ /**
70
+ * A traverse captures information about dragging a grid item
71
+ * from one list to another.
72
+ */
73
+ declare interface TraverseType {
74
+ sourceId: string;
75
+ targetId: string;
76
+ rx: number;
77
+ ry: number;
78
+ tx: number;
79
+ ty: number;
80
+ sourceIndex: number;
81
+ targetIndex: number;
82
+ execute?: boolean;
83
+ }
84
+
85
+ export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@abhishekzambare/react-grid-dnd",
3
3
  "description": "grid style drag and drop for react",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "author": "Abhishek Zambare",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -46,6 +46,7 @@
46
46
  "devDependencies": {
47
47
  "@babel/core": "^7.29.0",
48
48
  "@eslint/js": "^10.0.1",
49
+ "@microsoft/api-extractor": "^7.58.7",
49
50
  "@rolldown/plugin-babel": "^0.2.3",
50
51
  "@types/babel__core": "^7.20.5",
51
52
  "@types/node": "^25.6.0",
@@ -61,8 +62,8 @@
61
62
  "react-dom": "^19.2.5",
62
63
  "typescript": "~6.0.3",
63
64
  "typescript-eslint": "^8.59.1",
64
- "vite": "^8.0.10",
65
- "vite-plugin-dts": "^5.0.0"
65
+ "unplugin-dts": "^1.0.0",
66
+ "vite": "^8.0.10"
66
67
  },
67
68
  "peerDependencies": {
68
69
  "react": "^19",