import type { LayoutDirection } from "../layout-direction.js"; import type { LayoutMode } from "../layout-mode.js"; import type { ProjectionDefinition, ProjectionQuery } from "../projection.js"; import type { VisualViewOperation, VisualViewSummary } from "../adapters/visual/protocol-contract.js"; export interface SaveViewDialogProps { readonly views: readonly VisualViewSummary[]; readonly activeViewId: string; readonly query: ProjectionQuery | null; /** The layout mode and direction in force on the canvas (ADR 0147). */ readonly layout: LayoutMode; readonly direction: LayoutDirection; readonly showLifecycle: boolean; readonly showEvidence: boolean; readonly showOwnership: boolean; readonly showKindLabels: boolean; /** * Openness is the caller's, not the form's: every way in is somewhere else - * the rail's new-view button, three context-menu items - and two components * cannot both own one boolean. The strip's own `Save view` button is gone * with the rest of the strip's controls (#249). */ readonly open: boolean; /** * The folder a NEW view declares. Comes from "New view in this folder…", * which names one by pointing at a view already in it, or from "New * folder…", which names one that does not exist yet. Undefined is no folder. */ readonly folder: string | undefined; readonly onClose: () => void; /** Stages the write. Nothing is on disk until the changeset is committed. */ readonly onStage: (operation: VisualViewOperation) => void; } export interface BuildPayloadParams { /** The view being overwritten, or undefined to mint a new one. */ readonly id: string | undefined; /** * Every view id already in use, so a new one takes a free slug. The server * used to mint this; a staged row has to name the document it will write * before it is committed, so the browser mints it now (ADR 0103). */ readonly taken: ReadonlySet; /** Where the overwritten view's document already lives, if there is one. */ readonly path: string | undefined; /** * Everything the view being overwritten already declares, carried through * in full underneath what this form owns. The form composes the fields it * has controls for; every other field - `nesting`, `fold`, `notation` - is * the view's own opinion and must survive a save that never asked about it. * Measured by ApertureX on 1.24.0: an overwrite that dropped * `nesting: [composition, assignment]` turned 69 subjects and 72 edges into * 65 and 105, because nothing contained the members any more. A new view * has nothing to carry. */ readonly declared: ProjectionDefinition["presentation"] | undefined; /** * The folder this document declares, for a NEW view. An overwrite carries * its folder through `declared`; this names the one the opener chose. */ readonly folder: string | undefined; readonly title: string; readonly description: string; readonly query: ProjectionQuery | null; /** * The layout mode and direction the canvas is drawing (ADR 0147). Both have * controls on screen now, so a save writes what is in force, the way it * writes the badge flags; there is nothing to carry from a declaration the * reviewer may have moved away from. */ readonly layout: LayoutMode; readonly direction: LayoutDirection; readonly showLifecycle: boolean; readonly showEvidence: boolean; readonly showOwnership: boolean; readonly showKindLabels: boolean; } /** * Pure translation from the form's local state to the staged operation — no * active filter names an unfiltered view, since every field of a * `ProjectionQuery` is optional and `{}` is itself a valid, if unconstrained, * query. * * A saved view is a row in the changeset rather than a write (ADR 0103), so * this composes the whole projection document and the path it will occupy. * Overwriting keeps the path the view already has; a new view takes a fresh * slug beside every other one, and says which folder it belongs to rather than * being put in a directory named after it (ADR 0104). */ export declare const buildPayload: ({ id, taken, path, declared, folder, title, description, query, layout, direction, showLifecycle, showEvidence, showOwnership, showKindLabels, }: BuildPayloadParams) => VisualViewOperation; /** * Stages the reviewer's current filter and presentation as a named projection * document. "Save" overwrites whatever view is active and "Save As New" mints * a fresh id. * * Neither writes anything: both stage a row in the changeset (ADR 0103), which * is why the overwrite no longer asks first. The confirmation existed because * an overwrite was immediate and unundoable; a staged overwrite is a row the * reviewer can read, discard and undo before it lands, which is a better * answer than a dialog. * * Opened with a folder preset — "New folder…", "New view in this folder…" — * the overwrite is disabled (#299): it carries the active view's own folder * by design, so it is the one button that would silently drop the folder the * reviewer just named. */ export declare function SaveViewDialog({ views, activeViewId, query, layout, direction, showLifecycle, showEvidence, showOwnership, showKindLabels, open, folder, onClose, onStage, }: SaveViewDialogProps): import("react").JSX.Element | null;