/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The builder's one toolbar (#936), as the shared `Toolbar`'s items * (`Query Editor Spec.md` §4.1), folding on one ladder as Studio's toolbars * do: the history item (#935), **Copy jq**, which shows its check for a * moment after it copies and folds to its icon, * **Save…** (the save popover's trigger), and **Run**, the one primary * button, its shortcut in a `Kbd`, which folds away first, and "Running" with * a spinner while a run goes. A row short of room still (#1229) folds Copy jq * and Save… into one ⋯ chip, in one step: its menu holds the two, Save… * opening the save popover from the chip; Run keeps its folded form. Where * even the whole ladder leaves the row too wide — a phone's — Run is its icon * alone, named Run, a rung of the row's floor (`FLOOR_RANK`, hand retest, 27 * Oct 2026), so the row never runs past its end. * * **Visual · jq** is the Query tab's own ({@link viewToolbarItem}): the `seg` * strip Studio's canvas holds Desktop · Tablet in, at the top of the tab's * body, where a Library's band holds its search box, folding to its icons. * The result's controls are the results' own, in their band (#938). * * @packageDocumentation */ import { type ReactNode } from "react"; import { type ToolbarItem } from "@elaraai/east-ui-components"; import type { QueryWords } from "./model/words.js"; import { type Styles } from "./parts.js"; /** A view of the query: its steps, or its jq. */ export type QueryView = "visual" | "jq"; /** How long Copy jq shows its check. */ export declare const COPIED_MS = 1600; /** What the builder's toolbar holds. */ export interface QueryToolbarOptions { /** The history item (#935). */ readonly history: ToolbarItem; /** The text Copy jq copies: the program, or the jq as typed in the jq view. */ readonly copyText: () => string; /** The save popover, its trigger the toolbar's Save…. */ readonly save: ReactNode; /** The save popover hanging from the ⋯ chip Copy jq and Save… fold into — given the chip, as its anchor. */ readonly saveFrom: (anchor: ReactNode) => ReactNode; /** Opens the save popover — Save… in the ⋯ chip's menu. */ readonly onSaveAs: () => void; /** Whether the save popover is open: the item it hangs from keeps its form. */ readonly saving: boolean; /** Whether a run goes. */ readonly running: boolean; /** Runs the query. */ readonly onRun: () => void; /** The words. */ readonly words: QueryWords; /** The `queryBuilder` recipe's styles. */ readonly styles: Styles; } /** Copying the program: it goes to the clipboard, and `copied` holds for a moment after. */ export declare function useCopy(copyText: () => string): { copied: boolean; copy: () => void; }; /** What the Query tab's band holds: Visual · jq. */ export interface ViewItemOptions { /** The view shown. */ readonly view: QueryView; /** Shows a view. */ readonly onView: (view: QueryView) => void; /** The words. */ readonly words: QueryWords; /** The `queryBuilder` recipe's styles. */ readonly styles: Styles; /** The `seg` recipe's styles. */ readonly seg: Styles; } /** * Visual · jq, an item of the Query tab's band (`Query Editor Spec.md` §4.2): * the `seg` strip, folding to its icons. * * @param options - The view, what picking one does, the words and the styles ({@link ViewItemOptions}) * @returns The item */ export declare function viewToolbarItem(options: ViewItemOptions): ToolbarItem; /** * The builder's toolbar items — see the module docs. * * @param options - The history item, the result's controls, the save popover, the run, and the words ({@link QueryToolbarOptions}) * @returns The items, in their order along the row */ export declare function queryToolbarItems(options: QueryToolbarOptions): ToolbarItem[]; //# sourceMappingURL=toolbar.d.ts.map