Primitives / foldkit-primitives/dom

Move

const · packages/primitives/src/dom/move.ts:51

const Move: Mount.MountDefinitionNoArgs<
  'Move',
  | {
      readonly _tag: 'MoveStarted'
      readonly pointerId: number
      readonly pointerType: string
    }
  | {
      readonly _tag: 'Moved'
      readonly pointerId: number
      readonly deltaX: number
      readonly deltaY: number
      readonly pointerType: string
    }
  | {
      readonly _tag: 'MoveEnded'
      readonly pointerId: number
      readonly completed: boolean
    }
>

Pointer movement on an element as a Mount: a primary-button pointer down captures the pointer, each move reports the delta from where it started, and up ends it completed, while cancel, lost capture, or Escape ends it not completed (the Escape is the drag's and goes no further; the Model, which kept the start, drops the draft). Nothing is decided here: a drag threshold, a snap, or a constraint is the parent's update. Capture is released with the Mount.