Transfer scope
Generated by
website/scripts/generate-api.tsfrompackages/gridla/src. Do not edit by hand; runbun run generateinwebsite/.
Move items between controllers. createTransferScope hit-tests registered canvases against resting rects, previews the drop in the target, and commits it on release.
Functions
createTransferScope
Create a TransferScope. Pass it to every createGridController whose
items may move between each other (option scope); the controllers register
themselves and unregister on destroy().
measurePreviewShift
How far a canvas' drop preview has moved the item that hosts element,
right now, in client pixels. A preview pushes neighbors aside, and one of
them may be another canvas that a drag is being hit-tested against (the
source it came from, or a candidate target). Testing the moving rect lets
that canvas win as it slides under the pointer, which clears the preview,
slides it back, and repeats. Subtract this displacement from the element's
rect to test against its resting position instead. Returns zero when
element is not inside targetElement or no preview is active.
Types
TransferRegistration
One canvas registered in a TransferScope. createGridController builds this from its options.
TransferScope
Coordinates item moves between canvases. The pointer decides the target: the deepest registered canvas under the pointer that accepts the item previews the drop; releasing there commits it.