@whittakertech/mosaic / DragContext
Interface: DragContext
Defined in: drag/context.ts:20
Immutable context object describing the current drag operation.
A DragContext provides a stable, serializable view of MosaicJS’s internal drag state at a specific moment in time.
It is passed to lifecycle hooks and emitted with relevant events to allow external systems to observe drag behavior safely.
Remarks
- A DragContext is read-only and frozen at creation time.
- It represents a snapshot of state, not a live reference.
- Consumers must not attempt to mutate or persist this object.
The shape of DragContext is considered part of MosaicJS’s stable public API.
Properties
activeNodeId
readonly activeNodeId: string | null;Defined in: drag/context.ts:25
Currently dragged node ID, or null when idle
dropTargetId
readonly dropTargetId: string | null;Defined in: drag/context.ts:28
Resolved drop target node ID, or null when none
hasSnapshot
readonly hasSnapshot: boolean;Defined in: drag/context.ts:40
Whether a drag snapshot currently exists
mosaicRootId
readonly mosaicRootId: string;Defined in: drag/context.ts:22
Root Mosaic instance identifier
pointer
readonly pointer: object;Defined in: drag/context.ts:31
Pointer position at time of emission
x
readonly x: number;y
readonly y: number;state
readonly state: MosaicState;Defined in: drag/context.ts:37
Current Mosaic drag lifecycle state