/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Schematic's toolbar items (#1387, `Schematic Builder Spec.md` §6.1, * SC24) — every control the Schematic has, as items of its frame's one * toolbar, in this order: * * 1. **the rail** over its `Slice.bindRecords` — each source's fields, the * presets over them — and, at the row's end, its summary; * 2. **the tools**, one strip: Select, Zoom box, Marquee, Connect (while a link * kind is editable) and Move (while an item kind is editable); beside it, * while several link kinds are editable, Connect's menu of the kind it * draws; * 3. **Zoom** − / + and **Fit**; * 4. **Find**, over the item kinds' keys (`find.ts`); * 5. **the steps** to the previous and the next item, while something is * selected; * 6. **the history item**, last, where the Schematic edits (#1388). * * They fold on one ladder: the rail first, in its own order (#952) — its * fields into their chips, then one chip, then its icon — then its summary * (`SUMMARY_RANK`); then the Schematic's own: the tools' strip drops its words * for its icons, Find's box folds to its icon, the strip folds into one chip * naming the tool, whose menu holds every tool — Connect once per link kind * it may draw — and last the tools, the zoom, Fit and the steps fold into * Find's popover, the View, one move: a phone's row holds the rail's icon, * the View and the history item (the Plan's View precedent). The history * item's step (`DEFAULT_RANK`) comes after all of them. While Find's query * stands, its box keeps its form — the View held off — while anything else in * the row can fold, and folds to its icon only once nothing else can, its * query and its pick in the popover the icon opens, so the history stays in * the row (the shared key search's rule, ruled 26 Oct 2026, "Find folds"). * Nothing wraps, scrolls or goes to a second row, and on a coarse pointer * every control is a 44px target by its halo, the row's height its own. * * @packageDocumentation */ import { type SystemStyleObject } from "@chakra-ui/react"; import type { ValueTypeOf } from "@elaraai/east"; import type { RecordSlicesChromeType } from "@elaraai/east-ui/internal"; import { type KeySearchSource, type ToolbarItem } from "@elaraai/east-ui-components"; import { type ZoomRange } from "../shared/schedule/zoom.js"; import type { SchematicWords } from "./messages.js"; import type { SchematicTool, SchematicToolsState } from "./tools.js"; type Styles = Record; /** * The Schematic's own fold ranks, after every step of the slice rail's * (#952): the tools' strip drops its words, Find folds to its icon, the strip * folds into its chip, and last the View bundle. The history item's step * (`DEFAULT_RANK`) comes after them. */ export declare const SCHEMATIC_RANK: { readonly labels: 10; readonly seek: number; readonly chip: number; readonly view: number; }; /** The bundle a phone's row folds the tools, the zoom, Fit, the steps and Find into: Find's View popover, one move. */ export declare const SCHEMATIC_VIEW = "schematic.view"; /** One link kind Connect may draw. */ export interface SchematicLinkChoice { /** Its slot. */ readonly key: string; /** Its name (`Fibre run`). */ readonly name: string; } /** What the Schematic's toolbar items show and drive. */ export interface SchematicToolbarProps { /** The `schematic` recipe's styles. */ readonly styles: Styles; /** The Schematic's words. */ readonly words: SchematicWords; /** The rail: one over the Schematic's `Slice.bindRecords`, its affordances and its persistence; `undefined` with no slice. */ readonly chrome: ValueTypeOf | undefined; /** What the rail's summary counts each source in, by its name. */ readonly nouns: Readonly> | undefined; /** The tools the Schematic offers, in order. */ readonly tools: readonly SchematicTool[]; /** The tools in force: the tool held, and the link kind Connect draws. */ readonly held: SchematicToolsState; /** The link kinds Connect may draw: the editable ones. */ readonly links: readonly SchematicLinkChoice[]; /** Picks a tool, or the link kind Connect draws. */ readonly onTools: (next: SchematicToolsState) => void; /** Find's source, over the item kinds' keys. */ readonly find: KeySearchSource; /** Zooms about the canvas's middle by a factor. */ readonly onZoom: (factor: number) => void; /** Where the zoom stands: at Fit Zoom out takes no press, and at the zoom's limit Zoom in takes none (#1393). */ readonly zoom: ZoomRange; /** Fits the drawing in view. */ readonly onFit: () => void; /** Whether something is selected: the steps show. */ readonly selected: boolean; /** Steps the selection to the previous item, or the next. */ readonly onStep: (delta: 1 | -1) => void; /** The history item, where the Schematic edits (#1388); `undefined` where it does not. */ readonly history?: ToolbarItem | undefined; } /** * The Schematic's toolbar items, in §6.1's order and on its fold ladder (see * the module docs) — for its frame's one toolbar. * * @param props - What the items show and drive * @returns The items, a falsy entry for each the Schematic has no use for */ export declare function useSchematicToolbarItems(props: SchematicToolbarProps): ReadonlyArray; export {}; //# sourceMappingURL=toolbar.d.ts.map