react-dragdrop-kit 1.2.0 → 1.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.
@@ -1,6 +1,9 @@
1
1
  import type { DraggableItem, OrderUpdate } from "../types";
2
- export declare function useDragDropMonitor<T extends DraggableItem>({ items, onReorder, disabled, }: {
2
+ export declare function useDragDropMonitor<T extends DraggableItem>({ items, onReorder, disabled, direction, selectedIds, multiDragEnabled, }: {
3
3
  items: T[];
4
4
  onReorder: (newItems: T[], orderUpdates: OrderUpdate[]) => void;
5
5
  disabled?: boolean;
6
- }): import("@atlaskit/pragmatic-drag-and-drop/dist/types/internal-types").CleanupFn;
6
+ direction?: "vertical" | "horizontal";
7
+ selectedIds?: string[];
8
+ multiDragEnabled?: boolean;
9
+ }): () => void;
@@ -79,7 +79,9 @@ export interface DragProvided {
79
79
  'aria-roledescription': string;
80
80
  };
81
81
  /** Ref to attach to the draggable element */
82
- innerRef: React.RefObject<HTMLElement>;
82
+ innerRef: React.RefObject<HTMLDivElement>;
83
+ /** Optional drop zone ref (used by column containers) */
84
+ dropZoneRef?: React.RefObject<HTMLDivElement>;
83
85
  }
84
86
  /**
85
87
  * Snapshot of current drag state
@@ -8,6 +8,12 @@ import type { KanbanBoardState, DragLocation } from '../types';
8
8
  * Reorder an array by moving an item from one index to another
9
9
  */
10
10
  export declare function reorderArray<T>(list: T[], startIndex: number, endIndex: number): T[];
11
+ export declare function normalizeReorderDestinationIndex(params: {
12
+ itemCount: number;
13
+ sourceIndex: number;
14
+ rawDestinationIndex: number;
15
+ isSameList: boolean;
16
+ }): number;
11
17
  /**
12
18
  * Move a card within the same column
13
19
  */
@@ -27,6 +27,9 @@ export type DragDropListProps<T extends DraggableItem> = {
27
27
  dropIndicatorClassName?: string;
28
28
  dropIndicatorStyle?: React.CSSProperties;
29
29
  dropIndicatorPosition?: "top" | "bottom";
30
+ dragHandle?: string;
31
+ selectedIds?: string[];
32
+ multiDragEnabled?: boolean;
30
33
  };
31
34
  export type DraggableItemWrapperProps<T extends DraggableItem> = {
32
35
  item: T;
@@ -43,4 +46,6 @@ export type DraggableItemWrapperProps<T extends DraggableItem> = {
43
46
  dropIndicatorClassName?: string;
44
47
  dropIndicatorStyle?: React.CSSProperties;
45
48
  dropIndicatorPosition?: "top" | "bottom";
49
+ direction?: "vertical" | "horizontal";
50
+ dragHandle?: string;
46
51
  };
@@ -1,3 +1,10 @@
1
1
  import type { DraggableItem, OrderUpdate } from '../types';
2
2
  export declare function reorder<T>(list: T[], startIndex: number, endIndex: number): T[];
3
+ export declare function normalizeDestinationIndex(params: {
4
+ itemCount: number;
5
+ sourceIndex: number;
6
+ rawDestinationIndex: number;
7
+ isSameList: boolean;
8
+ }): number;
9
+ export declare function reorderMany<T>(list: T[], selectedIndexes: number[], rawDestinationIndex: number): T[];
3
10
  export declare function calculateOrderUpdates<T extends DraggableItem>(oldItems: T[], newItems: T[]): OrderUpdate[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-dragdrop-kit",
3
3
  "author": "Souvik Sen <https://github.com/Yourstruggle11>",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "description": "A flexible, lightweight React drag-and-drop kit for building sortable lists, grids, and kanban boards with ease.",
6
6
  "license": "MIT",
7
7