/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * `StudioSaveTemplate` — the builder toolbar's Save as template (#997), before * Preview and Publish. Its button opens the popover that names the template — * offering " template" — and saves the open page, as last saved, under * the name: one commit. A name the project holds is refused in the popover, * and so is a name another write took first. While a template is open the * button is disabled: a template is not saved again. * * Its button is the `button` recipe's outline, as its neighbours in the * toolbar are, and as tall as every control in the row (`sm`, 28px, ruled 23 * Oct 2026); its popover is the shared {@link NamePopover}, in the Studio's * words. * * On a row short of room the button folds into the toolbar's ⋯ chip (#1229), * whose menu's Save as template… opens the same popover: its host then holds * it open and hangs it from the chip, as its `anchor`. On a phone (`Studio Mobile * Spec.md` ST28) its host gives the trigger, and it opens as a view, its field * labelled and a help line under it. * * @packageDocumentation */ import { type ReactElement, type ReactNode } from "react"; import { type ValueTypeOf } from "@elaraai/east"; import { StudioSaveTemplatePayloadType } from "@elaraai/e3-ui/internal"; /** Save as template, as the builder draws it. */ type StudioSaveTemplateValue = ValueTypeOf; /** Props of {@link StudioSaveTemplate}: its button, or the chip its host hangs it from, open while its host says. */ export type StudioSaveTemplateProps = { /** The open page's title, whether it can be saved, the names taken, and the save. */ value: StudioSaveTemplateValue; } & ({ anchor?: undefined; /** A phone's trigger, in place of its button: the first row's. */ phoneTrigger?: ReactElement; /** The project, which a phone's help line names. */ project?: string | undefined; } | { /** The chip it hangs from — the toolbar's ⋯, whose menu opened it. */ anchor: ReactNode; phoneTrigger?: undefined; project?: undefined; /** Whether it is open. */ open: boolean; /** Opens or closes it. */ onOpenChange: (open: boolean) => void; }); /** * Renders Save as template — see the module docs. * * @param props - What it saves, and how * @returns The button, or the chip, and its popover while open */ export declare const StudioSaveTemplate: import("react").MemoExoticComponent<(props: StudioSaveTemplateProps) => import("react/jsx-runtime").JSX.Element>; export {}; //# sourceMappingURL=save-template.d.ts.map