@bettercms-ai/convert 0.21.0 → 0.23.0

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,23 @@
1
1
  # @bettercms-ai/convert
2
2
 
3
+ ## 0.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6c75c11: `bettercms-convert --upgrade-sections --root .` gives a site converted before helper v10 the section style marker, so the visual editor shows section spacing and style handles on its pages. Every element that carries `data-bcms-block` and no `data-bcms-style` gets the marker together with the style it promises. A component that `--componentize` wrote gets `data-bcms-style="" style={bcmsSectionStyle[Text](blockStyle)}` and the `blockStyle` prop, and its registry and `src/lib/bcms-sections.ts` are patched to pass each placement's `block.style`. The result is byte-identical to what a fresh extraction writes today. `data-bcms-block={block.id}` becomes `{...sectionRootAttrs(block)}` when the SDK range guarantees that export (`@bettercms-ai/astro` 0.19, `@bettercms-ai/next` 0.18), and otherwise gets the marker and `block.style` through the helper. The helper is upgraded to the current version, or added with its layout stub. Roots with their own `style` or a spread, roots that receive only a block id, and literal, conditional or unresolvable blocks are left alone. Each one is listed in the receipt with its reason (`OWN_STYLE`, `SPREAD`, `BLOCK_ID_ONLY`, `BLOCK_LITERAL`, `BLOCK_UNRESOLVABLE`, …). A second run writes nothing, and no class, className or existing style token changes. `--dry-run`, `--receipt`, `--strict` and `--overwrite-helper` work as in the other modes.
8
+
9
+ ## 0.22.0
10
+
11
+ ### Minor Changes
12
+
13
+ - c0afef4: The emitted helper (v11) paints the same section design keys as `blockStyleToCss`: `theme`, `bg`/`bgCustom`, `bgImage` (http(s) or root-relative only), `corner`, `shadow`, `fullHeight`, `opacity`, `borderTop`/`borderBottom` and the px padding sliders. A converted section root's `data-bcms-style` promise, that its inline style is `blockStyleToCss(block.style)`, holds again for sections styled in the visual editor. Helpers at v10 and older are recognised and upgraded. The content column (`contentWidth`) is still not drawn on converted roots.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [c0afef4]
18
+ - Updated dependencies [5c6db8e]
19
+ - @bettercms-ai/types@1.30.0
20
+
3
21
  ## 0.21.0
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -601,6 +601,45 @@ the now-unused `bcms`/snapshot imports P2 added, and a page whose registered cal
601
601
  `<Sections>` keeps the imports of the components it used to call. They are harmless at build time
602
602
  and removing them would mean editing statements no section asked about.
603
603
 
604
+ ### Section spacing handles on a site converted before helper v10 (`--upgrade-sections`)
605
+
606
+ The visual editor shows a page's section spacing and style handles only when EVERY root the build
607
+ stamps with `data-bcms-block` also carries `data-bcms-style` — the site's promise that the root's
608
+ inline style is `blockStyleToCss(block.style)`. Conversions before 0.21 (helper v6–v9, componentize
609
+ v2 sections, hand-written roots) stamp the block and not the marker, so those pages never get
610
+ handles. `get_next_steps` says so (`upgrade-section-roots`) when the release finds such roots.
611
+
612
+ ```bash
613
+ npx @bettercms-ai/convert@latest --upgrade-sections --root . --dry-run # read the plan
614
+ npx @bettercms-ai/convert@latest --upgrade-sections --root . # then push and release
615
+ ```
616
+
617
+ Each root with `data-bcms-block` and no `data-bcms-style` gets the marker together with the style:
618
+
619
+ - a component `--componentize` wrote (`data-bcms-block={blockId}`): `data-bcms-style=""
620
+ style={bcmsSectionStyle[Text](blockStyle)}`, the `blockStyle` prop, and the registry and
621
+ `src/lib/bcms-sections.ts` patched to pass `block.style` down — byte-identical to what a fresh
622
+ extraction writes today;
623
+ - `data-bcms-block={block.id}` where the SDK has `sectionRootAttrs` (`@bettercms-ai/astro` >= 0.19,
624
+ `@bettercms-ai/next` >= 0.18, read off the LOWEST version the range admits):
625
+ `{...sectionRootAttrs(block)}`;
626
+ - the same root on an older SDK: `data-bcms-style="" style={bcmsSectionStyle[Text](block.style)}`
627
+ through the helper, which is upgraded (or added, with its `bcms-content/layout.json` stub).
628
+
629
+ Left alone, and listed as `skipped` with a reason: `OWN_STYLE` (the root sets its own `style`),
630
+ `SPREAD` (a `{...rest}` that may carry one), `BLOCK_ID_ONLY` (only an id reaches the root —
631
+ `data-bcms-block={Astro.props.bcmsBlock}`; pass the block or its style down), `BLOCK_LITERAL`,
632
+ `BLOCK_UNRESOLVABLE` (a conditional or a call), `NOT_AN_ELEMENT`, `NAME_TAKEN`,
633
+ `REGISTRY_UNRECOGNISED`, `DIALECT_UNSUPPORTED` (html, vue, svelte), `PARSE_ERROR`. A helper this
634
+ package did not write is `HELPER_CONFLICT` (exit 1) only when a root needs it; `--overwrite-helper`
635
+ replaces it.
636
+
637
+ The receipt (`--receipt <file>`) is `{ helpers, registry, roots: { upgraded, alreadyMarked,
638
+ skipped } }`, each root as `{ file, line, tag, block, form | reason + message }`. No class,
639
+ className or existing style token changes (`--verify-styles` stays clean), and a second run writes
640
+ nothing and counts every root it marked as `alreadyMarked`. `--strict` exits 2 while any root is
641
+ skipped.
642
+
604
643
  ## Forms
605
644
 
606
645
  The third mode, and the shortest. The release-time derive lane reads every `<form>` in the built