@adobe/helix-md2jcr 1.3.0 → 1.4.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,3 +1,17 @@
1
+ ## [1.4.1](https://github.com/adobe/helix-md2jcr/compare/v1.4.0...v1.4.1) (2026-06-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * republish after npm provenance failures ([c078b3f](https://github.com/adobe/helix-md2jcr/commit/c078b3f68de461213347339cc6afd3de1c3cfcd7))
7
+
8
+ # [1.4.0](https://github.com/adobe/helix-md2jcr/compare/v1.3.0...v1.4.0) (2026-06-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * **section-metadata:** element grouping for section style + classes in modelFields ([#216](https://github.com/adobe/helix-md2jcr/issues/216)) ([861bf48](https://github.com/adobe/helix-md2jcr/commit/861bf481d623e74045a81de2a80bbc0af6a31db1)), closes [#215](https://github.com/adobe/helix-md2jcr/issues/215)
14
+
1
15
  # [1.3.0](https://github.com/adobe/helix-md2jcr/compare/v1.2.21...v1.3.0) (2026-06-08)
2
16
 
3
17
 
package/README.md CHANGED
@@ -109,6 +109,9 @@ console.log(xml);
109
109
  - [Block Options (Classes)](docs/block-options.md) — block option classes and
110
110
  element grouping (`classes`, `classes_*`): how header options are routed to
111
111
  fields by their options or boolean name-suffix.
112
+ - [Section Styles](docs/section-styles.md) — element grouping for a section's
113
+ `style` group (`style`, `style_*`): how the single Section Metadata `style`
114
+ cell is routed back to fields, mirroring block options.
112
115
  - [Field Hinting](docs/field-hinting.md) — using `<!-- field: name -->` to skip
113
116
  ahead within a field group.
114
117
 
@@ -76,8 +76,9 @@ Promo (highlight, featured, sticky) // classes is free-form, classes_sticky is
76
76
  -> classes="[highlight, featured]" classes_sticky="true"
77
77
  ```
78
78
 
79
- The classes group fields are block options, not content, so they are excluded
80
- from `modelFields` and never consume content rows.
79
+ The classes group fields are block options, not content, so they never consume
80
+ content rows. They are still listed in `modelFields` so the Universal Editor can
81
+ render their option controls.
81
82
 
82
83
  ## Requirements
83
84
 
@@ -0,0 +1,65 @@
1
+ # Section Styles (Element Grouping for `style`)
2
+
3
+ A section's appearance is controlled by the **Style** property of its Section
4
+ Metadata, which AEM turns into CSS classes on the containing section element.
5
+ `style` is the section counterpart of a block's [`classes`](./block-options.md)
6
+ property.
7
+
8
+ When a section model exposes several style options — especially mutually
9
+ exclusive ones — it can use the
10
+ [element grouping](https://www.aem.live/developer/component-model-definitions#element-grouping-for-block-options)
11
+ naming convention: a **style group** is the base `style` field plus any
12
+ `style_<name>` field.
13
+
14
+ ```jsonc
15
+ { "component": "select", "name": "style", "options": [ "variant-a", "variant-b" ] }
16
+ { "component": "multiselect", "name": "style_background", "options": [ "light", "dark" ] }
17
+ { "component": "boolean", "name": "style_fullwidth" }
18
+ ```
19
+
20
+ AEM collapses the whole style group into the single, well-known `style` cell of
21
+ the Section Metadata table (a flat, comma-separated list). Going from markdown to
22
+ JCR, md2jcr routes each token back to its field — exactly as it does for block
23
+ `classes`:
24
+
25
+ - **boolean field** — matched by its name suffix (after `style_`); token
26
+ `fullwidth` sets `style_fullwidth="true"`, absent leaves it unset;
27
+ - **select / multiselect field** — matched by its declared option values; a
28
+ multiselect claims all of its matching tokens (`style_background="[light, dark]"`);
29
+ - **base `style` field** — receives any leftover tokens (also the common single,
30
+ free-form `style` field case).
31
+
32
+ ### Example
33
+
34
+ ```markdown
35
+ +-------------------------------------------------------+
36
+ | Section Metadata |
37
+ +================+======================================+
38
+ | style | variant-a, light, fullwidth |
39
+ +----------------+--------------------------------------+
40
+ ```
41
+
42
+ becomes:
43
+
44
+ ```text
45
+ style="variant-a" style_background="light" style_fullwidth="true"
46
+ ```
47
+
48
+ ### Notes
49
+
50
+ - The routing rules and the underlying implementation are shared with block
51
+ options — see [Block Options](./block-options.md).
52
+ - Distribution only kicks in when the section model declares at least one
53
+ `style_<name>` field. A model with only a base `style` field keeps the simple
54
+ one-to-one mapping.
55
+ - The `style` group is listed in `modelFields` so the Universal Editor can
56
+ render those fields — the same as a block's `classes` group.
57
+
58
+ ### Worked fixtures
59
+
60
+ See [`test/fixtures/blocks/core/section-style-options`](../test/fixtures/blocks/core/section-style-options):
61
+
62
+ - `section-style-grouping` — single selects + a boolean that is on
63
+ - `section-style-grouping-multi` — a multiselect claiming several values, boolean off
64
+ - `section-style-grouping-fallback` — free-form base `style` catch-all + a boolean
65
+ - `section-style-grouping-booleans` — several independent boolean options, mixed on/off