/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * A bucket cell (#1267): its tiles and its marker — the tiles folded to the * room the cell gives them, their own box's (#1266). A lane's caption is its * gutter line's, never the cell's (#1680's review). * A cell with more than one tile shows the tiles that fit, in their order and * each drawn whole, then a `+n` chip that counts the rest: a button whose * anchored menu lists them by name. A pick selects the tile, as its click does * (#1197), and opens its popover where the root declares one (#816). * * The cell keeps a tile on its run — the selected one, the one whose popover * is open, or the one just picked — so the tile is there to act on, its ring * drawn and its popover anchored to it ({@link fitTiles}): shrunk to its floor * beside the chip if need be, or alone while the chip waits. A focused tile * that folds hands the focus to the chip. * * The fold is chosen before the browser paints, from widths the cell measured * with every tile drawn whole beside a stand-in chip, as a docked pane's tab * row folds its tabs (#1210): when the cell mounts, when its tiles change, * when fonts arrive, and when its room changes — taken in the ResizeObserver's * delivery, as the shared toolbar takes one, so no frame paints a fold the * cell does not rest on. While it measures again the chip keeps the last fold, * so an open menu stays open (#1235). A context strip's cell (R2) never folds. * * A cell with no room for one tile, its padding given way (#1276), draws none * of them: its chip alone, across the whole cell (`data-no-room`), lists every * tile, and a pick does what the tile's click does — its popover, the tile * having no box, hangs from the chip. * * The renderer sets data attributes and nothing else: `data-tile-measure` on * the tiles' box while it measures, `data-folded` on a folded tile, * `data-tile-more` on the chip, `data-tile-more-count` on its count, * `data-cramped` on a chip wider than the room, which shrinks to it and draws * no count, and `data-no-room` on a chip a cell with no room for a tile draws * across itself. Its styles are the Plan recipe's. * * @packageDocumentation */ import { type CSSProperties, type ReactNode } from "react"; import type { PlanWords } from "../words.js"; type Styles = Record>; /** One tile of a cell: its key, its accessible name, and the tile itself, drawn folded or not. */ export interface BucketCellTile { /** Its event's key — the tile's `data-event`. */ readonly key: string; /** Its accessible name — what the chip's menu lists it by (#819). */ readonly name: string; /** The tile, folded or not. */ readonly draw: (folded: boolean) => ReactNode; } /** Props of {@link BucketCell}. */ export interface BucketCellProps { /** The Plan recipe's styles. */ readonly styles: Styles; /** The row the cell is in, by its key — where an open popover's tile is looked for. */ readonly rowKey: string; /** The cell's key — its `data-plan-cell`. */ readonly cellKey: string; /** Where the cell sits: its left, width, top and height — inline, as a gesture moves them. */ readonly place: Readonly; /** Its marker's status — the ring — when it has one. */ readonly over: string | undefined; /** Its tiles, in order. */ readonly tiles: readonly BucketCellTile[]; /** Its marker's corner icon, drawn last. */ readonly marker: ReactNode; /** Whether the cell folds: it holds a tile, and is not a context strip's. */ readonly folds: boolean; /** The bucket's left edge, as a fraction of the window — the chip's place in the row's walk. */ readonly frac: number; /** The bucket, in words — the chip's name says where it is. */ readonly bucket: string; /** The cell's lane, in words, when it has one. */ readonly lane: string | undefined; /** The canvas's words. */ readonly words: PlanWords; /** A click on the cell itself: its row selected. */ readonly onClick: () => void; /** A signature of what sizes the tiles — each one's key and what it draws; the cell measures again when it changes. */ readonly signature: string; } /** * A bucket cell — see the module docs. * * @param props - The cell's place, its tiles and marker, whether it folds, and its words * @returns The cell */ export declare function BucketCell(props: BucketCellProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=BucketCell.d.ts.map