import { type TextFieldProps } from '@mui/material'; /** * A text field whose value may name VARIABLES, with the two ways of reaching * them that the besigner's attribute fields already taught (AGL-3197). * * ## What it is, and what it deliberately is not * * It is a plain MUI `TextField`. The value in it is the value that is stored — * `{{site.name}}` reads as `{{site.name}}`, and what makes that legible is the * PREVIEW under the field, not a pill drawn over the text. * * The besigner's `TokenTextField` does draw pills, and this is not that on * purpose. That field is a contentEditable surface with its own selection * model, DOM/model sync contract, paste handling and undo trade-offs, wired to * react-final-form and to the canvas's binding and media pickers. It earns all * of that because a node attribute can hold a token referring to any record on * the page. Here there are three variables, the field is 60 characters long, * and the honest cost of a pill surface — an editor that fights the IME, an * undo stack that truncates, a value the author cannot select and retype — is * not worth paying for a title. A plain input, a menu and a live preview are. * * ## Two ways in, because people reach for different ones * * The `+` opens the list with a description under each name; typing `{{` * offers the same list inline, filtered by whatever follows. Either way the * insert lands at the caret, and the caret is left after it — not at the end * of the value, which is where an insert that rebuilt the string would leave * it, and which is wrong whenever somebody is editing the middle of a title. */ export interface VariableOption { /** Written between the braces. */ name: string; /** What the menu calls it. */ label: string; /** One line under the label. */ description?: string; } export interface VariableTextFieldProps extends Omit { value: string; onChange: (value: string) => void; /** Every variable this field offers. */ variables: readonly VariableOption[]; /** The tooltip on the insert control. */ insertLabel?: string; } export declare function VariableTextField(props: VariableTextFieldProps): import("react").JSX.Element; export declare namespace VariableTextField { var displayName: string; } export default VariableTextField;