Inline plain text (inline-text)
Use <ctx.Text parameter="heading" presentation="inline" as="h1" /> to edit a plain string on the page. It is the recommended default for a single user-written string the page prints (headings, labels, captions); opt out where the panel serves the task better. Inline text is included in the contract-1 baseline under ADR 0008 and needs no requires entry. Existing Text calls keep the parameter panel; presentation="inline" chooses on-page editing for a particular node, with the same word and values as an editor's presentation ('dialog', the default, keeps the panel). Older requires: ['inline-text'] declarations remain valid. The starter headings use it. Installed-runtime capability discovery and the generated SDK include inline-text.
The activated occurrence uses the template's actual font, ancestors, dimensions and CSS at page zoom. Other occurrences continue to show the confirmed parameter until Apply succeeds. The parameter's scope and saved identity do not change. A custom editor that owns the parameter remains its sole editing surface: clicking that text (or using the Inspector/Tab) opens the owner, including layout parameters listed in an element editor's spread. The inline-text save path also rejects a draft if ownership changes before its save runs. Plain strings have no formatting; a string declared with markdown: 'inline' gets bold, italic and strikethrough (see below). An inline string declared multiline: true defaults to white-space: pre-wrap in both editing and artwork; template CSS classes and inline styles take precedence.
Typing is pending until Done, leaving the field, or Enter for a single line. For multiline strings, Enter inserts a line break and ⌘/Ctrl+Enter applies. Tab/Shift+Tab applies and moves to the next/previous occurrence in reading order. Escape and Discard drop only pending typing. Whitespace-only/empty strings retain the existing placeholder and display-only fallback behavior after exit. Paste inserts plain text, normalizes CR/CRLF to LF, and replaces line breaks with spaces for a single-line parameter. Text selection, caret keys and focused typing Undo/Redo belong to the text editor; each confirmed application becomes one book Undo entry. IME Enter/Escape are left to the input method while composing; a pending flush waits for composition to end.
Application validates the complete string (including maxLength), checks the original parameter declaration, layout and saved value again when the shared edit queue runs, and uses the normal revision-checked project save service. Failed saves, invalid text and external conflicts keep the editor and its pending text, with a selectable copy of the draft in the error area. Conflicting typing is never silently applied over newer saved values. Recovery instructions explicitly say to fix the text, retry Done, or copy the draft and choose Discard before continuing. Discard and reopen to resolve an external conflict. Outside pointer presses cannot start canvas gestures before applying the text. Normal clicks are performed after a successful apply; browser actions requiring trusted user activation (links, file inputs and controls marked data-requires-user-activation) instead show “Text saved. Click again to continue.” and require a new real click. Ordinary zoom/scroll/resize follows the same editor without remounting it. If the layout changes or the occurrence disappears, the pending draft remains recoverable rather than moving to another saved parameter.
The Inspector's marked-text action opens the existing parameter control, including from the keyboard. Targets under 48 × 12 screen pixels, rotated/skewed targets and read-only projects use the existing panel; an inline session keeps its draft if the page later becomes smaller. Whole-spread views often make headings that small: they are then edited in the panel, and on the page once the view is zoomed in far enough. Keep the printed type its intended size rather than enlarging it to stay above the threshold. Thumbnails, MCP artwork captures and PDF exports use only confirmed render output, without editable nodes, draft text or editor chrome.
Photo captions on the page (inline-caption)
A photo's caption belongs to the photo: it is saved with the photo and printed wherever the photo is placed. <ctx.Caption box="hero" as="figcaption" /> prints the caption of the photo in photo box hero and marks it, so clicking it in the editor types the caption where it prints, in the template's own type, as an inline string is typed. Finishing saves it exactly as Edit Caption… does: one Undo step, the first caption of a photo switches its Show caption parameter on, and the new text shows at every place the photo is. While the photo is placed elsewhere too, the editor's toolbar says where ("Also on p. 12"). Captions are plain text and may have several lines: Enter inserts a line break, ⌘/Ctrl+Enter, Done or a click elsewhere finishes, and Escape or Discard drops the typing. The node keeps its line breaks (white-space: pre-wrap); template CSS and style take precedence. Inline captions are included in the contract-1 baseline and need no requires entry.
hero: box.photo('Photo', { showCaption: p.boolean({ label: 'Show caption', default: false, shows: 'caption' }) }),
// ...
<ctx.PhotoBox id="hero" rect={at.page(30, 44, 230, 190)} />
<ctx.Caption box="hero" className="caption" rect={at.page(30, 240, 230, 20)} />box is one of the layout's photo boxes (type-checked with the spread builder). as takes the same tags as ctx.Text (default p); className, style, rect, decorative and issue() markers work as on the platform components. The mark renders nothing while the box is empty, as there is no photo to own a caption, and nothing while the box's shows: 'caption' parameter is off, so the switch and the page always agree and there is nothing to click; Caption… in the photo toolbar still edits it. A box that renders ctx.Caption counts as printing captions for Caption… (parameters), with or without such a parameter. With the switch on and no caption yet, the editing canvas shows placeholder (default "Add caption") dimmed in the template's own type and marks the node data-empty; thumbnails, layout previews, the Book check, MCP artwork, presentation, proofs and export show an empty node. The node carries data-caption with the box ID in every view, as ctx.Text keeps data-edit.
The caption node edits no parameter, so it is not listed with the Inspector's marked text and ctx.edit cannot name it. Where it cannot be typed on the page (a target under 48 × 12 screen pixels, rotated or skewed template CSS, or a read-only book), clicking it opens Edit Caption… instead. Cover layouts have ctx.Caption too; there the caption is edited in the Inspector's cover section. A template that prints ctx.boxes.hero.photo.caption with its own markup keeps working, edited with Caption… only.