Skip to main content

Module universal_editor

Module universal_editor 

Source
Expand description

The universal default editor: edit any value over one draft.

The editor renders a draft in two real projections – a readable text rendering and the codec-portable raw form (see EDIT_MODES). It validates before commit, anchors errors to the edited field, allows cancel/revert, preserves unknown fields when editing open maps (set semantics keep sibling keys), and refuses to commit a readonly value.

Note: earlier scaffolding advertised four “synchronized” modes (form/tree/text/raw), but form, tree, and text all rendered identically; only the two distinct projections below are advertised, so the mode list matches what is actually implemented.

Structs§

UniversalEditor
The universal default editor.

Constants§

EDIT_MODES
The real edit-mode projections over one draft: a readable text rendering and the codec-portable raw form. These are the only two distinct projections render_draft produces, so only they are advertised.

Functions§

render_draft
Render a draft in one of the real edit modes (text readable, raw codec-portable; see EDIT_MODES). Both are views over the same draft.proposed, so switching mode never changes the draft. Any unknown mode renders the readable form.