ue-component-model
Installation
SKILL.md
Universal Editor Component Models
In AEM-authoring projects (aem-boilerplate-xwalk) authors fill properties-panel fields instead of a table. AEM renders those properties as the same table structure that document authors would type, so one block serves both. The structure therefore comes from content-modeling; this skill maps it to fields and registers the block. Skip it for document-based projects.
Steps
- Get the content model (rows, cells, variants) from content-modeling. If it does not exist, create it first. Do not derive fields from
decorate(). - Map it to properties. Each row (or group of cells) is one property, in table order. Container blocks (cards, carousel): the container has a
filter, each item has its own model, one row per item and one column per property. - Write the partial
blocks/<name>/_<name>.jsonwithdefinitions,modelsandfilters. Register it where authors can add it, or they cannot: a block id goes into thesectionfilter inmodels/_section.json; a custom section type (for example a tab panel) goes into themainfilter inmodels/_component-filters.json. Then runnpm run build:json: it regenerates the rootcomponent-definition.json,component-models.jsonandcomponent-filters.json, which you never edit by hand (the pre-commit hook also runs it). - Check ids match (definition
template.modelorfilterto the model or filter id), JSON is valid, anddecorate()keepsdata-aue-*instrumentation when it moves elements (moveInstrumentation(), defined inscripts/scripts.jsof aem-boilerplate-xwalk).
Rules
The fields produce the same table a document author would type, so content-modeling's rules still apply to it (default content in cells, limited columns, no key/value for content, no nested blocks). The rules below are only the Universal Editor specifics.