/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The alignment contract, mechanically (`Plan Spec.md` §3): every body row is * one two-column grid — the fixed gutter cell and a plot of `n` buckets — so * every kind aligns by construction. The shell renders the gutter identity * vocabulary (name / id / sub / value / meta / swatches / status dot / caret, * one grid of fixed cells, an 8px indent per level), the plot's bucket grid * lines, and the shared now / cursor hairlines; the kind renderer supplies the * plot content. * * It is also a treegrid ROW (#819): `role="row"` at its level, selected and * expanded as it is, its gutter the `rowheader` and its plot a `gridcell`, * with its share of the canvas's one tab stop (`root/grid.ts`). */ import { type ReactNode } from "react"; import { type PlanVeto } from "../edit/candidate.js"; import type { PlanEventDrop } from "../edit/event-drag.js"; import { type PlanRowValue } from "../model.js"; import type { PlanGridRow } from "../root/grid.js"; import type { PlanDraftMark } from "../use-plan-editing.js"; import { type LaneBand } from "./lanes.js"; type Styles = Record>; /** Indent per nesting level (px, #1680's review): a row that folds has its * caret's cell, a leaf none, so a leaf's name starts at its level's indent. */ export declare const INDENT_PX = 8; /** A laned row's lane, as its gutter line draws it (#1680's review): its caption, and where it sits down the row. */ export interface PlanGutterLane { /** Its caption; `undefined` for a lane that has none. */ readonly caption: string | undefined; /** Its band, as fractions of the row's height. */ readonly band: LaneBand; } /** * The plot's bucket-column separators, O(1) DOM per row (#616). * * Equal-width buckets (hour / day / week — every high-count resolution) paint * ALL interior separators as one repeating gradient on a single element: it * starts at the FIRST interior edge and tiles at one bucket width, so no line * lands on the plot's own boundaries. A 100-row × 500-bucket canvas used to * mount ~50k separator divs; this is 100. Unequal buckets (month / quarter — * clipped edge buckets, low counts by construction) keep the per-edge divs. */ export declare function GridSeparators({ styles }: { styles: Styles; }): import("react/jsx-runtime").JSX.Element | null; /** * A row's DnD drop registration — present only when the canvas is a drag * target AND this row's KIND accepts drops (see `DROPPABLE_KINDS`): a library * card, where the row's series declares `edit.create`, and a moved run, chip, * tile or mark of the row's item type, where it declares a move's fields * (#825); and, on an event kind's row, the event kinds' drags (#1196). */ export interface PlanRowDrop { /** The canvas's DnD surface — its declared id, or one of its own when it declares none (#825). */ surface: string; /** Whether a card reaches `data`'s rows — from the canvas's own library panel's tabs (#1259), or from a Library * beside it that its `sources` lists under its declared `id`; with neither, a row of `data`'s that only takes * cards registers no cell. */ cards: boolean; /** The libraries whose cards land on `data`'s rows: the panel's author tabs', and the `sources` its `id` names. */ libraries: ReadonlySet; /** Whether `data`'s session takes a gesture now (#880): its rows take moves, and cards. */ data: boolean; /** The Plan's veto over what a drop would do (`canDrop`, #1541 U7), asked of * what the drag's CURRENT bucket would make of it on one of `data`'s rows — * its duplicate flag included — its refusal's words the ghost's. */ canDrop?: PlanVeto | undefined; /** The event kinds' drag and drop (#1196): what lands on their rows, its verdict and the ghost's words. */ events?: PlanEventDrop | undefined; } export interface RowShellProps { row: PlanRowValue; styles: Styles; /** Grid template (`"var(--plan-gutter-w) 1fr"`, the canvas's) — one source for every band. */ gridTemplate: string; /** Row height (px) — fixed per kind (`model.rowHeight`). */ height: number; /** Nesting depth (gutter indent). */ depth: number; selected: boolean; /** The caret state for nesting parents (undefined ⇒ no caret). */ caret?: { collapsed: boolean; } | undefined; /** Caret click: the subtree's fold — a caret only folds (#1680's review). * The WHOLE gutter cell is the click target (the group-strip convention — * a 14px caret is not a tree affordance); the plot keeps selection. */ onCaretClick?: (() => void) | undefined; /** Table-row emphasis (K5: header wash / footer 2px top rule). */ emphasis?: "header" | "footer" | undefined; /** Suppress the bucket grid lines (rows drawing their own canvas). */ noGrid?: boolean; /** Row-scoped focus controls (R1 links / R2 expand) — 24px ghost buttons * in the gutter line's two control slots, links then expand, always * shown, a pressed one in the brand tint (`Plan links.html`, #1258). An * expandable chart's spark ↔ chart is its expand control's (#1680's review). */ controls?: ReadonlyArray<{ kind: "links" | "expand"; active: boolean; onClick: () => void; }> | undefined; /** A laned row's lanes (#1680's review): a gutter line each, the lane's height, its caption in the value cell. */ lanes?: readonly PlanGutterLane[] | undefined; /** The labels of the rows it nests under, outermost first, where a links focus gathers it (#1680's review): its sub * line says them, then its own sub — which tells two rows of one name apart. */ path?: readonly string[] | undefined; /** The expand render's axis treatment inside this row (R2; default keep). */ axisMode?: "dim" | "off" | undefined; /** R2 (#591) — the focused row's developer render, mounted INSIDE this * row's plot cell beneath the row's own marks. Its presence is what makes * the row (and so its gutter) tall. */ expandBody?: ReactNode; /** R2 — content for the space the grown gutter cell opens up. */ expandGutter?: ReactNode; /** R2 — the row's NATURAL kind height: the band its own marks keep at the * top while the render fills the remainder. */ bandHeight?: number | undefined; /** R2 context strip (#591) — this row is not the focus, so it compresses * to 16px and its marks to 7px on the same axis. Never removed: order, * scroll position and the status dot survive, and the strip itself is * the return click target. */ ctx?: boolean | undefined; /** A strip that keeps its value and its status dot in their cells — a pinned row a links focus does not gather * (#1680's review). */ keep?: boolean | undefined; /** DnD drop registration for this row's plot. Absent ⇒ the row registers * no cell, so it is never a destination and never lights up. */ drop?: PlanRowDrop | undefined; /** The row's draft mark (#880) — a draft of its entry changed it: the * Sheet's pending wash, and incomplete or invalid while a check refuses * the entry. */ draft?: PlanDraftMark | undefined; /** The row's grid plumbing (#819) — its written position, its share of * the tab stop, and its focus handler (`usePlanGridRow`). */ grid: PlanGridRow; /** `aria-expanded` (#819): whether its section, chart or expand render is * open — absent for a row with nothing to open. */ expandedState?: boolean | undefined; /** The row is the last visible member of an open group — it carries the * group's closing rule (#949). */ groupEnd?: boolean | undefined; /** Its events are unread (#1398, CL2): the region wash lies under what its plot holds, on the canvas's reveal clock, * and the plot is busy — never an empty row while its cells are on their way. */ unread?: boolean | undefined; children: ReactNode; } /** One canvas body row — gutter + plot on the shared template. */ export declare function RowShell({ row, styles, gridTemplate, height, depth, selected, caret, onCaretClick, emphasis, noGrid, controls, lanes: gutterLanes, path, axisMode, ctx, keep, drop, draft, children, expandBody, expandGutter, bandHeight, grid, expandedState, groupEnd, unread, }: RowShellProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=RowShell.d.ts.map