/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * One canvas body row, memoized (#616) — the row-kind switch extracted from * the canvas's render callback so a store change re-renders O(changed rows) * instead of O(mounted rows). * * The contract that makes the memo real: every prop is a PRIMITIVE or an * identity-stable object, and the row reads its OWN slice of the UI state — * selection, chart toggle, active focus control — from the canvas controller * (`usePlanRowState`, #815). A selection click therefore renders exactly the * two rows it moved and never the canvas; a chart toggle, the one row whose * height it changes. * * The derivations are rebuilt whole on every data change and every paged * window landing, but a row reads only its own entries from them, and the * canvas keeps an entry's identity while its content holds * (`stableDerived`). So the memo compares those entries, not the maps: a * window landing renders the rows it added and the rows whose numbers it * moved, and none of the rows already on screen (#815). * * Scale changes still repaint every row — correctly: the row CONTENT consumes * `PlanScaleContext`, and context pierces the memo by design. What the memo * removes is the store-change tax, not the geometry-change work. */ import { type ReactNode } from "react"; import { type PlanRowDrop } from "./RowShell.js"; import type { PlanDraftMark } from "../use-plan-editing.js"; import type { PlanFocusTagWord } from "../messages.js"; import { type PlanDerived, type VisibleRow } from "../model.js"; import type { PlanEvent } from "../plan-state.js"; type Styles = Record>; /** * The row kinds that accept a drop. * * @remarks * A Plan's rows are heterogeneous, so "can you drop here" is a per-KIND * question before it is a per-row one — and the line is not arbitrary. These * four render a **collection of discrete scheduled objects** (runs, bucket * events, marks, chips): things a library card can BECOME, at an instant the * pointer names. * * The rest are excluded on the same principle: * * - `chart` / `heat` / `table` render DERIVED values — a plotted series, an * intensity field, computed cells. There is nothing for a card to become, * and a number is not a destination. * - `group` is wayfinding chrome; its MEMBERS are the droppable things, and * accepting on the strip would make a collapsed group swallow drops meant * for a row inside it. * * A canvas narrows further with `canDrop` — this set is what is structurally * possible, the predicate is what this particular canvas permits. And a row * takes a card only where its series declares where one lands (`edit`, * #880): its row arrives flagged `edits.drop`, and the drop drafts its entry. * An event kind's row of these kinds takes the event kinds' drags (#1196). */ export declare const DROPPABLE_KINDS: ReadonlySet; export interface PlanBodyRowProps { v: VisibleRow; /** The row's height (parent-computed via `rowHeight`, focus context applied). */ h: number; styles: Styles; gridTemplate: string; /** Whether the row nests children (its caret, and a collapsed parent's * slimmer bars). */ hasChildren: boolean; /** The renderer-side derivations — compared by THIS row's entries. */ derived: PlanDerived; dispatch: (e: PlanEvent) => void; /** * This row's presentation under the canvas's row focus: * `none` (no focus, or full-height family), `rail` (R1 unrelated — 11px), * `ctx` (R2 context strip — 16px), `focal` (the R2 focused row). */ focusRole: "none" | "rail" | "ctx" | "focal"; /** The links-focus family tag (R1). */ focusTag: PlanFocusTagWord | undefined; /** The expand render's axis treatment (R2, focal row only). */ axisMode: "dim" | "off" | undefined; /** Whether the row grows the links / expand focus controls. */ showLinksControl: boolean; showExpandControl: boolean; /** Whether the canvas's source is not yet exhausted — a paged canvas still * loading (#567 D9). A top-level section band's count then covers only * the loaded windows; every other row's numbers are exact * (`spansWindows`, #822). */ partial: boolean | undefined; /** The shared drop registration, when the canvas is a drag target. */ rowDrop: PlanRowDrop | undefined; /** The row's draft mark, when a draft of its entry changed it (#880). */ draft: PlanDraftMark | undefined; /** The row is the last visible member of an open group (#949). */ groupEnd: boolean; /** Its events are unread (#1398, CL2): its cells have not landed, or are read again — its plot washed under what it holds. */ unread: boolean; /** Focal-row extras (only ever passed to the focal row). */ expandBody?: ReactNode; expandGutter?: ReactNode; /** The focal row's natural kind height (its marks' band). */ bandHeight?: number | undefined; } /** Install (or clear) the test render probe. Test use only. */ export declare function setBodyRowRenderProbe(fn: ((key: string) => void) | undefined): void; /** Install (or clear) the test mount probe. Test use only. */ export declare function setBodyRowMountProbe(fn: ((key: string, phase: "mount" | "unmount") => void) | undefined): void; /** One body row — a group band, an R1 rail, or a kind row in its shell. */ export declare const PlanBodyRow: import("react").MemoExoticComponent<({ v, h, styles, gridTemplate, hasChildren, derived, dispatch, focusRole, focusTag, axisMode, showLinksControl, showExpandControl, partial, rowDrop, draft, groupEnd, unread, expandBody, expandGutter, bandHeight, }: PlanBodyRowProps) => import("react/jsx-runtime").JSX.Element>; export {}; //# sourceMappingURL=BodyRow.d.ts.map