All notable changes to klehm/content-blocks are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- A long collection entry no longer overflows the block form. A folded
entry's summary (a FAQ question, say) is one unbroken line, and a plain
1frcolumn never shrinks below it: every entry grew past the sidebar. The column now shrinks and the summary ends with an ellipsis. - A value of the wrong shape no longer fails a whole paste. A list where a string goes, a string where an object goes, or collection entries written as strings (a forged clipboard entry, or a language model) used to end in a 500 from deep inside the form component. The replay now drops that one field and reports it, like any refused value.
-
A preset or initial-settings key that extends a core key is the host's, not a typo:
anchorIdis kept, where the newanchorwould have made it one, and refused atcache:clear. A key one or two letters off (anchr) is still refused. -
An edit in the sidebar costs one request, and the preview follows at once. A block or section save now returns the saved element's preview markup, which the builder swaps in straight away. Before, it waited 500 ms and asked
/block/{id}/render(or/section/{id}/render) for it. A section settings save answers200with{hotReload, html}where it answered204; a block type that opts out of hot reload, or a render that fails, falls back to the render endpoint as before, and never fails the save. -
The upload endpoint's errors are translated.
erroris now a sentence in the request's language naming the file and the limit, where it was an English string, and PHP's own wording (upload_max_filesize) no longer leaks out. A newcodefield (csrf,area_not_found,no_file,too_large,type_not_allowed,failed) stays the same in every language. A request overpost_max_size, which PHP empties whole, is now a 413too_large: it used to answer that the area was not found. -
A provider's actions show when the host includes the launcher directly. They were gathered by
ContentAreaTypeonly, so a direct include had to pass them astopbarActions. The shell now callscb_builder_actions(area, topbarActions)itself; an action listed twice shows once, so a host already passing them sees no duplicate.
-
Each column can be styled on its own. The section sidebar has a Columns style tab with one panel per column: padding (per viewport), background colour, background image with its size, position and veil, rounded corners (each corner, or all four linked, per viewport) and vertical alignment.
BoxSpacingTypeandResponsiveBoxSpacingTypetake acornersoption for that. Stored understylingin the column's settings, so it waits for Publish, undoes, copies, pastes, exports and imports like the label. A styled column getscb-col--styled(pluscb-col--bg-imageand a tone class) and wraps its blocks in a.cb-col__inner, since padding on the column itself would widen it. An unstyled column renders exactly as before; a host stylesheet reaching blocks with.cb-col > .cb-blockshould use.cb-col .cb-blockto reach those of a styled column. The headless tree hascolumns[].styling, and the content schema$defs.columnStyling(where the tab is shown), so a generated section can style its columns. A host'sStylingTypeextension stays out of the column tab, since a column keeps only the core keys. See docs/guide/styling.md. -
A section can have an anchor, its
id, set in the sidebar's Advanced panel (anchorsetting, allowed in presets):/page#pricingscrolls to it. A pasted#is dropped and spaces become dashes; anything that cannot be an id is refused, and checked again at render. Two sections with the same anchor both render, the first keeps theid. Alsosections[].anchorin the headless tree. -
A tab or an accordion panel opens from the URL:
#pricing-2opens the second panel of the section anchoredpricing, and a panel's own id or anything inside a closed panel works too. A small script,content_blocks_asset_panels(public route), is linked only by a public page with tabs or an accordion. -
A slider can show a glimpse of the next slide (
sliderPeek, Show a glimpse of the next slide): the slides narrow so the start of the next one shows at the edge.--cb-slide-peeksets the sliver (12% of the row).slider.peekin the headless tree. -
A gutter for every section,
content_blocks.section.gutter(a CSS length,nullby default): an inline padding on each section, which a section's own left or right padding still overrides.--cb-section-gutteroverrides it from the host's CSS, per screen. Off by default, since it moves the public 10BC8 page of a site that spaces its sections itself. -
Sections shown as tabs. When a tab needs its own columns, background or spacing, make each tab a whole section: tick Show as a tab (new Tab panel) or use Turn into tabs on the section toolbar, which adds a second tab in one undo step. Sections shown as tabs that follow each other form one group; Start a new tab group splits a run. In the builder the tab bar selects a section, + Tab adds one, and a title or style edit relabels the bar in place. On a phone the group turns into an accordion, and a tab that shows its own columns as tabs stacks them under
.cb-col-titleheadings instead (the mobile display offers only Grid and Slider there).#anchoropens a tab and#anchor-Nits N-th column. A copied tab joins the group it lands next to. The navigator, the library thumbnail and the headless tree (tab,tabGroup) show it. No migration: it is section settings. -
Tab styles:
underline(default),pillsandcards, picked on a group's first tab. A host adds, restyles or hides one withcontent_blocks.section.tab_stylesor aTabStyleProviderInterface; aTabStylenames the fields its tab shows (subtitle,icon) and may draw the tab with its own template. A host field joins the Tab panel with a form type extension andSectionSettingsType::tabStyleCondition(). -
SectionSettingsResolverInterfaceandSectionCloneObserverInterface, the section twins of the column seams: change the settings a section renders with, and hear which copy came from which section. The i18n package uses both to translate tab titles. -
A block can follow the blocks it reads, without reloading the preview. A total under a product list used to keep its old figure after an edit, or cost a full reload on every keystroke. A block type implementing
PreviewDependentInterfaceanswersdependsOn($block, $changed), by type or by the block a field targets, and the builder re-renders it in place after an edit, add, duplicate, move or delete of what it reads, in the response of that action.AreaBlocksInterfacegives its resolver the blocks the page shows and their data, the draft in the builder and the published state on the public page. See Blocks that read other blocks in the custom blocks guide. -
cb:focus, a third inbound builder event. Dispatched at the builder with{kind: 'block' | 'section', id}, it selects that element the way a click does: its sidebar opens and the preview scrolls to it. A host or a shell fragment can now point the editor at a block; the SEO audit package uses it. -
Headless rendering.
ContentAreaNormalizerInterfacerenders an area as data instead of HTML: sections (layout, display per viewport, settings), columns (span, width, label) and blocks (type, data, order per viewport), in a tree markedformat: 1. It reads what the HTML render reads, the published state for a visitor and the draft for an editor asking?cb_preview=1, and the immutability tests now snapshot the public JSON beside the public HTML.toJson()gives the string to send (empty maps stay objects, safe inside<script>), and Twig getscb_content_area_data()/cb_content_area_json(). No route is shipped: the host decides which pages may be read. ABlockJsonNormalizerInterface(autoconfigured, a pipeline) does for a JSON client what a block's view does: resolve URLs, sanitize, expand ids. Guide:docs/guide/headless.md. -
More server-side events. Saving a section's settings (
BeforeSectionSaveEvent/AfterSectionSaveEvent, with the settings about to be written), deleting a section (BeforeSectionDeleteEvent/AfterSectionDeleteEvent), and content inserted from a payload (BeforeContentInsertEvent/AfterContentInsertEvent): a paste, a section template, an import or Insert content, told apart byorigin(ContentInsertOrigin), the after event listing the sections and blocks created. Every before event can be refused, as before: the builder says the reason in its snackbar (in the import dialog for an import) and writes nothing. A refused paste keeps the copy. -
A content schema for AI.
content-blocks:schemaprints, andGET /area/{id}/schema(routecontent_blocks_area_schema,canEdit()) serves, one JSON document telling a language model what it may write into an area: the block types with their purpose, the layouts, the structure mode, the palette and section presets with their role, the latest saved sections as examples, and the JSON Schema of the output, a list ofcontent-blocks/section-v1sections. Each block's schema is derived from its own form (field types, choices,Length/Count/Range, collections, labels and help), so it cannot drift from what validates the data. No model ships. See Content schema for AI. -
BlockPurposeInterface, optional on a block type:getPurpose()says in a sentence what the block is for.content_blocks.schema.block_purposesoverrides it per type, andcontent_blocks.schema.examples(default 3) sets how many saved sections the schema carries. -
roleon a palette entry and a section style (PaletteColor::$role,SectionStyle::$role, config keyrole): what the colour or the preset is for, read by the content schema. -
FieldSchemaContributorInterface, autoconfigured, for a form field type whose stored value is not its children (the core's colour and upload fields ship one each). -
AI actions, each switched on or off on its own. With a provider registered (
AiProviderInterface, autoconfigured; none ships), the builder offers a ✦ menu beside prose fields (rewrite, shorten, change the tone) and beside an image'salt(describe the image), and a topbar Generate dialog with three scopes: add content (one or more sections, after the selected one), change the selected section (the new version takes its place; also from a ✦ on the section's toolbar in the preview) and change the whole page. For an edit the provider gets the sections to revise inContentRequest::$current. A field proposal is applied only on Replace; generated sections go through the paste replay into the draft, as one undo step. Off by default: AI needscontent_blocks.ai.enabled: true(orai: true) as well as a provider, so a dependency implementing the interface cannot start sending pages to a model on its own. Until then nothing is drawn and the endpoints (content_blocks_ai_text,_alt_text,_content) answer 404. Once enabled,content_blocks.ai.actions.<action>: falseswitches one off;ai.tonesandai.max_sectionstune the rest.AiBriefProviderInterfacehands every request what the host knows about the page. See AI actions. -
content-blocks:ai:apply <area> [file]writes a{"sections": [...]}document produced by your own pipeline or MCP server to an area's draft, through the same replay (--after,--replace).GeneratedContentWriteris the same from PHP. -
cb_aiform option (text,html,alt,false) and thecb:field:setevent a rich-text editor cancels to take a value set from outside. -
Browse library on the image and video fields. When the host registers a
ContentBlocks\Storage\MediaLibraryInterfacethat supports the field's kind, the upload widget shows Browse library. The button dispatchescb:media:browse; the dialog that claims it hands back a path throughpick({path, alt}), written the way an upload is, so the stored value stays a path. Without a library, nothing changes on screen. -
cb_alt_fieldonImageUploadTypenames a sibling field the library's alt text fills when it is empty. The editor's own alt is never overwritten. -
BuilderShellFragment::$standalone: a fragment that reads nothing off.cb-shellsays so withstandalone: true, and the i18n workbench renders it too. False by default: an existing fragment renders where it always did.
This release carries, across the three packages: CSS and JS declared by a
block, the add-block picker grouped by category, block and context in
block views, the public CSS in an optional cascade layer, Publish and Revert
to published choosing their languages, and lang on text shown in another
language. Everything is opt-in or additive; no migration.
- Typing right after adding a block could be lost. Adding a block opens its form; clicking the block then loaded the form a second time, which could land while the editor was typing: focus left the field and the text typed so far was gone. A click on the block or section the sidebar already shows, in the preview or the Navigator, now loads nothing.
-
cb_lang(object, 'field'), a Twig function for block views: it printslang="…"when a field is shown in another language than the page's, as recorded under the reserved_langkey of the object holding it, and nothing otherwise. The translation package fills it; without that package it always prints nothing. A value that is not a language tag is dropped. -
A block declares the CSS and JS it needs. A block type implementing the optional
BlockAssetsInterfacereturns aBlockAssets(stylesheets, modules, classic scripts) fromassets(array $data), so what is linked can follow the content. The page links them only where such a block renders, each once, after the core's stylesheets; a path goes throughasset()when the app hasframework.assets;entriesnames bundler entries, resolved by anEntrypointResolverInterfaceadapter: the Encore one (EncoreEntrypointResolver, entry linked with its runtime and shared chunks, deduplicated with the layout's own) is registered only whensymfony/webpack-encore-bundleis installed, which the package does not require; another bundler aliases its own. In the builder, a block added or edited in place brings its assets into the preview. A block type without the interface changes nothing. With AssetMapper, declare a block moduleentrypoint: trueinimportmap.php, passed to noimportmap(), for its imports to resolve. No migration. -
Picker categories.
#[AsContentBlock(category: 'media')]puts a block in a group of the add-block picker;prioritystill orders it within the group. Built-in groups:text,media,layout,actions,advanced, andother, where a block without a category lands. A subclass that re-applies the attribute without a category keeps its parent's.content_blocks.picker.categoriesadds, relabels and reorders groups (listed ones first),content_blocks.picker.blocksmoves a block type to another group. An undeclared category is refused atcache:clear, a near-miss block type when the builder opens. A picker whose blocks all fall in one group shows the flat grid it showed before.BlockTypeRegistrygainsgetCategory(). No migration. -
A block view receives
blockandcontext. Besidedataandblock_id, a view template now getsblock(BlockView:id,type, read-only, never the entity) andcontext(theRenderContext, its mode always set, its locale the request's when the caller left it open), so a view can tell the builder from the public page (context.preview) and knows its language (context.locale).RenderContextgainsisPreview()andisPublic(). A host overridingrender/block.html.twigmust passblock: block.view, context: block.contextin itsinclude(). No migration. -
Publish and Revert to published can choose their locales. When a bundle keeps locale drafts (the i18n package) and some are pending, both buttons open a dialog listing those languages, all ticked: an unticked one keeps its draft. The page's own draft always goes, so a translation can be held back but never pushed ahead of its source. Without such a bundle, or with nothing pending, nothing changes. New seam
LocaleDraftsProviderInterface(value objectLocaleDraft, autoconfigured).content_blocks_area_publishandcontent_blocks_area_discardtake an optional JSON body{"locales": [...]}; without it they cover every locale, as before. No migration. -
content_blocks.css_layer: the public CSS in a cascade layer. Set to a layer name (content-blocks), it serveslayout,stylingand the kit'skit.cssinside@layer <name> { … }, so any unlayered host rule wins over them whatever its specificity. Off by default: turning it on lets a host's global CSS (img,a, a reset) start winning, so check your pages. The default changes only in 2.0. The?v=of each link hashes the layered bytes, and the builder chrome is never layered. No migration.
- A Glide recipe for image optimization, the bundle-free alternative to LiipImagine: signed URLs, WebP variants, no upscaling (docs/guide/recipes/glide.md). The Encore sandbox runs it, under an end-to-end test. No package code changes.
This release carries, across the three packages: theme variables in the
colour palette (var(--brand, #hex), or a bare var(--brand) whose provider
hands the current hex from the host's back office), and colour fields shown
as swatches instead of a text dropdown.
- A palette entry can be a theme variable.
color: 'var(--theme-primary, #eb0540)'is stored and rendered as written, so pages follow the host's theme. The hex fallback is what the builder shows (sidebar swatch, library thumbnails) and what decides the dark / light tone classes, through the newCssColor::swatch().cb_color_palette()entries gain aswatchkey. - A palette entry can carry its preview hex.
PaletteColorgains an optionalswatch(config keyswatch), so a host whose colours live in its back office storesvar(--brand)and hands the current hex: the sidebar, the dark / light tone classes and the thumbnails follow it, with no CSS to inject in the builder.ColorPaletteRegistry::swatch()/tone()are the lookup, and the palette is now read once per request.
- Colour fields show swatches.
PaletteColorTyperenders a row of colour swatches (None, the palette, Custom…) instead of a text dropdown, the name on hover. It is now a radio group: a test or script driving it shouldcheck()aninput[value="#hex"]rather thanselectOption()a<select>.
- A stored colour that is not a hex and no longer in the palette stays on
offer in the field instead of falling into the
#rrggbbpicker, which lost it on the next save.
- An invalid field no longer holds the rest of a block's form. With a
required field still empty (the
alerttext, abuttonlabel), changing another field saved nothing: the preview stayed put, and closing the sidebar lost the change. The invalid field now keeps its stored value while the valid ones save, and its error shows only once the editor has touched it, instead of on every field of the form. An error on the form itself still holds the whole save.
This release carries, across the three packages:
- A narrower builder (
klehm/content-blocks).content_blocks.structureturns the builder into a stack of blocks (sections: hidden), a skeleton to fill (sections: fixed) or locks the columns (columns: false), per area if the host wishes;content_blocks.styling: falsedrops the free styling fields. Seedocs/guide/builder-structure.md. - Import and Export, each on its own (
klehm/content-blocks):enable_importandenable_exportonContentAreaType. - Routes mounted where they belong on Symfony 7.4+ (all three packages):
a new app's
routing.controllersimport no longer remounts the packages' controllers at the root.
content_blocks.structure, to narrow what editors do to sections and columns.sections: hiddenis a blocks-only builder: no section in the UI, blocks stack in one full-width section the server creates with the first block (new routecontent_blocks_area_block_create,POST /area/{id}/blocks).sections: fixedkeeps the sections in place selectable but rules out adding, moving, duplicating, deleting, pasting and inserting one.columns: falseremoves the Columns and Layout panels. The endpoints refuse what a mode rules out (409,reasons: ["structure"]). Per area throughBuilderStructureResolverInterface(defaultConfiguredBuilderStructureResolver). Seedocs/guide/builder-structure.md.content_blocks.styling, to hide the free styling fields (spacing, background, alignment) for a sober builder:styling: falsefor both sidebars, or{ block: false }/{ section: false }for one. The block sidebar loses its Style tab; the section sidebar keeps thesection_stylespreset dropdown and drops the Customize styling switch and its fields. UI-only: stored values still render and survive a save.enable_importandenable_export, twoContentAreaTypeoptions (andenableImport/enableExportfor a launcher included directly), so a host can keep Export and drop Import, or the reverse. Left atnullthey followenable_import_export, which keeps its meaning. With one half off, the topbar entry and the dialog are named after the half that remains, and the dialog has no tabs. UI-only, like the other toggles.
- On Symfony 7.4+, the builder's routes were mounted at the root
(
/upload,/area/{id}/publish…) instead of under/_content-blocks. A new app'sconfig/routes.yamlimportsrouting.controllers, which picked up the package's autoconfigured controllers a second time, unprefixed, and replaced the recipe's mount. The controllers are no longer autoconfigured; nothing to change on the host side. doctrine/collections3 is accepted. A fresh Symfony 8.1 app on PHP 8.4 resolves it throughdoctrine/orm3.7, and neededcomposer require -W.- The Flex recipes applied without
allow-contrib. The endpoint marked itself as a contrib repository, so Flex asked before each recipe, and skipped it on a non-interactive install. Adding the endpoint is the opt-in.
This release carries, across the three packages:
- Content from code (
klehm/content-blocks).ContentManipulatorInterfaceadds, moves, duplicates and deletes sections, columns and blocks the way the builder does, for fixtures, migrations and seed commands. - Server-side events (
klehm/content-blocks). Before/after pairs around publish, discard, block save and block delete; a before listener can refuse the action, and the builder says why. - Translation (
klehm/content-blocks-i18n). Publish one language from the workbench, replace images and videos per language, carry translations through section templates and the clipboard, an opt-in locale fallback chain, hreflang links, and a translation-only change can now be published from the builder.
No database migration. klehm/content-blocks-i18n 1.2 requires
klehm/content-blocks ^1.2: carrying translations through section
templates and the clipboard is on by default, never missing. A host
that copied builder/shell.html.twig or launcher.html.twig should switch to
cb_has_unpublished_changes(area). The three packages are tagged together.
cb-builder_controller.jsis split into one file per feature underassets/builder/(requests, session, preview, structure, history, clipboard, sidebar, template library, …), mixed into the controller. Nothing changes for a host: same controller name, samecb:*events, nothing to add tocontrollers.json. A host that overrode the controller file through its importmap or bundler now has to override thebuilder/file that holds the method instead.
-
ContentManipulatorInterface: build content from code. Fixtures, CMS migrations and seed commands used to setpreviewPosition, collection_ids and settings by hand. The service adds, moves, duplicates, deletes and restores sections, columns and blocks the way the builder does, because the builder's endpoints now run it: a section gets its layout's columns and the configuredinitial_settings, a block starts from its type's defaults with_ids minted, order is kept. It writes the draft only and never flushes;publish()puts the result live.insertSection()andinsertBlock()place a node built elsewhere; paste, section templates, import and "Insert content" go through them, so a decorator of the service sees every structural change. A refusal throwsContentManipulationExceptionwith a stablereason. See Content from code. -
Symfony events around publish, discard, block save and block delete, in before/after pairs. A cache purge or a webhook used to mean decorating
ContentAreaPublisherInterface, a block save had no hook at all, and nothing could stop an action. Eight events inContentBlocks\Event:Before…events are dispatched before anything is written, and a listener can refuse the action with$event->refuse('Why.'). The builder then shows the reason and changes nothing: in the snackbar for publish, discard and delete, above the form for a block save.BeforeBlockSaveEventcarries the data about to be written.After…events are dispatched after the flush.BeforeContentAreaPublishEvent/AfterContentAreaPublishEventandBeforeContentAreaDiscardEvent/AfterContentAreaDiscardEventcarry the area and thePublishContext. They come from the outermost decorator of the publisher, so they bracket every other decorator (translations are committed by the time the after event runs) and still fire when the host replaced the publisher. A refusal throwsActionRefusedExceptionto a caller in PHP, and answers409to the builder.BeforeBlockSaveEvent/AfterBlockSaveEventandBeforeBlockDeleteEvent/AfterBlockDeleteEventcarry the block and its area. They are draft events: only a publish changes the public page.
Nothing to migrate, and nothing changes for a host that listens to nothing. See Server-side events.
-
UnpublishedChangesProviderInterface: a bundle that keeps a draft of its own beside the area (a translation) tells the builder there is something to publish. The shell, the launcher badge and every endpoint answeringhasUnpublishedChangesread the area's draft and then these providers (UnpublishedChanges, Twigcb_has_unpublished_changes(area)).ContentArea::hasUnpublishedChanges()is unchanged. A host that copiedbuilder/shell.html.twigorlauncher.html.twigkeeps the old reading until it switches to the function. -
SnapshotExtensionInterface: section templates and the clipboard carry what a bundle stores beside a block, asContentAreaTransferExtensionInterfacedoes for an export, underextensions.<key>of the snapshot. Older templates and clipboard entries read as before, and the serializers are unchanged.
- Duplicating a block kept none of its translations, while duplicating its section kept them. A duplicated block now notifies the clone observers too.
This release carries two changes:
- Fixed: concurrent section saves (
klehm/content-blocks). Two section-setting autosaves in quick succession could overlap, and the older one could overwrite the newer. The section sidebar now sends one save at a time. - Added: host-supplied translation locales (
klehm/content-blocks-i18n). The new interfaceContentBlocks\I18n\Locale\TargetLocalesProviderInterfacelets a host service supply the locales editors translate into, for example from the database. The default implementation,ContentBlocks\I18n\Locale\ConfiguredTargetLocalesProvider, keeps readingcontent_blocks_i18n.locales.
Nothing to migrate. The three packages are tagged together.
- A section setting changed right after another could be lost. The section sidebar posted each autosave as it came, so two saves could overlap, and when the server handled the older one last it overwrote the newer: ticking Customise style then picking a colour kept the tick and dropped the colour, while the sidebar still showed it selected. The sidebar now keeps one save in flight and sends what changed meanwhile once it returns.
The first stable release. No code change since 1.0.0-RC17, which a production host has run without a finding. From here, everything the backward compatibility page lists is stable until 2.0: a 1.x release adds, fixes and deprecates, and removes nothing before 2.0.
Coming from a beta or a candidate, the upgrade guide lists each step.
- Any editor could read any file on the server through the export. A
stored path was joined onto the upload directory without normalisation, so
/uploads/content-blocks/../../../.envtyped into any field was read into the export zip.LocalFileStoragenow refuses./../empty segments, backslashes and NUL bytes, and only reads or removes a real file under the real upload directory. A customFileStorageInterfacemust hold to the same rule (docs/guide/security.md). Upgrade. - Export and replace-with read the draft with only
canView(). Both copy unpublished content, and the documentedcanView()returnstrue: behind a single firewall the export was downloadable anonymously. Both now requirecanEdit()— on the source area too for replace-with. A host that let a view-only user export or copy from an area loses that; that was the bug. - A colour could carry extra CSS declarations. The custom picker of
PaletteColorTypevalidated nothing, andbackgroundColorwent intostyleverbatim:red;position:fixed;inset:0;background:url(…)covered the public page. The picker now accepts#rrggbbonly, and the styling decorators emit a colour only if it is a single colour value (ContentBlocks\Palette\CssColor, Twigcb_css_color()), which also covers values arriving by import or template. - SVG is no longer an allowed upload by default. A scripted SVG served
from the site's origin runs when opened directly — stored XSS reachable by
any editor, through the upload endpoint or an import.
upload.allowed_mime_typesdefaults to JPEG, PNG, GIF, WebP and PDF. To keep SVG, list it explicitly and serve the upload directory withContent-Security-Policy: sandbox(docs/guide/security.md). - An import or a pasted section wrote its layout and presets verbatim.
A layout this install does not know, a preset that is not
col-1…col-12, or a block without a type landed as-is — a string longer than the column answered 500. They now fall back tofull,col-12, and no block. Block data stays verbatim; the kit guards what it renders. /uploadchecked the CSRF token only. Any session holding acontent_blockstoken could write files. The upload widgets now post the builder'sarea(fromdata-cb-area-id, added to the shell) and the endpoint checkscanEdit()on it; an upload without it answers 404. A host posting to the endpoint from its own script must sendareatoo.- An access denial answered 500.
ContentBlocksAccessDeniedExceptionnow extendsAccessDeniedHttpException: 403, logged as a denial rather than a crash. It is still a\RuntimeException. - An import echoed library exception messages. Only the importer's own
refusals (
ImportRefusedException) are shown; anything else answers a generic message. - Preview responses are
private, no-storeandX-Frame-Options: SAMEORIGIN(PreviewResponseListener; a header the host set wins), so a shared cache cannot store a draft and another origin cannot frame it. - The block editor's Live Component re-checks
canEdit()on every request (#[PostHydrate]), not only on its actions: a replayed props blob no longer re-renders a draft after the rights were revoked. - Replace-candidates lists only areas the user can edit, the rule replace-with itself now applies.
- Size limits on restore. An import or a pasted section with more than 1 000 sections, 20 columns in a section or 5 000 blocks is refused before any file is stored; a paste body over 5 MB answers 413.
- Small hardening. A huge
?page=no longer throws (clamped to 10 000), and%/_in the section-template search match literally. twig/twigis required at^3.27, past the advisories on earlier releases.- An import could write any file type into the public upload directory.
Each embedded file was stored under the
extensionwritten in the JSON, so a forged export could drop a.phpfile (code execution where the upload directory runs PHP) or an.htmlfile (stored XSS). An import now applies the upload policy to every file: the MIME type is sniffed from the bytes and checked againstcontent_blocks.upload.allowed_mime_types, the extension is derived from it, andupload.max_sizeapplies. Requires an editor account; upgrade.
- A block view receives
block_id, next todata: markup that must be unique on the page and identical from one render to the next (a radio group'sname, an ARIA id) uses it instead ofrandom(). - The Insert content picker keeps focus inside while open (
aria-modal, Tab wraps around) and gives it back to the button that opened it. cb:readyis a DOM event. It was only a message from the preview iframe to the builder, out of a host's reach although it was listed as public. The builder now re-dispatches it on its element (bubbling,detail.areaId) each time the preview becomes interactive.cb:notify, a second inbound public event. Dispatched at the builder, it showsdetail.messagein the builder's snackbar, with an optionaldetail.link({ label, href }) opened in a new tab. A host action that reported its outcome in its own page did so under the builder's modal, where nobody saw it — the sandbox's Save as model looked like it did nothing. Text only; a non-http(s) link is dropped.- Export as a streamed zip.
GET …/exportanswers a.zip—content.jsonplus onemedia/{hash}.{ext}per file, stored as-is — written as it is sent (maennchen/zipstream-php, a new dependency). Memory stays at one file whatever the page, and an exactContent-Lengthgives the browser a real progress bar.?assets=0leaves the media out.GET …/export/summarysays what the archive will hold and weigh. - Import in steps. The builder opens the archive itself, asks which media
this site already holds (
POST …/import/plan), sends the others one per request (POST …/import/asset), then the content (POST …/import/commit), one undoable step as before. A copy on the same site sends no media and duplicates none; the export's size never meetspost_max_size, only the largest single file does. Each file is hashed on arrival and kept only if the export lists it; the content is resolved only against files the server checked. - A new Import / Export dialog. A native modal dialog with an Export and
an Import tab: what the archive holds and weighs, an Include media files
switch, a drop zone, a review of the file before anything is written (media
here, to send, missing or too large, block types unknown here), progress,
and the outcome. Media missing from the archive can be dropped in and are
checked against the export. It replaces the panel and its
window.confirm. - Missing media are named after an import (
missingAssets): a file neither in the archive nor on this site keeps its source path. content_blocks.import.max_size(default 50 MB) caps the single-requestPOST …/import, kept for scripts, which answers413withmaxByteswhen a file is too large for it or for PHP.- Which collection entries open. A
LiveCollectionTypetakescb_open_entries:all(default, unchanged),first,lastornone. The other entries render folded from the server, with no flash on load. An entry added or duplicated later still opens.
- The preview runs under a strict Content Security Policy. Its block
types and overlay labels travel in
<script type="application/json">blocks instead of inline scripts settingwindow.__cb*, so no nonce is needed. A copiedrender/content_area.html.twigthat still sets the globals keeps working. The security guide now documents the policy the packages need. - Dependency floors raised to what is tested. CI now resolves every
dependency at its lowest allowed version and runs the suite. It showed
doctrine/orm2.12 lacksOnFlushEventArgs::getObjectManager(), which the touch listener calls (now^2.15), and UX 2.0 lacksComponentToolsTrait. The Live Component JavaScript is only exercised by the browser suite, on UX 2.36 and 3.x, sosymfony/ux-live-component,ux-twig-componentandstimulus-bundlerequire^2.36 || ^3.0. - PostgreSQL is tested. The whole browser suite also runs on PostgreSQL 16 in CI; the entities were already plain Doctrine.
- Direct dependencies are declared:
doctrine/doctrine-bundle,symfony/console,symfony/routing,symfony/options-resolver,symfony/property-access,doctrine/collectionsand friends only arrived through other packages. - The public CSS and JS are cached properly. Each served file carries an
ETag, so a revalidation is a
304; the package templates link it with its content hash (?v=), which is answered with a year ofimmutablecache. After an upgrade the new hash is a new URL: no stale stylesheet for five minutes, and no re-download every five minutes either. AccessCheckerInterface::canView()is removed. Nothing called it since export and replace-with moved tocanEdit(), so it read as a protection it never gave. Every draft read askscanEdit(); the published page is guarded by the host's own route. An implementation that keeps the method still satisfies the interface.BlockTypeInterface::getType(),getLabel()andgetIcon()are no longer static. As static methods they could not read what the service was built with: one class could not serve two types, and a label or an icon could not come from configuration. Removestaticfrom them on your block types; a class that keeps it fails loudly when loaded. Call$type->getLabel()rather than$type::getLabel(). See the upgrade guide, §9.- The backward-compatibility page is rewritten from the code. It now lists
what hosts were already told to use:
ContentAreaTypeand its options, the field types,BlockTypeRegistry,#[AsBlockFormExtension], the value objects an implementation builds, the exceptions, eight tables, sixteen Stimulus controllers, seven events with theirdetail. The HTTP promise is narrowed: every route name is stable, but payloads only for the routes a host calls itself (upload, export, import, publish, discard, public assets). - Setters of published state are
@internal:Block::setPublishedData(),setPublishedColumnId()andsetPosition(),Section/ColumnsetPublishedSettings()andsetPosition(),Column::setPublishedPreset(), andContentArea::setUpdatedAt(). Code building content writes the draft and callspublish(), which is what these methods bypassed. - The export's
assetsentries list files instead of carrying them:mimeType,extension,sizeand the sourcepath, nodata. The format stayscontent-blocks/v1; a pre-RC17 export, bytes inline, still imports. ContentAreaImporterInterface::import()takes a third argument,array $storedAssets = [](hash ⇒ path of a file the server verified). An implementation of your own must add it.- The Import / Export panel moved to
builder/transfer_dialog.html.twig; a copiedbuilder/shell.html.twigincludes it instead (see the upgrade guide, 3a).
config/routes/editor.phpalso mounted the public asset routes onsymfony/routingbefore 6.4.x, which ignores theexcludeof a directory import: the public CSS and JS landed under the admin prefix, out of a visitor's reach. The asset controller moved out ofsrc/Controller/(@internal, no host change), so the import no longer needs anexclude.
- Collection entries fold. Each entry of a live collection in the sidebar
has a
10BC8
header naming it (its first image and first text, else its position)
that folds the entry down to that line; Collapse all / Expand all sit
above a list of two or more. A folded entry stays folded through a reorder,
a duplicate or a delete. The
cb-collection-sortcontroller now sits on a wrapper around the list (data-cb-collection-sort-target="list").
- Lighter inline styles. A section's or block's padding, margin and gap no
longer emit the CSS variables the stylesheet already resolves to the same
value: a
0on desktop, or a tablet/mobile value equal to the one above it. The render is unchanged; a section or block with an all-zero box keeps its--styledclass. A host stylesheet reading--cb-*-pad-*,--cb-*-mar-*or--cb-gap-*directly must use the same fallback chain asstyling.css.
- Sidebar tabs and panels for every field. Four form options lay out the
block and section sidebars without a template:
cb_group(the tab),cb_panel(a collapsible panel in it),cb_help_tooltip(the long help behind an (i) button) andcb_panels_exclusive. The panels of a tab are native<details>sharing aname, so opening one closes the other; the one holding an invalid field opens, and the sidebar remembers the tab and panel last used for the session. A closed panel sums up its values in its header. See Laying out sidebar fields. - Icon choices.
cb_iconson aChoiceTypedraws each choice as an icon button over its native radio — or checkbox, withmultiple— in a row or a grid (cb_icon_layout,cb_icon_columns), optionally labelled (cb_icon_labels). 78 icons ship (positions, corners, sides, alignments, media fits and ratios, layouts, displays, effects, directions); a host adds or redraws some throughUiIconProviderInterface(autoconfigured). Twig:cb_ui_icon(name). - A background image can sit in a corner:
backgroundPositionacceptstop left,top right,bottom leftandbottom right, picked from a 3×3 grid.
- The section sidebar has tabs, like the block one: Structure and
Style. Structure holds four panels — Columns, Layout (the display per
screen with every field it gates: slider and accordion options, reverse on
mobile, column widths), Width and Advanced; the styling is folded into
Spacing, Background and Size and alignment panels, on blocks too. A
field that gates another shares its panel. A field a host adds to
SectionSettingsTypelands on Structure unless it names a tab. - Display, width mode, background size and alignments are icon choices; the display labels are shortened to Grid / Slider / Tabs / Accordion. The help of Customize styling is one line, the rest in its tooltip.
- A lighter chrome. Fields are white (
--cb-field-bg: a tinted field read as disabled) with a hairline shadow,--cb-shadow-field; buttons and the preview's add controls take--cb-shadow-control, lift to--cb-shadow-control-hoverunder the pointer, and a picked value — icon choice, column-width preset, linked sides — is a solid accent with--cb-shadow-selected. A host that redeclared--cb-field-bgkeeps its fill. data-cb-groupis still read, andcb_groupwins over it.- If you styled or overrode the sidebar:
.cb-block__tab*became.cb-sidebar-tabs__*,.cb-sidebar__group*and.cb-align-*are gone, and so are thecb_vertical_align/cb_horizontal_aligntheme blocks — the fields render throughcb_icon_choice_widget. Nocontrollers.jsonchange:cb-tabsdoes the new work.
- An expired session no longer passes for a save. A firewall's login
redirect answered a builder call with a
200login page, which the section form reported as saved (nothing was stored) and which made the preview reload onto an unrelated page. Such a redirect is now a401(SessionExpiredResponseListener, headerX-Content-Blocks-Session: expired), the builder also recognises a followed redirect, and a Session expired banner replaces the save error. The preview is not reloaded meanwhile, and the unsaved edit is sent again once the session is back. - The builder checks the session when the editor returns. The first
interaction after a minute of inactivity asks
GET /area/{id}/state, which now also returns the session's currentcsrfToken. The banner shows before an edit is lost, and a renewed session hands over its new CSRF token.
- Display per viewport. Display gets the desktop / tablet / mobile switch:
displayTabletanddisplayMobileinherit the viewport above, and can only get more compact (grid or slider → grid, slider or accordion; tabs → tabs or accordion; accordion stays). A section that changes renderscb-section--responsive cb-section--t-* cb-section--m-*; a uniform one keeps its markup. Tabs becoming an accordion reuse the tab radios. See Display per viewport. - Slider display. Columns scroll and snap, one column per slide, with
sliderPerViewper viewport (1 to 6),sliderControls(arrows, dots, both, none),sliderAutoplay(seconds; pauses on hover and focus, off for reduced motion and in the builder) andsliderLoop. Swiping needs no script; the controls and ARIA come fromcontent_blocks_asset_slider, loaded only by a page that has a slider. Also a layoutdisplay. - Order per viewport. With the preview on tablet or mobile, dragging a
section, or a block within its column, orders that viewport only, through
POST /area/{id}/viewport-order(and/reset). Ranks live under_order, render as--cb-order-t/--cb-order-m, go through undo and Publish, and a block moved to another column on desktop loses them. - Drag a section by its label. The hanging Section label drags the section; a click still selects it.
||indata-cb-conditionseparates whole alternatives.
- Tab panels are matched with
.cb-col:nth-of-type(n)instead of:nth-child(n), and an open accordion panel isdisplay: flexlike a tab panel (margins between its blocks no longer collapse). Host CSS copying the old selectors needs the same change. - Accordion toggles and headers are
display: noneoutside an accordion, and shown by the accordion rules.
- A background image on sections. The section's Style group gains an image
(upload, drop or path), its size (cover or contain), its position, and a veil
(colour and opacity, 0 to 90%) to keep text readable. Rendered as
cb-section--bg-imagewith--cb-s-bg-img,--cb-s-bg-size,--cb-s-bg-pos,--cb-s-overlayand--cb-s-overlay-color; the URL goes throughImageUrlResolverInterfaceat 1920px. From 40% opacity the veil sets the tone class. Exported, imported and kept by the asset GC like any other file. See Background image of a section. - Accordion options.
accordionSingleopens one panel at a time (CSS only, clicking the open header closes it) andaccordionCollapsedstarts with every panel closed. Both are sidebar checkboxes shown for the accordion display, and preset settings. - Host keys in preset and initial settings.
section_styles[].settingsandsection.initial_settingskeep keys the core does not know, so a field added by a form type extension can be preset. Core keys stay typed, and a key a letter or two off a core key is refused as a typo.
-
A block added and never edited is translatable. Collection entries only got their
_idwhen the block's form was saved, so a freshtable,card,list,accordion,tabs,gallery,breadcrumborbutton_groupstored its default entries without one, and the translation workbench skipped them. Adding a block, inserting a section template and importing now fill in the missing ids through the newCollectionIdBackfiller(ids already present are kept). Blocks added before this fix: runcontent-blocks:backfill-collection-ids. -
assets/package.jsondeclares aversion. Yarn 1 refused the package (invalid package version "") when a host linked it withfile:; npm let it through. A test keeps it from falling behind the last release. -
A late sidebar response no longer replaces a newer form. Opening a section's settings right after adding it, or clicking outside while a form was loading, could let the earlier request land last and undo the editor's choice, or bring the dismissed form back. Only the latest request lands now.
-
The tab bar follows the section's width. On a centered section the bar spanned the whole section while the panels stopped at the max width, and once a vertical alignment turned the section into a flex column, a host style centring its children shrank the bar to its labels.
.cb-tabs__navis now capped by--cb-row-max-wlike the row, and always full width.
- Section layouts are host config:
content_blocks.section.layouts. Add a layout (four_cols: { label: '4 columns', columns: [3, 3, 3, 3] }, or an uneven[4, 8]), relabel a built-in, or hide one withname: false. Spans are on a 12-unit grid and must add up to 12. Names must be snake_case, 30 characters at most. Both are checked atcache:clear. The add-section buttons, their glyphs, the navigator labels andPOST …/sectionsall read the sameSectionLayoutRegistry, and the Twig functioncb_section_layouts()exposes it. Hiding a layout only stops new sections: existing ones render from their own column presets. See Section layouts. - Columns are edited from the section sidebar, and a section can show them
as tabs or as an accordion. A new Columns group adds a column, removes one (never the last)
and names each. At most 20 columns per section. The new Display setting
(
display: grid | tabs | accordion) shows them side by side, one at a time, or as collapsible panels, with the column names as tab or panel titles. Tabs are CSS only (radios + labels, no script on the public page), themable through--cb-tabs-accent,--cb-tabs-lineand--cb-tabs-gap. The accordion is CSS only as well (a checkbox and a header before each column, panels open independently), themable through--cb-accordion-accent,--cb-accordion-lineand--cb-accordion-gap. In the builder the open tab or panels survive a preview reload, and selecting a block opens its tab or panel. All of it is draft, journalled for undo, and carried by duplicate, copy/paste, section templates and export/import (columns[].settings, only when set). A layout can start its sections as tabs or an accordion withdisplay: tabsordisplay: accordion. New endpointsPOST …/section/{id}/columns,POST …/column/{id}/delete,POST …/column/{id}/settings(CSRF +canEdit). See Columns and tabs. - Two seams for what is stored beside a column:
ColumnSettingsResolverInterface(tagcontent_blocks.column_settings_resolver) rewrites a column's settings at render, andColumnCloneObserverInterface(tagcontent_blocks.column_clone_observer) is told of each column copy during a section clone. Both are autoconfigured and empty by default, so output and cloning are unchanged without them.content-blocks-i18nuses them to translate tab titles. - Text alignment on every block. The block's Style tab gains Text align
(left, centre, right, justify), rendered as the class
cb-block--text-start|center|end|justify. It sits next to the existing Max width and Horizontal align, which cap and place a block for readable line lengths. See Styling. - Reverse the column order on mobile. A section with two columns or more
has a
reverseOnMobilesetting (sidebar checkbox, also accepted in presetsettings). At 540px and below its stacked columns read last to first (cb-section--reverse-mobile), for alternating image and text rows. Grid display only. - Dark or light background, as a class and a helper. A section or block
with a background colour carries
cb-section--bg-dark|lightorcb-block--bg-dark|light, so a host stylesheet can switch the text colour.ContentBlocks\Palette\ColorTone(of(),isDark(),isLight(),luminance()) and the Twig functionscb_color_tone()/cb_color_is_dark()expose the same rule, which the section library's thumbnails already used. See Dark and light backgrounds. VideoUploadType: the image upload widget (picker, drop zone, pasted path) with a<video>preview andacceptset to MP4, WebM and Ogg. The default upload whitelist is unchanged and has no video type. Addvideo/mp4/video/webmtoupload.allowed_mime_typesto upload videos.
-
cb_columngains draft twins:published_preset,published_settings,draft_settings. Migration required:Version20260917120000(in the sandbox), which also pins the preset of every published column.presetis now the draft value and the public render readspublished_preset, so re-spanning columns in the builder never moves the live page before Publish. See the upgrade guide. -
Column presets are spans, rendered as
flex-grow.layout.cssnow styles everycol-1tocol-12instead of onlycol-12,col-6andcol-4. Built-in layouts render as before: equal columns on desktop, a three-column row two per row on tablet, stacked on mobile. A host stylesheet that targeted.cb-col--col-4/.cb-col--col-6throughflex-basisshould be checked. -
The builder no longer filters layout names client-side.
cb-builderposts whatever the button carries and the server refuses an unknown or hidden layout with a 400, as it already did.
- A section edit was saved twice, and could survive Revert to published.
With Symfony's
csrf_protection_controller.jsinstalled (the Flex recipe default), the first save rewrites the form's_token.cb-autosavetook that for an edit and posted the same values again on the next focusout. When that focusout came from clicking Revert to published, the second save could land after the revert and leave the draft marked as changed. The token is now ignored when comparing, like the spacing-link toggles.
Version bump only — no functional change in klehm/content-blocks. The tag is cut
across the monorepo so the three packages stay installable as one set; this
candidate's change is in klehm/content-blocks-i18n: the translation
workbench's preview can be resized. No migration, nothing to wire.
- A "View page" link in the builder topbar. It opens the published page in a
new tab, from the URL
ContentAreaUrlResolverInterfacealready returns — so there is nothing to wire. On by default;ContentAreaType'senable_public_link: false(orenablePublicLink: falseon a directlauncher.html.twiginclude) hides it. The URL is also exposed as the Twig functioncb_public_url(area). content_blocks.section.initial_settings: settings a new section starts with. Written as the draft settings of every section added from the builder, so padding, margin, background or the Customize styling switch render straight away — which aSectionSettingsDefaultsProviderInterfacedefault could not do, since it only pre-fills the sidebar and styling has no render fallback. Same typed tree as a preset'ssettings, validated atcache:clear. Pasted, duplicated, imported and template-built sections keep their own settings. See Initial settings of a new section.- Empty Twig blocks for host additions in the builder shell:
cb_shell_topbar_left_end,cb_shell_topbar_right_start,cb_shell_topbar_right_endandcb_shell_end. A host overridesbuilder/shell.html.twig, extends@!ContentBlocks/…and fills only the blocks it needs. See Host services.
- The "View page" link is no longer underlined on hover when the host's stylesheet underlines hovered links.
- The host page no longer shows its scrollbar behind the open builder.
admin.csssetsoverflow: hiddenonhtmlandbodywhile the builder dialog is open (:has(.cb-builder-dialog[open])), and the page scrolls again once it closes.
-
The host chooses where the routes are mounted.
/_content-blocksis now only the default:config/routes/editor.php(every builder endpoint) andconfig/routes/public.php(the CSS/JS public pages link) carry the routes with no prefix, so a host can mount the builder under/adminand let its existing firewall pattern cover it. The builder reads the mount from the router (cb_api_base(), carried on the shell asdata-cb-api-base), app base URL included. Route names, and the default mount, are unchanged: a host importingconfig/routes.phpneeds to do nothing. See Mounting the routes.A host that overrides
builder/shell.html.twigshould adddata-cb-api-base="{{ cb_api_base() }}"next todata-cb-csrf-token. Without it the builder falls back to/_content-blocks, which is only correct on the default mount.
- Adding or deleting a section no longer reloads the preview. The new
section is inserted in place, pinned and scrolled into view; a deleted one is
flagged hidden in place, with the same markup a reload renders. Scroll
position and the JS state of every other block survive. The reload remains
the fallback when the preview cannot be reached, and for undoing a delete.
POST /_content-blocks/area/{id}/sectionsnow also returnshotReloadandhtml.
- Deleting the last section shows the empty-area call to action again. A soft-deleted section, still in the preview DOM but hidden, kept the area out of its empty state.
- A block open in the sidebar is cleared when its section is deleted. The focus re-pin matched the hidden block, so the form of a deleted block stayed open.
-
The schema no longer depends on the host's Doctrine naming strategy. Join columns left their name to that strategy, which under Doctrine's default spells a camelCase property as-is:
cb_section.contentArea_idinstead ofcontent_area_id, and acb_action_logwhosecb_action_log_stackindex names a column that does not exist —doctrine:schema:updateanddoctrine:migrations:diffthen failed outright. Every join column is now named explicitly (content_area_id,section_id,column_id), and a test holds the generated schema identical under the default and underscore strategies.Hosts using underscore naming (Symfony Flex's default, and all three sandboxes): nothing changes, no migration. Hosts using Doctrine's default naming:
doctrine:migrations:diffgenerates the rename ofcb_section.contentArea_id(aCHANGE, data kept — checked on DBAL 3 and 4); see the upgrade guide.
-
Export and import can now carry what a bundle stores beside a block.
ContentAreaTransferExtensionInterface(autoconfigured) lets a bundle write a fragment under the payload's newextensions.<key>map and read it back on import.klehm/content-blocks-i18nis the first user: a translated page exported from one installation now arrives translated in the next, instead of structurally identical and silently empty of translations.Every exported block also carries a positional
ref(s0.c1.b2), which is how a fragment addresses it — database ids mean nothing on the other side of a transfer. A block the importer skips (a type this app does not have) is absent from the map handed to extensions, so its rows are dropped with it rather than landing on a neighbour.Both additions are additive keys, not a new format: an older reader ignores them and imports exactly what it always did, so
content-blocks/v1still means what it meant. Without an extension registered, the payload is byte-for-byte what it was.The asset seam is shared, so a file that only a fragment references travels like any other —
AssetTokenizeron the way out,AssetRewriteron the way back, both extracted from the exporter and importer for this. -
Action history —
Ctrl/Cmd-Z. The builder now has an undo stack.Ctrl/Cmd-Zwalks back through the current session's actions one at a time,Ctrl/Cmd-Shift-Z(orCtrl-Y) walks forward. It covers everything the builder does: create, move, duplicate, delete and restore of sections and blocks, paste, insert content, import, a section's settings and a block's fields.Between the delete snackbar — one delete, six seconds — and Discard, which throws away the entire unpublished draft, there was nothing. Editors coming from any other builder expect the chord, and every action in that gap was final until it was undone by hand.
It is draft-scoped like every other builder action: undoing writes to draft fields only, so the published page does not move until Publish. The suites that pin that promise —
PublishedRenderImmutabilityTestand its browser twin — cover undo and redo alongside the rest.An entry is not a snapshot of the area. It is the pair of state assignments that move the draft between before and after, obtained by reading the same fields twice around the mutation and diffing them. Diffing rather than declaring is what makes
pasteandreplace-withinvertible at all: their inverse needs the ids they produced, and a diff yields those without any call site opting in. The structure scope deliberately carries no payload, because a creation is inverted by the draftdeletedflag rather than by removing the row.Three behaviours worth knowing before relying on it:
- A step whose target moved under it is refused, with a message, rather than guessed. Two editors on one area — or one editor in two tabs — will eventually undo into a world that has changed, and overwriting each other silently is the worse failure.
- The stack survives a page reload, which is precisely when an editor
wants it. It lives in a new
cb_action_logtable keyed by content area and hashed HTTP session; Publish and Discard empty it, since the draft its entries describe is gone either way. - Sidebar autosaves are coalesced, so a paragraph of typing is one undo step and not forty — bounded by both an idle window and a total span, so a long steady run cannot grow into a single ten-minute step either.
The chord is relayed from inside the preview iframe, and every refusal is said out loud in the snackbar. It stands back from a field with an undo stack of its own — a textarea, a text input, a rich-text editor — but not from a
<select>or a colour swatch, which have none: requiring a blur first was a rule nobody could guess. Because the chord can now fire mid-edit, the open form is committed before the undo runs, so an edit still inside the autosave's debounce window cannot be journalled after the step it was meant to be.An undo/redo pair sits in the topbar (
↶ ↷), greyed rather than hidden, carrying the chord in its tooltip — a keyboard-only feature is invisible to a first-time editor and unreachable on a touch device. The buttons mirror the server's stack: any mutation means "undoable, no redo left", and undo and redo pass the real counts back.The open sidebar is ruled on rather than reset. Undoing a step three sections away used to close the form the editor was working in; the server now answers
keep,reloadorclosefor whatever the sidebar has open, so the caret survives an unrelated undo and a form over a deleted row still cannot autosave itself back.Two endpoints,
POST /_content-blocks/area/{id}/undoand…/redo(CSRF +canEdit), answering 200 with a status — "nothing to undo" is an answer, not a failure. New seams, all@internal:ActionJournal,AreaStateSnapshot,StateApplier,BuilderSessionandActionLogStoreInterface(a store interface so the journal's policy is tested without a database).JournalPruningPublisherdecorates the concreteContentAreaPublisher, so a host decoration of the interface still wraps it. Rationale: docs/internals/history.md.Needs a migration for existing projects — one new table, nothing else touched; see the sandbox migration. Without it the endpoints have nowhere to write and undo reports itself unavailable.
-
Navigator — the whole area as an outline. A topbar button, beside the viewport switcher, opens a floating panel listing sections → columns → blocks, with drag-to-reorder, duplicate and delete on every section and block. It answers "what is in this area, in order", and it is how a block moves from the top of a long page to the bottom without being dragged past everything in between. The panel is draggable by its header — it floats over the content it describes, so it must be movable off whatever it is hiding — kept inside the builder window, and it remembers both its open state and where it was parked.
It deliberately holds no state of its own. Selection is still the sidebar's mount markers — the panel highlights whatever the sidebar has open, whether the click landed in the tree or in the preview — and every action is an endpoint that already existed (
move,duplicate,delete), signalled tocb-builderso it still goes through the one serialized mutation queue. The outline itself comes from one new read-only endpoint,GET /_content-blocks/area/{id}/tree(TreeController,canEdit), built byAreaTreeBuilderin draft order with soft-deleted subtrees pruned.A block row is its icon plus a line of text: the text from
BlockPreviewHintInterface(the same seam the section library's thumbnails read), falling back to the type's label, and the icon from the type's owngetIcon()— the same glyph the add-block picker shows. Columns appear as read-only nodes: they are derived from the section's layout and have no CRUD of their own.A floating panel rather than a second sidebar mode, because the sidebar is where a selected node is edited — the two are used together. New Stimulus controller
cb-tree, to declare in the host'sassets/controllers.json(Flex writes it at install).
- The Discard button now reads "Revert to published" (
cb.builder.discardandcb.builder.discard_confirm). Beside an undo arrow, "Discard changes" was the same verb for two unrelated scopes — one step of this session against every unpublished change since the last publish — and read as "undo, but bigger". Naming the destination is also the more honest description: it does not undo anything in the stack's sense, it takes the area back to what is live. Behaviour is unchanged; a host that overrides either key keeps its own wording.
-
Uploaded files can finally be reclaimed.
FileStorageInterface::remove()had no caller anywhere in the package: every upload leaked. Swapping a block's image kept the old file, discarding a draft that had uploaded one kept it, Insert content and import kept theirs. A dev sandbox held 340 MB of files that nothing pointed at.Cleaning up when a block is deleted would have been wrong, and not by a small margin:
deletedis a draft flag, so the published page still renders that block until Publish and Discard brings it back — unlinking the file there breaks a live page. Even at publish time the file may still be reachable from the block's own published/draft twins, from another block after a copy/paste (the clipboard duplicates the path, so two blocks share one file), from another area after an Insert content clone, from a saved section template, from a translated value, or from the host's own entities.So the new
content-blocks:assets:gcmarks and sweeps instead. It reports by default and deletes only with--force; it snapshots the storage inventory before collecting references, so a concurrent upload cannot be swept; and a--retentionwindow (30 days) covers the race that actually happens — the upload endpoint writes the file the moment an editor picks it, minutes before the block referencing it is saved. There is no scheduler: whether this runs on a cron is the host's call.New seams, all additive:
AssetInventoryInterface(enumeration, deliberately not folded intoFileStorageInterface, which hosts alias —LocalFileStorageimplements it),AssetReferenceProviderInterface(autoconfigured, "these paths are still mine"; the package's own two sources go through it too, so a host's provider is on equal footing), andAssetReportViewerInterfacegating a read-only report page at/_content-blocks/assets/report— 404 by default, no delete button by design. See Asset lifecycle. -
Worker mode (FrankenPHP, RoadRunner, Swoole) is a supported deployment, and is now enforced rather than assumed. Under a worker the kernel boots once and the same service instances answer every request, so a property written while serving one request is handed to the next visitor. The rule the packages hold themselves to: a class that keeps mutable state is either resettable (
ResetInterface, cleared onkernel.terminate) or explicitly declared as not request-scoped — a value object, or an index of tagged services identical for every request.ContentBlocks\Testing\CrossRequestStateScanneris that check, shipped so a host can point it at its ownsrc/:unaccountedFor()returns the classes that keep state without qualifying,staleDeclarations()returns entries that no longer describe anything. It reflects over classes and never instantiates them. Each package now carries aCrossRequestStateTestbuilt on it, and the sandbox carriesbin/worker-smoke.sh, which boots a real FrankenPHP worker and — among other things — changes content directly in the database behind the worker's back to prove the next request sees it. Full rationale in the worker mode guide.No behaviour change in this package: the audit found its services already clean. The one real fix is in
klehm/content-blocks-i18n. -
A bundle can render its own UI inside the builder shell.
BuilderActionProviderInterfacegave a bundle a menu entry and acb:builder:actionevent, and stopped there: what happened on the click was "the host's business", which is right for a host and a dead end for a bundle that owns no page. Its only ways into the builder window were a Stimulus controller every host had to enable by hand, or asking the host to write the listener.BuilderShellExtensionInterface(autoconfigured) is the missing half. It yieldsBuilderShellFragments — a Twig template, a context, a priority — which the shell renders inside.cb-shell, after its own chrome, in an isolated context plus theareabeing edited. A bundle ships its<dialog>and a<script type="module">pointing at a route it serves, and the host wires nothing: nocontrollers.jsonentry, no asset build, the same under AssetMapper and Encore. The shell reads the fragments itself through the newcb_shell_fragments(area)Twig function, so they appear wherever the shell is rendered — throughContentAreaTypeor a direct include of the launcher. -
cb:area:changed, the first inbound public event. A fragment (or the host) that changed the area through its own endpoint dispatches it at the builder, from the shell element or anything inside it; the builder reloads the preview and re-syncs Publish / Discard, exactly as it does after an import or an "Insert content".detail.hasUnpublishedChangesis optional and defaults totrue. The publiccb:*contract is now five events.
-
Exports were silently losing every image uploaded from a rich-text editor. Asset detection tested whether a whole stored string was a storage path, and a rich-text field stores
<p><img src="/uploads/…"></p>— so the check said no and the file was never bundled. The export looked complete and the import produced a page with broken images.Detection now also finds references embedded in markup, and replaces them in place; the importer substitutes the resulting inline
asset://tokens the same wa 10BC8 y. It also recognizes relative URLs (../../uploads/…), which is the spelling TinyMCE actually writes —relative_urlsis on by default, so that is the normal case for an editor-uploaded image, not an edge case.This shares one implementation (
AssetReferenceCollector) with the new asset sweep on purpose: a detector that saw fewer references than the exporter would lose a file from an export, and one that saw fewer than reality would delete a file still on a page.
-
The published page no longer changes while someone edits it. Reported from a live site: an editor rearranged a page without publishing, and the public page changed under them — into something matching neither the previously published page nor the builder. Pressing Publish then "fixed" it, which is the tell: the public render was reading draft state.
It was reading three kinds of it. The draft
deletedflag was honoured, so deleting a block or a section took it off the live site immediately — a soft delete is an intent to remove at the next Publish, not a removal. Sections and columns that had never been published were rendered, so adding a section, duplicating one, applying a section template, pasting, importing or using "Insert content" dropped an empty section onto the live page — atposition0, ahead of everything, which is why the result matched no view of the page. And a block dragged into another column moved on the live page at once, because the drag writes the column FK, which the public render followed.Public mode now renders the last published state and nothing else: entities with a
published_at/published_data, at their published positions, in their published columns, with their published settings.Blockgainedpublished_column_idto remember where a dragged block is published, and Discard now puts such a block back where it came from (it previously could not, and the move survived the discard).Two suites hold the package to it end to end — one exercising every builder controller against a rendered public page, one driving the real builder in a browser and diffing the public markup byte for byte.
::: warning Migration required
Version20260831120000adds the column and backfillspublished_aton sections and columns that predate it. Without the backfill those rows read as unpublished and vanish from live pages. See the upgrade guide. :::
Version bump only — no functional change in klehm/content-blocks. The tag is
cut across the monorepo so the three packages stay installable as one set; the
candidate's fixes are in klehm/content-blocks-kit (a subclassed block now
receives its options / choices / defaults, and table no longer starts on
an alignment its own form refuses). Nothing here touches the shape of
block.data, so there is no content migration and no content_version bump
between RC2 and RC3.
- A block whose whole body is a link is selectable again.
<a>is draggable by default: a press that drifts a few pixels before release starts a native link drag, and the browser then fires noclickat all. On a block whose root is the link — a card wrapped in<a>, a panel filling its column — the entire clickable surface was a drag surface, so the block could not be opened for editing at all; on a small button the same defect goes unnoticed. The preview overlay now cancels native drags, which it had no use for: reordering runs on its own pointer events from the toolbar grip. Found while installing the RC on a host, against a block rendered as one full-column<a>. - The bundle's config example named a key the tree rejects. The docblock of
ContentBlocksBundle::configure()still showedsection_styles[].settings.styling.padding.d, whileresponsiveBoxNode()has accepted onlydesktop/tablet/mobilesince the viewport rename below. A host copying the example gotUnrecognized option "d"when the container was built.
The first release candidate for 1.0. The public surface is frozen as
described in the backward compatibility
page: what is listed there is stable until 2.0, and anything marked
@internal is outside the promise. Report anything this candidate
breaks before the stable tag.
-
BREAKING —
ContentAreaPublisherInterfacegained a?PublishContext.publish(ContentArea)becomespublish(ContentArea, ?PublishContext), anddiscardDraft()follows. Both parameters are optional andnullmeans what the methods always did, so every call site keeps working unchanged — only an implementor or a decorator has to widen its own signature.It lands now for the same reason
RenderContextdid: adding a parameter to a published interface breaks every implementor, including a host's decorator for an audit trail or a cache purge, and the publish path has a known input still to grow.PublishContextcarries a locale scope —everything()(the default),withLocales('fr'),sourceOnly()— read byklehm/content-blocks-i18nto decide which locales' translations go live beside the source. The core ignores it: an area's draft is a single state with no locale dimension.The shape enforces an invariant rather than documenting one. The scope covers translations, never the area's own draft, so a locale can be held back but never pushed ahead of the source text it was written against — the one ordering that puts a French heading live describing an English heading nobody has seen. No UI exposes per-locale publishing; this is API surface, frozen with 1.0 because the alternative was widening a published signature after it.
-
The public surface is now marked, ahead of the 1.0 freeze. An audit found that not one symbol across the three packages carried
@internal,@experimentalor@deprecated— so tagging 1.0 as it stood would have frozen the 14 HTTP controllers,CsrfProtectedTrait,DependencyInjection\, the block-type compiler pass andBlockComponentalongside the seams that are actually the product. All of those are now@internal, as are the constructors ofImportResult,InstantiationResultandSectionTemplateSnapshot— the objects stay frozen as things you read, so the package can grow their fields without a major bump.Nothing was removed and no signature changed; this only writes down where the line already was. What 1.0 covers is now a page of its own: backward compatibility.
-
The
cb:*event contract is four events, not thirty-seven.cb:ready,cb:block:saved,cb:section:savedandcb:builder:actionare public and stable across 1.x. The rest — the…-requested,…:apply,…:patchand…:desyncfamilies — are internal choreography between the preview overlay, the iframe and the builder shell, and are documented as such at their dispatch sites. A host listening to one of those today should move to a public event before 1.0. -
All 90
--cb-*CSS custom properties are documented, up from 39. The guide already claimed the token names were covered by semver while listing fewer than half of them, which made the promise unverifiable. The builder chrome and the form alias layer are in the styling guide; a CI check now fails the build when a package declares a--cb-*token that no doc page mentions. -
symfony/validatoris now a dependency, not an assumption. The package's security model says a block's form is "the whitelist and the validator" — but nothing declared the validator, so a host installing the core alone could run without it and haveconstraintssilently do nothing. In practice every install already had it (klehm/content-blocks-kitrequires it), which is precisely the problem: a core guarantee was resting on a sibling package's dependency list. No action needed on upgrade. -
BREAKING —
BlockRendererInterfacetakes aRenderContextinstead of a bareRenderMode.render(ContentArea, ?RenderMode)becomesrender(ContentArea, ?RenderContext), andrenderBlock()/renderSection()follow;resolveMode()is unchanged.RenderContextcarries the render mode and an optional locale, both nullable with the same "null means decide for me" semantics the mode parameter already had — sorender($area)behaves exactly as before, andRenderContext::forPublic()/::forPreview()replace a passedRenderMode::PUBLIC/::PREVIEW. Only relevant if you call the renderer directly or implement/decorate the interface.The reason it lands now rather than in 1.x: adding a parameter to a published interface method breaks every implementor, and the render pipeline needs room to grow inputs (locale first) past the 1.0 freeze. See
TRANSLATION-SPIKE.md. -
The builder's chrome is restyled — "Paper · Marine". Cool blue-grey surfaces, a teal accent (
#0e7490) replacing the previous blue, 8px corners, tinted form fields, an accent rule along the sidebar's top edge and a dot grid on the canvas gutters. Content rendering is untouched — the preview iframe still draws the host's page fromcontent_blocks.paletteand the block styling settings, as it always did.Captions — field labels, sidebar group titles, the block-picker header, the box-spacing side names — now render small, uppercase and in
--cb-font-mono. A label names a control; setting it apart in case and family, not only in size, is what lets the eye skip the labels when scanning a settings column for a value. The scale is two sizes: a group heading matches the labels under it and outranks them by weight and color, not by a third size. Checkbox and radio labels are deliberately excluded — those are the sentence the user reads to decide, so they keep the host's body font. Labels go back to sentence case with--cb-form-label-transform: none(see the theming guide) — no fork needed. -
The topbar collapsed into a single "Actions" menu. Insert content, Import / Export and every host-contributed action now live behind one button; the topbar keeps only what an editor reaches for constantly (close, viewport, discard, publish). A row of ghost buttons made the rare and the constant look equally important, and each action a host added made it worse.
enable_replace/enable_import_exportstill hide their entries, and with both off and no contributed action the button is not rendered at all.Note for hosts styling or scripting the topbar:
.cb-shell__replace,.cb-shell__import-exportand.cb-shell__action--*are now menu items inside.cb-shell__actions-listrather than top-level topbar buttons. Thecb:builder:actionevent and itsdetail.keyare unchanged. -
The three pickers are centered modals over a backdrop. Replace, Import / Export and the section library were panels pinned under the button that opened them, which put a 360px column in a screen corner and left the rest of the builder looking live while it was not. They now center over a shared, accent-tinted backdrop, and dismiss on Escape or a backdrop click.
-
The section library moved out of a modal and into the empty sidebar. With nothing selected, the list of saved sections is what the panel is for — hiding it behind "Insert from library" cost a click for no gain. The in-preview library button now clears the selection (which is what puts the library back on screen) instead of opening a dialog. Search, pagination and delete are unchanged. Also fixes rows for incompatible and partially-usable templates, whose disabled styling matched a class the library's rows never carry.
-
Inserting a section scrolls the preview to it. A new section lands at the end of the area — off screen on any page taller than the viewport — and the reload restored the editor's previous scroll position, hiding the one thing they were waiting to see. Applies to an empty section and to a library insert.
-
The block edit form's tabs are folder tabs, not underlined words. General / SEO / Style switch the whole panel, so they now read as a control: the open tab is filled with the panel color, carries the accent along its top edge and paints over the tab strip's line so it reads as continuous with the fields below; the closed ones are tinted. This also keeps the segmented pill (
.cb-viewport-tabs,.cb-align-group) meaning one thing only — pick a value inside a field, never navigate away from one. -
A standalone checkbox no longer renders its label twice. The form theme gained a
checkbox_rowblock that drops the row-level label: a checkbox already labels itself next to the box, so the generic row printed the same words as both a caption and a sentence (visible on the section sidebar's "Customize styling" switch, and on any host block usingCheckboxType). Radio groups and expanded choices are unaffected — there the row label names the group, not an option. -
BREAKING — styling viewport keys
d/t/m→desktop/tablet/mobile. The responsive styling sub-tree (styling.padding/margin/gap) now spells out the viewport keys in stored data (sectiondraft_settings/published_settingsand blockdraft_data/published_data). The emitted CSS custom-property names stay terse (--cb-s-pad-d-t,--cb-gap-d) — the decorators map long→short — sostyling.cssand any host CSS override are unaffected. Migrate existing rows with the reference migrationVersion20260715130000(both sandboxes; reversible). Host code that produces those keys needs updating too, and this one fails silently: aSectionSettingsDefaultsProviderInterfaceorBlockDataDefaultsProviderInterfacereturningstyling.padding.{d,t,m}simply stops applying — no error, no warning, just fields opening empty. Stored data and CSS are the visible halves of this rename; defaults providers are the quiet one. -
BREAKING — config key
upload.dir→upload.directory. The last abbreviation in the config tree, next topublic_prefix,max_sizeandallowed_mime_typesspelled out in the same block. Renamed now because YAML keys freeze at 1.0. A staledir:fails at container build withUnrecognized option "dir" under "content_blocks.upload"— there is no silent fallback. -
BREAKING — config key
styles→section_styles. The section-style-presets config key now matches the emitted parameter (content_blocks.section_styles); host YAML undercontent_blocks.styles:must be renamed tosection_styles:. -
BREAKING —
ContentBlocks\Service\is gone. The six services that lived in that catch-all namespace moved next to the rest of their domain, where every other extension point already sat:ContentAreaPublisher→ContentBlocks\Publishing\,SectionCloner→ContentBlocks\Section\,ContentAreaExporter/ContentAreaImporter→ContentBlocks\Transfer\,SectionTemplateSerializer/SectionTemplateInstantiator→ContentBlocks\SectionTemplate\(joiningInstantiationResult,IncompatibleTemplateExceptionandSectionTemplateManagerInterface, which were already there). Class names, methods and behaviour are unchanged — a find-and-replace ofContentBlocks\Service\suffices, and a missed one fails loudly at container build. The matching…Interfaceclasses follow the same mapping. -
BREAKING —
ContentAreaImporterInterface::import()returns anImportResult,SectionTemplateSerializerInterface::serialize()aSectionTemplateSnapshot. Both used to return bare arrays/ints.$snapshot->payload/->blockTypesreplace$serialized['payload']/['blockTypes'];$result->sectionCountreplaces the returnedint. Only relevant if you call these services directly. -
Both restore flows (area import, section-template insert) are now optimistic: they bring in everything this installation can use and report the rest. A block whose type is not registered here is skipped — importing it would hand the editor an inert placeholder (no view template, no edit form), and nothing is lost since the JSON file / stored payload remains the archive: install the block type and re-import. A stored key no registered type declares is kept and merely reported — the block itself is usable, and the key may well be a field about to be added. In short, "compatible" is judged per block, not per key. Previously the import accepted any block type silently (producing unrenderable blocks) while the template insert refused the whole operation. The only hard stop left on content is a template that had blocks and kept none. Both flows report through their result object (
ImportResult,InstantiationResult), which now share their vocabulary:skippedBlockCount,skippedBlockTypes,unknownFields. -
The section-template picker warns instead of blocking when a template is partially usable. A row is disabled only when nothing would come in (an unreadable payload envelope, or every one of its block types gone); otherwise it stays clickable and its tooltip spells out how many blocks will be skipped and of which types. The list response fields changed accordingly:
compatible/missingTypes→insertable/skippedTypes. -
Section-template payloads are validated against the envelope format they declare.
SectionTemplateSerializer::FORMATwas written into every stored payload since the feature shipped but never read back, so a payload written under an older structure would have been replayed blind. Such a template is now shown as unavailable in the library picker, and the instantiator refuses it with a dedicatedUnsupportedTemplateFormatException— separate fromIncompatibleTemplateException, whosegetMissingTypes()would be empty and read as "nothing is missing". The format versions the payload structure, which the core owns; it says nothing about the shape of the block data inside, which belongs to the block types. -
section_styles[].settingsis now a typed config node (was a free-formvariableNode). Preset YAML is validated and self-documenting; the shape mirrorsSectionSettingsType/StylingType. Unknown keys and bad viewport/align/unit values now fail at container build instead of silently persisting. Host presets using the oldd/t/mviewport keys must be updated todesktop/tablet/mobile.
-
?cb_chrome=0renders draft content without the builder's editing chrome. Preview mode used to decide two things at once — which data is rendered (draft) and what is drawn around it (toolbars, add-section tray, section handles,builder.css, the overlay script). Addingcb_chrome=0besidecb_preview=1keeps the first and drops the second, so a draft can be shown to someone who is not editing it: a review link, an approval step, a preview pane in a tool that is not the builder. Soft-deleted sections / columns / blocks are left out as well — with no chrome to strike them through, showing them would read as live content — whiledata-cb-block-idmarkers stay, so scroll-to-block and hot-swap still work.Opt-out and preview-only: every existing preview URL renders exactly as before, and a public render never gains chrome. Consumed by
klehm/content-blocks-i18n's translation workbench. -
The block hot-swap endpoint accepts an optional
?locale=.GET /_content-blocks/block/{id}/renderpasses it straight intoRenderContext::forPreview(); absent or empty keeps the previous behaviour of letting the request decide, so the builder's own hot-swap path is unchanged. The core does nothing with the value on its own — it exists so a satellite can swap a single block into a preview showing a language other than the one the calling page is served in, which is whatklehm/content-blocks-i18n's workbench does. -
BlockCloneObserverInterface— told which copy came from which source during a deep clone.SectionClonercopies a block'sdatawholesale, so anything stored inside it rides along for free; anything stored beside a block — a satellite package's own table keyed byblock_id— did not, and had no way to learn a copy existed. Implement the interface (it is autoconfigured) and you are called once per copied block, during the walk.Additive by construction, which is why it can land after the interface freeze:
SectionClonergains an optional constructor argument, sonew SectionCloner()still works andSectionClonerInterfacenever moves. With no observer registered, cloning is byte-for-byte what it was.Consumed by
klehm/content-blocks-i18n, which uses it to carry a block's per-locale values onto its duplicates; the shape is general enough for per-block analytics, A/B variants or review state. -
Copy / paste a section or a block, across areas and across pages.
Ctrl/Cmd-Ccopies whatever the sidebar has open — clicking an element is what opens it, so the sidebar is the selection — andCtrl/Cmd-Vpastes it. The shortcut works from the preview iframe too (the overlay relays it; the preview holds no clipboard state of its own), and it stands back whenever the keystroke belongs to the editor's text: focus in a field, or any live text selection. A copy changes nothing on screen, so it is acknowledged in the snackbar — the same bar as the undo offer, minus the button.Placement follows the selection: a section lands right after the selected section (at the end of the area when nothing is selected), a block right after the selected block, or at the end of the selected section's first column. Pasting a block with nothing selected has no answer to where, so it is refused with a sentence rather than guessed. Paste writes to draft, like every other structural op: Publish commits it, Discard reverts it, and
canEdit()is checked on the target area — which for a cross-area paste is not the one the copy came from.The clipboard lives in the browser's
localStorage, which is what lets a copy survive leaving the page — and what makes the payload input, not truth. Every pasted block is therefore replayed through its own form (ContentBlocks\Clipboard\BlockDataReplayer): an undeclared key never reachesBlock.data, and a value the form refuses is reset to the type's default and reported, rather than costing the whole block. An entry copied under anothercontent_versionis refused outright (a clipboard entry is cheap to recreate, unlike a stored section template, which still routes throughContentVersionUpgraderInterface).New public surface:
GET /_content-blocks/section|block/{id}/copy,POST /_content-blocks/area/{id}/paste, andBlockSnapshotSerializerInterface(the block-level counterpart ofSectionTemplateSerializerInterface, formatcontent-blocks/block-v1). -
ImageUrlResolverInterface— the seam for responsive images. The package ships no image processing: an uploaded file is served as stored and only its display box is controlled by CSS. Reducing byte size needs an image library or a transforming CDN, so this is an interface with a passthrough default rather than a dependency — the same shape asFileStorageInterface.resolve(string $src, ?int $width, ?int $height)returns aResolvedImage({src, srcset?, sizes?}); the shippedPassthroughImageUrlResolverreturns the source untouched, so markup is byte-for-byte what it was until a host aliases the interface. View templates reach it through the newcb_image()Twig function, and the kit already routes itsimage,galleryandcardviews through it — aliasing the interface gives all threesrcset/sizeswith no template override.The width/height passed are the display box the view intends, and are
nullwhere the layout is genuinely fluid; a resolver that returns candidates withoutsizesgets one derived from that width, since a baresrcsetis read as100vw. -
The image field is a drop zone, and gained Remove + paste-a-path.
ImageUploadType's widget was a bare file input with a thumbnail under it; it now frames the preview in a dashed drop zone with an actions row beneath — Choose an image, Remove (only once there is a value), and a link toggle revealing the raw path.- Drop — a file released anywhere on the widget, preview included, uploads
through the same
/_content-blocks/uploadendpoint, CSRF token and limits as one picked from the dialog. The highlight is depth-counted so it survives the pointer crossing child elements, and only drags carrying files are intercepted, so dragging a collection row across the sidebar still behaves. A dropped file is filtered client-side against the field's ownaccept(extensions, exact types and wildcards) — a courtesy on top of the server-side MIME/size gate. - Paste a path — the escape hatch for an image that already exists (a host
media library, an asset migrated from a previous CMS, a CDN URL). Nothing is
uploaded. The value is stored as typed, with one normalization: an absolute
URL on the builder's own origin becomes its path, since that is what survives
a domain change. Such a value lives outside
FileStorageInterface, so export/import does not bundle it — constrain the field if a block should only reference your own storage. - Remove clears the reference; the stored file is never deleted.
It also gets its label back. Because
ImageUploadTypeparentsHiddenType, Symfony pickedhidden_rowfor it — no row wrapper, no label — so the field rendered nameless and outside the form's vertical rhythm, running into whatever came next. Acb_image_upload_rowblock routes it through the standard row again.Nine new
cb.upload.*keys (en + fr) cover the labels and the status wording, which the controller reads fromdata-i18n-*attributes. If you overrode thecb_image_upload_widgetform-theme block, your version keeps working but gains none of this — the new controls are markup, andcb-file-uploadtreats each of its targets as optional. - Drop — a file released anywhere on the widget, preview included, uploads
through the same
-
BuilderActionProviderInterface— the seam for a bundle to add a topbar action. Autoconfigured (content_blocks.builder_action_provider); each provider yieldsBuilderActionvalue objects for a given area, so an action can hide itself by yielding nothing. Complements the existingtopbar_actionsform option, which stays the way a single form declares a one-off: the two merge into one list ordered by descendingpriority, providers first, with a duplicatekeycollapsing to its first occurrence. Thetopbar_actionsarray shape is unchanged, butform.vars['topbar_actions']now exposesBuilderActionobjects rather than raw arrays — relevant only if you render the topbar from your own template. -
BlockDataResolverInterface— the seam for changing what a block renders. An autoconfigured pipeline (content_blocks.block_data_resolver) where each resolver receives what the previous produced. The shippedCoreBlockDataResolverruns first (priority256) and seeds the payload from the block's draft-or-published slots — the rule that used to be inlined inBlockRenderer— so with no host resolver registered the output is unchanged. ComplementsBlockDecoratorInterface, which contributes classes/styles/ attributes to the wrapper and by contract cannot touchdata. -
cb_translatableform option +TranslatableFieldsInterface. A block declares which of its fields hold language-dependent values; the interface reads the tags back off the built form, returning dotted paths with[]for collection entries (items[].label). Fields a host adds throughBlockFormExtensionInterfaceare picked up for free.Neither has a consumer in this package, and nothing about the rendered output changes: content translation is designed to live in a satellite package, and what ships here is the convention it reads — published now so it freezes with the 1.0 contract and blocks written today are already annotated.
-
Stable
_idon every collection entry. A collection entry had no identity of its own — it was a position in a list — so anything keyed per entry pointed at the wrong one after a reorder, a duplicate or a delete. Entries now carry a_id, minted on the draft-write path byCollectionItemIdsand driven by the block's form (only a form knows which array value is a collection). No item type needs an_idfield: a key no form child declares round-trips untouched. Ids are unique within one collection of one block, so clone / import / template-insert copy them verbatim and per-entry data maps straight onto the copy.Ships in 1.0 rather than later because adding it afterwards would mean a data migration across every collection block. Normalize content written before it with
php bin/console content-blocks:backfill-collection-ids(idempotent,--dry-runavailable) — a command rather than a Doctrine migration, because which JSON keys hold a collection is knowledge that lives in the block types' forms and SQL cannot ask them. -
The
_prefix is reserved inBlock.data. At every level, including collection entries: a key starting with_belongs to the package, andBlockDataKeysnever reports one as unknown. Host block types must not declare one. Reserving the namespace rather than a list of names means the next such need does not reopen a frozen data contract. -
Builder chrome design tokens (
assets/styles/tokens.css). The admin CSS readsvar(--cb-*)throughout instead of color literals; a host restyles the builder by redeclaring tokens on.cb-shell/.cb-launcher/.cb-builder-dialog, with no fork. Token names are public surface — see Theming the builder chrome.AssetController::builderCss()now prepends the token file to the response, because the preview iframe is served raw and cannot resolve an@import. Alongside the colors, the file carries the type tokens--cb-font-mono,--cb-caption-size,--cb-caption-size-smand--cb-caption-tracking. -
Host-owned content versioning (
content_blocks.content_version). The shape of stored block data is decided by the block types — the host's and the kit's — not by this package, so the schema generation of that content is now a host config value (int, default1). It is stamped ontocb_content_area.content_versionas content is written (by the same onFlush listener that touchesupdatedAt), and ontocb_section_template.content_versionwhen a snapshot is saved, so a host migration can target what predates a change of its own making:WHERE content_version < N OR content_version IS NULL. Read the area column as "last written under version N", not "conforms to version N": editing one block re-stamps the whole area while its other blocks keep whatever shape they had, so migrate before letting editors work on a new version. A section template carries no such caveat — a snapshot is frozen.NULLmeans "predates versioning" and is deliberately distinct from0. Export payloads carry the emitting app'scontentVersionfor information only; import ignores it and stamps the target with the local version, since a version number means something only inside the installation that issued it. Reference migrationVersion20260729120000in both sandboxes. -
ContentVersionUpgraderInterface— what to do with content from an older schema generation. Section templates are the one place where a stored version is comparable (the number came from this same installation), so that is where the seam applies:supports(?int $stored, int $current)is called once per row when listing the library, so the picker greys out what the host refuses instead of letting an editor click into an error, andupgrade(array $payload, …)runs on the way in. Upgrading is transient — what the host returns is instantiated, the stored row is untouched; a permanent rewrite is a migration. The shippedDenyOnMismatchUpgraderrefuses a known mismatch and acceptsnull: every row written before versioning carries null, and refusing those would make a host's whole library unusable the day they upgrade. Import does not consult the seam — an imported payload's version belongs to the app that exported it; hosts controlling both ends can decorateContentAreaImporterInterfaceinstead. -
EnvelopeUpgraderInterface+EnvelopeUpgradeChain— the package's own side of versioning. A stored payload has two schemas with two owners: the content inside it is shaped by the block types (host territory, see above), the envelope around it belongs to this package. When a release changes that structure it can now ship an upgrade step alongside, and the chain walks a payload from the format it declares to the one the code reads — so old section templates and old export files keep working across a format bump. Both restore flows go through it, and the section-template picker treats "readable" as "reachable through the chain" rather than "exactly today's format". The chain ships empty: only one format of each kind exists so far, so every call is a no-op today. It exists now because the alternative — a bump condemning every stored payload — is what makes a bump unthinkable in the first place. Steps are autoconfigured (content_blocks.envelope_upgrader), so adding one is a class and nothing else; a test asserts exactly that. -
ContentVersionUpgraderInterface— what to do with content from an older schema generation. Section templates are the one place where a stored version is comparable (the number came from this same installation), so that is where the seam applies:supports(?int $stored, int $current)is called once per row when listing the library, so the picker greys out what the host refuses instead of letting an editor click into an error, andupgrade(array $payload, …)runs on the way in. Upgrading is transient — what the host returns is instantiated, the stored row is untouched; a permanent rewrite is a migration. The shippedDenyOnMismatchUpgraderrefuses a known mismatch and acceptsnull: every row written before versioning carries null, and refusing those would make a host's whole library unusable the day they upgrade. Import does not consult the seam — an imported payload's version belongs to the app that exported it; hosts controlling both ends can decorateContentAreaImporterInterfaceinstead. -
Per-block form extension API. Hosts can now add fields to the edit form of one (or several) block types without subclassing. Implement
ContentBlocks\Form\Extension\BlockFormExtensionInterface(buildForm($builder, $data, $blockType)) and tag it with#[AsBlockFormExtension('button')](one type),#[AsBlockFormExtension(['button', 'card'])](several) or#[AsBlockFormExtension](global, every block).BlockFormTypeinvokes every matching extension after the block's ownbuildForm(), inpriorityorder. Keyed by block type id (string, not class) so it survives subclassing and matches the config keys. This replaces theFormTypeExtension+instanceof-guard workaround, which could not be scoped to one block. The added field's value round-trips intoBlock.datalike any other (block data is not pruned); render it via a host block-template override. Autoconfigured, no wiring. The seam is not add-only: the builder is the block's own, so an extension may alsoremove()a field (its stored value is frozen, not deleted, and a POST still carrying it is dropped) or reorder fields by re-adding their child builders. See the Add a field to a block recipe. -
BlockRendererInterface— rendering override seam (road to v1.0). The centralBlockRenderernow implements aBlockRendererInterface(render,resolveMode,renderBlock,renderSection, and theQUERY_PARAMconstant), aliased to the shipped implementation. Consumers (the Twig extension and the render controllers) type-hint the interface, so a host can now customize rendering — wrap output, add caching, swap the preview-mode heuristic — by decorating it (#[AsDecorator(BlockRendererInterface::class)]) or re-aliasing. Backward-compatible: the concreteBlockRendererservice id still resolves. -
Interfaces for the six remaining core services (road to v1.0). Following
BlockRendererInterface, the services that carry the rest of the builder's core behaviour are now each an interface aliased to the shipped implementation, with every consumer type-hinting the interface:ContentAreaPublisherInterface,SectionClonerInterface,ContentAreaExporterInterface,ContentAreaImporterInterface,SectionTemplateSerializerInterfaceandSectionTemplateInstantiatorInterface. Hosts can now replace or decorate any of them (#[AsDecorator(...)]) instead of being stuck with afinalclass injected by concrete type. The payload-format constants moved onto the interfaces (ContentAreaExporterInterface::FORMAT,SectionTemplateSerializerInterface::FORMAT) and the importer now validates against the interface, so swapping the exporter no longer leaves the importer checking the shipped class. Backward-compatible: the concrete service ids still resolve, andContentAreaExporter::FORMATstill reads the same value through inheritance.
- The bundle could not boot on a Webpack Encore host.
prependExtension()registered the package'sassets/directory underframework.asset_mapper.pathsunconditionally. That node is declared withcanBeEnabled(), whose normalization turns any non-empty array intoenabled: true— so the prepend did not merely describe a path, it enabled a component this package has never required. Withoutsymfony/asset-mapperinstalled,FrameworkExtensionthen threwAssetMapper support cannot be enabled as the AssetMapper component is not installed, at container build, before anything else could report a cause. The prepend is now guarded byclass_exists(). Encore hosts read the same controllers out ofassets/package.jsonthrough@symfony/stimulus-bridge; see Installation → With Webpack Encore. - Section-template insert warned about fields that were perfectly valid.
SectionTemplateInstantiatordecided which stored keys a block could hold fromgetDefaultData()alone, so it flaggedstyling(added to every block form byBlockFormType, deliberately absent fromgetDefaultData()) and every field contributed by a hostBlockFormExtension. Known keys are now the union ofgetDefaultData()and the children of the block's built edit form. - …and the warning never reached anyone anyway. The builder wrote the message into the template picker's status line and then closed the picker, blanking the only element carrying it. The picker now stays open when there is something to report.
- Semantic bundle configuration.
ContentBlocksBundlenow exposes a config tree (content_blocks:) coveringsection.default_width_mode/section.default_max_width(previously parameter-only, still overridable via parameters),palette(named colors),styles(section style presets) andupload(dir, public prefix, max size, MIME allow-list). Config is the declarative shortcut; the provider interfaces remain the power-user path and both sources merge. PaletteColorType— palette + custom color picker. A dropdown of named project colors plus a "Custom…" option revealing a free color picker, storing a single#hexstring (''= none). It replaces the rawColorTypeforbackgroundColorinStylingType(sections and blocks). Palette colors come from thecontent_blocks.paletteconfig and/orColorPaletteProviderInterfaceimplementations (autoconfigured, aggregated byColorPaletteRegistry). With no palette declared the dropdown still offers None / Custom…, giving the field a real empty state. Optionallow_custom: falselocks editors to the palette. The None / Custom… labels are pinned to the corecontent_blockstranslation domain, so they resolve even when a host/kit block sets the field'stranslation_domainto its own catalog (otherwise they rendered as raw keys).- Section style presets can carry settings values.
SectionStylegains an optionalsettingsarray (same shape asdraft_settings). At render time the selected preset's settings apply underneath the section's own settings (BlockRenderer), the user's explicit values winning key-by-key; the sidebar prefills the styling fields from the preset. Presets can be declared in config (content_blocks.styles) or viaSectionStyleProviderInterface(whosecssClassis now optional — settings-only presets are valid). - "Customize styling" switch on sections (progressive disclosure). The section sidebar's styling fields now hide behind a
stylingCustomswitch: everyday editors only see the preset dropdown; flipping the switch reveals the full fields, prefilled from the preset. While off, the styling subtree is dropped on save so a later preset change never fights stale hidden values. Sections saved before the switch existed (styling values, no flag) are treated as customized. cb-conditionStimulus controller. Generic conditional-field visibility: tag any row withdata-cb-condition="field:value1|value2"inside adata-controller="cb-condition"scope (checkboxes map totrue/false;fieldalone means "non-empty"; instances nest, nearest scope wins). Clauses combine with AND via;(e.g.size:custom;customHeightAuto:false), each still OR-ing its values with|. The controller is also attached to the block edit-form root, so a<select>can gate sibling rows (e.g. the image size/width/height reveal). Drives the styling switch and the palette's custom picker; reusable in host block forms.- Upload brick moved into the core (from the kit).
FileStorageInterface,LocalFileStorage,NullFileStorage(nowContentBlocks\Storage\*), the/_content-blocks/uploadendpoint (ContentBlocks\Controller\UploadController, size/MIME limits configurable viacontent_blocks.upload.*) and thecb-file-uploadStimulus controller now ship with the main package, plus a newImageUploadType(file picker + preview around a hidden path input, rendered by thecb_image_uploadform-theme widget). Settingcontent_blocks.upload.dirswitches the storage alias toLocalFileStorage.FileStorageAssetResolveralso moved into the core and is the defaultAssetResolverInterfacealias.
- Default background is transparent.
CoreStylingDefaults/CoreBlockStylingDefaultsnow defaultstyling.backgroundColorto''instead of#ffffff— the palette color field has a real empty state, so the historical white pre-fill (needed when the field was a raw<input type="color">) is gone, and picking White from the palette applies a real#ffffff. Upgrade note: settings saved earlier withbackgroundColor: '#ffffff'used to be stripped as default-equal and now render an actual white background. - Section settings JSON is pruned before persisting.
SectionSidebarControllernow recursively drops empty leaves (null,'',false, empty arrays) from the saved settings;0is kept. Untouched styling fields no longer persist asnull(they would mask a preset's values on the next prefill), and unchecked switches read as "off" by absence.
- Section layout labels rendered raw keys. The layout picker referenced
cb.section.layout.{full,two_cols,three_cols}while the catalog still only defined the supersededcb.styling.layout.*, so the buttons showed their translation keys. The keys are realigned, and a newTranslationCatalogTestguards EN/FR key parity, non-blank values, and that UI-referenced keys resolve.
- Symfony 8.1 and PHP 8.4 support. The package already declared
symfony/* ^8.0andphp >=8.2, so both were resolvable; this release verifies it — the package resolves against Symfony 8.1 and the source carries no PHP 8.4 deprecations (no implicitly-nullable parameters). CI now runs the browser suite on aPHP 8.4 · Symfony 8leg in addition to the lockedPHP 8.3 · Symfony 7baseline, so the newest stack is exercised end to end. - Symfony UX 3.x support.
symfony/ux-live-component,symfony/ux-twig-componentandsymfony/stimulus-bundleare now accepted as^2.0 || ^3.0. UX 3 requires PHP 8.4 + Symfony 7.4, so Composer only selects it on that stack and keeps UX 2 otherwise — a backward-compatible widening. The one Live Component uses only stable core APIs and none of UX 3's removed ones (thecsrfargument onAsLiveComponent,LegacyLivePropMetadata,ux_controller_link_tags()).
enable_replace/enable_import_exportset tofalsenow actually hide their buttons. The builder templates read theseContentAreaTypeflags with Twig's|default(true), which treats a booleanfalseas "empty" and falls back totrue— so a host passingenable_replace: false(orenable_import_export: false) could never turn the feature off. The templates now use the null-coalescing?? true, which only defaults when the value is undefined. Both flags still default totruefor hosts that don't set them.
- Host-provided builder topbar actions. A new
topbar_actionsoption onContentAreaTypelets the host app render its own buttons in the builder topbar (after the Import/Export button) without the bundle knowing what they do. Each entry is['key' => …, 'label' => …, 'icon' => … (optional, may be inline SVG), 'title' => … (optional)]. Clicking a button dispatches a single generic, bubblingcb:builder:actionevent carryingdetail.key(plusareaIdand the clickedbutton); the host adds one stable listener and filters on the key — no per-key event names. Note: the builder<dialog>is re-parented to<body>, so host listeners attach todocument/windowrather than the launcher element.
- Typing a value into a range field no longer jumps. The range widget's number input committed mid-keystroke: each input event reached autosave, whose debounce flushed a change on the still-focused field — clamping the partial value, snapping the slider, and triggering a Live morph between two keystrokes.
cb-rangenow owns a local debounce for the typing path (emitting a single change once the editor pauses,commitDelaydefault 400 ms); a real change (blur/Enter) or a slider release commits immediately and cancels the pending one. The slider drag path is unchanged.
- Discarding all changes now asks for confirmation. The "Discard changes" topbar button threw away every unpublished draft edit at once, with no prompt and no recovery short of redoing the work — far more destructive than a single delete (which has its own one-click Undo). It now shows a native confirm dialog before reverting, mirroring the "Insert content" replace flow. The prompt text is translatable via the new
cb.builder.discard_confirmkey (FR + EN).
- Drag & drop reorders no longer silently revert. On pages with many elements, a section or block move could look like it applied but snap back to its original slot after a reload — intermittently, and more often the larger the page. The reorder/duplicate endpoints each rewrite a whole sibling set's draft position (
previewPosition), and the builder fired these requests with no serialization: two overlapping requests read each other's pre-commit state and the later commit clobbered the earlier move (a lost update). Structural mutations now run one at a time, in submission order. Also fixed along the way: a cross-column block move re-indexed the source column from its published order instead of its draft order, reverting any unpublished reorder of the blocks left behind.
- A wide column gap no longer stacks the columns. The front-side column presets subtracted a hardcoded
1remfrom theirflex-basis, so once a section's configured gap grew past1rem(e.g.40px) the columns no longer fit on one row and wrapped onto separate lines. The presets now reserve the section's actual gap (--cb-gap-d, with the tablet chain at the≤768pxbreakpoint), falling back to1remfor sections with no gap configured.
First beta: from this release on, the public API (entities, interfaces, endpoints, form types, Twig/Stimulus contracts) is considered frozen — further breaking changes bump to 0.2. New infrastructure backs that promise: a CI matrix (PHP 8.2–8.4 × PHPUnit / Vitest / Playwright) now gates the package split and tag propagation, the AJAX controllers and the import/export pipeline are unit-tested, and Symfony Flex recipes are served from a self-hosted endpoint (see the README installation section).
- Packaging — the kit now declares a real version constraint.
klehm/content-blocks-kitrequiredklehm/content-blocks: "@dev", which made any tagged kit release uninstallable for stability-normal consumers; it now requires^0.1. Both packages aliasdev-masterto0.1.x-devso monorepo path installs keep resolving.
- Symfony Flex recipes. Bundles, routes and documented config templates are applied automatically when installing via the self-hosted recipe endpoint (one
composer configline — see README). Each package has its own independent recipe. - Deleting a block or section can be undone in one click. Deletes are immediate (no confirm dialog) and the only recovery used to be Discard — which throws away the whole draft. After every delete, a snackbar ("Block deleted — Undo") now floats at the bottom of the shell for 6 seconds; clicking Undo flips the draft soft-delete flag back via the new
POST /_content-blocks/block/{id}/restore/POST /_content-blocks/section/{id}/restoreendpoints (CSRF +AccessCheckerInterfaceprotected, like every mutation) and reloads the preview. The offer is single-slot (a newer delete replaces it) and is withdrawn on publish/discard, where it could no longer be honoured. Also fixed: a failed section delete used to reload the preview as if it had succeeded. - Save failures are now visible (and recoverable). Every save path — structural ops (add/move/delete/duplicate, publish, discard, replace), block-form autosaves (Live Component), and the section-settings POST — now surfaces a persistent "not saved" banner in the topbar on failure (HTTP error or network loss); the banner clears on the next successful save. Previously failures were console-only: the editor had no way to know their edits were not stored. Three silent-failure bugs fixed along the way: a network error during a structural op threw an unhandled rejection; a network error during a Live Component save left the component permanently wedged (its request queue never drained, so no later save could run); and a failed autosave was treated as "already saved" by the dirty-detection baseline, so the unchanged value was never re-sent. After a failure, the editor's next interaction with the form retries the save.
- RangeType fields accept a precise typed value. The range widget now renders an editable number input next to the slider, so the editor can enter a value finer than the slider's step (e.g.
345on a step-10 slider). The number input is the submitted field and stays in two-way sync with the slider; its step defaults to1and is overridable per field viaattr.precise_step. - Duplicating a block or section no longer reloads the preview. The duplicate endpoints ship the copy's rendered markup when it's safe to hot-reload (the block — or every block in the section — opts into
supportsPreviewHotReload), and the overlay drops the copy in place, right after its source, preserving sibling DOM + JS state. An unsafe copy still falls back to a full reload. - Topbar features are now toggled per field, via
ContentAreaTypeoptions.enable_replace(Insert content) andenable_import_export(Import / Export) both default totrueand hide their topbar button + overlay when set tofalse:$builder->add('contentArea', ContentAreaType::class, ['enable_import_export' => false]).
- BREAKING — Import/Export is no longer toggled globally. The
content_blocks.import_export.enabled[_default]parameters, theCONTENT_BLOCKS_IMPORT_EXPORT_ENABLEDenv var, and thecb_import_export_enabledTwig global have been removed in favour of the per-fieldenable_import_exportoption above. The feature is now UI-only: theGET …/export/POST …/importroutes no longer return 404 when "disabled" — they stay reachable and remain protected byAccessCheckerInterface+ CSRF. Hosts that relied on the env/parameter to close the endpoints should gate them via their firewall orAccessCheckerinstead.
- Section style changes hot-reload in place. Saving a section's settings (padding/margin/background/gap/alignment/width mode + column widths) now patches the section's wrapper class/style and its columns' class/style directly in the preview instead of reloading the whole iframe — the inner blocks (and their JS state) are left untouched, so it's always safe. New
BlockRenderer::renderSection()+GET /_content-blocks/section/{id}/render; the overlay copies wrapper + column attributes, preserving the focus outline; the builder falls back to a full reload on any error.
- Section styles no longer leak into blocks. Section and block styling shared the same CSS custom property names (
--cb-pad-*,--cb-mar-*,--cb-bg); since custom properties inherit, a section's padding/margin/background cascaded into its descendant blocks (e.g. a padding-top set on a section was inherited by the blocks inside it). Section vars are now namespaced--cb-s-*and block vars--cb-b-*, so each scope is independent. Non-shared vars are unchanged.
- Section vertical alignment now aligns the columns. Previously the setting only applied
justify-contentto the section (a flex column), which has no visible effect unless the section also has amin-heightleaving spare room — so on a normal multi-column section it did nothing. The vertical-align value is now also applied asalign-itemson the inner.cb-row, so columns align relative to each other (e.g. a short column centers against a taller sibling) with nomin-heightrequired. The min-height "hero" centering still works via the section'sjustify-content; the default (no alignment) keeps columns stretched to equal height.
- Configurable column widths per section. Two- and three-column sections can now use unequal widths (e.g. 33/67, 40/60) via presets or free values that must sum to 100. Stored as a
columnWidthsCSV in the section settings JSON (no migration; rides the existing draft/publish/discard lifecycle) and rendered as per-columnflex-growweights (.cb-col--weighted+--cb-col-grow), with a clean fallback to equal widths when unset or malformed. The control offers preset buttons (with an active/selected state) plus a "Custom" toggle that reveals free per-column inputs; the active preset is reflected on open. - Responsive column gap per section. A new "Column gap" control (Styling tab) sets the gap between columns per viewport (desktop / tablet / mobile), reusing the existing viewport-tabs UI. Emitted as
--cb-gap-{d,t,m}on the section and applied to the inner row with the usual D→T→M fallback cascade; defaults to the framework 1rem when unset.
- WYSIWYG preview: the "+ Block" pill no longer takes flow space. It now floats absolutely, straddling the bottom border of its column (
margin: 0), so the builder preview matches the production layout instead of being pushed around by the affordance. It's hidden by default and revealed only when useful — on an empty column or while the parent section is hovered. Its hover state keeps a white background (only the border/text turn accent blue).
- Hover-revealed section handle. A small tab pinned to a section's top-left corner appears on hover (even with the cursor over a block, since
:hoverbubbles) and selects the section + opens its settings — a dependable way to grab a section that's full of blocks, where a plain click would hit a block instead. It floats, so it never affects the production-matching flow. Covered by Playwright E2E.
- Keyboard shortcuts on the focused element. With a section or block pinned (clicked) in the preview,
Delete/Backspacedeletes it — the same soft-delete intent as the toolbar × button — andEscapedeselects it (retracts the pinned toolbar and closes the sidebar). Shortcuts are ignored while typing in a preview form field, during a drag, while the block-type popover is open, and when a modifier key is held. Covered by Playwright E2E.
- Duplicate button on LiveCollection entries. Each collection card (tabs, FAQ entries…) now carries a duplicate button (⧉) next to the reorder controls; it inserts a copy of the entry right after the original via the new
duplicateCollectionItemlive action. Like a reorder, it's an in-place value change with nochildListmutation the autosave observer could catch, so the action persists the draft itself and reloads the preview — the copy survives a full reload. Covered by Playwright E2E plus Vitest and PHPUnit unit tests.
- Block picker ordering.
#[AsContentBlock]now accepts apriority(higher appears first in the "+Bloc" grid); blocks sharing a priority keep their service-discovery order. TheBlockTypeCompilerPassregisters types viafindAndSortTaggedServices, so the registry insertion order — which drives the grid — is now controllable. Defaults to0, so existing custom blocks are unaffected. The kit ships an explicit order: Title, Text, Rich text, Image, Tabs. - Block name in the edit sidebar. The block edit form now shows a lightweight heading (the block's icon in an accent chip + its translated label) above the fields, so it's always clear which block is being edited.
- Adding a section auto-opens its settings sidebar. Creating a section now focuses its settings panel immediately — parity with adding a block, which already opened its edit sidebar.
- Icon-grid block picker. The "+Bloc" popover in the preview is now a 3-column grid of tiles (icon + label) with a themed hover state, replacing the plain scrolling text list — it scans far better as the number of registered block types grows. Block types expose an icon via the new
BlockTypeInterface::getIcon(): ?string(return self-contained inline SVG usingcurrentColor, ornullfor a generic fallback glyph).AbstractBlockTypedefaults tonull, so existing custom blocks keep working unchanged. The kit blocks (Text, Title, Image, Rich text, Tabs) ship dedicated icons.
- Themed radios and checkboxes now render their
checkedstate. The form theme'sradio_widget/checkbox_widgetrouted the input throughform_widget_simple, butform_div_layoutemitscheckedfrom the radio/checkbox widget blocks themselves — so no themed radio or checkbox was ever marked checked (most visibly, the section settings "Largeur" /widthModeradios showed no selection despite a valid default).checkedis now folded into the input attributes.
- Import / export can be toggled off. The builder's Import/Export feature is now gated by
content_blocks.import_export.enabled(shipstrue), overridable in one place: set the env varCONTENT_BLOCKS_IMPORT_EXPORT_ENABLED(0/false/empty → off,1/true→ on) or the parameter directly. When off, the topbar button + overlay are hidden (via the newcb_import_export_enabledTwig global) and theGET …/export/POST …/importroutes return 404 — the endpoints close, not just the UI.
- Configurable default section width. New sections now inherit a project-wide default width mode instead of always starting
full. Setcontent_blocks.section.default_width_mode(full|centered) — paired with the existingcontent_blocks.section.default_max_width, a host can make every new section centered at a chosen container width in one place. The shipped default staysfull, so existing projects are unchanged. Wired throughCoreSectionDefaults(form pre-fill),SectionSettingsType(radio pre-selection) andBuiltInSectionDecorator(render fallback) so all three move together.
- Centered sections keep a full-width background. A
centeredsection's max-width + centering now applies to the inner.cb-row(via a--cb-row-max-wcustom property read inlayout.css) instead of the<section>element itself. The section background therefore spans the full viewport width while its content stays contained — the standard full-bleed pattern. Visual change for existing centered sections that have a background colour: the colour now bleeds edge to edge instead of being capped to the container width.
cb-form-rowwrapper was no longer applied. The form theme's row block was namedform_row_render— a name Symfony'sform_row()never invokes (the rendered block has beenform_rowsince Symfony ≥5.3), so the custom row markup was silently bypassed. Renamed toform_row, and folded in the nativewidget_attr(aria-describedbylinking the help text) that the built-inform_rowprovides.
- Preview hot reload. After an inline block edit the builder now refreshes just that block's markup in place instead of reloading the whole preview iframe — no flash, and the host page's scripts aren't re-run. A new
BlockTypeInterface::supportsPreviewHotReload()(defaultfalseinAbstractBlockType) lets a block type opt in when its rendered view is self-contained (static or CSS-only); JS-dependent views keep the full reload. The decision is enforced server-side viaGET /_content-blocks/block/{id}/render, which returns the single block's fragment ({hotReload:true, html}) or{hotReload:false}. Block deletes also drop the element in place (no reload — deleted blocks render hidden anyway), and the overlay dispatches acb:block:renderedDOM event on each swapped block so JS-enhanced views can re-initialise idempotently. - Drag & drop reordering of LiveCollection items. Collection fields (tabs, cards, FAQ…) edited in the sidebar can be reordered by dragging a handle or via keyboard up/down buttons. Works for any block with a
LiveCollectionType, no host wiring. Action required for upgrading hosts: add"@klehm/content-blocks/cb-collection-sort"toassets/controllers.json. - Block fields grouped into sidebar tabs. Fields are bucketed into tabs by a
data-cb-groupattribute, with a default "General" tab and a trailing "Style" tab; hidden tabs stay in the DOM so autosave and validation keep working across them. Action required for upgrading hosts: add"@klehm/content-blocks/cb-tabs"toassets/controllers.json. SeparatorTypeform field. A non-mapped pseudo-field rendering an<hr>in the sidebar so a block can visually group its fields, picked up by the generic form theme (cb_separator_widget) — no per-blockgetFormTheme()wiring needed.
- Structural edits in a block form now autosave. Adding or removing an item in a block that renders a
LiveCollectionType(e.g. the kit's Tabs block) goes through a Live action that re-renders the sidebar without emitting any fieldinput/changeevent — socb-autosave's field listeners missed it and the change was never persisted to the draft, leaving the preview stale (a removed item silently reappeared on the next edit).cb-autosavenow also watches the form's node tree with aMutationObserver: any re-render that changes the form's serialized state triggers a save. The save stays idempotent —_saveNow()only POSTs when the serialized state actually differs from the last snapshot, so the morph caused by the save itself is a no-op and there is no loop. - Autosave no longer loops the upload on file fields. Before saving,
cb-autosavesynthesises achangeon the focused field to flush its value into the Live model binding. On an<input type="file">that re-triggeredcb-file-upload, which re-uploaded the same file under a fresh random name, wrote a new hiddensrc, and fired another save — an infinite loop ("Uploading…" that never stopped after picking an image). File inputs are now skipped: their value is already committed via the hidden input the upload controller writes. - Builder close (×) button. The launcher re-parents the
<dialog>todocument.bodyon connect, which moved the close button out of the launcher controller's scope so its action never bound (only the native Escape key closed the builder). The close action now lives oncb-builder, which stays inside the dialog and closes it directly.
- Builder preview spacing aligned with the production render. Dropped builder-only column padding and section
padding-top(the preview overlay markers don't exist in prod, so they skewed fidelity) and bumped the inline "+ Block" pill margin to compensate.
- JSON Import / Export. A new "Import / Export" button sits in the builder topbar next to "Insert content" and opens an overlay panel exposing two flows: download the area as a self-contained JSON file (sections + columns + blocks + base64-encoded asset binaries, deduplicated by sha256), or upload a previously-exported file to replace the current draft (soft-delete + clone semantics, mirroring the existing replace-with flow — Publish commits the swap, Discard reverts). Endpoints are
GET /_content-blocks/area/{id}/exportandPOST /_content-blocks/area/{id}/import, both CSRF + AccessChecker protected. The export walks block data recursively and rewrites any stored asset path to anasset://{hash}token; the importer re-uploads each blob and reverses the substitution. A newContentBlocks\Asset\AssetResolverInterfaceabstracts asset I/O; the kit ships a default bridge overFileStorageInterface, so hosts already configured for image uploads get import/export for free.
- Range slider form widget.
cb_form_theme.html.twignow defines arange_widgetblock that renders<input type="range">with min / max bounds underneath the track and a live numeric readout positioned at the row's top-right (visually aligned with the label). A newcb-rangeStimulus controller keeps the<output>in sync as the user drags, since browsers don't auto-bind<output>to<input type="range">. The row gets acb-form-row--rangemodifier (detected viablock_prefixes, sincetypeis only set inside the widget block) so it establishes the positioning context for the absolutely-placed readout. Action required for upgrading hosts: add"@klehm/content-blocks/cb-range"toassets/controllers.json.
- Live-collection cards now stack one per row.
.cb-form-collectionswitched fromrepeat(auto-fill, minmax(140px, 1fr))to a single-column grid — multi-item blocks like gallery / accordion are easier to read at typical sidebar widths than when cards squeeze side-by-side.
- Live-collection form theme.
LiveCollectionTypefields rendered through the builder (gallery, accordion, list, info-card…) now lay out as a CSS grid of cards instead of a vertical stack of fieldsets — overridinglive_collection_widgetandlive_collection_entry_rowin the bundledcb_form_theme.html.twig. Each entry is wrapped in a.cb-form-collection__itemcard with the delete button rendered as a small absolute "×" in the corner; the add button spans full width with a dashed border. Applies automatically to every block whose form uses aLiveCollectionType— no per-block form theme needed.
- Type-picker popover scrolls past 160 px.
.cb-overlay-popovernow caps atmax-height: 160pxwithoverflow: auto, so the section / block type list stays usable when many types are registered.
- Sidebar no longer freezes on a stale form when its target element is deleted. Removing a block or section from the iframe now clears the focused-element sidebar instead of leaving the previously-rendered form attached to a non-existent id.
- Block horizontal alignment (
styling.alignSelf). Blocks gain astart/center/endchoice rendered as a three-bar text-align icon in the styling sidebar. Output as the CSS variable--cb-align-selfon the block wrapper. Only meaningful when the block has amaxWidthcap — otherwise the block stretches to fill the column and align-self has no visible effect — so the row is hidden until amaxWidthvalue is entered. Visibility is driven by the newcb-block-styling-formStimulus controller, which listens forinput/changeevents on[name$="[maxWidth][value]"]and toggles the row'shiddenattribute. Action required for upgrading hosts: add"@klehm/content-blocks/cb-block-styling-form"toassets/controllers.json. CoreSectionDefaultsprovider (mirror ofCoreStylingDefaultsfor top-level section settings). SeedsmaxWidth = 1320so a freshly-created Centered section always presents a sensible cap in the form and renders with that cap when no explicit value is saved. Bound to a new container parametercontent_blocks.section.default_max_widthand shared via a targetedbind('int $defaultMaxWidth', …)withBuiltInSectionDecorator,CoreSectionDefaultsandSectionSettingsTypeso the form pre-fill, the placeholder and the rendered fallback all read the same number — overriding the parameter in one place keeps them in lock-step.- README section on customizing default values. Documents the parameter-based override path (
content_blocks.section.default_max_width) and the provider-based path (SectionSettingsDefaultsProviderInterface,BlockDataDefaultsProviderInterface), including how the form pre-fill / renderer fallback / default-stripping pipeline fit together.
- Centered sections without an explicit
maxWidthnow fall back to the configured default (1320 px out of the box) instead of being rendered uncapped. The literal value0is preserved as an explicit opt-out, distinct from a missing key. - Section sidebar title removed.
sidebar_section.html.twigno longer renders thecb.section.settings.titleheading — the sidebar context is already clear from the focused-section outline, and dropping the redundant title gives the form a few extra pixels of vertical room. - Block-form
stylingsub-form now opts intoinclude_align_self(alongside the existinginclude_max_width). Section settings keep the previous flag set untouched.
- Sidebar tabs replaced by two stacked groups. The section-settings and block-edit sidebars no longer hide their fields behind General / Styling tabs — both groups are now rendered in sequence under small uppercase labels (
.cb-sidebar__group-title) and the sidebar content scrolls when they overflow. Thecb-sidebar-tabsStimulus controller is removed (CSS / package manifests /controllers.jsonentries cleaned up). Action required for upgrading hosts: drop thecb-sidebar-tabsline fromassets/controllers.json. - Section settings:
maxWidthfield hidden unlesswidthMode = centered. The initial visibility is driven by Twig (hiddenattribute set server-side based on the form's currentwidthMode) so there's no flash of misplaced field on first paint;cb-section-settings-formkeeps it in sync with the live radio value via achangelistener on the form.
- No-op autosaves and the iframe reloads they triggered are now suppressed.
cb-autosavesnapshots the form's serialized state (new URLSearchParams(new FormData(form)), sorted) at connect and after every save, and skips the trigger when nothing has changed since the last snapshot. A typical edit no longer produces two POSTs (one from the input-debounce, one from the subsequentfocusout/change) followed by two iframe reloads — the second event is deduped away.
- Permanent sidebar with autosave (Elementor-like layout). The builder shell now renders the sidebar as a fixed left column instead of a floating panel that animated in/out. The sidebar always shows either an empty-state hint with the three "Add a section" shortcuts, or the editor for the focused block/section. A floating toggle chip on the right edge collapses the column to a 32 px stub when the user wants a wider preview; collapsed state is persisted in
localStorage. - Auto-save for block & section forms (
cb-autosaveStimulus controller). Edits are persisted automatically: 250 ms debounce oninput, immediate save onchange/focusout/Enter(single-line inputs). The controller dispatches a syntheticchangeon the focused field before clicking the hidden in-form save trigger so Live Component model bindings flush their value first. Multi-line targets (textarea, contenteditable) keep their native Enter behavior. The companioncb-block-edit-keyscontroller is removed — its keyboard role is folded intocb-autosave. BlockDataDefaultsdefaults system (block-side mirror ofSectionSettingsDefaults). Hosts can implementBlockDataDefaultsProviderInterface(auto-tagged) to seed initial block form data; defaults equal to the saved value are stripped before the decorator pipeline so they don't leak as inline styles. Ships withCoreBlockStylingDefaultsdefaultingstyling.backgroundColorto#ffffff— same compromise as the section-sideCoreStylingDefaults(white treated as "no override" to work around<input type="color">'s lack of an empty state).- Outline preservation across iframe reloads. Autosave-triggered preview reloads no longer drop the blue selection outline. After the iframe's
loadevent,cb-builderpostscb:focus:block/cb:focus:sectionto the overlay, which re-pins the focus on the matching[data-cb-block-id]/[data-cb-section-id]element. - Click-to-edit in the preview. Clicking a block or section inside the iframe now both pins the outline and opens the corresponding sidebar editor — the dedicated Edit (✎) / Settings (⚙) toolbar buttons are removed in favor of this direct affordance. Drag, move, duplicate and delete remain on the floating toolbar.
- Empty-state sidebar partial. New
@ContentBlocks/builder/sidebar_empty.html.twigrenders a hint + three add-section buttons whenever no element is focused; the iframe'scb-add-section-trayis unchanged.
- Iframe reload after save is debounced 500 ms. Autosave can fire several
cb:*:savedevents per second; the shell now coalesces them so the preview only re-renders once after the user pauses. Structural ops (add / delete / move / duplicate) still reload synchronously. - Sidebar grid sizing driven by a CSS custom property.
--cb-sidebar-widthlives on.cb-shelland is read by.cb-shell__main'sgrid-template-columns. The resize handle on the sidebar's right edge writes the same property, persisted inlocalStorage. min-heightsetting on sections no longer shadowed in the preview.[data-cb-section-id]inbuilder.cssnow usesmin-height: var(--cb-min-h, 60px)so a user-set value wins over the builder's 60 px guide for empty sections.- Color picker initial value for blocks defaults to
#ffffff(pre-populated throughBlockDataDefaultsso the native<input type="color">doesn't surprise users with#000000on a fresh block form).
horizontalAlignsection styling. The option was silently inert: the current full-fill column presets (col-12, twocol-6, threecol-4) sum to 100 % of the row sojustify-contenthad no slack to distribute. Removed fromStylingType,StylingSectionDecorator,styling.css, the form theme widget, and the EN / FR translations.- Sidebar Save / Close buttons. Save is gone (autosave replaces it); the header X is gone (sidebar is permanent — collapse via the floating chip instead). The launcher's
confirm_closeprompt is also gone since autosave makes the "unsaved changes" scenario impossible. cb-block-edit-keysStimulus controller. Its Enter-to-save / Escape-to-cancel mapping is folded intocb-autosave(Enter → save) and the cancel path no longer applies. Action required for upgrading hosts: replace thecb-block-edit-keysentry inassets/controllers.jsonwithcb-autosave.
backgroundColoron a block emits no inline style when left at the default.BlockRenderer::buildBlockList()now strips default-equal entries viaBlockDataDefaults::withoutDefaults()before handing data to the decorator pipeline — same treatment sections already had.
- Twig override priority for the
@ContentBlocksnamespace. The bundle no longer manually registers itstemplates/path under its own Twig namespace — this was duplicating Symfony'sAbstractBundleauto-detection and inserting the vendor path with higher priority than the host app'stemplates/bundles/ContentBlocksBundle/override directory, effectively disabling the standard override mechanism. Override directories now work as documented.
- Refactor: extract section / column / block render into dedicated templates for granular overrides.
@ContentBlocks/render/content_area.html.twigno longer renders sections, columns and blocks inline — each level now lives in its own template and is included from the parent withwith_context = false. Markup, CSS classes anddata-cb-*attributes are unchanged.- New override points exposed under
templates/bundles/ContentBlocksBundle/render/in the host app:section.html.twig— receivessection: Section,isPreview: boolcolumn.html.twig— receivescolumn: Column,isPreview: boolblock.html.twig— receivesblock: Block,isPreview: bool
- Breaking for forks of
content_area.html.twig: if your host app previously copied the entry-point template to customise a sub-level (a<section>, a<div class="cb-col">, etc.), re-target your override to the new dedicated template rather than maintaining a full copy ofcontent_area.html.twig.
- New override points exposed under
Initial alpha. See git log for the per-commit history prior to this changelog.