@react-hive/honey-layout 9.0.0 → 9.2.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.
@@ -6,12 +6,13 @@ import { Nullable } from '../types';
6
6
  * @template Element - The type of the draggable element (must extend HTMLElement).
7
7
  *
8
8
  * @param draggableElement - The element being dragged.
9
+ * @param e - The event that initiated the drag. Can be either a `MouseEvent` or a `TouchEvent`.
9
10
  *
10
11
  * @returns A Promise that resolves to a boolean:
11
12
  * - `false` to cancel the drag.
12
13
  * - `true` to proceed with the drag.
13
14
  */
14
- export type HoneyDragOnStartHandler<Element extends HTMLElement> = (draggableElement: Element) => Promise<boolean>;
15
+ export type HoneyDragOnStartHandler<Element extends HTMLElement> = (draggableElement: Element, e: MouseEvent | TouchEvent) => Promise<boolean>;
15
16
  /**
16
17
  * Context provided to the move handler, containing information about the drag's movement.
17
18
  */
@@ -83,10 +84,11 @@ interface HoneyDragEndContext {
83
84
  * @param context - The context containing details about the drag operation at its end.
84
85
  * Provides information such as the final position and drag result.
85
86
  * @param draggableElement - The element that was being dragged.
87
+ * @param e - The event that ended the drag. Can be either a `MouseEvent` or a `TouchEvent`.
86
88
  *
87
89
  * @returns A Promise that resolves when the end handler completes its operations.
88
90
  */
89
- export type HoneyDragOnEndHandler<Element extends HTMLElement> = (context: HoneyDragEndContext, draggableElement: Element) => Promise<void>;
91
+ export type HoneyDragOnEndHandler<Element extends HTMLElement> = (context: HoneyDragEndContext, draggableElement: Element, e: MouseEvent | TouchEvent) => Promise<void>;
90
92
  /**
91
93
  * A set of handlers that define the behavior of the drag operation at different stages.
92
94
  * These handlers are customizable for managing drag initialization, movement, and completion.