/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * Dropping a query into the builder (#939, `Query Editor Spec.md` §4.13): a * card of a `` dragged onto the builder opens its query, as * Studio's canvas takes the palette's cards — through the shared drag layer. * * - **The target** is the builder's, named by its id. It takes `add`s from * the query library that shares the id (`queryKeys(id).library`, the cards * keyed by the saved query's name) on one cell: the builder's frame * (#1125) — its toolbar, the pane, the results and the status line. * - **Its veto** takes a card whose query can open here and refuses any * other: the ⊘ stage. The cell's name is what the drag layer says the drag * rests over, so a refused card's name carries the builder's reason, and the * layer announces it. * - **A drop** opens the dropped query. * - **Its look** is the `queryBuilder` recipe's `dropTarget` over the frame: * armed while a card it takes is dragged, over while one rests on it — pure * CSS on the layer's `data-drop-valid` / `data-drop-active` — with "Drop to * open “{name}”" and "{n} steps.", the name kept from the veto's candidate. * * Without a `DragLayerProvider` on the page there is no target: the frame * renders alone, as it would without one. * * @packageDocumentation */ import { type ReactElement, type ReactNode } from "react"; import type { QueryWords } from "./model/words.js"; /** Props of {@link QueryDropTarget}. */ export interface QueryDropTargetProps { /** The builder's id (`queryKeys(id)`'s), naming its drop target. */ readonly id: string | undefined; /** Why a query of a name can't open here, in the builder's words; undefined when it can. */ readonly refusal: (name: string) => string | undefined; /** How many steps the query of a name has, for the target's words; undefined when unknown. */ readonly steps: (name: string) => number | undefined; /** Opens the query of a name — what dropping it does. */ readonly onOpen: (name: string) => void; /** The words. */ readonly words: QueryWords; /** The builder's frame: the toolbar, the pane, the results and the status line. */ readonly children: ReactNode; } /** * The builder's frame as a drop target for the query library's cards — see * the module docs. The builder wraps its frame in it: with a drag layer on the * page the frame sits in the target's zone, which takes the frame's place; * without one, the frame renders alone. * * @param props - The builder's id, the refusal and the steps of a query by name, what a drop does, the words and the frame ({@link QueryDropTargetProps}) * @returns The frame, in its drop zone when a drag layer is on the page */ export declare function QueryDropTarget({ id, refusal, steps, onOpen, words, children }: QueryDropTargetProps): ReactElement; //# sourceMappingURL=drops.d.ts.map