inmake DOCS
Docs / Generative / Elements & translations (package)

Elements & translations (package)

The element and translation tooling inside the package.

Elements#

An element is a reusable, prebuilt UI building block of a store's element library: one document at store/{sid}/elements/{elementId} (ElementEntity) bundling fields (the data shape of ONE placement — same FieldSchema vocabulary as document schemas), html (a Handlebars fragment, no page wrapper), css/js (hoisted into the page shell of every page that places the element), sample (preview data shaped by the fields), a free-form category grouping tag (missing/empty = the default group), plus authored metadata: a description and a component flag (small reusable building block — button, chip, card — vs a full-width page section; metadata only, it drives the admin's framing and how the agent is told to scope the CSS).

Content editors place elements through a kind:'element' schema field; each placement stores its own data and pages bind the rendered fragment as {{{ myField.html }}}. Live placements re-render with the element's CURRENT html/css/js, so element edits propagate to every page that places it.

store/{sid}/setup/elements (ElementsSetupEntity) is the library setup doc: item display order, categories order, the shared element-kit css/js, the legacy provenance of the retired platform-kit import (imports) and shared library assets (Storage files linked onto element-bearing pages). Agents never write setup/elements — the element agent's rules say so explicitly (category display order lives there and is admin-owned), and writeElement only touches elements/{elementId}.

Translations#

translations is a reserved data-collection key (see RESERVED_KEYS): it holds the store's localization strings for the {{t}} Handlebars helper — one flat document per group at data/{locale}/translations/{group}, public key group.leaf ({{t "cta.buy"}} reads key buy of group doc cta). Humans edit them in the admin's dedicated Localizations view; agents read/write the group documents directly like any data documents (e.g. when a template needs a key that does not exist yet) but must never registerCollection the key — reserved keys are refused by the tool, and updateStoreDocument's missing-registration warning deliberately skips them. The helper contract lives in rules/handlebars-binding.md; the reservation in rules/data-collections.md.