import { B as ListDragSource, F as ListDragEntry, L as ListDragPreviewContext, R as ListDragPreviewRenderer, V as ListNativeDragStartDetail, z as ListDragPreviewSourceResolver } from "./tree-component-BE7OEIiH.js"; import { ReactiveController, ReactiveControllerHost } from "lit"; type ListNativeDragControllerConfig = { readonly source: ListDragSource; /** `itemsDraggable && selection usable` */ isEnabled: () => boolean; /** Event target → item key, or `undefined` when the drag did not start on an item. */ resolveEventToKey: (target: EventTarget | null) => string | undefined; /** * Apply the origin rule (origin ∉ selection ⇒ replace with origin); return * display-ordered `{ origin, selected }` for both modes, or `undefined` when * the origin is not selectable. */ prepareSelection: (originKey: string) => { origin: ListDragEntry; selected: Array>; } | undefined; getMetrics: () => ListDragPreviewContext[`metrics`]; getRenderer: () => ListDragPreviewRenderer | undefined; getDragPreviewSourceResolver?: () => ListDragPreviewSourceResolver | undefined; /** Fire the cancelable `list-native-drag-start`; return `!defaultPrevented`. */ dispatch: (detail: ListNativeDragStartDetail) => boolean; /** * Optional: write custom payloads onto the drag's `DataTransfer` (e.g. a * MIME type for same-app drops). Called once, after a non-cancelled dispatch, * inside the synchronous `dragstart` turn. */ writeDataTransfer?: (dataTransfer: DataTransfer, detail: ListNativeDragStartDetail) => void; /** * Host toggles `data-native-dragging` / `aria-label`, re-renders. `keys` is the dragged block in display * order (when `active`), for positional drops — see `ListDropController.setInternalDrag`. */ onActiveChange: (active: boolean, originKey?: string, keys?: readonly string[]) => void; /** Host clears state + starts its post-drag click-suppress timer. */ onEnd: () => void; /** Optional: sync `draggable` on light-DOM / slotted children while enabled. */ syncLightDomDraggable?: () => void; /** * Optional. Called at the very top of the capture-phase `dragstart`, before * enablement / key resolution. Return `false` to abort the native drag — the * controller calls `event.preventDefault()` so the browser starts no drag. * Use when the gesture belongs to another interaction (e.g. marquee select). */ shouldStart?: (event: DragEvent) => boolean; }; type DragHost = ReactiveControllerHost & HTMLElement; /** * Shared native item/row drag-out for list components. * * Owns capture-phase `dragstart` / `dragend` listeners on the host and its * render root, a `MutationObserver` that keeps light-DOM / slotted item `draggable` * attributes in sync, and a single post-dispatch disposal on * `requestAnimationFrame`. All DOM / selection knowledge lives in the host * config callbacks. */ declare class ListNativeDragController implements ReactiveController { #private; constructor(host: DragHost, config: ListNativeDragControllerConfig); get isDragging(): boolean; /** `"true"` when enabled, else `"false"` — for shadow-row template bindings. */ get draggableAttr(): string; /** Re-run the light-DOM `draggable` sync (e.g. after `itemsDraggable` flips). */ refreshDraggable(): void; hostConnected(): void; /** `renderRoot` does not exist yet at `hostConnected` for a shadow-DOM host — rebind once it does. */ hostUpdated(): void; hostDisconnected(): void; } export { ListNativeDragControllerConfig as n, ListNativeDragController as t };