/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. * * The canvas as a drag TARGET: library cards land on a row at an instant, and * the canvas's own runs, chips, tiles and marks move and resize on it (#825). * Rows register their own cells (`RowShell`); this registers the surface * those cells name and hands every completed drag to the editing session, * which drafts it into the entry its row came from (#880). * * A target is a named surface (cells are addressed `surface × row × slot`). * The cards of the Plan's own library panel — its author's tabs — reach the * canvas whether or not it declares an `id` (#1259): the Plan takes its own * panel's cards without `sources`. A Library beside the Plan reaches it by the * root's `id`, so its cards land only on a canvas that declares one and lists * the Library in `sources` (the root's `id` is `none` otherwise, #824). The * canvas's own runs, chips, tiles and marks move with or without it (#825): * with no `id` the canvas names a surface of its own, which only its panel's * cards reach. Either way the editing session must be able to take the * gesture — a drop with nowhere to go is a gesture that silently loses work — * or nothing registers, so no row lights up and no drag can complete against * a canvas that cannot act on it. `canDrop` still vets every drop — at the * pointer, and once more before it is delivered — before it becomes a draft. * * Beside a Plan's event kinds (#1196) the canvas takes their drags too: the * Events and Backlog tabs' cards and an author's tab's cards with a `drop`, a * card dropped on an event kind's row; the kinds' elements moved and resized * on their rows; and an element returned to the Backlog tab, which the * surface names as the one library its elements return to — with no trash * zone, since nothing of the canvas's is thrown away by a drag. The event * kinds judge each and say why not on the ghost (`edit/event-drag.ts`). * * @packageDocumentation */ import { type DragEventValue, type DragMeta } from "@elaraai/east-ui-components"; import type { PlanVeto } from "../edit/candidate.js"; import type { PlanDropAnswer, PlanEventDrop } from "../edit/event-drag.js"; import type { PlanRootValue } from "../model.js"; import type { PlanRowDrop } from "../rows/RowShell.js"; /** * Register the canvas as a drop target while `data`'s editing session or its * event kinds take a gesture — named by its `id`, or by a surface of its own * when it declares none. * * @param value - The latest root (its `id`) * @param sources - The library ids beside the Plan accepted for `add` drags (data-stable) * @param panel - The library ids of the Plan's own panel tabs whose cards land on its rows (data-stable) * @param onDrop - Where a completed drag goes — a card's drop, an element's move or resize, an element's return — answering whether it was taken, or the words a drop that did something else is announced by (stable) * @param data - Whether `data`'s editing session takes a gesture now * @param events - The event kinds' drag and drop (#1196), for a Plan of event kinds * @param veto - The Plan's veto over what a drop would do (#1541, U7): the root's `canDrop`, which `data`'s rows ask * @returns The per-row drop registration every droppable row shares, or * `undefined` when the canvas is not a target */ export declare function usePlanDropTarget(value: PlanRootValue, sources: readonly string[], panel: readonly string[], onDrop: (event: DragEventValue, meta?: DragMeta) => PlanDropAnswer, data: boolean, events?: PlanEventDrop, veto?: PlanVeto): PlanRowDrop | undefined; //# sourceMappingURL=drop.d.ts.map