Issue 457
enhancement: The content, call-to-action and archive blocks take plain props (0013)
Back to our planDone
enhancementfrontendcmspriority: high
Summary
Move the page builder's own blocks (content, call to action, archive) to plain props, built from the shared components, as decision 0013 says. Editors and visitors see the same pages; the code stops passing raw CMS data into components.
Details
Today ContentBlock, CallToActionBlock and ArchiveBlock take the generated Payload types and hand-build their sections and cards (B8–B11, B13, B16 in docs/ui/). The component set (docs/ui/component-set-modules.md) gives each one plain props and the shared parts:
ContentBlock:layout:single,columns,cards,stats(today guessed from the column sizes inside the component; the mapper decides it once),columns({ size, body, link? }[]). Built fromSection,CardGrid,Card,RichText · compact,Button.CallToActionBlock:body,links. Built fromSection · brand,RichText · inverse,Button · inverse.ArchiveBlock:intro,posts(loaded by a use case, passed in byapp/). Built fromSection · surface,CardGrid.
Following 0013:
- props types in
src/modules/site/domain/;to…Propsmappers insrc/modules/site/data/mappers.ts; links go throughresolveLink(), and theResolvedLinktype moves tosrc/platform/lib/content.ts getPageBySlugreturnssite's blocks already mapped; the layout union keeps the stored type for blocks other modules own (form, media), which the registry inapp/mapsPageBlockComponentsstays keyed byblockType, sotscfails on a missing component
Heroes move in a separate issue.
Acceptance criteria
- Not done: The three blocks take plain props; none imports
@/payload-types. - Not done: Each mapper has unit tests (including the layout choice for
ContentBlock). - Not done: Pages look the same at the six widths in both themes (or each change is listed and follows the card rules).
- Not done:
docs/ui/component-set-modules.mdsays what exists.
Generated by Claude Code, opens in a new tab