import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraFrame}from'../../../internal/variants.js'; /** * `` — a corner overview map of a `lr-flow-canvas`: scaled node rectangles plus * a draggable viewport rectangle, for orientation and fast navigation on canvases larger than the * screen. Draws no edges (nodes only, matching the React Flow/n8n minimap convention) and never * reads `nodes` itself — geometry always comes from the canvas's `registerCompanion()` snapshots, so * the two can never disagree. The initial companion snapshot is silent; keyboard, map-click, and * wheel viewport changes append their next rAF-coalesced snapshot to the document's shared * light-DOM polite sink, while a completed viewport drag appends its final position once. * Identical repeats remain distinct additions and `[part="live-region"]` stays an aria-hidden * mirror. A completed viewport drag consumes the browser-synthesized click that follows its * `pointerup`; canceled or lost-capture drags stay silent and leave the next genuine map click * available for click-to-center navigation. * * @customElement lr-flow-minimap * @csspart base - The root wrapper. Drops its floating-surface chrome (border, background, * radius) under `frame="plain"`. * @csspart map - The scaled SVG. * @csspart node - One rect per node. * @csspart viewport - The exact visible canvas-view rectangle. * @csspart viewport-hit-area - The transparent, draggable/focusable interaction rectangle, floored * to the shared hit-area size without changing the visible viewport geometry. * @csspart instructions - Visually hidden keyboard instructions for the viewport. * @csspart live-region - An aria-hidden shadow mirror of viewport-change announcements; the actual * announcements use the shared light-DOM polite sink. * @cssprop [--lr-flow-minimap-inline-size=var(--lr-size-12rem)] - Map inline size. * @cssprop [--lr-flow-minimap-block-size=var(--lr-size-8rem)] - Map block size. * @cssprop [--lr-flow-status-color=var(--lr-color-border-strong)] - Fill of nodes without * an execution status. * @cssprop [--lr-flow-status-pending-color=var(--lr-color-border-strong)] - Pending-node fill. * @cssprop [--lr-flow-status-running-color=var(--lr-color-brand)] - Running-node fill. * @cssprop [--lr-flow-status-success-color=var(--lr-color-success)] - Successful-node fill. * @cssprop [--lr-flow-status-error-color=var(--lr-color-danger)] - Failed-node fill. * @cssprop [--lr-flow-status-denied-color=var(--lr-color-warning)] - Denied-node fill. * @cssprop [--lr-flow-minimap-viewport-color=var(--lr-color-brand)] - Fill (mixed 15% into * transparent) and stroke of `[part="viewport"]`, the rectangle showing the canvas's visible * area, independent of the per-status node fills above. * @cssprop [--lr-flow-minimap-viewport-min-size=var(--lr-icon-button-size)] - Smallest rendered size, * in physical pixels, of the transparent `viewport-hit-area` along either axis. On a canvas whose * node bounds dwarf the visible viewport the raw rectangle collapses to a few pixels, which * leaves the only pointer-drag handle for panning effectively unclickable; the floor grows it * symmetrically about its own centre so it still points at what the viewport shows. The visible * `viewport` stays exact. Defaults to Lyra's 40px interaction floor; set `0` to opt out. * @status stable * @since 4.0.0 */ export declare class LyraFlowMinimap extends LyraElement{static styles:import("lit").CSSResultGroup[]; /** Id of the target `lr-flow-canvas`. When empty, the nearest ancestor is used (the * slotted-into-a-corner-slot case, the primary wiring). */ for:string; /** Accessible name for the map region; falls back to a host `aria-label`, then `flowMinimapLabel`. */ label:string; /** Container treatment, in the shared `LyraFrame` vocabulary. `'card'` (the default) keeps the * bordered, filled corner surface. `'plain'` removes the border, background and corner radius, * for a minimap placed in a host panel or toolbar that already draws its own surface, so the * frame isn't doubled. The map's own hover/click affordances and the viewport rect stay either * way -- only the outer `[part="base"]` decoration goes. Mirrors `lr-flow-controls`'/ * `lr-flow-run-status`'s identical `frame`. */ frame:LyraFrame;private snapshot;private liveText;private announcementSink?;private canvasEl?;private unsubscribe?;private dragState?; /** Window that owns the active viewport drag's global pointer listeners. */ private dragEventWindow?; /** Set once an in-progress viewport drag actually moves. A completed pointer drag makes the * browser synthesize a `click` on the captured element afterward, which bubbles up into the * map's own `@click` (click-to-center) handler -- without this, releasing the viewport rect * after dragging it re-centers the map on the release point, undoing the drag. Consumed (reset * to `false`) the next time `onMapClick` runs, so a genuine click on the map still centers it. */ private justDraggedViewport;private announceNextSnapshot; /** Physical-pixel floor for the draggable viewport rect, resolved from the live * `--lr-flow-minimap-viewport-min-size` token. */ private viewportMinSizePx; /** `[part='base']`'s resolved border width, which is what separates the host's own content box * from the SVG's rendered box. */ private baseBorderPx;private readonly instructionsId;private readonly companionController;connectedCallback():void; /** Re-reads the live token values the viewport-rect floor depends on. */ private refreshViewportMetrics;disconnectedCallback():void;adoptedCallback():void;private releaseAnnouncementSink;private syncAnnouncementSink;private announceViewport;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private attachCanvas;private cancelViewportDrag;private contentBounds; /** Physical size of the rendered map surface, in CSS px. `[part='map']` fills `[part='base']`'s * content box, which is the host's own content box inset by that wrapper's border on each side * (`box-sizing: border-box` is inherited library-wide) -- so this stays exact without measuring * an element that does not exist yet on the first frame that renders the SVG. */ private mapSizePx; /** The viewport rectangle in map user-units, floored to a real pointer target. * * The raw rect is the canvas viewport divided by its zoom, which is meaningful data but not a * usable affordance: on the canvases this component exists for -- node bounds far larger than * the screen -- it collapses to a couple of physical pixels inside a 12rem x 8rem map, leaving * the only pointer-drag handle for panning effectively unclickable and near-invisible. The same * shape `` already solves for its data-driven cells, resolved from a live token the * same way, and outside `check:hit-area`'s reach because that gate deliberately excludes SVG * shape elements. * * The floor is a physical-pixel length, so it is converted into user units through the SVG's own * scale -- `preserveAspectRatio="xMidYMid meet"` scales uniformly by the SMALLER of the two * viewBox-to-box ratios. Growth is symmetric about the rect's own centre, so a floored rect * still points at the part of the graph the viewport is actually showing; keyboard panning and * drag math read the canvas viewport directly and are untouched. */ private viewportRectContent;private clientToContentPoint;private onMapClick;private onMapWheel;private onViewportPointerDown;private onViewportPointerMove;private onViewportPointerUp;private detachViewportDragListeners;private onViewportKeyDown;private renderNodes;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-flow-minimap':LyraFlowMinimap;}}