/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * Renders aligned spreadsheet rows and full-width group summaries. Group * membership lives in the gutter markers and rails; rows share one grid. * And the SUB ROWS under a line (#844): read-only rows that share none of * the line's columns — a tree and a `{line}.{n}` index in the gutter, then * one grey well spanning the rest. * * Where the sheet takes drops (#1187), each row, line and band is a drop * target and, when it moves, carries a grip in its gutter's actions column. * * A FOLDED gutter (#1215) — a coarse pointer's, in a frame too narrow for its * actions beside a cell — holds one row-actions button in place of the * actions column: the row's grip, and a tap's menu of its decisions and its * inserts. */ import { type MouseEvent, type ReactNode } from "react"; import { type PlaceholderKind, type SlotStyles } from "@elaraai/east-ui-components/internal"; import { type LineGroup, type SheetBand, type SheetColumnIndex, type SheetColumnMeta, type SheetGroupIndex, type SheetRegisterIndex, type SheetWindowFailure } from "./model.js"; import { type LinkCellContext } from "./cells/Cell.js"; import type { PendingFill } from "./sheet-types.js"; import type { SheetCellValue, SheetNounValue, SheetRowValue, SheetSubRowValue } from "./values.js"; import type { DraftPresentation } from "./draft-state.js"; import type { SheetMembership } from "./membership.js"; import type { SheetRowMarks } from "./optimise.js"; import type { SheetRowDrop } from "./drop.js"; import type { SheetActionHost } from "./actions/host.js"; type Styles = Record>; /** Whether a column's cell names a register member, which it shows by the member's label: an enum, a reference, a lookup, a person, a cycle. */ export declare function namesMember(meta: SheetColumnMeta): boolean; /** Install (or clear) the test render probe. Test use only. */ export declare function setSheetRowRenderProbe(fn: ((r: number, copy: boolean) => void) | undefined): void; /** One item of a folded gutter's menu (#1215): what it says, and what it does. */ export interface SheetRowAction { /** The item's key in the menu. */ value: string; /** Its words — the words of the control it stands for. */ label: string; /** What it does. */ run: () => void; } /** * The per-row facts the row renderer is handed — primitives and references * that hold still, so the memo skips every row a gesture does not touch (#858). */ export interface SheetRowProps { styles: Styles; /** The insertion seam above the row, by the side of the gutter its chips take — `undefined` where nothing inserts. */ seam?: "gutter" | "body" | undefined; /** The seam is hovered: the sheet's one insertion layer shows its chips. */ onSeamEnter?: ((r: number, side: "gutter" | "body", hit: HTMLElement) => void) | undefined; /** The pointer left the seam. */ onSeamLeave?: ((to: EventTarget | null) => void) | undefined; insertPreview?: "row" | "group" | undefined; /** Where the previewing seam's chips sit; the insertion line starts at them. */ insertSide?: "gutter" | "body" | undefined; columns: SheetColumnIndex; registers: SheetRegisterIndex; driverColumn: string | undefined; gridTemplate: string; rowPx: number; /** The row-space index. */ r: number; /** The 1-based row number. */ number: number; /** The grid's id (#860): each cell's id is `{idPrefix}-{r}-{c}`, what the grid names as its active cell. None on a copy that sticks under the header. */ idPrefix?: string | undefined; /** The row's place among the grid's rows, the header first (#860). */ ariaRowIndex?: number | undefined; /** The first body item — the row under the sticky header (its ring stays inside the cell). */ first?: boolean | undefined; /** The real row, or `undefined` for a blank padding row. */ row: SheetRowValue | undefined; /** A line's group: its number resets within the group; membership stays in the gutter. */ group?: LineGroup | undefined; membership?: SheetMembership | undefined; /** The link cell's halves, vocabulary and flags for a row (P3). */ linkCtx: (row: SheetRowValue | undefined, meta: SheetColumnMeta) => LinkCellContext | undefined; /** The ring's column when it sits on this row. */ selC: number | undefined; /** The range's columns when the row is inside it. */ range: { c0: number; c1: number; } | undefined; /** The whole row is selected (the gutter bar). */ picked: boolean; /** A lens hit — the brand row number (B§8). */ hit: boolean; /** The editor, when it sits on this row: the column and the element. */ editor: { c: number; node: ReactNode; } | undefined; /** The copilot's pending fills when this row is the anchor, by column key (B§5.1). */ fills: ReadonlyMap | undefined; /** The column of the next ⇥ target when it sits on this row. */ nextTargetC: number | undefined; /** The hovered column when the pointer is on this row — the ✓ take button's home. */ hoverC: number | undefined; onCellDown: (r: number, c: number, e: MouseEvent) => void; onCellDouble: (r: number, c: number) => void; onCellEnter: (r: number, c: number) => void; onRowPick: (r: number, e: MouseEvent) => void; /** ✓ on a fill. */ onTake: (key: string) => void; /** The gutter's → button. */ onFillRow: () => void; /** Schema-derived state of the current unapplied row. */ draft?: DraftPresentation | undefined; /** Discard a never-applied row as an undoable gesture — the row's id, or a line's group and its key. */ onDiscard?: ((id: string, child?: string) => void) | undefined; /** How many sub rows sit under this line (none: `undefined`), and whether they show. */ subRowCount?: number | undefined; subRowsOpen?: boolean | undefined; /** The chevron: show or hide them; `all` (⌥) takes every line of the group the same way. */ onSubRows?: ((r: number, all: boolean) => void) | undefined; /** The host's word for a group (#844) — the chevron's title names it. */ noun?: SheetNounValue | undefined; /** The copy that sticks under the group's band while the line's sub rows scroll under it. */ sticky?: boolean | undefined; /** The line's group was just unfolded: it drops in, this far into the cascade. */ entering?: number | undefined; /** The sheet's drops (#1187): the row is a drop target — a builder's sheet; absent where the sheet takes none. */ drop?: SheetRowDrop | undefined; /** The row as its drop names it — `SheetDropRowType`, printed. */ dropRow?: string | undefined; /** Its grip moves it (SB44). */ movable?: boolean | undefined; /** The gutter is folded (#1215): one row-actions button holds the row's grip, its decisions and its inserts. */ foldedGutter?: boolean | undefined; /** A folded gutter's inserts at a row, read when its menu opens — absent where nothing inserts. Stable. */ inserts?: ((r: number) => readonly SheetRowAction[]) | undefined; /** What a run of the optimiser left on the row (#1409, R25), while it is the run's draft: each changed cell's mark, and its provenance on hover. */ marks?: SheetRowMarks | undefined; /** What the row's action cells ask of the sheet (#1475): absent on a sheet with no action column. Stable. */ actions?: SheetActionHost | undefined; } /** Renders one row. */ export declare const SheetRow: import("react").MemoExoticComponent<(props: SheetRowProps) => import("react/jsx-runtime").JSX.Element>; export interface SheetSubRowProps { styles: Styles; /** The row's least height (px); it grows when its detail wraps. */ subRowPx: number; subRow: SheetSubRowValue; /** Its line's number in the group — the index reads `{line}.{n}`. */ parent: number; /** Its index under the line, and how many the line has (the last ends the tree). */ index: number; count: number; /** The gutter's width (px) — the well starts at its edge. */ gutterPx: number; /** The width of the view (px): the well's content stays inside it while the columns scroll sideways. */ viewPx: number | undefined; membership?: SheetMembership | undefined; /** Its line was just opened: it drops in, this far into the cascade. */ entering?: number | undefined; /** The row's place among the grid's rows, the header first (#860). */ ariaRowIndex?: number | undefined; /** How many columns the well spans (#860). */ colCount: number; } /** * One sub row of an open line. It shares none of the line's columns: the * gutter holds the tree — the stem from the line's chevron, an elbow into * this row, the last row's stem stopping at its middle — and the index * `{line}.{n}` on the surface; then ONE grey well spans the rest. The well * reads left to right: the LEAD (a code and a name; with no detail beside it * the name runs on past the lead rather than wrap inside it), the DETAIL (chips, * then labelled facets; it wraps and the row grows, never truncated), and * the ID pinned right so ids align down the sheet. The well's content stays * at the view's left edge as the columns scroll sideways. Read-only, and * outside the row space: the ring never lands on it. */ export declare const SheetSubRow: import("react").MemoExoticComponent<({ styles, subRowPx, subRow, parent, index, count, gutterPx, viewPx, membership, entering, ariaRowIndex, colCount }: SheetSubRowProps) => import("react/jsx-runtime").JSX.Element>; export interface SheetProposalRowProps { styles: Styles; insertion?: ReactNode; insertPreview?: "row" | "group" | undefined; columns: SheetColumnIndex; registers: SheetRegisterIndex; driverColumn: string | undefined; gridTemplate: string; rowPx: number; /** The proposal's index under its anchor. */ index: number; /** The 1-based row number it would take. */ number: number; /** Proposed under a grouped line. */ grouped?: boolean | undefined; cells: ReadonlyMap; meta: string; /** Selected — the 3 px brand bar and the wash. */ picked: boolean; linkCtx: (row: SheetRowValue | undefined, meta: SheetColumnMeta) => LinkCellContext | undefined; onPick: (i: number) => void; onAccept: (i: number) => void; onReject: (i: number) => void; /** The row's place among the grid's rows on a grouped sheet (#860); a flat sheet's proposal has no source position, so none. */ ariaRowIndex?: number | undefined; /** The gutter is folded (#1215): ✓ and × are its row-actions button's menu. */ foldedGutter?: boolean | undefined; } /** A proposed row (B§5.2): dashed-topped, hatched, real numbers; ✓ adds it, × rejects it. */ export declare const SheetProposalRow: import("react").MemoExoticComponent<(props: SheetProposalRowProps) => import("react/jsx-runtime").JSX.Element>; export interface SheetRunRowProps { /** The sheet recipe's slot styles — or a host's grid's, its `run` slots (#1531). */ styles: Styles | SlotStyles; /** The run's place among the grid's rows, the header first: where its first element would be (#860). */ ariaRowIndex?: number | undefined; /** A paged source's unloaded run, or a stretch of the record the lens is still reading (#1349). */ band?: SheetBand | undefined; /** A window whose read failed (#853): the run said once, with its Retry (CL11). */ failure?: SheetWindowFailure | undefined; /** Whether the run's rows are in flight: it is the region being read (`aria-busy`). */ loading: boolean; /** The rows' grid tracks: the gutter, then each column's. */ gridTemplate: string; /** The columns the grid draws. */ columns: SheetColumnIndex; /** A row's height, px: the density's pitch. */ rowPx: number; /** A grouped sheet's band height, px: each element a band, then its lines at the row's pitch; absent, a flat sheet. */ bandPx?: number | undefined; /** Compact rows. */ dense: boolean; /** What the rail counts the rows in — `work orders`: what a failed run's line names them by. */ noun: string; /** Ask a failed window again. */ onRetry: (w: number) => void; /** * What the run's first cell, under the grid's lead track, stands for (#1531): the gutter's row number, by default, * or a host's lead — a Record's select column, its box; `null` where the grid has no lead track. */ lead?: PlaceholderKind | null | undefined; } /** * A run of the sheet's rows not drawn yet (#1398, CL2) — a paged source's * unloaded run, a stretch of the record the lens is still reading or placing * (#1349), or a window whose read failed (#853) — as the shared * `UnloadedRun`: rows at the density's pitch where the run meets the view, * with the sheet's own gutter, columns and rules, each cell its column kind's * placeholder. A flat sheet's runs keep their real row numbers. A lens * stretch stands for the narrowing's rows in it — as many placeholders as it * holds matches, at the pitch they land at — whose numbers are not known * until they are read, so its numbers are short bars, as a grouped sheet's * lines are, under a band of the band's height. A failed window is said once, * in its first row in view, with Retry; its other rows keep their numbers and * rules and carry nothing else (CL11). Its height is the ledger's slot, so the * rows that replace it take the same space. To the grid it is one row at its * first element's place, its one cell across the grid (#860), busy while its * rows are read; its placeholders are `aria-hidden`, and a failed run's line * is the cell instead (CL12). */ export declare const SheetRunRow: import("react").MemoExoticComponent<({ styles, band, failure, loading, gridTemplate, columns, rowPx, bandPx, dense, noun, onRetry, ariaRowIndex, lead, }: SheetRunRowProps) => import("react/jsx-runtime").JSX.Element>; export interface SheetRetryProps { styles: Styles; /** Ask again. */ onRetry: () => void; } /** The whole-sheet message's Retry (#853): a source that failed before any row landed asks again through it. */ export declare function SheetRetry({ styles, onRetry }: SheetRetryProps): import("react/jsx-runtime").JSX.Element; export interface SheetRowBoundaryProps { styles: Styles; /** The row's least height (px). */ rowPx: number; /** Its 1-based number — what the diagnostic names. */ number: number; /** The row's data — when it changes, the boundary tries again. */ resetKey: unknown; children: ReactNode; } /** * A render failure stays in its row (#853): a row that throws while it * renders shows as a one-row diagnostic in its place, and the rows around it * keep working. It resets when the row's data changes. The Plan's part * boundary does the same (#811). */ export declare function SheetRowBoundary({ styles, rowPx, number, resetKey, children }: SheetRowBoundaryProps): import("react/jsx-runtime").JSX.Element; export interface SheetGroupRowProps { styles: Styles; /** The insertion seam above the band, by the side of the gutter its chips take — `undefined` where nothing inserts. */ seam?: "gutter" | "body" | undefined; onSeamEnter?: ((r: number, side: "gutter" | "body", hit: HTMLElement) => void) | undefined; onSeamLeave?: ((to: EventTarget | null) => void) | undefined; insertPreview?: "row" | "group" | undefined; insertSide?: "gutter" | "body" | undefined; columns: SheetColumnIndex; registers: SheetRegisterIndex; gridTemplate: string; /** The band's height (px). */ bandPx: number; /** The row-space index. */ r: number; number: number; /** The grid's id (#860): the title's id is `{idPrefix}-{r}-0`, a band cell's `{idPrefix}-{r}-{c}`. None on the copy that sticks under the header. */ idPrefix?: string | undefined; /** The band's place among the grid's rows, the header first (#860). */ ariaRowIndex?: number | undefined; membership?: SheetMembership | undefined; /** The group's wire row — its band cells under {@link TITLE_KEY} and the line columns. */ row: SheetRowValue; /** The band's cells and the title span. */ group: SheetGroupIndex; folded: boolean; /** The group's line count. */ count: number; /** The first body item — the row under the sticky header. */ first?: boolean | undefined; /** The copy that sticks under the column header while the group's lines scroll (G1). */ sticky?: boolean | undefined; /** The ring's column when it sits on this band. */ selC: number | undefined; /** The range's columns when the band is inside it. */ range: { c0: number; c1: number; } | undefined; /** The band is selected whole (the gutter bar). */ picked: boolean; /** Some of the group's lines are picked: the band's checkbox goes indeterminate. */ mixed?: boolean | undefined; /** The editor, when it sits on this band: the column and the element. */ editor: { c: number; node: ReactNode; } | undefined; onCellDown: (r: number, c: number, e: MouseEvent) => void; onCellDouble: (r: number, c: number) => void; onCellEnter: (r: number, c: number) => void; /** The gutter: selects the group's lines. */ onRowPick: (r: number, e: MouseEvent) => void; /** The chevron; `all` (⌥ held) applies the band's new state to every group. */ onFold: (r: number, all?: boolean) => void; draft?: DraftPresentation | undefined; /** Discard a never-applied group as an undoable gesture — the group's id. */ onDiscard?: ((id: string) => void) | undefined; /** The sheet's drops (#1187): the band is a drop target — a builder's sheet; absent where the sheet takes none. */ drop?: SheetRowDrop | undefined; /** The band as its drop names it — `SheetDropRowType`, printed. */ dropRow?: string | undefined; /** Its grip moves the group (SB44). */ movable?: boolean | undefined; /** The gutter is folded (#1215): one row-actions button holds the band's grip, its discard and its inserts. */ foldedGutter?: boolean | undefined; /** A folded gutter's inserts at a row, read when its menu opens — absent where nothing inserts. Stable. */ inserts?: ((r: number) => readonly SheetRowAction[]) | undefined; /** What a run of the optimiser left on the band's cells (#1409, R25), while the group is still the run's draft. */ marks?: SheetRowMarks | undefined; } /** Renders one full-width summary with a fold control and independent metadata. */ export declare const SheetGroupRow: import("react").MemoExoticComponent<(props: SheetGroupRowProps) => import("react/jsx-runtime").JSX.Element>; /** The tone of an enum member, exported for the gutter's future status dot. */ export declare function memberTone(registers: SheetRegisterIndex, register: string | undefined, key: string): string | undefined; export {}; //# sourceMappingURL=Rows.d.ts.map