@bygghammar/cms-platform 0.46.0 → 0.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.46.1
4
+
5
+ - Page builder host contract: `renderEditor` now also receives `initialBlocks` (the server baseline) alongside the live canvas.
6
+
3
7
  ## 0.46.0
4
8
 
5
9
  - Page builder is package-owned: new `backoffice/PageBuilderView` (rename, public URL, locale switch, save/publish, scheduling, version history, canvas and SEO slots) plus a `PageBuilderRoute` driven by a new `pages` host group.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygghammar/cms-platform",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "description": "Shared CMS platform: blocks, block types, i18n core, UI primitives and design-token contract used by every Bygghammar/Voyara site.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -206,6 +206,8 @@ export type BackofficeHost = {
206
206
  /** Renders the block canvas for the builder. */
207
207
  renderEditor: (args: {
208
208
  pageKey: string;
209
+ /** Blocks as last loaded from the server (the editor's baseline). */
210
+ initialBlocks: any[];
209
211
  blocks: any[];
210
212
  setBlocks: (next: any[]) => void;
211
213
  globals: Record<string, any[]>;
@@ -133,6 +133,7 @@ export function PageBuilderRoute() {
133
133
  renderEditor: ({ blocks, setBlocks, locale, setLocale, setDirty }) =>
134
134
  pages.renderEditor({
135
135
  pageKey: key,
136
+ initialBlocks: (pageQ.data?.blocks as any[]) ?? blocks,
136
137
  blocks,
137
138
  setBlocks,
138
139
  globals,