Composition / foldkit-mixins-builder
The editor's words
Every word the editor shows of its own, from "Add a block" to the shortcut
list's headings, is one of BuilderWords, English by default
(builderWords). Give any of them as a view input:
BuilderView.inputs({
words: { palette: 'Bloque nuevo', addBlock: 'Añadir {label}' },
})Keep the words in one value made once, not built in the view: each part that draws words is drawn again when the object it is given is another one.
Words are text: a word that takes a value names it as a blank ('Add {label}'),
so a translation puts it where its language does. They are not functions,
because they are a view input, and Foldkit throws on a function nested in
one; being text, one object can hold a form's words and these. The Catalog's
words (a Block's label and description, its group) and the command table's
labels are the application's already, and are not among them; so are key
names, but for the named keys (Enter, Delete), which keyNames words. A test draws the editor with every word replaced by a marker
and finds nothing else of its own left.
Previewing a context
With a Catalog context, a role="group" labelled "Preview as" (the
preview Slot) holds one field per key, a blank for unset. The canvas draws
the page for that context: a node hidden there is still drawn, marked
data-composition-hidden, which the site's CSS can dim:
[data-composition-hidden] > * { opacity: 0.4; }