@openpresentation/opf 0.34.1 → 0.34.2

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.
Files changed (83) hide show
  1. package/dist/browser.js +18 -18
  2. package/dist/{catalog-refs-CoIrOdAw.d.ts → catalog-refs-wtuudZTe.d.ts} +12 -3
  3. package/dist/{catalog-schemas-FjLRPtjB.d.ts → catalog-schemas-CSxuFtsu.d.ts} +1 -1
  4. package/dist/{chunk-HHVQ2SDT.js → chunk-6MSH3KCZ.js} +1 -1
  5. package/dist/{chunk-SR6T4LKI.js → chunk-AQ3WR3H7.js} +2 -2
  6. package/dist/{chunk-X72WPTST.js → chunk-EQCZ2SFD.js} +6 -6
  7. package/dist/chunk-HSXWDXKM.js +1 -0
  8. package/dist/{chunk-6PMXVP5G.js → chunk-HX4HEJB4.js} +201 -21
  9. package/dist/{chunk-MAFJ5O2D.js → chunk-IDYYLJCQ.js} +6 -6
  10. package/dist/{chunk-CJVKOJ6B.js → chunk-IGT4523S.js} +406 -58
  11. package/dist/{chunk-XLSWZSQS.js → chunk-KJFCHCWV.js} +2 -2
  12. package/dist/{chunk-ABA2D6X5.js → chunk-MDAXXFAY.js} +2 -2
  13. package/dist/{chunk-AGYPRTEC.js → chunk-NMZCPZ3R.js} +3 -3
  14. package/dist/{chunk-2B6GLT2O.js → chunk-P2X4BBW2.js} +1 -1
  15. package/dist/{chunk-FCSYIBVR.js → chunk-PHOSM2RA.js} +1 -1
  16. package/dist/{chunk-MUILZGRY.js → chunk-RM4Z7ZSW.js} +4 -4
  17. package/dist/{chunk-244OPLAV.js → chunk-UKI43JE6.js} +1 -1
  18. package/dist/{chunk-AAWHOCXS.js → chunk-V4G3BYPY.js} +2 -2
  19. package/dist/{chunk-LCT5ZV3Q.js → chunk-VI7VWDTN.js} +17 -1
  20. package/dist/{chunk-CQXBGZQP.js → chunk-VVPPMHP6.js} +5 -5
  21. package/dist/{chunk-AEHDXNZX.js → chunk-WBPXRUZT.js} +459 -270
  22. package/dist/{chunk-L3MCLD3X.js → chunk-XLXCXEVF.js} +2 -2
  23. package/dist/{composition-CvtvgBDE.d.ts → composition-DF07Ha4R.d.ts} +154 -135
  24. package/dist/composition.d.ts +2 -2
  25. package/dist/composition.js +1 -1
  26. package/dist/{conversion-CyNRlWGw.d.ts → conversion-52ki0lfZ.d.ts} +9 -7
  27. package/dist/conversion-F3HSCFOV.js +25 -0
  28. package/dist/convert.d.ts +2 -2
  29. package/dist/convert.js +7 -7
  30. package/dist/data.d.ts +1 -1
  31. package/dist/data.js +2 -2
  32. package/dist/{deck-report-BVlQZ42f.d.ts → deck-report-C3EsoHC3.d.ts} +3 -3
  33. package/dist/deck.d.ts +5 -5
  34. package/dist/deck.js +11 -11
  35. package/dist/diff.js +4 -4
  36. package/dist/docs.js +16 -16
  37. package/dist/example-files/technical/assets/alice.png +0 -0
  38. package/dist/example-files/technical/assets/context-photo.png +0 -0
  39. package/dist/example-files/technical/assets/cover-image.png +0 -0
  40. package/dist/example-files/technical/assets/cover.png +0 -0
  41. package/dist/example-files/technical/assets/diagram.svg +1 -0
  42. package/dist/example-files/technical/assets/icon.svg +1 -0
  43. package/dist/example-files/technical/assets/logo-dark.svg +1 -0
  44. package/dist/example-files/technical/assets/logo-light.svg +1 -0
  45. package/dist/example-files/technical/assets/logo.svg +1 -0
  46. package/dist/example-files/technical/assets/primary-logo.svg +1 -0
  47. package/dist/example-files/technical/assets/product-shot.png +0 -0
  48. package/dist/example-files/technical/assets/watermark.png +0 -0
  49. package/dist/example-files/technical/assets/wordmark.svg +1 -0
  50. package/dist/examples.js +49 -1
  51. package/dist/format.js +2 -2
  52. package/dist/ids.js +4 -4
  53. package/dist/index.d.ts +12 -12
  54. package/dist/index.js +21 -21
  55. package/dist/markdown.d.ts +1 -1
  56. package/dist/markdown.js +8 -8
  57. package/dist/node-engine.d.ts +21 -7
  58. package/dist/node-engine.js +37 -21
  59. package/dist/{pagination-CZQQYk7L.d.ts → pagination-Do7vNgU-.d.ts} +2 -2
  60. package/dist/pagination.d.ts +3 -3
  61. package/dist/pagination.js +4 -4
  62. package/dist/patch.js +3 -3
  63. package/dist/precompiled.js +2 -2
  64. package/dist/{presentation-s9262acV.d.ts → presentation-ANs2WkaS.d.ts} +8 -0
  65. package/dist/schema-engine-ajv.js +1 -1
  66. package/dist/schema-engine-precompiled.js +2 -2
  67. package/dist/schema.d.ts +2 -2
  68. package/dist/schema.js +3 -3
  69. package/dist/schemas.js +1 -1
  70. package/dist/source.d.ts +5 -0
  71. package/dist/source.js +10 -10
  72. package/dist/spec/schemas/icon-set.schema.json +5 -0
  73. package/dist/spec/schemas/opf.schema.json +9 -1
  74. package/dist/symbol-font-encodings.js +12695 -12736
  75. package/dist/types.d.ts +2 -2
  76. package/dist/{validation-types-CYbsUuZ9.d.ts → validation-types-BNS41nzb.d.ts} +2 -2
  77. package/dist/validator.d.ts +4 -4
  78. package/dist/validator.js +3 -3
  79. package/dist/yaml.d.ts +1 -1
  80. package/dist/yaml.js +7 -7
  81. package/package.json +7 -7
  82. package/dist/chunk-UJZN2ZH6.js +0 -1
  83. package/dist/conversion-CSQ5EHD2.js +0 -25
package/dist/docs.js CHANGED
@@ -12,19 +12,19 @@ var docsData = Object.freeze([
12
12
  "slug": "catalog-schema-reference",
13
13
  "file": "docs/catalog-schema-reference.md",
14
14
  "title": "OPF Catalog Schema Reference",
15
- "markdown": "# OPF Catalog Schema Reference\n\nCatalog records are reusable presets that OPF documents reference by id. This page summarizes every catalog companion schema in `spec/schemas/`. The top-level presentation schema has its own [schema reference](schema-reference.md), and the report format every tool shares has the [validation results reference](finding-schema-reference.md).\n\nOPF documents usually reference these records with string ids such as `design.theme = \"minimal\"`, `tone = \"formal\"`, or `chart.type = \"line\"`. Dense examples may also embed catalog sources or inline records under `catalogs`.\n\n## Audience\n\n- File: `spec/schemas/audience.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-audience/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for audience records. Each record names an audience archetype (e.g. 'executive', 'engineering-team', 'investor') and carries seniority, technical-fluency, decision-power, and attention-budget hints used by AI-driven generation. Documents reference an audience from 'audience', which also accepts free-form text. A document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-audience/v1\"` | Identifies a published record file as a audience record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The audience's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this f... |\n| `name` | yes | `string` | Human-readable audience name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the audience who they are and what they care about. |\n| `description` | no | `string` | Longer prose describing the audience archetype and how to address them. |\n| `seniority` | no | `enum:ic \\| manager \\| director \\| vp \\| c-suite \\| mixed` | Typical seniority level of the audience. Engines use this as a hint for default depth and pacing. |\n| `technicalFluency` | no | `enum:low \\| medium \\| high \\| mixed` | Typical technical fluency of the audience. AI generation uses this to decide whether to expand or assume technical terminology. |\n| `decisionPower` | no | `enum:informational \\| advisory \\| decision-maker` | Whether the audience is expected to be informed, to advise, or to actually decide. Shapes the strength of the closing ask. |\n| `attentionBudgetMinutes` | no | `number` | Realistic upper bound on this audience's focused attention for a single presentation, in minutes. Used as a hint when comparing against duration and the resolved narrative's duration range. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: ids of narratives in the same catalog that work well for this audience. Used by picker UIs to suggest narratives once an audience is chosen. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: ids of tones in the same catalog that work well for this audience. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional. |\n\n## Catalog Index\n\n- File: `spec/schemas/catalog-index.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-catalog-index/v1`\n- Type: `object`\n- Required fields: `$schema`, `version`, `description`, `records`\n- Purpose: Generic shape shared by every `<kind>/index.json` file of the @openpresentation/gallery package (packages/gallery/catalog in the OPF repo) and by the default-catalog index that pptx.gallery publishes at `https://www.pptx.gallery/<kind>/index.json` (the gallery package is a pinned snapshot of that catalog; see docs/default-catalog.md). An index is a lightweight, ordered summary of the full-record JSON files that live alongside it: each entry names the record's stable id, a human-readable name,...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-catalog-index/v1\"` | |\n| `kind` | no | `enum:audiences \\| chart-types \\| color-schemes \\| font-schemes \\| icon-sets \\| languages \\| layouts \\| narratives \\| purposes \\| social-platforms \\| themes \\| tones` | Catalog kind, as the URL segment of the default catalog (`https://www.pptx.gallery/<kind>`) and the `packages/gallery/catalog/<kind>` directory name. |\n| `version` | yes | `string` | Index format version, as a string. |\n| `description` | yes | `string` | Human-readable description of what this catalog kind holds and how entries are ordered. |\n| `contentSha256` | no | `string` | SHA-256 (lowercase hex) of the canonical JSON of the full records this index lists, in index order, with every top-level `x-*` member removed. Canonical JSON sorts object keys and has no insignificant whitespace. Lets... |\n| `records` | yes | `array<ref:IndexRecord>` | Ordered list of lightweight record summaries. Order defines the catalog's canonical/display order; full record data lives in the sibling JSON file named by `file`. |\n\n### Nested Types\n\n#### IndexRecord\n\n- Type: `object`\n- Required fields: `id`, `name`, `file`\n- Purpose: Lightweight summary of one catalog record. Additional per-kind fields (e.g. `summary`, `tags`, `bcp47`, `duration`, `group`, `label`) are allowed and vary by catalog kind.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable identifier, matching the `id` field inside the record file named by `file`. Lowercase kebab-case; chart-type ids may start with a digit (e.g. '100pct-stacked-bar'). |\n| `name` | yes | `string` | Human-readable name shown in pickers. |\n| `file` | yes | `string` | Filename of the full record, relative to this index file's directory. |\n| `deprecated` | no | `const:true` | Present on the entry of a record that carries `deprecation`. Pickers and default listings hide deprecated entries; the id keeps resolving. |\n| `replacedBy` | no | `string` | The deprecated record's `deprecation.replacedBy`, repeated so a picker can offer the replacement without loading the record. |\n\n## Catalog Snapshot Manifest\n\n- File: `spec/schemas/catalog-manifest.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-catalog-manifest/v1`\n- Type: `object`\n- Required fields: `$schema`, `description`, `publisher`, `source`, `kinds`\n- Purpose: Shape of the `manifest.json` of the @openpresentation/gallery package (packages/gallery/catalog/manifest.json), which pins the snapshot of the default OPF catalog published by pptx.gallery. It records the gallery commit the snapshot came from and, per kind, how the snapshot relates to the published catalog plus a content hash of the bundled records. Written by scripts/sync-gallery-catalog.mjs and checked by scripts/check-spec-integrity.mjs; see docs/default-catalog.md. This schema describes a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-catalog-manifest/v1\"` | |\n| `description` | yes | `string` | |\n| `publisher` | yes | `string` | Base URL of the default-catalog publisher. Each kind is published at `<publisher>/<kind>/index.json`. |\n| `source` | yes | `object` | The published catalog files the snapshot was taken from. |\n| `kinds` | yes | `object` | One entry per catalog kind, keyed by the kind's URL segment. |\n\n### Nested Types\n\n#### KindEntry\n\n- Type: `object`\n- Required fields: `mode`, `records`, `contentSha256`, `gallery`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `mode` | yes | `enum:mirror` | Always 'mirror': the snapshot holds every record the publisher serves for the kind (OPF 0.15). |\n| `records` | yes | `integer` | Number of records bundled for this kind. |\n| `contentSha256` | yes | `string` | contentSha256 of the bundled records, as defined by the catalog index schema. |\n| `gallery` | yes | `object` | The published catalog for this kind at the pinned commit. |\n\n## Chart Type\n\n- File: `spec/schemas/chart-type.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-chart-type/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `mappings`\n- Purpose: Schema for chart-type records: display metadata for chart pickers (name, group, expected series, complexity) and the Open XML mapping a picker can describe. One record per chart type that OPF supports natively in its preview and PPTX export, plus the column-and-line combination 'combo'. A document's chart.type is an engine vocabulary validated directly; engines never look a chart-type record up. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.ch...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-chart-type/v1\"` | Identifies this record as a chart type in the open presentation catalog. |\n| `id` | yes | `string` | The chart-type value (`chart.type`) this record describes. Lowercase kebab-case; it may start with a digit (e.g., '100pct-stacked-column') to mirror conventional chart naming. |\n| `name` | yes | `string` | Human-readable name of the chart type, as a chart picker shows it. |\n| `summary` | no | `string` | One-sentence positioning: when to reach for this chart variant. |\n| `description` | no | `string` | Longer prose describing the chart and ideal use cases. |\n| `mappings` | yes | `ref:ChartTypeMappings` | Canonical and optional renderer-specific mappings used by engines to render this chart type. |\n| `group` | no | `string` | Top-level grouping in the chart picker. |\n| `groupSort` | no | `integer` | Display ordering hint within the chart group. |\n| `complexity` | no | `enum:simple \\| calculated \\| hierarchical \\| normalized` | Shape of the underlying data: a flat series ('simple'), one with engine-side calculation ('calculated'), parent-child rows ('hierarchical'), or pre-normalized rows ('normalized'). The editor offers only 'simple' types... |\n| `series` | no | `integer` | Number of data series this chart type expects: exactly that many, except that a stacked or percent-stacked type and a combination (composition 'mixed', such as combo) expect at least that many. The editor offers a typ... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n### Nested Types\n\n#### ChartTypeMappings\n\n- Type: `object`\n- Required fields: `openxml`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `openxml` | yes | `ref:OpenXmlChartMapping` | Canonical mapping to Open XML chart structures. |\n| `renderers` | no | `object` | Optional renderer-specific mappings. Keys are renderer ids; values are intentionally opaque to OPF. The bundled catalog records carry none. |\n\n#### OpenXmlChartMapping\n\n- Type: `object`\n- Required fields: none\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `element` | no | `string` | Primary Open XML chart element or extension chart element, such as 'barChart', 'lineChart', 'pieChart', 'treemapChart', or 'waterfallChart'. |\n| `barDir` | no | `enum:bar \\| col` | Bar direction for Open XML barChart mappings. |\n| `grouping` | no | `enum:standard \\| clustered \\| stacked \\| percentStacked` | Open XML chart grouping value when the chart family supports grouping. |\n| `marker` | no | `boolean` | Whether the chart type expects visible data markers. |\n| `radarStyle` | no | `enum:standard \\| marker \\| filled` | Open XML radarStyle value for radarChart mappings. |\n| `scatterStyle` | no | `enum:line \\| lineMarker \\| marker \\| smooth \\| smoothMarker` | Open XML scatterStyle value for scatterChart mappings. |\n| `composition` | no | `enum:single \\| mixed \\| extension` | Whether the chart maps to one standard chart element, multiple combined chart elements, or an Open XML extension chart. |\n| `extension` | no | `string` | Optional Open XML extension namespace or element hint for extension charts. |\n| `series` | no | `array<ref:OpenXmlChartMapping>` | Open XML chart elements used by mixed/composite chart types. |\n| `notes` | no | `string` | Short implementation note for mappings that need renderer interpretation. |\n\n## Color Scheme\n\n- File: `spec/schemas/color-scheme.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-color-scheme/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for color-scheme records. Each scheme is a named palette with the twelve PowerPoint color slots (six accents, two darks, two lights, plus hyperlink and followed-hyperlink), suitable for being mapped directly into OOXML theme XML. Documents reference a scheme from design.colorScheme (or design.colorScheme.id) and from a theme's colorScheme; slot overrides on design.colorScheme take precedence over the resolved scheme. The slot fields here mirror the inline-override fields on the in-docu...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-color-scheme/v1\"` | Identifies a published record file as a colour scheme record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The colour scheme's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without t... |\n| `name` | yes | `string` | Human-readable scheme name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the palette what mood it evokes and where to use it. |\n| `description` | no | `string` | Longer prose describing the palette and its intended use. |\n| `accent1` | no | `ref:HexColor` | Accent 1 color (hex). Mirrors the OOXML accent1 slot. |\n| `accent2` | no | `ref:HexColor` | Accent 2 color (hex). Mirrors the OOXML accent2 slot. |\n| `accent3` | no | `ref:HexColor` | Accent 3 color (hex). Mirrors the OOXML accent3 slot. |\n| `accent4` | no | `ref:HexColor` | Accent 4 color (hex). Mirrors the OOXML accent4 slot. |\n| `accent5` | no | `ref:HexColor` | Accent 5 color (hex). Mirrors the OOXML accent5 slot. |\n| `accent6` | no | `ref:HexColor` | Accent 6 color (hex). Mirrors the OOXML accent6 slot. |\n| `dark1` | no | `ref:HexColor` | Dark 1 color (hex). Typically the deepest neutral; OOXML dark1. |\n| `dark2` | no | `ref:HexColor` | Dark 2 color (hex). Secondary dark; OOXML dark2. |\n| `light1` | no | `ref:HexColor` | Light 1 color (hex). Typically the slide canvas; OOXML lt1. |\n| `light2` | no | `ref:HexColor` | Light 2 color (hex). Secondary light surface; OOXML lt2. |\n| `hyperlink` | no | `ref:HexColor` | Hyperlink color (hex). OOXML hlink. |\n| `followedHyperlink` | no | `ref:HexColor` | Followed-hyperlink color (hex). OOXML folHlink. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n### Nested Types\n\n#### HexColor\n\n- Type: `string`\n- Required fields: none\n- Purpose: Hex color: '#RGB', '#RRGGBB' or '#RRGGBBAA'. The same definition as HexColor in opf.schema.json.\n\n_No named properties._\n\n## Font Scheme\n\n- File: `spec/schemas/font-scheme.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-font-scheme/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `major`, `minor`\n- Purpose: Schema for font-scheme records. Each scheme pairs a major (heading) and minor (body) font family in the OOXML majorFont/minorFont sense, scoped to a target app (powerpoint or google-slides) and a language family (Latin, East Asian, or Complex Script). Documents reference a scheme from design.fontScheme (or design.fontScheme.id), from a theme's fontScheme and from a language's fontScheme / googleFontScheme. Role overrides on design.fontScheme (heading, body, accent, code), each a font family n...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-font-scheme/v1\"` | Identifies a published record file as a font scheme record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The font scheme's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without thi... |\n| `name` | yes | `string` | Human-readable scheme name shown in pickers. |\n| `major` | yes | `string` | Heading (major) font family mirrors the OOXML majorFont entry. |\n| `minor` | yes | `string` | Body (minor) font family mirrors the OOXML minorFont entry. |\n| `code` | no | `string` | Optional monospaced font family name for code blocks and for inline code runs (TextRun.code). It has the same shape as the OPF FontScheme 'code' role, so a record and an inline design.fontScheme override are interchan... |\n| `eastAsian` | no | `object` | East Asian script fonts. Maps to the OOXML a:ea element of majorFont (major) and minorFont (minor), and to run-level a:ea. When set, they fill the eastAsian slot for every language; when omitted, the slot comes from t... |\n| `complexScript` | no | `object` | Complex-script fonts (for example Arabic, Hebrew, Indic and Thai). Maps to the OOXML a:cs element of majorFont (major) and minorFont (minor), and to run-level a:cs. When set, they fill the complexScript slot for every... |\n| `type` | no | `enum:sans-serif \\| serif \\| monospace` | High-level typographic class of the scheme. |\n| `app` | no | `enum:powerpoint \\| google-slides` | Target application this font pairing is intended for. Metadata for pickers and catalog filters: no engine changes its output by it. |\n| `languageFamily` | no | `enum:latin \\| ea \\| cs \\| eastAsian \\| complexScript` | Font-language family this scheme is intended for: 'latin' for Latin-script content, 'ea' (or 'eastAsian', the same value) for East Asian scripts, 'cs' (or 'complexScript', the same value) for Complex Scripts. The long... |\n| `languages` | no | `array<string>` | Optional list of BCP-47 language tags this scheme is curated for. Useful for picker UIs that group fonts by language coverage. As the design font scheme, an 'ea' or 'cs' scheme fills its script slot only when this lis... |\n| `textSample` | no | `string` | Short specimen string used by picker UIs to preview the scheme. |\n| `summary` | no | `string` | One-sentence positioning of the font pairing. |\n| `description` | no | `string` | Longer prose describing the font scheme and where it shines. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n## Icon Set\n\n- File: `spec/schemas/icon-set.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-icon-set/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `license`, `copyright`, `viewBox`, `style`, `icons`\n- Purpose: Schema for icon-set records: one set of icons that share a viewBox and a style, each icon as SVG path data. An OPF `icon` names one as `<set>:<name>` (docs/icons.md). @openpresentation/gallery ships Lucide and Tabler outline, generated from their npm packages; a host registers them as `galleryIconSets()` of `@openpresentation/gallery/icon-sets` and loads only the icons a deck uses, and a document embeds only the icons it uses under `catalogs.<group>.iconSets.<id>` (a record without `$schema`,...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-icon-set/v1\"` | Identifies this record as an icon set. |\n| `id` | yes | `string` | The set's id, the part of an icon reference before the colon. `asset` is not a set id: `asset:<id>` is an asset reference. |\n| `name` | yes | `string` | Human-readable set name shown in pickers. |\n| `summary` | no | `string` | One line on what the set looks like. |\n| `version` | no | `string` | The version of the source the icons were taken from, such as the npm package version. |\n| `package` | no | `string` | The npm package the icons were generated from. |\n| `homepage` | no | `string` | Where the set is published. |\n| `license` | yes | `string` | The SPDX license id of the icons. |\n| `copyright` | yes | `string` | The copyright notice the license asks every copy to keep. |\n| `licenseText` | no | `string` | The full license text, as the source package ships it. |\n| `viewBox` | yes | `array<unknown>` | The one viewBox every icon of the set is drawn in: min-x, min-y, width, height. |\n| `style` | yes | `enum:stroke \\| fill` | How a string icon draws: `stroke` strokes its path at `strokeWidth` with no fill, `fill` fills it (nonzero rule). |\n| `strokeWidth` | no | `number` | The stroke width in viewBox units (stroke sets). Default 2. |\n| `strokeLinecap` | no | `enum:butt \\| round \\| square` | The stroke's line caps. Default round. |\n| `strokeLinejoin` | no | `enum:miter \\| round \\| bevel` | The stroke's line joins. Default round. |\n| `icons` | yes | `object` | The icons by name. A string is the icon's path data, drawn as `style` says; an object separates the parts a stroke set strokes (`stroke`) from those it fills (`fill`). Every icon is one color: the engines draw it in t... |\n| `tags` | no | `object` | Search keywords by icon name, from the source package: what an icon search (the MCP's search_icons, pptx.gallery) matches besides the name. |\n\n## Language\n\n- File: `spec/schemas/language.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-language/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `bcp47`\n- Purpose: Schema for language records: display metadata for the language pickers of authoring tools (name, ISO code, the default font schemes a picker suggests). The document's 'language' is an engine vocabulary, a BCP-47 tag validated directly; engines never look a language record up, and their script, direction, OOXML tag and default script fonts come from spec/reference/engine-vocabularies.json. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.languages.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-language/v1\"` | Identifies this record as a language in the openpresentation.org catalog. |\n| `id` | yes | `string` | The record's id in the gallery's language catalog, lowercase kebab-case. Documents name a language by its BCP-47 tag ('bcp47'), never by this id. |\n| `name` | yes | `string` | Human-readable language name. |\n| `code` | no | `string` | ISO 639-3 (or 639-2) three-letter language code. Carried for engines that prefer ISO codes. |\n| `bcp47` | yes | `string` | BCP-47 language tag for this record. Use 'en-GB' for UK English; 'en-UK' is not a valid BCP-47 region form. |\n| `ooxmlLang` | no | `string` | Curated culture tag for OOXML text-run language attributes (a:rPr/@lang, a:endParaRPr/@lang), in the language-[Script-]REGION form Office recognizes (e.g. 'ja-JP', 'ar-SA', 'ms-MY', 'nb-NO', 'fil-PH', 'zh-CN'). Engine... |\n| `direction` | no | `enum:ltr \\| rtl` | Base text direction for the language. When omitted, engines derive it from the script: Arabic (Arab), Hebrew (Hebr), Syriac (Syrc), Thaana (Thaa), N'Ko (Nkoo), Adlam (Adlm), Samaritan (Samr), Mandaic (Mand) and Hanifi... |\n| `script` | no | `string` | ISO 15924 script code of the language's writing system. The script selects the OOXML font slot the language's text uses: East Asian scripts (Hans, Hant, Hani, Jpan, Kore, Hang, Hira, Kana, Bopo, Yiii) use the eastAsia... |\n| `fontScheme` | no | `string` | The font-scheme id a picker suggests for this language when targeting PowerPoint output. Display metadata: engines take a language's default script fonts from their own vocabulary. |\n| `googleFontScheme` | no | `string` | The font-scheme id a picker suggests for this language when targeting Google Slides output. Display metadata. |\n| `summary` | no | `string` | One-sentence note about coverage or font defaults. |\n| `description` | no | `string` | Longer prose describing the language record and any font-pairing rationale. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n## Layout Preview Index\n\n- File: `spec/schemas/layout-preview-index.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-layout-preview-index/v1`\n- Type: `object`\n- Required fields: `$schema`, `version`, `description`, `records`\n- Purpose: Shape of previews/layouts/index.json in @openpresentation/gallery 2: one self-contained SVG preview per v2 intent layout, keyed by the matching catalog layout id. Each record names its SVG file and exact UTF-8 byte length. The gallery package owns the files; this checkout materializes ignored copies under packages/gallery/previews/layouts/. This internal index schema is excluded from the package's published/typed schema surface.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-layout-preview-index/v1\"` | |\n| `version` | yes | `const:\"2\"` | Index format version, as a string. |\n| `description` | yes | `string` | Human-readable description of the preview gallery and its rendering conventions. |\n| `records` | yes | `array<ref:PreviewRecord>` | One entry per v2 layout and its SVG preview. |\n\n### Nested Types\n\n#### PreviewRecord\n\n- Type: `object`\n- Required fields: `id`, `file`, `bytes`\n- Purpose: One layout template preview.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | The matching layout record id, such as cover, chart or two-column. |\n| `file` | yes | `string` | SVG filename, relative to this index directory, using the matching layout id. |\n| `bytes` | yes | `integer` | Exact UTF-8 byte length of the referenced SVG file. |\n\n## Slide Layout\n\n- File: `spec/schemas/layout.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-layout/v2`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `regions`\n- Purpose: Schema for slide-layout records. A layout is one ordered list of regions, declared once, in reading order: 'direction' says whether the record's 'regions' sit side by side (row) or are stacked (column), and each region says which content kinds it takes and how several blocks share it. A split is an entry that nests a second list the other way, which is how a layout gets two dimensions. 'title' and 'subtitle' are reserved heading regions. Engines compile the list into a grid of tracks (the gui...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-layout/v2\"` | Identifies a published record file as a layout template. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The layout's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this fie... |\n| `name` | yes | `string` | Human-readable layout name, shown in layout pickers and as the PowerPoint layout name. |\n| `summary` | no | `string` | One-sentence positioning of the layout when to reach for it. |\n| `description` | no | `string` | Longer prose describing the layout structure and ideal use cases. |\n| `design` | no | `ref:DesignHints` | The layout's design defaults, with the same keys and values as the deck's design and a slide's design (a slide overrides exactly what its layout sets, by the same name). An absent key means the layout has no opinion.... |\n| `direction` | no | `enum:row \\| column` | How the record's 'regions' are laid out: 'row' places them side by side from the start edge in reading order (left to right; right to left in a right-to-left deck); 'column' stacks them top to bottom. Default 'column'. |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the content of every body region when it is shorter than the region. A split's 'anchor' replaces it for the regions under that split, and a region's own 'anchor' replaces both. Only 'anchor' is in... |\n| `regions` | yes | `array<ref:RegionEntry>` | The record's regions in reading order: 1 to 12 entries, each a region ({ name, size?, ...rules }) or a split ({ direction, regions, size?, anchor? }). Every region is declared once, here, with its content rules; a blo... |\n| `overflowRegion` | no | `string` | The region where content that no region accepts goes, whatever its 'accepts', while it has room; content beyond every region's room is drawn there too, with the warning opf/layout-unplaced. Omitted: the first primary... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n| `composition` | no | `ref:Composition` | Only 'gap', 'padding', 'minFontSize' and 'overflow', with their 0.18 meaning. A template's regions replace composition.mode, columns and weights. |\n\n### Nested Types\n\n#### RegionEntry\n\n- Type: `oneOf:ref:HeadingRegion / ref:Region / ref:Split`\n- Required fields: none\n- Purpose: One entry of a regions list: a heading region, a body region or a split.\n\n_No named properties._\n\n#### RegionSize\n\n- Type: `oneOf:number / const:\"auto\"`\n- Required fields: none\n- Purpose: The region's or split's share along its parent's direction: a number above 0 and up to 100 that siblings share in proportion (the gap is taken out first), default 1; or 'auto', the length the content needs at the starting text size (up to the space the heading rows and the content of the numeric rows leave; auto rows that do not all fit shrink together, each giving up the same fraction of what it can give up above...\n\n_No named properties._\n\n#### HeadingRegion\n\n- Type: `object`\n- Required fields: `name`\n- Purpose: A reserved heading region: 'title' holds the slide's heading group (tag, title and subtitle, stacked) and 'subtitle' takes the subtitle out of it. A heading region takes a size and an anchor, and the 'title' a rule; the content rules belong on body regions. At most one of each; a 'subtitle' needs a 'title'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | yes | `enum:title \\| subtitle` | 'title' or 'subtitle'. |\n| `size` | no | `ref:RegionSize` | |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the heading group in its area when the area is sized (a number): 'middle' (default) centers it, 'bottom' sets it at the foot of the area, as a cover or section sets its display title low, 'top' at... |\n| `rule` | no | `boolean` | 'title' only: draw a short accent rule (80 by 5 px at a 720 px short edge) half a gap above the title, at the title's start edge, on a slide with a title and no tag; a tag is the group's eyebrow and takes the rule's p... |\n\n#### Split\n\n- Type: `object`\n- Required fields: `direction`, `regions`\n- Purpose: A split nests a list of regions the other way inside one cell of its parent: a row of regions inside a column, or a column inside a row. It has no name; its regions are declared in reading order like the record's own. Splits nest at most three levels (the record's own list is level 1).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `direction` | yes | `enum:row \\| column` | How the split's 'regions' are laid out: 'row' side by side, 'column' stacked. |\n| `regions` | yes | `array<ref:RegionEntry>` | The split's regions in reading order: 1 to 12 regions and splits. |\n| `size` | no | `ref:RegionSize` | |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the content of every body region under this split, unless the region sets its own. The heading regions 'title' and 'subtitle' never inherit it. |\n\n#### Region\n\n- Type: `allOf:schema`\n- Required fields: `name`\n- Purpose: One body region of a layout: its name, its share of the space and the rules for which content it takes and how several blocks share it.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | yes | `string` | The region's name, lowercase kebab-case, unique across the whole record. A block targets it with 'region': '<name>'. It may not be 'title' (those are heading regions), 'tag', 'auto' or one of the promoted-region words... |\n| `size` | no | `ref:RegionSize` | |\n| `accepts` | no | `array<enum:text \\| list \\| image \\| video \\| chart \\| table \\| code \\| metric \\| quote \\| timeline \\| diagram \\| shape \\| group>` | Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A region that takes 'image' also takes a shape block. A group is also accepted where every one of its leaf kinds... |\n| `role` | no | `enum:primary \\| secondary \\| media \\| supporting` | Which content the region wants first. Binding gives a picture (image, video) to a media region first, then primary, secondary, supporting; every other kind to a primary region first, then secondary, supporting, media;... |\n| `flow` | no | `enum:none \\| grid \\| column \\| auto` | How several blocks share the region: 'none' one block fills it (blocks no region had room for join it, up to 6, and it flows as 'auto'); 'grid' by count (1 fills, 2 side by side, 3 in a row, 4 as 2 x 2, 5 as 3 + 2, 6... |\n| `max` | no | `integer` | Blocks the region holds on one slide. Default 1 for flow 'none' (which requires 1), else 6. Content beyond every region's room is drawn in the overflow region with the warning opf/layout-unplaced, and paginate moves i... |\n| `bleed` | no | `boolean` | The region's outer edges that lie on the content box's edge extend to the slide edge, as a placed image does. A bled region is never drawn as a card. Default false. |\n| `listColumns` | no | `oneOf:const:\"auto\" / const:1` | 'auto': a list in the region that does not fit its cell at the starting size (a lone list, or one of several blocks) flows into up to three columns before it shrinks, as a list payload's columns: 'auto'; a list of 6 o... |\n| `metrics` | no | `enum:stack \\| tile` | How a metric block in the region is laid out. 'stack' (default): value, unit, label and the rest as one block at the region's anchor and content alignment. 'tile': the metric fills its cell (its card when the layout d... |\n| `sequence` | no | `enum:steps \\| numbered` | The region lists the steps of a sequence. 'steps': two or more text or list blocks are the steps, each under a numbered badge (an accent circle with its numeral; a one-entry numbered list gives the badge its number an... |\n| `arrangement` | no | `enum:pyramid \\| matrix \\| cycle \\| chevrons \\| flow \\| vertical-flow \\| org-chart \\| hierarchy \\| venn` | The region draws its lone list of one level as a diagram (docs/smartart.md), in the first design that holds every entry at one size, the list's role size or larger (up to 1.5 times), never smaller: PowerPoint's own ge... |\n| `pyramidDirection` | no | `enum:up \\| down` | For arrangement 'pyramid': 'up' (default) puts the narrow tip first, at the top; 'down' puts the widest level first and the tip at the bottom. Entries retain their authored top-to-bottom order. Both the continuous and... |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the region's content when it is shorter than the region. Replaces the 'anchor' of the record and of the splits around it. Default: the nearest of those that sets one, else 'top'. A picture shown w... |\n| `empty` | no | `enum:collapse \\| keep` | What the region does on a slide that gives it no content: 'collapse' (default) joins its cells to a neighbouring area that shares the full length of one of its edges and is not itself empty; 'keep' leaves the space. |\n\n#### DesignHints\n\n- Type: `object`\n- Required fields: none\n- Purpose: Design hints a layout carries. The keys and lowercase values are those of the deck's design and a slide's design in opf.schema.json (Design), so a slide overrides a layout by the same name and layout.design can be copied into slide.design unchanged. An absent key means the layout has no opinion. Only the keys the layout sets are stored. scripts/check-spec-integrity.mjs verifies that every key here has the same typ...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `titleAlignment` | no | `enum:start \\| center \\| end` | Horizontal alignment of the title heading area. Logical, as design.titleAlignment of a deck: 'start' is the edge a paragraph starts on. |\n| `contentAlignment` | no | `enum:start \\| center \\| end` | Horizontal alignment of the body regions. Logical, as design.contentAlignment of a deck: 'start' is the edge a paragraph starts on. |\n| `contentBox` | no | `boolean` | Whether the body regions are drawn inside a visible card or surface. |\n| `contentDirection` | no | `enum:horizontal \\| vertical` | Axis along which parallel body content is arranged: 'vertical' is a column, 'horizontal' a row. On a layout slide it turns every flowing region into one row or one column; the slide's own composition.mode, columns and... |\n| `chartPrimary` | no | `enum:none \\| top \\| bottom \\| start \\| end` | Where the primary chart sits relative to supporting content on automatic slides. Template layouts express this arrangement with their regions; chartPrimary does not override a template. |\n| `imageFit` | no | `enum:cover \\| contain \\| stretch \\| auto` | Default fit of the slide's image blocks: 'cover' fills the frame and crops around focus, 'contain' shows the whole picture, 'stretch' scales it to the frame, 'auto' covers when the crop keeps at least 85% of the pictu... |\n| `listBullet` | no | `enum:character \\| image \\| none` | Marker style of lists: 'character' draws the glyph, 'image' draws the deck's icon logo as a picture bullet, 'none' draws no marker and no hanging indent (label-and-description lists). |\n| `listStyle` | no | `enum:stack \\| rows` | As design.listStyle of a deck: 'stack' or 'rows' (ruled rows) for the lists of slides using this layout. |\n| `mirror` | no | `boolean` | Draw the layout mirrored: each row's cells and the column sizes reversed, so a 'beside' layout puts its picture, chart or table at the end. Logical: a right-to-left deck mirrors on top. Binding and reading order do no... |\n| `variant` | no | `oneOf:ref:ColorVariantSlot / ref:ColorVariant / ref:LayoutVariantRole` | The color variant slides on this layout draw on: a background slot ('accent1', 'dark1', ...) or the ColorVariant object, as design.variant, or a value relative to the deck's own variant (LayoutVariantRole: 'surface',... |\n\n#### LayoutVariantRole\n\n- Type: `enum:surface | brand`\n- Required fields: none\n- Purpose: A layout variant relative to the deck's own variant. 'surface' is the deck's secondary surface on its own side: light2 on a light deck and dark2 on a dark one (light1 or dark1 where the deck is already on light2 or dark2), so a statement stands off the deck without changing its tone. 'brand' is the scheme's brand dark, dark2 (dark1 where the deck is already on dark2), with light text: a closing slide's strong surf...\n\n_No named properties._\n\n#### Composition\n\n- Type: `object`\n- Required fields: none\n- Purpose: A template's composition: only gap, padding, minFontSize and overflow, with their 0.18 meaning. A slide's composition overrides them; a slide's composition.mode, columns and weights arrange its first primary flowing region.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `gap` | no | `number` | Space between cells as a fraction of the container short edge (canvas at slide root). Default 0.03333333333333333. |\n| `padding` | no | `number` | Inset as a fraction of the container short edge. Default 0.08 on a slide, 0 inside a group. |\n| `minFontSize` | no | `number` | Minimum readable text size in reference pixels at a 720-pixel canvas short edge. Default 16. Overflow is diagnosed when text cannot fit at this size. |\n| `overflow` | no | `enum:warn \\| error` | warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn. |\n\n## Narrative Template\n\n- File: `spec/schemas/narrative.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-narrative/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `beats`\n- Purpose: Schema for narrative records. A narrative is a plan: a named story arc (e.g. 'problem-solution', 'scqa') as an ordered list of beats, each saying what its slide must do. A document points at one with the string 'narrative' and links its slides to beats with 'slides[].beat'; a narrative the document defines itself is a record in catalogs.custom.narratives. Core validate warns about a 'slides[].beat' id the resolved narrative does not define (opf/unknown-beat) and about a root 'duration' outsid...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-narrative/v1\"` | Identifies a published record file as a narrative record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The narrative's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this... |\n| `name` | yes | `string` | Human-readable template name, e.g. 'Problem Solution'. |\n| `summary` | no | `string` | One-sentence description of when and why to use this narrative. |\n| `description` | no | `string` | Longer prose describing the narrative arc and ideal use cases. Used by AI-driven generation to seed deck-level direction. |\n| `audienceFit` | no | `array<string>` | Audiences this narrative works well for, e.g. ['executive', 'investor', 'customer']. |\n| `duration` | no | `object` | Typical talk length this narrative suits, as a range in minutes. A deck's own target is the root 'duration' (one number); core validate warns when that target lies outside this range, and when 'min' is greater than 'm... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search, e.g. ['business', 'pitch', 'internal']. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n| `beats` | yes | `array<ref:Beat>` | Ordered list of beats that make up the narrative arc. |\n\n### Nested Types\n\n#### Beat\n\n- Type: `object`\n- Required fields: `id`, `name`\n- Purpose: A single narrative beat a labeled segment of the story arc with a specific dramatic purpose. One beat is one slide: 'type' is that slide's Slide.type and 'layout' is its Slide.layout, so a planner copies them straight into a skeleton deck. Split a heavy beat into several beats rather than giving it several slides.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable slug used by Slide.beat to reference this beat. Lowercase kebab-case. |\n| `name` | yes | `string` | Human-readable beat name, e.g. 'The Problem'. |\n| `description` | no | `string` | Curator-written prose that explains what this beat should accomplish. |\n| `instructions` | no | `string` | Short author-facing instruction for the beat typically one phrase. Complements 'description' with a concise directive. |\n| `type` | no | `enum:text \\| list \\| image \\| video \\| chart \\| table \\| code \\| metric \\| quote \\| timeline \\| diagram` | Default content kind for the beat's slide: the same values as Slide.type. Helps engines and planners choose a layout when only the beat is known. |\n| `layout` | no | `string` | Suggested layout id for the beat's slide, e.g. 'section-divider', 'title-slide', 'text-left'. Resolves the same way as Slide.layout against catalogs.layouts and the default catalog at https://www.pptx.gallery/layouts. |\n| `thoughtCues` | no | `array<string>` | Optional speaker or thinking cues for the beat: questions the slide should answer. A planner or author turns them into the slide's notes; no engine copies them there on its own. |\n\n## Purpose\n\n- File: `spec/schemas/purpose.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-purpose/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for purpose records. Each record names a presentation objective such as informing, aligning, persuading, driving a decision, or selling. Documents reference a purpose from 'purpose', which also accepts free-form text and inline Purpose objects. A document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines never fetch a catalog. A published record file carries '$schema' a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-purpose/v1\"` | Identifies a published record file as a purpose record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The purpose's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this fi... |\n| `name` | yes | `string` | Human-readable purpose name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the purpose what this deck is trying to accomplish. |\n| `description` | no | `string` | Longer prose describing when to use this purpose and how it should shape a deck. |\n| `outcome` | no | `string` | Desired audience outcome after the presentation. |\n| `successCriteria` | no | `array<string>` | Observable signals that the deck accomplished this purpose. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: ids of narratives in the same catalog that work well for this purpose. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: ids of tones in the same catalog that work well for this purpose. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional. |\n\n## Social Platform\n\n- File: `spec/schemas/social-platform.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-social-platform/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for social-platform records: display metadata for authoring UIs (name, brand color, handle example) alongside the URL patterns. The keys of a Socials object are an engine vocabulary validated directly; engines link a handle with the patterns in spec/reference/engine-vocabularies.json and never look a social-platform record up. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.socialPlatforms.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-social-platform/v1\"` | Identifies this record as a social-platform entry in the openpresentation.org catalog. |\n| `id` | yes | `string` | The social platform's key, as written in a Socials object. Lowercase kebab-case. |\n| `name` | yes | `string` | Human-readable platform name shown in pickers and footers. |\n| `summary` | no | `string` | One-sentence positioning of the platform what it's used for and who's on it. |\n| `description` | no | `string` | Longer prose describing the platform and any rendering conventions (e.g., handle prefixes, distributed instances). |\n| `baseUrl` | no | `string` | Canonical base URL of the platform used as the prefix when normalizing handles to full URLs. |\n| `profileUrlPattern` | no | `string` | URL pattern for individual member profiles. Use '{handle}' as the placeholder for the handle (with the prefix already stripped). |\n| `companyUrlPattern` | no | `string` | Optional URL pattern for organization / company pages, when the platform distinguishes them from member profiles. Use '{handle}' as the placeholder. |\n| `handlePrefix` | no | `string` | Conventional prefix character displayed before the handle (e.g. '@' for X / Mastodon / Threads / TikTok). Empty string when no prefix is used. Renderers strip it before substituting into URL patterns. |\n| `handleExample` | no | `string` | Example handle in its conventional rendered form, used by picker UIs and validation hints. |\n| `brandColor` | no | `string` | Brand color (hex) for branded icon chips, link styling, or section accents in authoring UIs. Catalog metadata: engines do not draw it. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n## Theme\n\n- File: `spec/schemas/theme.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-theme/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for theme records. Each theme is a small, named bundle that pairs a color scheme, a font scheme, a default theme-controlled background, and a slide size. Documents reference a theme from design.theme; design.colorScheme, design.fontScheme, design.background and design.dimensions take precedence over the resolved theme. The theme's own colorScheme and fontScheme references resolve in the theme's group first, so a catalog's theme finds that catalog's schemes. A document references a reco...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-theme/v1\"` | Identifies a published record file as a theme record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The theme's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this field. |\n| `name` | yes | `string` | Human-readable theme name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the theme when to reach for it. |\n| `description` | no | `string` | Longer prose describing what the theme looks and feels like and the kinds of decks it suits. |\n| `colorScheme` | no | `string` | The theme's default colour scheme: a reference (a bare id or 'name:id') resolved like design.colorScheme, but in the theme's own catalogs group first. |\n| `fontScheme` | no | `string` | The theme's default font scheme: a reference (a bare id or 'name:id') resolved like design.fontScheme, but in the theme's own catalogs group first. |\n| `background` | no | `ref:ThemeBackground` | |\n| `variants` | no | `array<ref:ThemeVariant>` | The color variants the theme offers (OPF 0.23), for example light, light-alt, dark and dark-alt: named values of design.variant over the theme's one color scheme, so a dark deck is a variant of a theme and not a theme... |\n| `dimensions` | no | `enum:16:9 \\| 4:3 \\| 16:10 \\| 1:1 \\| 4:5 \\| 9:16 \\| letter \\| a4 \\| widescreen \\| standard` | Default slide size for this theme. Accepts the same preset values as design.dimensions.preset. |\n| `design` | no | `object` | The theme's design defaults (OPF 0.19), so a house style such as boxed content or centred titles is set once: the keys and values of the deck's design for titleAlignment, contentAlignment, contentBox, contentDirection... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n### Nested Types\n\n#### ThemeVariant\n\n- Type: `object`\n- Required fields: `id`, `name`, `variant`\n- Purpose: One named color variant of a theme.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | The variant's id within the theme, lowercase kebab-case. |\n| `name` | yes | `string` | Human-readable variant name shown in pickers. |\n| `variant` | yes | `oneOf:ref:ColorVariantSlot / ref:ColorVariant` | The value design.variant takes when the variant is chosen: a background slot ('light1', 'light2', 'dark1', 'dark2', or an accent 'accent1' to 'accent6'; the same as { background: slot }) or the ColorVariant object of... |\n\n#### ThemeBackgroundSlot\n\n- Type: `enum:light1 | light2 | dark1 | dark2`\n- Required fields: none\n- Purpose: PowerPoint theme-controlled slide background slot from the active color scheme. These are slots, not assumptions about actual colors: light1 is usually white and dark1 is usually black by convention, but the color scheme controls the real values.\n\n_No named properties._\n\n#### ThemeBackground\n\n- Type: `object`\n- Required fields: `type`, `slot`\n- Purpose: Theme-controlled PowerPoint slide background. The slot is resolved through the active color scheme and remains theme-aware.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"theme\"` | Theme-controlled background fill. |\n| `slot` | yes | `ref:ThemeBackgroundSlot` | |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). Default 1; the selected theme slot remains unchanged. |\n\n## Tone\n\n- File: `spec/schemas/tone.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-tone/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for tone records. Each record names a presentation tone (e.g. 'formal', 'casual', 'inspirational') and carries voice cues, anti-patterns, and sample phrases that AI-driven generation uses to shape output. Documents reference a tone from 'tone'. A document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines never fetch a catalog. A published record file carries '$schema' a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-tone/v1\"` | Identifies a published record file as a tone record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The tone's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this field. |\n| `name` | yes | `string` | Human-readable tone name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the tone when to reach for it. |\n| `description` | no | `string` | Longer prose describing the tone and the kinds of decks it suits. |\n| `voiceCues` | no | `array<string>` | Short directives that shape AI generation toward this tone. Phrased as imperatives, e.g. 'use second-person', 'favor short sentences', 'lead with the recommendation'. |\n| `avoid` | no | `array<string>` | Anti-patterns that AI generation should not produce when this tone is active. |\n| `samplePhrases` | no | `array<string>` | Short example phrases that exemplify this tone. Used by picker UIs and as few-shot examples for AI generation. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: ids of narratives in the same catalog this tone pairs well with. Used by picker UIs to suggest narratives once a tone is chosen. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional. |\n"
15
+ "markdown": "# OPF Catalog Schema Reference\n\nCatalog records are reusable presets that OPF documents reference by id. This page summarizes every catalog companion schema in `spec/schemas/`. The top-level presentation schema has its own [schema reference](schema-reference.md), and the report format every tool shares has the [validation results reference](finding-schema-reference.md).\n\nOPF documents usually reference these records with string ids such as `design.theme = \"minimal\"`, `tone = \"formal\"`, or `chart.type = \"line\"`. Dense examples may also embed catalog sources or inline records under `catalogs`.\n\n## Audience\n\n- File: `spec/schemas/audience.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-audience/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for audience records. Each record names an audience archetype (e.g. 'executive', 'engineering-team', 'investor') and carries seniority, technical-fluency, decision-power, and attention-budget hints used by AI-driven generation. Documents reference an audience from 'audience', which also accepts free-form text. A document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-audience/v1\"` | Identifies a published record file as a audience record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The audience's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this f... |\n| `name` | yes | `string` | Human-readable audience name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the audience who they are and what they care about. |\n| `description` | no | `string` | Longer prose describing the audience archetype and how to address them. |\n| `seniority` | no | `enum:ic \\| manager \\| director \\| vp \\| c-suite \\| mixed` | Typical seniority level of the audience. Engines use this as a hint for default depth and pacing. |\n| `technicalFluency` | no | `enum:low \\| medium \\| high \\| mixed` | Typical technical fluency of the audience. AI generation uses this to decide whether to expand or assume technical terminology. |\n| `decisionPower` | no | `enum:informational \\| advisory \\| decision-maker` | Whether the audience is expected to be informed, to advise, or to actually decide. Shapes the strength of the closing ask. |\n| `attentionBudgetMinutes` | no | `number` | Realistic upper bound on this audience's focused attention for a single presentation, in minutes. Used as a hint when comparing against duration and the resolved narrative's duration range. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: ids of narratives in the same catalog that work well for this audience. Used by picker UIs to suggest narratives once an audience is chosen. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: ids of tones in the same catalog that work well for this audience. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional. |\n\n## Catalog Index\n\n- File: `spec/schemas/catalog-index.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-catalog-index/v1`\n- Type: `object`\n- Required fields: `$schema`, `version`, `description`, `records`\n- Purpose: Generic shape shared by every `<kind>/index.json` file of the @openpresentation/gallery package (packages/gallery/catalog in the OPF repo) and by the default-catalog index that pptx.gallery publishes at `https://www.pptx.gallery/<kind>/index.json` (the gallery package is a pinned snapshot of that catalog; see docs/default-catalog.md). An index is a lightweight, ordered summary of the full-record JSON files that live alongside it: each entry names the record's stable id, a human-readable name,...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-catalog-index/v1\"` | |\n| `kind` | no | `enum:audiences \\| chart-types \\| color-schemes \\| font-schemes \\| icon-sets \\| languages \\| layouts \\| narratives \\| purposes \\| social-platforms \\| themes \\| tones` | Catalog kind, as the URL segment of the default catalog (`https://www.pptx.gallery/<kind>`) and the `packages/gallery/catalog/<kind>` directory name. |\n| `version` | yes | `string` | Index format version, as a string. |\n| `description` | yes | `string` | Human-readable description of what this catalog kind holds and how entries are ordered. |\n| `contentSha256` | no | `string` | SHA-256 (lowercase hex) of the canonical JSON of the full records this index lists, in index order, with every top-level `x-*` member removed. Canonical JSON sorts object keys and has no insignificant whitespace. Lets... |\n| `records` | yes | `array<ref:IndexRecord>` | Ordered list of lightweight record summaries. Order defines the catalog's canonical/display order; full record data lives in the sibling JSON file named by `file`. |\n\n### Nested Types\n\n#### IndexRecord\n\n- Type: `object`\n- Required fields: `id`, `name`, `file`\n- Purpose: Lightweight summary of one catalog record. Additional per-kind fields (e.g. `summary`, `tags`, `bcp47`, `duration`, `group`, `label`) are allowed and vary by catalog kind.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable identifier, matching the `id` field inside the record file named by `file`. Lowercase kebab-case; chart-type ids may start with a digit (e.g. '100pct-stacked-bar'). |\n| `name` | yes | `string` | Human-readable name shown in pickers. |\n| `file` | yes | `string` | Filename of the full record, relative to this index file's directory. |\n| `deprecated` | no | `const:true` | Present on the entry of a record that carries `deprecation`. Pickers and default listings hide deprecated entries; the id keeps resolving. |\n| `replacedBy` | no | `string` | The deprecated record's `deprecation.replacedBy`, repeated so a picker can offer the replacement without loading the record. |\n\n## Catalog Snapshot Manifest\n\n- File: `spec/schemas/catalog-manifest.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-catalog-manifest/v1`\n- Type: `object`\n- Required fields: `$schema`, `description`, `publisher`, `source`, `kinds`\n- Purpose: Shape of the `manifest.json` of the @openpresentation/gallery package (packages/gallery/catalog/manifest.json), which pins the snapshot of the default OPF catalog published by pptx.gallery. It records the gallery commit the snapshot came from and, per kind, how the snapshot relates to the published catalog plus a content hash of the bundled records. Written by scripts/sync-gallery-catalog.mjs and checked by scripts/check-spec-integrity.mjs; see docs/default-catalog.md. This schema describes a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-catalog-manifest/v1\"` | |\n| `description` | yes | `string` | |\n| `publisher` | yes | `string` | Base URL of the default-catalog publisher. Each kind is published at `<publisher>/<kind>/index.json`. |\n| `source` | yes | `object` | The published catalog files the snapshot was taken from. |\n| `kinds` | yes | `object` | One entry per catalog kind, keyed by the kind's URL segment. |\n\n### Nested Types\n\n#### KindEntry\n\n- Type: `object`\n- Required fields: `mode`, `records`, `contentSha256`, `gallery`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `mode` | yes | `enum:mirror` | Always 'mirror': the snapshot holds every record the publisher serves for the kind (OPF 0.15). |\n| `records` | yes | `integer` | Number of records bundled for this kind. |\n| `contentSha256` | yes | `string` | contentSha256 of the bundled records, as defined by the catalog index schema. |\n| `gallery` | yes | `object` | The published catalog for this kind at the pinned commit. |\n\n## Chart Type\n\n- File: `spec/schemas/chart-type.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-chart-type/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `mappings`\n- Purpose: Schema for chart-type records: display metadata for chart pickers (name, group, expected series, complexity) and the Open XML mapping a picker can describe. One record per chart type that OPF supports natively in its preview and PPTX export, plus the column-and-line combination 'combo'. A document's chart.type is an engine vocabulary validated directly; engines never look a chart-type record up. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.ch...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-chart-type/v1\"` | Identifies this record as a chart type in the open presentation catalog. |\n| `id` | yes | `string` | The chart-type value (`chart.type`) this record describes. Lowercase kebab-case; it may start with a digit (e.g., '100pct-stacked-column') to mirror conventional chart naming. |\n| `name` | yes | `string` | Human-readable name of the chart type, as a chart picker shows it. |\n| `summary` | no | `string` | One-sentence positioning: when to reach for this chart variant. |\n| `description` | no | `string` | Longer prose describing the chart and ideal use cases. |\n| `mappings` | yes | `ref:ChartTypeMappings` | Canonical and optional renderer-specific mappings used by engines to render this chart type. |\n| `group` | no | `string` | Top-level grouping in the chart picker. |\n| `groupSort` | no | `integer` | Display ordering hint within the chart group. |\n| `complexity` | no | `enum:simple \\| calculated \\| hierarchical \\| normalized` | Shape of the underlying data: a flat series ('simple'), one with engine-side calculation ('calculated'), parent-child rows ('hierarchical'), or pre-normalized rows ('normalized'). The editor offers only 'simple' types... |\n| `series` | no | `integer` | Number of data series this chart type expects: exactly that many, except that a stacked or percent-stacked type and a combination (composition 'mixed', such as combo) expect at least that many. The editor offers a typ... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n### Nested Types\n\n#### ChartTypeMappings\n\n- Type: `object`\n- Required fields: `openxml`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `openxml` | yes | `ref:OpenXmlChartMapping` | Canonical mapping to Open XML chart structures. |\n| `renderers` | no | `object` | Optional renderer-specific mappings. Keys are renderer ids; values are intentionally opaque to OPF. The bundled catalog records carry none. |\n\n#### OpenXmlChartMapping\n\n- Type: `object`\n- Required fields: none\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `element` | no | `string` | Primary Open XML chart element or extension chart element, such as 'barChart', 'lineChart', 'pieChart', 'treemapChart', or 'waterfallChart'. |\n| `barDir` | no | `enum:bar \\| col` | Bar direction for Open XML barChart mappings. |\n| `grouping` | no | `enum:standard \\| clustered \\| stacked \\| percentStacked` | Open XML chart grouping value when the chart family supports grouping. |\n| `marker` | no | `boolean` | Whether the chart type expects visible data markers. |\n| `radarStyle` | no | `enum:standard \\| marker \\| filled` | Open XML radarStyle value for radarChart mappings. |\n| `scatterStyle` | no | `enum:line \\| lineMarker \\| marker \\| smooth \\| smoothMarker` | Open XML scatterStyle value for scatterChart mappings. |\n| `composition` | no | `enum:single \\| mixed \\| extension` | Whether the chart maps to one standard chart element, multiple combined chart elements, or an Open XML extension chart. |\n| `extension` | no | `string` | Optional Open XML extension namespace or element hint for extension charts. |\n| `series` | no | `array<ref:OpenXmlChartMapping>` | Open XML chart elements used by mixed/composite chart types. |\n| `notes` | no | `string` | Short implementation note for mappings that need renderer interpretation. |\n\n## Color Scheme\n\n- File: `spec/schemas/color-scheme.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-color-scheme/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for color-scheme records. Each scheme is a named palette with the twelve PowerPoint color slots (six accents, two darks, two lights, plus hyperlink and followed-hyperlink), suitable for being mapped directly into OOXML theme XML. Documents reference a scheme from design.colorScheme (or design.colorScheme.id) and from a theme's colorScheme; slot overrides on design.colorScheme take precedence over the resolved scheme. The slot fields here mirror the inline-override fields on the in-docu...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-color-scheme/v1\"` | Identifies a published record file as a colour scheme record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The colour scheme's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without t... |\n| `name` | yes | `string` | Human-readable scheme name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the palette what mood it evokes and where to use it. |\n| `description` | no | `string` | Longer prose describing the palette and its intended use. |\n| `accent1` | no | `ref:HexColor` | Accent 1 color (hex). Mirrors the OOXML accent1 slot. |\n| `accent2` | no | `ref:HexColor` | Accent 2 color (hex). Mirrors the OOXML accent2 slot. |\n| `accent3` | no | `ref:HexColor` | Accent 3 color (hex). Mirrors the OOXML accent3 slot. |\n| `accent4` | no | `ref:HexColor` | Accent 4 color (hex). Mirrors the OOXML accent4 slot. |\n| `accent5` | no | `ref:HexColor` | Accent 5 color (hex). Mirrors the OOXML accent5 slot. |\n| `accent6` | no | `ref:HexColor` | Accent 6 color (hex). Mirrors the OOXML accent6 slot. |\n| `dark1` | no | `ref:HexColor` | Dark 1 color (hex). Typically the deepest neutral; OOXML dark1. |\n| `dark2` | no | `ref:HexColor` | Dark 2 color (hex). Secondary dark; OOXML dark2. |\n| `light1` | no | `ref:HexColor` | Light 1 color (hex). Typically the slide canvas; OOXML lt1. |\n| `light2` | no | `ref:HexColor` | Light 2 color (hex). Secondary light surface; OOXML lt2. |\n| `hyperlink` | no | `ref:HexColor` | Hyperlink color (hex). OOXML hlink. |\n| `followedHyperlink` | no | `ref:HexColor` | Followed-hyperlink color (hex). OOXML folHlink. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n### Nested Types\n\n#### HexColor\n\n- Type: `string`\n- Required fields: none\n- Purpose: Hex color: '#RGB', '#RRGGBB' or '#RRGGBBAA'. The same definition as HexColor in opf.schema.json.\n\n_No named properties._\n\n## Font Scheme\n\n- File: `spec/schemas/font-scheme.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-font-scheme/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `major`, `minor`\n- Purpose: Schema for font-scheme records. Each scheme pairs a major (heading) and minor (body) font family in the OOXML majorFont/minorFont sense, scoped to a target app (powerpoint or google-slides) and a language family (Latin, East Asian, or Complex Script). Documents reference a scheme from design.fontScheme (or design.fontScheme.id), from a theme's fontScheme and from a language's fontScheme / googleFontScheme. Role overrides on design.fontScheme (heading, body, accent, code), each a font family n...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-font-scheme/v1\"` | Identifies a published record file as a font scheme record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The font scheme's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without thi... |\n| `name` | yes | `string` | Human-readable scheme name shown in pickers. |\n| `major` | yes | `string` | Heading (major) font family mirrors the OOXML majorFont entry. |\n| `minor` | yes | `string` | Body (minor) font family mirrors the OOXML minorFont entry. |\n| `code` | no | `string` | Optional monospaced font family name for code blocks and for inline code runs (TextRun.code). It has the same shape as the OPF FontScheme 'code' role, so a record and an inline design.fontScheme override are interchan... |\n| `eastAsian` | no | `object` | East Asian script fonts. Maps to the OOXML a:ea element of majorFont (major) and minorFont (minor), and to run-level a:ea. When set, they fill the eastAsian slot for every language; when omitted, the slot comes from t... |\n| `complexScript` | no | `object` | Complex-script fonts (for example Arabic, Hebrew, Indic and Thai). Maps to the OOXML a:cs element of majorFont (major) and minorFont (minor), and to run-level a:cs. When set, they fill the complexScript slot for every... |\n| `type` | no | `enum:sans-serif \\| serif \\| monospace` | High-level typographic class of the scheme. |\n| `app` | no | `enum:powerpoint \\| google-slides` | Target application this font pairing is intended for. Metadata for pickers and catalog filters: no engine changes its output by it. |\n| `languageFamily` | no | `enum:latin \\| ea \\| cs \\| eastAsian \\| complexScript` | Font-language family this scheme is intended for: 'latin' for Latin-script content, 'ea' (or 'eastAsian', the same value) for East Asian scripts, 'cs' (or 'complexScript', the same value) for Complex Scripts. The long... |\n| `languages` | no | `array<string>` | Optional list of BCP-47 language tags this scheme is curated for. Useful for picker UIs that group fonts by language coverage. As the design font scheme, an 'ea' or 'cs' scheme fills its script slot only when this lis... |\n| `textSample` | no | `string` | Short specimen string used by picker UIs to preview the scheme. |\n| `summary` | no | `string` | One-sentence positioning of the font pairing. |\n| `description` | no | `string` | Longer prose describing the font scheme and where it shines. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n## Icon Set\n\n- File: `spec/schemas/icon-set.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-icon-set/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `license`, `copyright`, `viewBox`, `style`, `icons`\n- Purpose: Schema for icon-set records: one set of icons that share a viewBox and a style, each icon as SVG path data. An OPF `icon` names one as `<set>:<name>` (docs/icons.md). @openpresentation/gallery ships Lucide and Tabler outline, generated from their npm packages; a host registers them as `galleryIconSets()` of `@openpresentation/gallery/icon-sets` and loads only the icons a deck uses, and a document embeds only the icons it uses under `catalogs.<group>.iconSets.<id>` (a record without `$schema`,...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-icon-set/v1\"` | Identifies this record as an icon set. |\n| `id` | yes | `string` | The set's id, the part of an icon reference before the colon. `asset` is not a set id: `asset:<id>` is an asset reference. |\n| `name` | yes | `string` | Human-readable set name shown in pickers. |\n| `summary` | no | `string` | One line on what the set looks like. |\n| `version` | no | `string` | The version of the source the icons were taken from, such as the npm package version. |\n| `package` | no | `string` | The npm package the icons were generated from. |\n| `homepage` | no | `string` | Where the set is published. |\n| `license` | yes | `string` | The SPDX license id of the icons. |\n| `copyright` | yes | `string` | The copyright notice the license asks every copy to keep. |\n| `licenseText` | no | `string` | The full license text, as the source package ships it. |\n| `viewBox` | yes | `array<unknown>` | The one viewBox every icon of the set is drawn in: min-x, min-y, width, height. |\n| `style` | yes | `enum:stroke \\| fill` | How a string icon draws: `stroke` strokes its path at `strokeWidth` with no fill, `fill` fills it (nonzero rule). |\n| `strokeWidth` | no | `number` | The stroke width in viewBox units (stroke sets). Default 2. |\n| `strokeLinecap` | no | `enum:butt \\| round \\| square` | The stroke's line caps. Default round. |\n| `strokeLinejoin` | no | `enum:miter \\| round \\| bevel` | The stroke's line joins. Default round. |\n| `icons` | yes | `object` | The icons by name. A string is the icon's path data, drawn as `style` says; an object separates the parts a stroke set strokes (`stroke`) from those it fills (`fill`). Every icon is one color: the engines draw it in t... |\n| `renamed` | no | `object` | Former icon names by current name, from the source package's aliases. Only a finding and an icon search read it; an old name is never an icon. |\n| `tags` | no | `object` | Search keywords by icon name, from the source package: what an icon search (the MCP's search_icons, pptx.gallery) matches besides the name. |\n\n## Language\n\n- File: `spec/schemas/language.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-language/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `bcp47`\n- Purpose: Schema for language records: display metadata for the language pickers of authoring tools (name, ISO code, the default font schemes a picker suggests). The document's 'language' is an engine vocabulary, a BCP-47 tag validated directly; engines never look a language record up, and their script, direction, OOXML tag and default script fonts come from spec/reference/engine-vocabularies.json. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.languages.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-language/v1\"` | Identifies this record as a language in the openpresentation.org catalog. |\n| `id` | yes | `string` | The record's id in the gallery's language catalog, lowercase kebab-case. Documents name a language by its BCP-47 tag ('bcp47'), never by this id. |\n| `name` | yes | `string` | Human-readable language name. |\n| `code` | no | `string` | ISO 639-3 (or 639-2) three-letter language code. Carried for engines that prefer ISO codes. |\n| `bcp47` | yes | `string` | BCP-47 language tag for this record. Use 'en-GB' for UK English; 'en-UK' is not a valid BCP-47 region form. |\n| `ooxmlLang` | no | `string` | Curated culture tag for OOXML text-run language attributes (a:rPr/@lang, a:endParaRPr/@lang), in the language-[Script-]REGION form Office recognizes (e.g. 'ja-JP', 'ar-SA', 'ms-MY', 'nb-NO', 'fil-PH', 'zh-CN'). Engine... |\n| `direction` | no | `enum:ltr \\| rtl` | Base text direction for the language. When omitted, engines derive it from the script: Arabic (Arab), Hebrew (Hebr), Syriac (Syrc), Thaana (Thaa), N'Ko (Nkoo), Adlam (Adlm), Samaritan (Samr), Mandaic (Mand) and Hanifi... |\n| `script` | no | `string` | ISO 15924 script code of the language's writing system. The script selects the OOXML font slot the language's text uses: East Asian scripts (Hans, Hant, Hani, Jpan, Kore, Hang, Hira, Kana, Bopo, Yiii) use the eastAsia... |\n| `fontScheme` | no | `string` | The font-scheme id a picker suggests for this language when targeting PowerPoint output. Display metadata: engines take a language's default script fonts from their own vocabulary. |\n| `googleFontScheme` | no | `string` | The font-scheme id a picker suggests for this language when targeting Google Slides output. Display metadata. |\n| `summary` | no | `string` | One-sentence note about coverage or font defaults. |\n| `description` | no | `string` | Longer prose describing the language record and any font-pairing rationale. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n## Layout Preview Index\n\n- File: `spec/schemas/layout-preview-index.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-layout-preview-index/v1`\n- Type: `object`\n- Required fields: `$schema`, `version`, `description`, `records`\n- Purpose: Shape of previews/layouts/index.json in @openpresentation/gallery 2: one self-contained SVG preview per v2 intent layout, keyed by the matching catalog layout id. Each record names its SVG file and exact UTF-8 byte length. The gallery package owns the files; this checkout materializes ignored copies under packages/gallery/previews/layouts/. This internal index schema is excluded from the package's published/typed schema surface.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-layout-preview-index/v1\"` | |\n| `version` | yes | `const:\"2\"` | Index format version, as a string. |\n| `description` | yes | `string` | Human-readable description of the preview gallery and its rendering conventions. |\n| `records` | yes | `array<ref:PreviewRecord>` | One entry per v2 layout and its SVG preview. |\n\n### Nested Types\n\n#### PreviewRecord\n\n- Type: `object`\n- Required fields: `id`, `file`, `bytes`\n- Purpose: One layout template preview.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | The matching layout record id, such as cover, chart or two-column. |\n| `file` | yes | `string` | SVG filename, relative to this index directory, using the matching layout id. |\n| `bytes` | yes | `integer` | Exact UTF-8 byte length of the referenced SVG file. |\n\n## Slide Layout\n\n- File: `spec/schemas/layout.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-layout/v2`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `regions`\n- Purpose: Schema for slide-layout records. A layout is one ordered list of regions, declared once, in reading order: 'direction' says whether the record's 'regions' sit side by side (row) or are stacked (column), and each region says which content kinds it takes and how several blocks share it. A split is an entry that nests a second list the other way, which is how a layout gets two dimensions. 'title' and 'subtitle' are reserved heading regions. Engines compile the list into a grid of tracks (the gui...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-layout/v2\"` | Identifies a published record file as a layout template. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The layout's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this fie... |\n| `name` | yes | `string` | Human-readable layout name, shown in layout pickers and as the PowerPoint layout name. |\n| `summary` | no | `string` | One-sentence positioning of the layout when to reach for it. |\n| `description` | no | `string` | Longer prose describing the layout structure and ideal use cases. |\n| `design` | no | `ref:DesignHints` | The layout's design defaults, with the same keys and values as the deck's design and a slide's design (a slide overrides exactly what its layout sets, by the same name). An absent key means the layout has no opinion.... |\n| `direction` | no | `enum:row \\| column` | How the record's 'regions' are laid out: 'row' places them side by side from the start edge in reading order (left to right; right to left in a right-to-left deck); 'column' stacks them top to bottom. Default 'column'. |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the content of every body region when it is shorter than the region. A split's 'anchor' replaces it for the regions under that split, and a region's own 'anchor' replaces both. Only 'anchor' is in... |\n| `regions` | yes | `array<ref:RegionEntry>` | The record's regions in reading order: 1 to 12 entries, each a region ({ name, size?, ...rules }) or a split ({ direction, regions, size?, anchor? }). Every region is declared once, here, with its content rules; a blo... |\n| `overflowRegion` | no | `string` | The region where content that no region accepts goes, whatever its 'accepts', while it has room; content beyond every region's room is drawn there too, with the warning opf/layout-unplaced. Omitted: the first primary... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n| `composition` | no | `ref:Composition` | Only 'gap', 'padding', 'minFontSize' and 'overflow', with their 0.18 meaning. A template's regions replace composition.mode, columns and weights. |\n\n### Nested Types\n\n#### RegionEntry\n\n- Type: `oneOf:ref:HeadingRegion / ref:Region / ref:Split`\n- Required fields: none\n- Purpose: One entry of a regions list: a heading region, a body region or a split.\n\n_No named properties._\n\n#### RegionSize\n\n- Type: `oneOf:number / const:\"auto\"`\n- Required fields: none\n- Purpose: The region's or split's share along its parent's direction: a number above 0 and up to 100 that siblings share in proportion (the gap is taken out first), default 1; or 'auto', the length the content needs at the starting text size (up to the space the heading rows and the content of the numeric rows leave; auto rows that do not all fit shrink together, each giving up the same fraction of what it can give up above...\n\n_No named properties._\n\n#### HeadingRegion\n\n- Type: `object`\n- Required fields: `name`\n- Purpose: A reserved heading region: 'title' holds the slide's heading group (tag, title and subtitle, stacked) and 'subtitle' takes the subtitle out of it. A heading region takes a size and an anchor, and the 'title' a rule; the content rules belong on body regions. At most one of each; a 'subtitle' needs a 'title'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | yes | `enum:title \\| subtitle` | 'title' or 'subtitle'. |\n| `size` | no | `ref:RegionSize` | |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the heading group in its area when the area is sized (a number): 'middle' (default) centers it, 'bottom' sets it at the foot of the area, as a cover or section sets its display title low, 'top' at... |\n| `rule` | no | `boolean` | 'title' only: draw a short accent rule (80 by 5 px at a 720 px short edge) half a gap above the title, at the title's start edge, on a slide with a title and no tag; a tag is the group's eyebrow and takes the rule's p... |\n\n#### Split\n\n- Type: `object`\n- Required fields: `direction`, `regions`\n- Purpose: A split nests a list of regions the other way inside one cell of its parent: a row of regions inside a column, or a column inside a row. It has no name; its regions are declared in reading order like the record's own. Splits nest at most three levels (the record's own list is level 1).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `direction` | yes | `enum:row \\| column` | How the split's 'regions' are laid out: 'row' side by side, 'column' stacked. |\n| `regions` | yes | `array<ref:RegionEntry>` | The split's regions in reading order: 1 to 12 regions and splits. |\n| `size` | no | `ref:RegionSize` | |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the content of every body region under this split, unless the region sets its own. The heading regions 'title' and 'subtitle' never inherit it. |\n\n#### Region\n\n- Type: `allOf:schema`\n- Required fields: `name`\n- Purpose: One body region of a layout: its name, its share of the space and the rules for which content it takes and how several blocks share it.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | yes | `string` | The region's name, lowercase kebab-case, unique across the whole record. A block targets it with 'region': '<name>'. It may not be 'title' (those are heading regions), 'tag', 'auto' or one of the promoted-region words... |\n| `size` | no | `ref:RegionSize` | |\n| `accepts` | no | `array<enum:text \\| list \\| image \\| video \\| chart \\| table \\| code \\| metric \\| quote \\| timeline \\| diagram \\| shape \\| group>` | Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A region that takes 'image' also takes a shape block. A group is also accepted where every one of its leaf kinds... |\n| `role` | no | `enum:primary \\| secondary \\| media \\| supporting` | Which content the region wants first. Binding gives a picture (image, video) to a media region first, then primary, secondary, supporting; every other kind to a primary region first, then secondary, supporting, media;... |\n| `flow` | no | `enum:none \\| grid \\| column \\| auto` | How several blocks share the region: 'none' one block fills it (blocks no region had room for join it, up to 6, and it flows as 'auto'); 'grid' by count (1 fills, 2 side by side, 3 in a row, 4 as 2 x 2, 5 as 3 + 2, 6... |\n| `max` | no | `integer` | Blocks the region holds on one slide. Default 1 for flow 'none' (which requires 1), else 6. Content beyond every region's room is drawn in the overflow region with the warning opf/layout-unplaced, and paginate moves i... |\n| `bleed` | no | `boolean` | The region's outer edges that lie on the content box's edge extend to the slide edge, as a placed image does. A bled region is never drawn as a card. Default false. |\n| `listColumns` | no | `oneOf:const:\"auto\" / const:1` | 'auto': a list in the region that does not fit its cell at the starting size (a lone list, or one of several blocks) flows into up to three columns before it shrinks, as a list payload's columns: 'auto'; a list of 6 o... |\n| `metrics` | no | `enum:stack \\| tile` | How a metric block in the region is laid out. 'stack' (default): value, unit, label and the rest as one block at the region's anchor and content alignment. 'tile': the metric fills its cell (its card when the layout d... |\n| `sequence` | no | `enum:steps \\| numbered` | The region lists the steps of a sequence. 'steps': two or more text or list blocks are the steps, each under a numbered badge (an accent circle with its numeral; a one-entry numbered list gives the badge its number an... |\n| `arrangement` | no | `enum:pyramid \\| matrix \\| cycle \\| chevrons \\| flow \\| vertical-flow \\| org-chart \\| hierarchy \\| venn` | The region draws its lone list of one level as a diagram (docs/smartart.md), in the first design that holds every entry at one size, the list's role size or larger (up to 1.5 times), never smaller: PowerPoint's own ge... |\n| `pyramidDirection` | no | `enum:up \\| down` | For arrangement 'pyramid': 'up' (default) puts the narrow tip first, at the top; 'down' puts the widest level first and the tip at the bottom. Entries retain their authored top-to-bottom order. Both the continuous and... |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical position of the region's content when it is shorter than the region. Replaces the 'anchor' of the record and of the splits around it. Default: the nearest of those that sets one, else 'top'. A picture shown w... |\n| `empty` | no | `enum:collapse \\| keep` | What the region does on a slide that gives it no content: 'collapse' (default) joins its cells to a neighbouring area that shares the full length of one of its edges and is not itself empty; 'keep' leaves the space. |\n\n#### DesignHints\n\n- Type: `object`\n- Required fields: none\n- Purpose: Design hints a layout carries. The keys and lowercase values are those of the deck's design and a slide's design in opf.schema.json (Design), so a slide overrides a layout by the same name and layout.design can be copied into slide.design unchanged. An absent key means the layout has no opinion. Only the keys the layout sets are stored. scripts/check-spec-integrity.mjs verifies that every key here has the same typ...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `titleAlignment` | no | `enum:start \\| center \\| end` | Horizontal alignment of the title heading area. Logical, as design.titleAlignment of a deck: 'start' is the edge a paragraph starts on. |\n| `contentAlignment` | no | `enum:start \\| center \\| end` | Horizontal alignment of the body regions. Logical, as design.contentAlignment of a deck: 'start' is the edge a paragraph starts on. |\n| `contentBox` | no | `boolean` | Whether the body regions are drawn inside a visible card or surface. |\n| `contentDirection` | no | `enum:horizontal \\| vertical` | Axis along which parallel body content is arranged: 'vertical' is a column, 'horizontal' a row. On a layout slide it turns every flowing region into one row or one column; the slide's own composition.mode, columns and... |\n| `chartPrimary` | no | `enum:none \\| top \\| bottom \\| start \\| end` | Where the primary chart sits relative to supporting content on automatic slides. Template layouts express this arrangement with their regions; chartPrimary does not override a template. |\n| `imageFit` | no | `enum:cover \\| contain \\| stretch \\| auto` | Default fit of the slide's image blocks: 'cover' fills the frame and crops around focus, 'contain' shows the whole picture, 'stretch' scales it to the frame, 'auto' covers when the crop keeps at least 85% of the pictu... |\n| `listBullet` | no | `enum:character \\| image \\| none` | Marker style of lists: 'character' draws the glyph, 'image' draws the deck's icon logo as a picture bullet, 'none' draws no marker and no hanging indent (label-and-description lists). |\n| `listStyle` | no | `enum:stack \\| rows` | As design.listStyle of a deck: 'stack' or 'rows' (ruled rows) for the lists of slides using this layout. |\n| `mirror` | no | `boolean` | Draw the layout mirrored: each row's cells and the column sizes reversed, so a 'beside' layout puts its picture, chart or table at the end. Logical: a right-to-left deck mirrors on top. Binding and reading order do no... |\n| `variant` | no | `oneOf:ref:ColorVariantSlot / ref:ColorVariant / ref:LayoutVariantRole` | The color variant slides on this layout draw on: a background slot ('accent1', 'dark1', ...) or the ColorVariant object, as design.variant, or a value relative to the deck's own variant (LayoutVariantRole: 'surface',... |\n\n#### LayoutVariantRole\n\n- Type: `enum:surface | brand`\n- Required fields: none\n- Purpose: A layout variant relative to the deck's own variant. 'surface' is the deck's secondary surface on its own side: light2 on a light deck and dark2 on a dark one (light1 or dark1 where the deck is already on light2 or dark2), so a statement stands off the deck without changing its tone. 'brand' is the scheme's brand dark, dark2 (dark1 where the deck is already on dark2), with light text: a closing slide's strong surf...\n\n_No named properties._\n\n#### Composition\n\n- Type: `object`\n- Required fields: none\n- Purpose: A template's composition: only gap, padding, minFontSize and overflow, with their 0.18 meaning. A slide's composition overrides them; a slide's composition.mode, columns and weights arrange its first primary flowing region.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `gap` | no | `number` | Space between cells as a fraction of the container short edge (canvas at slide root). Default 0.03333333333333333. |\n| `padding` | no | `number` | Inset as a fraction of the container short edge. Default 0.08 on a slide, 0 inside a group. |\n| `minFontSize` | no | `number` | Minimum readable text size in reference pixels at a 720-pixel canvas short edge. Default 16. Overflow is diagnosed when text cannot fit at this size. |\n| `overflow` | no | `enum:warn \\| error` | warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn. |\n\n## Narrative Template\n\n- File: `spec/schemas/narrative.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-narrative/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`, `beats`\n- Purpose: Schema for narrative records. A narrative is a plan: a named story arc (e.g. 'problem-solution', 'scqa') as an ordered list of beats, each saying what its slide must do. A document points at one with the string 'narrative' and links its slides to beats with 'slides[].beat'; a narrative the document defines itself is a record in catalogs.custom.narratives. Core validate warns about a 'slides[].beat' id the resolved narrative does not define (opf/unknown-beat) and about a root 'duration' outsid...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-narrative/v1\"` | Identifies a published record file as a narrative record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The narrative's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this... |\n| `name` | yes | `string` | Human-readable template name, e.g. 'Problem Solution'. |\n| `summary` | no | `string` | One-sentence description of when and why to use this narrative. |\n| `description` | no | `string` | Longer prose describing the narrative arc and ideal use cases. Used by AI-driven generation to seed deck-level direction. |\n| `audienceFit` | no | `array<string>` | Audiences this narrative works well for, e.g. ['executive', 'investor', 'customer']. |\n| `duration` | no | `object` | Typical talk length this narrative suits, as a range in minutes. A deck's own target is the root 'duration' (one number); core validate warns when that target lies outside this range, and when 'min' is greater than 'm... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search, e.g. ['business', 'pitch', 'internal']. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n| `beats` | yes | `array<ref:Beat>` | Ordered list of beats that make up the narrative arc. |\n\n### Nested Types\n\n#### Beat\n\n- Type: `object`\n- Required fields: `id`, `name`\n- Purpose: A single narrative beat a labeled segment of the story arc with a specific dramatic purpose. One beat is one slide: 'type' is that slide's Slide.type and 'layout' is its Slide.layout, so a planner copies them straight into a skeleton deck. Split a heavy beat into several beats rather than giving it several slides.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable slug used by Slide.beat to reference this beat. Lowercase kebab-case. |\n| `name` | yes | `string` | Human-readable beat name, e.g. 'The Problem'. |\n| `description` | no | `string` | Curator-written prose that explains what this beat should accomplish. |\n| `instructions` | no | `string` | Short author-facing instruction for the beat typically one phrase. Complements 'description' with a concise directive. |\n| `type` | no | `enum:text \\| list \\| image \\| video \\| chart \\| table \\| code \\| metric \\| quote \\| timeline \\| diagram` | Default content kind for the beat's slide: the same values as Slide.type. Helps engines and planners choose a layout when only the beat is known. |\n| `layout` | no | `string` | Suggested layout id for the beat's slide, e.g. 'section-divider', 'title-slide', 'text-left'. Resolves the same way as Slide.layout against catalogs.layouts and the default catalog at https://www.pptx.gallery/layouts. |\n| `thoughtCues` | no | `array<string>` | Optional speaker or thinking cues for the beat: questions the slide should answer. A planner or author turns them into the slide's notes; no engine copies them there on its own. |\n\n## Purpose\n\n- File: `spec/schemas/purpose.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-purpose/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for purpose records. Each record names a presentation objective such as informing, aligning, persuading, driving a decision, or selling. Documents reference a purpose from 'purpose', which also accepts free-form text and inline Purpose objects. A document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines never fetch a catalog. A published record file carries '$schema' a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-purpose/v1\"` | Identifies a published record file as a purpose record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The purpose's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this fi... |\n| `name` | yes | `string` | Human-readable purpose name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the purpose what this deck is trying to accomplish. |\n| `description` | no | `string` | Longer prose describing when to use this purpose and how it should shape a deck. |\n| `outcome` | no | `string` | Desired audience outcome after the presentation. |\n| `successCriteria` | no | `array<string>` | Observable signals that the deck accomplished this purpose. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: ids of narratives in the same catalog that work well for this purpose. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: ids of tones in the same catalog that work well for this purpose. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional. |\n\n## Social Platform\n\n- File: `spec/schemas/social-platform.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-social-platform/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for social-platform records: display metadata for authoring UIs (name, brand color, handle example) alongside the URL patterns. The keys of a Socials object are an engine vocabulary validated directly; engines link a handle with the patterns in spec/reference/engine-vocabularies.json and never look a social-platform record up. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.socialPlatforms.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-social-platform/v1\"` | Identifies this record as a social-platform entry in the openpresentation.org catalog. |\n| `id` | yes | `string` | The social platform's key, as written in a Socials object. Lowercase kebab-case. |\n| `name` | yes | `string` | Human-readable platform name shown in pickers and footers. |\n| `summary` | no | `string` | One-sentence positioning of the platform what it's used for and who's on it. |\n| `description` | no | `string` | Longer prose describing the platform and any rendering conventions (e.g., handle prefixes, distributed instances). |\n| `baseUrl` | no | `string` | Canonical base URL of the platform used as the prefix when normalizing handles to full URLs. |\n| `profileUrlPattern` | no | `string` | URL pattern for individual member profiles. Use '{handle}' as the placeholder for the handle (with the prefix already stripped). |\n| `companyUrlPattern` | no | `string` | Optional URL pattern for organization / company pages, when the platform distinguishes them from member profiles. Use '{handle}' as the placeholder. |\n| `handlePrefix` | no | `string` | Conventional prefix character displayed before the handle (e.g. '@' for X / Mastodon / Threads / TikTok). Empty string when no prefix is used. Renderers strip it before substituting into URL patterns. |\n| `handleExample` | no | `string` | Example handle in its conventional rendered form, used by picker UIs and validation hints. |\n| `brandColor` | no | `string` | Brand color (hex) for branded icon chips, link styling, or section accents in authoring UIs. Catalog metadata: engines do not draw it. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n## Theme\n\n- File: `spec/schemas/theme.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-theme/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for theme records. Each theme is a small, named bundle that pairs a color scheme, a font scheme, a default theme-controlled background, and a slide size. Documents reference a theme from design.theme; design.colorScheme, design.fontScheme, design.background and design.dimensions take precedence over the resolved theme. The theme's own colorScheme and fontScheme references resolve in the theme's group first, so a catalog's theme finds that catalog's schemes. A document references a reco...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-theme/v1\"` | Identifies a published record file as a theme record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The theme's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this field. |\n| `name` | yes | `string` | Human-readable theme name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the theme when to reach for it. |\n| `description` | no | `string` | Longer prose describing what the theme looks and feels like and the kinds of decks it suits. |\n| `colorScheme` | no | `string` | The theme's default colour scheme: a reference (a bare id or 'name:id') resolved like design.colorScheme, but in the theme's own catalogs group first. |\n| `fontScheme` | no | `string` | The theme's default font scheme: a reference (a bare id or 'name:id') resolved like design.fontScheme, but in the theme's own catalogs group first. |\n| `background` | no | `ref:ThemeBackground` | |\n| `variants` | no | `array<ref:ThemeVariant>` | The color variants the theme offers (OPF 0.23), for example light, light-alt, dark and dark-alt: named values of design.variant over the theme's one color scheme, so a dark deck is a variant of a theme and not a theme... |\n| `dimensions` | no | `enum:16:9 \\| 4:3 \\| 16:10 \\| 1:1 \\| 4:5 \\| 9:16 \\| letter \\| a4 \\| widescreen \\| standard` | Default slide size for this theme. Accepts the same preset values as design.dimensions.preset. |\n| `design` | no | `object` | The theme's design defaults (OPF 0.19), so a house style such as boxed content or centred titles is set once: the keys and values of the deck's design for titleAlignment, contentAlignment, contentBox, contentDirection... |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available. |\n\n### Nested Types\n\n#### ThemeVariant\n\n- Type: `object`\n- Required fields: `id`, `name`, `variant`\n- Purpose: One named color variant of a theme.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | The variant's id within the theme, lowercase kebab-case. |\n| `name` | yes | `string` | Human-readable variant name shown in pickers. |\n| `variant` | yes | `oneOf:ref:ColorVariantSlot / ref:ColorVariant` | The value design.variant takes when the variant is chosen: a background slot ('light1', 'light2', 'dark1', 'dark2', or an accent 'accent1' to 'accent6'; the same as { background: slot }) or the ColorVariant object of... |\n\n#### ThemeBackgroundSlot\n\n- Type: `enum:light1 | light2 | dark1 | dark2`\n- Required fields: none\n- Purpose: PowerPoint theme-controlled slide background slot from the active color scheme. These are slots, not assumptions about actual colors: light1 is usually white and dark1 is usually black by convention, but the color scheme controls the real values.\n\n_No named properties._\n\n#### ThemeBackground\n\n- Type: `object`\n- Required fields: `type`, `slot`\n- Purpose: Theme-controlled PowerPoint slide background. The slot is resolved through the active color scheme and remains theme-aware.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"theme\"` | Theme-controlled background fill. |\n| `slot` | yes | `ref:ThemeBackgroundSlot` | |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). Default 1; the selected theme slot remains unchanged. |\n\n## Tone\n\n- File: `spec/schemas/tone.schema.json`\n- Schema id: `https://openpresentation.org/schema/opf-tone/v1`\n- Type: `object`\n- Required fields: `$schema`, `id`, `name`\n- Purpose: Schema for tone records. Each record names a presentation tone (e.g. 'formal', 'casual', 'inspirational') and carries voice cues, anti-patterns, and sample phrases that AI-driven generation uses to shape output. Documents reference a tone from 'tone'. A document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines never fetch a catalog. A published record file carries '$schema' a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | yes | `const:\"https://openpresentation.org/schema/opf-tone/v1\"` | Identifies a published record file as a tone record. Required in a published file; an embedded copy omits it. |\n| `id` | yes | `string` | The tone's id in its catalog, lowercase kebab-case. Required in a published record file; a document references the record by it (a bare id, or 'name:id' for a named group) and embeds it keyed by it, without this field. |\n| `name` | yes | `string` | Human-readable tone name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the tone when to reach for it. |\n| `description` | no | `string` | Longer prose describing the tone and the kinds of decks it suits. |\n| `voiceCues` | no | `array<string>` | Short directives that shape AI generation toward this tone. Phrased as imperatives, e.g. 'use second-person', 'favor short sentences', 'lead with the recommendation'. |\n| `avoid` | no | `array<string>` | Anti-patterns that AI generation should not produce when this tone is active. |\n| `samplePhrases` | no | `array<string>` | Short example phrases that exemplify this tone. Used by picker UIs and as few-shot examples for AI generation. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: ids of narratives in the same catalog this tone pairs well with. Used by picker UIs to suggest narratives once a tone is chosen. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n| `preview` | no | `object` | Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional. |\n"
16
16
  },
17
17
  {
18
18
  "slug": "chart-options",
19
19
  "file": "docs/chart-options.md",
20
20
  "title": "Chart options: axis titles, legend, data labels, highlight, series colors and the value axis",
21
- "markdown": '# Chart options: axis titles, legend, data labels, highlight, series colors and the value axis\n\nStatus: RR-35 (release readiness) for axis titles, legend and data labels, FA-14 (format audit) for `highlight`, and RR-89 and RR-92 (core 0.21.0) for series colors (`chart.colors`) and the computed value axis. The first four fields change geometry only for charts that use the first three fields, and colors only for charts that use `highlight`. Use the coordinated package set in the [compatibility matrix](compatibility-matrix.md); schema support alone does not establish native visual fidelity.\n\n## Native export data domains and limitations\n\nPowerPoint\'s native categorical Pareto aggregation can omit negative categories even when its workbook and caches retain them. A single-series Pareto with signed category values therefore exports, in default/auto/native modes, as an editable classic combo: descending signed columns plus an explicit positive-only cumulative-share line on a secondary 0\u20131 axis. Negative values remain visible bars and do not subtract from the cumulative share. The cumulative cells are static values: native bar edits do not recalculate them. Import returns the actual combo with its sorted/derived series, not the original Pareto source form. Positive categorical Pareto and raw-sample binning retain their native constructs. Explicit `chartex: "fallback"` retains the documented column-only representation and its adaptation diagnostic.\n\nA categorical histogram exported as classic columns keeps the preview\'s broad bars (6% gap) and composed histogram value-axis bounds and unit. It is still a column representation, with an adaptation diagnostic where native aggregation cannot display signed category data; it does not establish native histogram editability or complete visual parity.\n\nNative funnel labels have a separate Office limitation: PowerPoint can ignore the written label color and choose its own contrast color, observed as white where the renderer uses black. Export reports `export-lossy` with `feature: "funnel-label-color"` when native funnel labels are enabled. The chart remains editable. XML contrast checks establish only the requested paint, not the physical color PowerPoint renders.\n\n## The fields\n\nFour optional fields on the `Chart` object (the fourth, `highlight`, has [its own section](#chart-emphasis-highlight) below):\n\n```json\n{\n "chart": {\n "type": "column",\n "data": { "columns": ["Quarter", "Revenue"], "rows": [["Q1", 12], ["Q2", 18]] },\n "axisTitles": { "category": "Quarter", "value": "Revenue ($M)" },\n "legend": "bottom",\n "dataLabels": { "content": ["value"], "position": "outside-end" }\n }\n}\n```\n\n| Field | Values | Absent means |\n| --- | --- | --- |\n| `axisTitles` | `{ category?: string, value?: string, secondary?: string }` (`secondary`: combo charts) | no axis titles (today) |\n| `legend` | `none`, `top`, `bottom`, `left`, `right` | a line chart of two to four series names its series at the [line ends](#defaults-follow-few) and a pie or one-series doughnut names its slices, with no legend (each falls back to its legend when the names do not fit); a column, bar, area or combo chart of two to four series shows its legend in the [header row](#chart-layer-small-charts-and-the-header-row) above the plot; other multi-series charts and pie and doughnut charts a legend at the right; none for a single-series chart |\n| `dataLabels` | `true`, `false` or `{ content?, position?, separator? }` | no data labels, except on a [small chart](#chart-layer-small-charts-and-the-header-row), which labels its values, and the [direct labels](#defaults-follow-few) of line, pie and doughnut charts; the funnel and treemap constructs keep the labels they draw by default (values, category names) |\n\n`axisTitles.category` titles the axis that carries the row labels: the horizontal axis of a column, line, area, histogram, pareto, waterfall and box-and-whisker chart, the **vertical** axis of a bar chart and the X axis of a scatter chart. `axisTitles.value` titles the other one. A named `legend` position shows the legend there even for a single-series chart; `none` hides it.\n\n`dataLabels: true` is `{ "content": ["value"], "position": "auto" }`. `dataLabels: false` draws no labels: on a small chart it switches the default value labels off and brings the value axis back, and on the funnel and treemap constructs, which label their marks by default, it removes those labels (`resolveChartOptions` reports `dataLabelsOff`). In the object form:\n\n- `content`: any of `category`, `value`, `percent` (default `["value"]`). A label shows the selected parts in the fixed order category, value, percent, joined by `separator` (default `", "`). Values print in the General number format (twelve significant digits), `percent` as the integer share of the total (`0%`), `category` as the category name (the X value on a scatter chart).\n- `position`: `auto` (default), `center`, `inside-end`, `inside-base`, `outside-end`, `above`, `below`, `left`, `right`. `auto` is the type\'s default in the table below; the engines write that concrete position, so the preview and PowerPoint do not each pick their own.\n- `separator`: text between the parts.\n\n## Chart emphasis: `highlight`\n\nHighlighting the one series or category that carries the message, and muting the rest, is the main data-storytelling technique. The content stays semantic: `highlight` names series and categories, and the engines pick the colors from the theme. There is no color field.\n\n```json\n{\n "chart": {\n "type": "column",\n "data": { "columns": ["Quarter", "Revenue", "Costs"], "rows": [["Q1", 12, 8], ["Q2", 18, 11], ["Q3", 24, 15]] },\n "highlight": { "series": ["Revenue"], "categories": ["Q3"] }\n }\n}\n```\n\n| Field | Meaning |\n| --- | --- |\n| `highlight.series` | Value columns (series) whose marks are highlighted: every mark of each named series. Names match the data column names after any `fields` selection; a series is a plotted value column. |\n| `highlight.categories` | Row labels (the category column, or `mapping.category`) whose marks are highlighted: a column or bar of every series, a line\'s points, a pie or doughnut slice. Labels match as text (the number `2024` as `"2024"`) and a label shared by several rows highlights each of them. |\n\n**The rule.** When `highlight` is present, a mark is highlighted if its series OR its category is listed. Highlighted marks take the deck\'s primary (accent) color; every other mark takes a muted neutral derived from the theme. With both lists given, a bar of series `Revenue` in any category is highlighted, and so is a bar of category `Q3` in any series. A chart without `highlight` keeps its colors, byte for byte. A highlight that names nothing the chart plots (for example a column that is the category column) leaves the chart as if it had none.\n\n**The colors** come from core\'s `chartHighlightColors(surface, primary, text)`, which the preview and the PPTX export both call with the chart\'s backdrop (the card or the slide background: no chart has a panel, LH-105), the deck primary and the chart text color:\n\n- the accent is the primary color, kept at 3:1 contrast against the panel by `chartColorForFill` (a primary that already has that contrast is used unchanged);\n- the muted color is the panel mixed 30% of the way toward the text color: a light gray on a light panel and a dim gray on a dark one, in the panel\'s own hue. If that is under 1.6:1 against the panel, the mix moves toward the text color until it holds, so a muted mark is always visible and always quieter than the text.\n\nData labels stay readable: a label inside a mark takes the text color that contrasts with that mark\'s own color (core `textColorForFill`), so a label on a muted bar contrasts with the muted fill, as one on an accent bar does with the accent. Labels outside marks keep the chart text color. The legend shows each series in the color its marks have: accent for a highlighted series, muted otherwise. (A multi-series chart that highlights only categories mutes every series alike, so its legend keys look the same; name the series too when the legend matters.)\n\n**Validation.** A name that matches no data column (`series`) or no row label (`categories`) is a `chart-highlight-unknown-name` **error**, found by `resolveChartData` like `chart-mapping-unknown-column`. A series name that is a column but not plotted as a series (the category or X column, or a column `mapping.series` leaves out) is a `chart-highlight-adapted` warning and highlights nothing. A part the chart type cannot highlight is dropped with a `chart-option-adapted` diagnostic (option `highlight.series` or `highlight.categories`). `highlight` must name at least one series or category, and each list has no duplicates.\n\n### What each chart type highlights\n\n`chartOptionSupport(target).highlight` returns `{ series, categories }`; the validator, the preview, the exporter and the editor all follow it.\n\n| Type (catalog ids) | Series | Categories | What is drawn |\n| --- | --- | --- | --- |\n| clustered column, bar | yes | yes | the series\' columns or bars; a category\'s column or bar in every series |\n| stacked and 100% stacked column, bar | yes | yes | the same, per segment |\n| line, stacked line, with markers | yes | yes | a series\' line and markers; a category highlight draws a marker on each series at that category (on a line without markers, only there) |\n| area, stacked area, 100% stacked area | yes | no | the series\' area |\n| scatter | yes | no | the series\' markers (a scatter point label is not a category) |\n| radar, with markers, filled | yes | no | the series\' line (or fill) and markers |\n| pie, doughnut | no | yes | the slice of each named category (a pie plots one series, so a series name is meaningless) |\n| histogram, pareto, waterfall, funnel, treemap, box and whisker, world, combo | no | no | not supported: dropped with `chart-option-adapted` |\n\nThe Office 2016 (chartex) constructs are left out on purpose. Their marks take their colors from the construct\'s chart style, and a per-point color (`cx:dataPt`) would need native verification this change does not have; the waterfall also already colors its marks by increase, decrease and total. They draw and export as before.\n\n## Series colors\n\nSeries colors follow the deck\'s color scheme by default: the same chart takes the colors of whichever scheme the deck uses (`design.colorScheme`, the theme\'s scheme, a catalog record, a built-in such as `vibes`, or an inline scheme with slot overrides). To set the color of one series, slice or category, list colors in [`chart.colors`](#setting-colors-chartcolors); a position it does not list keeps the deck palette.\n\nCore\'s `chartSeriesPalette(colorScheme)` (on `@openpresentation/opf/composition`) returns the twelve colors the preview, the PPTX export and the `chart-color-only` accessibility rule all use, in this order:\n\n| Series | Color |\n| --- | --- |\n| 1 to 6 | `accent1` to `accent6` of the resolved color scheme (a slot the scheme leaves out takes the engine default scheme\'s slot) |\n| 7 to 12 | the same six accents mixed 40% toward white, in the same order (series 7 is a tint of `accent1`) |\n\nSeries `i` takes color `i`; a pie, doughnut, treemap or funnel colors category `i` with color `i`. A chart with more than twelve series repeats the list (and `chart-color-only` says so). The `primary`, `secondary` and `accent` role overrides do not reorder the list: series 1 to 3 are always `accent1` to `accent3`, the slots the PPTX export writes as theme colors.\n\nBoth engines then pass the list through `chartPaletteForFill(backdrop, palette, { legible: chartSchemeSeries(chart.colors, colorScheme), soften: true })`, which keeps every series at 3:1 contrast against the backdrop the chart stands on (the card, or the slide background; LH-105: no chart has a panel) and apart from its neighbors, so on a dark panel the colors are lightened, never merged. On a dark panel every series that comes from the scheme (not from an authored `colors` entry) reaches 4.5:1, and series 2 keeps a lightness step of at least 20 (CIE L*) from series 1, so the first two series never read as one blue (LH-55). The palette is read in tiers of six (series 1 to 6, then 7 to 12): a color is kept apart from the colors of its own and earlier tiers only, so the tints never pull the six accents towards each other. Plan a chart\'s series order for the scheme: put the series that carries the message first (accent1 is the deck\'s primary), and keep a chart to six series or fewer so no tint is needed. The `highlight` colors above are separate: they come from the primary and the panel, not from this list.\n\nA host that validates with its own palette passes `ValidateOptions.chartPalette`; without it the rule judges each slide\'s own scheme.\n\n### Setting colors: `chart.colors`\n\n`colors` lists colors by position and replaces the palette color of that position; the rest of the palette is unchanged.\n\n```json\n{\n "chart": {\n "type": "column",\n "data": { "columns": ["Quarter", "Revenue", "Costs"], "rows": [["Q1", 12, 8], ["Q2", 18, 11]] },\n "colors": ["accent3", "#7B241C"]\n }\n}\n```\n\n- **Position.** Entry `i` is the color of series `i` (the `i`-th plotted value column), of slice or category `i` on a pie, doughnut, treemap or funnel chart, and of the `i`-th color a histogram, pareto, waterfall or box-and-whisker chart draws with (the first color for its bars, the second for its line or negative bars, the third for a waterfall total; a waterfall with `colors` keeps these positions instead of the role colors of [Chart marks](#chart-marks-waterfall-roles-value-lists-stacked-labels-reference-marks)). Up to 24 entries; positions past the last entry keep the deck palette.\n- **Values.** Any `ColorRef`: a hex color, a color-scheme slot or role (`accent3`, `secondary`), or a `var:<id>` color variable. A scheme name follows the deck if its scheme changes and is written to PowerPoint as a theme color; a hex color stays as written. Alpha is dropped. An entry that cannot be resolved is ignored (the palette color of its position is used) and `opf/chart-colors-adjusted` says so.\n- **Contrast.** Colors still pass through `chartPaletteForFill`: one with under 3:1 contrast against the backdrop is drawn lighter or darker, and series are kept apart. `opf/chart-colors-adjusted` warns when that happens to an authored color, and `opf/chart-color-only` judges the authored colors for color-blind and greyscale collisions.\n- **Highlight wins.** With `chart.highlight`, highlighted marks take the primary color and every other mark the muted neutral, whatever `colors` says.\n- **Engines.** Core resolves the list with `chartSeriesPalette(colorScheme, chart.colors, { roles, variables })` (and `resolveChartColors` for the entries alone); the preview and the PPTX export pass the result to `chartPaletteForFill` as before.\n\n## Value axis\n\nA column, bar, line or area chart (standard, stacked and 100% stacked) has one value axis, and composition computes it: `composeSlide` puts `{ min, max, majorUnit }` on the composed chart item as `chart.valueAxis`. The preview draws that axis and the PPTX export writes it as `c:min`, `c:max` and `c:majorUnit`, so PowerPoint and Keynote show the same gridlines as the preview instead of choosing their own major unit. A 100% stacked chart\'s axis is a fraction (`max: 1` is 100%) and carries `percent: true`. Combo, scatter, pie and the Office 2016 constructs have no computed axis (`chart` is absent); each engine keeps drawing them as before.\n\n**Radar layout (RR-105).** Core lays a radar out once (`chartRadarLayout`, `chart.layer.radar`): its value axis (`axis: { min, max, majorUnit }`, `niceScale` with `endOnTick` and as many intervals as the web\'s radius holds lines of text), which the preview draws and the PPTX export writes as the radar\'s `c:valAx` scaling, and where its default legend (two or more series, no `legend` option) stands. The legend moves under the web (`legend: "bottom"`, `legendBox`) when that gives the web a radius at least `RADAR_BOTTOM_LEGEND_GAIN` (1.1) times larger than a side legend does, as in a box taller than it is wide; the export writes it as `c:legendPos b` at core\'s box (a manual layout) with the plot area above it, and the import reads that legend back as the default, not as `legend: "bottom"`. In automatic composition a radar\'s box is at most square (other charts at most 4:3 landscape in a cell), so three radars in a row are as tall as they are wide.\n\n**Sibling charts (LH-33, LH-93).** Column, bar, line and area charts on one slide that run the same way, are both 100% stacked or both not, and plot one unit (the same first-series number format, or the same series names when unformatted) share one value axis (`shareSiblingChartAxes`). Column, line and area charts of such a set also share one plot height, so equal values stand equally tall: core lays each member\'s plot out as the preview does (`chartPlotInset`: under the header row or a top legend, above a bottom legend, the category axis title and the category labels, beside the value axis title, the tick labels and a side legend), and `shareSiblingPlots` gives the set the shortest plot\'s height. Charts side by side (boxes that overlap by half the shorter one\'s height) share one plot top and baseline; a chart in another row keeps its own baseline. The plot is stored as an inset from the chart box, `chart.layer.plot` (`{ left, top, right, bottom }`, slide pixels); the preview draws its plot there and the PPTX export writes it as the plot area\'s manual layout (`c:plotArea` `c:manualLayout`, `layoutTarget inner`), so PowerPoint draws the same plot. Horizontal bar charts of such a set (LH-93 remainder), whose value axis runs across, share one plot too (`horizontalBarPlot`, laid out as the preview lays a horizontal bar chart out): charts side by side share one plot top and height (their category bands line up), charts one above another start their plots at the same x, and every member takes the set\'s narrowest plot width, so one value is one bar length on every chart. A horizontal chart with chart options or drawn on a table\'s rows (LH-115) keeps its own plot, and so does the rest of its set. Stacked and percentage-stacked siblings share their final plot too; afterward their original-size direct names/values are fitted again, restoring the existing legend or numeric axis when the common plot needs it.\n\nThe scale is core\'s `niceScale(dataMin, dataMax, maxIntervals, { percent })`: zero is on the axis (always for bars and areas; for a line only when the data does not sit in the top sixth of its range), the data gets 5% headroom, and the major unit is the smallest 1, 2 or 5 times a power of ten that fits `maxIntervals` intervals. `maxIntervals` is `maxIntervalsFor(length, labelExtent)`, at most `CHART_MAX_INTERVALS` (6, LH-105), where `length` is the plot\'s extent along the value axis estimated from the chart box (without measuring text) and `labelExtent` is the space one tick label needs: a column, line or area chart has `box height - 2 x pad - 1.5 x line height` (less a line for a category axis title, and a line plus a pad for a top or bottom legend) over 1.2 line heights, a bar chart `70% of the box width - 2 x pad - text size` over 4 text sizes. Here pad is `10 x scale`, text size is `chartTextSize(...) x scale` px and line height is 1.5 text sizes. `chartTextSize({ width, height, scale, minFontSize })` is the chart text size the preview draws: `CHART_TEXT_PX` (20 px at the 1280 x 720 reference, 15 pt), shrunk only when the box is small (at most 1/18 of the box height and 1/30 of its width, whole pixels) and never below `minFontSize` (default 16), with `scale = min(slide width, slide height) / 720`. A chart in a short box therefore has fewer, larger intervals (0 to 800 in steps of 100 in a tall box, steps of 200 in a short one); a tall box always gets six at most (0 to 800 in steps of 200). An axis with room for three intervals or more is never tightened to one (LH-105): when no equal division of the tightened end fits, a finer end is tried (data peaking at 116: 0 to 125 with ticks every 50, not 0 and 140).\n\nThe axis maximum stays near the data (LH-59): it is at most `CHART_AXIS_MAX_OVERSHOOT` (a quarter) of the plotted range above the data maximum, 1.25 x the maximum on a zero-based axis. When the first major tick above the headroom lies further out (a short axis of one or two intervals: data peaking at 124 on an axis of 0 to 200), the axis ends at the first multiple of the largest finer 1, 2 or 5 unit within that bound (150). The ticks keep the major unit when the last one is at most half a unit below that end (0 to 40 in tens, ending at 45; the end is then not a labeled tick, as PowerPoint draws a `c:max` off the major unit); otherwise the end is divided into as many equal intervals as fit, each a multiple of that unit (0, 400, 800 for data peaking at 760; 0 and 150 in one interval), with zero kept on a tick. Every chart the preview scales this way follows the rule: the column, bar, line and area axis core composes (and the PPTX export writes), the histogram, pareto, waterfall and box-and-whisker constructs and the scatter axes. The radar and the combo chart keep the end on a tick (`niceScale(..., { endOnTick: true })`): the radar\'s outer ring and the combo chart\'s shared gridlines are the axis end. Only the maximum is tightened; a negative minimum keeps its major-unit tick, so zero stays on a gridline in PowerPoint too.\n\n**Native horizontal category names (LH-93).** Category names sit in the physical left gutter in both LTR and RTL; horizontal bars retain a top-to-bottom category axis and left-to-right numeric axis in RTL. When the computed numeric minimum is negative, PPTX writes `c:catAx/c:tickLblPos low`, so Office does not attach the names to the zero crossing. It keeps the axis crossing, bounds, fonts and authored axis titles/legend/data-label options. Ordinary nonnegative exports retain their previous bytes. A horizontal chart with explicit options still uses Office\'s automatic inner-plot dimensions: its native width/height can differ from the preview, an inherited limitation untouched by this label correction. No invented plot inset or exact options-plot parity is claimed.\n\n**Bar width and gap (LH-176).** Clustered columns and bars leave a gap of 1.5 bar widths between categories and stand side by side; stacked and 100% stacked ones leave half a bar width and stand on one another (`CHART_BAR_GAP_WIDTH`: DrawingML `c:gapWidth` 150 and 50, `c:overlap` 0 and 100). The gap is a share of one bar, as PowerPoint reads it, so a category of `n` clustered series holds bars of `band / (n + 1.5)` (`chartBarGeometry`): the preview draws that geometry, the PPTX export writes the same gap width and overlap, and a small chart\'s labels fit against the same bar slot. Before LH-176 the preview read the gap as a share of the whole cluster and drew two series\' bars about a third thinner than PowerPoint.\n\n## Category order and waterfall totals\n\nA bar chart (`bar`, `stacked-bar`, `100pct-stacked-bar`) lists its categories top to bottom in data order, the first series at the top of each cluster. The PPTX export writes PowerPoint\'s reversed category axis (`c:catAx` `c:orientation val="maxMin"`) with the value axis crossing at the last category (`c:valAx` `c:crosses val="max"`), so the value labels stay at the bottom and PowerPoint draws what the preview draws. Column, line and area charts keep their order (reversed only for right-to-left slides).\n\nA waterfall\'s bars float from the running total. OPF has no total marker, so core\'s `waterfallSteps(values)` infers one: the **last** value is a total when at least two values precede it and it equals their sum (to twelve significant digits), as in Start 100, +24, -8, End 116. A total bar stands on zero and does not add to the running total; its color and label follow the waterfall roles (LH-107, [Chart marks](#chart-marks-waterfall-roles-value-lists-stacked-labels-reference-marks)), or with `colors` the third palette color (increases the first, decreases the second); the native PPTX waterfall (`chartex: \'native\'`) writes it as `cx:subtotals`, which PowerPoint draws the same way. Any other last value is one more step; intermediate subtotals are not inferred.\n\n## Chart layer: small charts and the header row\n\nStatus: LH-03 and LH-81 (layout harvest). Two defaults make a plain chart read like a designed one. Composition decides them once per chart item, from the chart, its resolved data and its box, and puts them on the composed item as `chart.layer` (core `chartLayer`, on `@openpresentation/opf/composition`); the preview and the PPTX export both draw that decision.\n\n**Small charts (LH-03).** A clustered column, bar or line chart (`column`, `bar`, `line`, `line-with-markers`) of one or two series, each of at most sixteen points (`SMALL_CHART_MAX_SERIES`, `SMALL_CHART_MAX_POINTS`), whose value labels fit beside each other at the chart text size (a column or line label no wider than the room between neighboring marks, a bar label no taller than its bar\'s slot). The fit decides, not a count (LH-111; the limit was eight points): twelve monthly columns are labeled when their labels fit, and a focus\'s context marks then take the light labeled gray (below). Such a chart:\n\n- labels every mark with its value, at the type\'s default position (outside the end of a column or bar, above a line point), in the column\'s number format;\n- draws no value axis: no tick labels, no gridlines and no value axis line (the category axis line stays at zero). The PPTX value axis is deleted (`c:delete val="1"`) and has no `c:majorGridlines`; the composed axis still sets the scale. Nothing reads a length from zero, so a line\'s scale drops zero once its minimum is at least 0.75 of its maximum (LH-119, `CHART_LABELED_ZERO_SHARE`; every other chart keeps PowerPoint\'s rule, zero dropped only when every value is in the top sixth of the range);\n- draws no chart panel: the chart stands on the card or the slide background, and its colors and labels are judged against that backdrop (LH-105 made this every chart\'s default);\n- on a one-series column or bar chart whose categories run in time (LH-105, see [Defaults follow Few](#defaults-follow-few)) and whose slide title names none of them, draws the last point that has a value in a stronger shade of the series color and every other point in the series color (LH-95, core `chartEmphasisColors`). The shade is the series color mixed away from the backdrop, towards black on a light backdrop and towards white on a dark one, just far enough to stand 15 L* (CIE) from it (`CHART_EMPHASIS_MIN_LIGHTNESS_STEP`), so the emphasis shows; moving away from the backdrop only raises the contrast, so every bar keeps 3:1 against the backdrop (`CHART_EMPHASIS_MIN_CONTRAST`; a bar is a graphical object under WCAG 1.4.11). A series color too close to black or white for that step is shaded the other way, still at 3:1. This emphasizes the last bar in all 84 gallery theme x color scheme x light and dark combinations (a faded tint of the other bars, LH-03\'s first rule, found room in 36). The PPTX export writes the series in its color and the emphasized point as one `c:dPt`.\n\n**Header row (LH-81).** A column, bar, line, area or combo chart of any grouping draws a row above the plot. Its caption, bold at the chart text size in the text color, sits at the start of the row (the right edge right to left). A caption is generated only when it adds to the legend: one series gives `<series> by <category>` ("Count by stage"), the series part being the value axis title or the series name; two or more series give a caption only from a value axis title ("Revenue ($M) by quarter"), since the legend already names them. The category part is the category axis title or the category column\'s name in sentence case: a plain capitalised word is lower-cased, and an acronym or proper-looking token (all capitals, an internal capital or a digit: "Q1", "ARR", "FY27") stays as written. Outside English decks the caption is the series part alone. Two to four series show their legend in the same row (at its end) or, when caption and legend do not fit together, at the start of a second row. LH-143: a legend wider than the row wraps its entries onto a second row (`CHART_HEADER_LEGEND_ROWS`) instead of moving to the side, so the decision does not depend on the font an engine measures it in (the preview\'s font measured a legend too wide for the row while the PPTX export\'s narrower font fitted it, so the same chart had two plot widths); only an entry wider than the row, or a legend of more than two rows, keeps the side legend. The plot then takes the chart\'s whole width, and PowerPoint lays the entries out in the legend\'s box (one row when its font fits them). In PowerPoint the caption is the chart title, and title, legend (`legendPos t`) and plot area (`layoutTarget outer`) carry the positions core computed as `c:manualLayout`.\n\n**Ring names (LH-92).** A doughnut of two or more rings (LH-60\'s nested rings: a pie or doughnut of several series) colors its slices by category, and its legend names the categories, so each ring names its series inside the ring, on its largest slice (`chart.layer.rings`, core `chartRingLabels`). The name is that slice\'s label: alone, or before the slice\'s own label with the labels\' separator ("FY24, 40%"), in the color that contrasts with the slice. The PPTX export writes it as the slice\'s `c:dLbl` with `c:showSerName val="1"`, which PowerPoint draws in the ring, first among the label\'s parts; import reads the other slices for the chart\'s own labels. A pie drawn as rings labels inside its rings as a doughnut does (no `c:dLblPos`).\n\n**An explicit option wins.** `dataLabels: false` keeps a small chart\'s value axis and draws no labels; an explicit `dataLabels` is drawn as written (a label without the value, or a value axis title, keeps the value axis); `highlight` and `colors` keep their colors (no emphasis); a `legend` option keeps that legend and draws no header row; a payload `caption` replaces the header caption (the legend still moves into the header).\n\n**Import.** `fromPptx` does not write these defaults back: value labels on a chart the small-chart rule covers (by type and counts) and a header legend (`legendPos t` with a manual layout) import as no option, so an exported deck imports with the options it was authored with. LH-105: every chart area is unfilled now, so a small chart is recognized by its deleted value axis; a small chart whose value axis has a title (its axis is kept) imports its default labels as `dataLabels: true`, which draws the same chart.\n\nNative chart-series name edits import from the current native cached reference or direct text value. Numeric point selectors keep their series index; a name selector that no longer exists reports a finding and keeps the actual overlay position. The native header legend uses a manual box sized for the exported names. A longer rename in PowerPoint can omit another legend entry while its data and bars remain intact. Import the edited file, review its findings and export the current OPF again to recompose the header at the retained text size. Longer names can require this reflow; native editing keeps the authored box size.\n\n## Defaults follow Few\n\nStatus: LH-105 (layout harvest). The defaults follow Stephen Few (*Show Me the Numbers*; *Information Dashboard Design*): every pixel of ink shows data, color is for what matters, labels sit at the data. Composition decides them with the rest of the [chart layer](#chart-layer-small-charts-and-the-header-row) (`chart.layer`), and the preview and the PPTX export draw the same. Every explicit option still wins, and `fromPptx` does not write a default back as an option.\n\n| Default | Rule | Why (Few) |\n| --- | --- | --- |\n| No panel | No chart draws a panel (the gray card surface it had): it stands on its card or the slide background, and its series, labels and text are judged against that backdrop (`chartPaletteForFill`, `textColorForFill`). The PPTX chart and plot areas are `a:noFill`, and so is a chartex chart area. | Non-data ink: a panel frames nothing the reader needs. |\n| Soft series colors | A series from the scheme takes its accent softened: core `softenChartPalette` (on `chartPaletteForFill(..., { soften: true })`) moves its HSL lightness `CHART_SERIES_SOFT_MIX` (25%) of the way towards the backdrop\'s and lowers its saturation by the same share (`satMod` 75%, `lumMod` 75%, `lumOff` 25% on white), or by less, in 1% steps, where the full move would take it under 3:1 against the backdrop (4.5:1 for a scheme series on a dark backdrop, LH-55) or closer to a neighboring series than the palette had them, capped at 11 L* (20 between series 1 and 2 on a dark backdrop). An authored `colors` entry is drawn as written. The PPTX export writes a softened accent as the theme color with those transforms (`<a:schemeClr val="accent1"><a:satMod/><a:lumMod/><a:lumOff/></a:schemeClr>`, `chartSoftColors`), so re-theming in PowerPoint keeps it soft. | Soft colors for ordinary data; strong color is kept for emphasis. |\n| Emphasis from the title | The slide title and subtitle are matched against the chart\'s series names, category names and (one series) values (core `chartTitleFocus`, `chart.layer.focus`): words of any script compared with `Intl.Collator` at base sensitivity in the deck language, a possessive dropped and a plural matching its singular; a name of several words also matches by the words it does not share with every other name ("Enterprise NPS" beside "Mid-market NPS" by "Enterprise"); a unit in parentheses is not part of a name; a month name matches the category of that month (November and Nov, in English and the deck language); a number in the title matches the categories with that value at the precision written (1,790; 31; 20% for a percent column). The focus is a proper subset: on a chart of several series the series named, else the categories named, else (every series named) the one named first; on one series or a pie, the categories named or whose values are printed. The focused marks keep their full-strength color and the other marks take the context neutrals (core `chartContextColors`): grays in the backdrop\'s hue, the backdrop mixed towards the text color, one per context series (or slice, or stacked segment) in the order they come, the first the strongest and each next one 11 L* lighter, so neighboring context series stay apart; each keeps a color difference of 20 (CIE76) from the focused colors, which a gray beside a colored focus has by its chroma. The context reaches 3:1 against the backdrop where it is read against an axis, and only 1.6:1 (`CHART_CONTEXT_LABELED_MIN_CONTRAST`, a light gray) where every context mark carries its text: a small chart\'s value labels, the names at the line ends, the names on the slices (WCAG 1.4.11 does not ask 3:1 of a graphic whose information the text gives; `chart.layer.focus.labeled`). That light floor is for filled marks (columns, bars, areas, slices): a context mark drawn as a stroke (every line series, a combo\'s line) keeps 3:1 even when labeled, because the line is the data and a thin line at 1.6:1 all but disappears (core `chartSeriesStrokes` and `chartFocusContextColors`, which the preview and the PPTX export both read). The PPTX export writes a gray that equals a neutral as that scheme color (`tx1` with `lumMod`/`lumOff`). Column, bar, line, area, pie and one-series doughnut charts; not combo charts or the chartex constructs. | Color only for what the message is about; the rest is context, light where it is labeled. |\n| Emphasis from the slide (LH-113) | When the title names nothing, the focus comes from the slide\'s other texts: every text block, list entry, quote and chart `alt` (core `slideFocusSources`, `chartSlideFocus`). Each is matched as the title is, with conservative rules: stop words never name a key; a proper name of several capitalized words matches by its first word ("Corvid" for "Corvid Plastics"); a printed quantity (3.1%, $71M) is a value, not a name; a range ("from March to August", "range from 71 in APAC to 78 in the Americas") names nothing; coordinated keys ("Engineering and support") are named together, and otherwise the key a sentence names first is its subject; a paragraph over 140 characters that names more than one key and a list that names keys in two or more entries name nothing; and the focus is what every naming source agrees on. The same focus highlights a table\'s rows (`table.highlight`, [content payloads](content-payloads.md#highlighted-rows)) on the same slide. | The message is often in the sentence beside the chart, or in the chart\'s own alt, not the title. |\n| Emphasis only over time | Without a title focus, a small one-series column or bar chart emphasizes its last point (LH-03, LH-95) only when its categories run forward in time (core `chartCategoriesInTime`, below). Its emphasized point takes the series color at full strength (or a stronger shade of it, 15 L* from the soft color); the others keep the soft color. | The last point is the latest one only in time; on nominal categories it is just the last one written. |\n| Line ends instead of a legend | A line chart (`line`, `line-with-markers`, stacked lines) of two to four series without `legend` or `dataLabels`, every series having a value in the last row, names each series at its last point: its last value as its data labels print it, then its name ("61 Enterprise NPS"), in the series color made legible as text (`chartSeriesLabelColor`, 4.5:1), bold for a series the title names (`chart.layer.endLabels`). The plot leaves a gutter for the names at its end (`chart.layer.plot`; the left right to left). Names closer than a text line move apart, never more than a line from their point; when they cannot (or when the gutter would turn the category labels the legend layout keeps level), the chart keeps its header legend. A small two-series line chart gives its value labels and hidden value axis up for the end labels. The header row keeps only its caption. PPTX: the last point\'s `c:dLbl` with the text as written (`c:tx c:rich`, value first, which PowerPoint\'s own field order would reverse), `c:showSerName`, `c:dLblPos r` (`l` right to left) and a manual layout offset where the name moved; no `c:legend`; the plot area\'s inner manual layout. Area charts keep their legend: PowerPoint has no label position for an area point. | Direct labels: the eye does not travel between a key and the data. |\n| Names on the slices | A pie or one-series doughnut without `legend` or `dataLabels` names each slice with a value (`chart.layer.slices`): inside the slice when the name\'s text fits there at the slice\'s inside end (a doughnut: in its ring), in the color that contrasts with the slice; else, on a pie, outside its end. The outside names shrink the pie as outside labels do. A doughnut name that does not fit its ring, outside names that would touch each other or leave the chart box, or a pie shrunk under 30% of its room (`CHART_SLICE_LABEL_MIN_RADIUS`) keep the side legend. PPTX: one `c:dLbl` per slice with `c:showCatName`, `c:dLblPos inEnd` or `outEnd` (none on a doughnut), `c:showLeaderLines`; no `c:legend`. A doughnut of several series (nested rings) keeps its legend. | Labels at the data, not in a key. |\n| Fewer intervals | The value axis has at most `CHART_MAX_INTERVALS` (6) intervals of 1, 2 or 5 times a power of ten (it was 8, and `maxIntervalsFor` capped at 10); an axis with room for three intervals is not tightened to one. Gridlines stay light (`gridline`, tx1 at 15%), horizontal on column, line and area charts and vertical on bar charts; no tick marks on either axis (`c:majorTickMark none`). | A few well-rounded ticks; gridlines only as faint as they must be. |\n\n**Time order** (`chartCategoriesInTime(labels, { title, language })`). Categories run in time when every label is one family of time point running forward: years (2024, FY24, FY 2025, \'24; a span FY24/25), periods (Q1 to Q4, H1 and H2, M1 to M12, and outside English T1 to T4 and S1 and S2, with an optional year: Q1 2024, 2024 Q1, Q1\'24, FY24 Q3, 1Q24), weeks and steps (W12, Week 3, Day 4, Sprint 5, and the deck language\'s words for year, quarter, month, week and day from `Intl.DisplayNames`), months (January, Jan, Sept, with an optional year, in English and the deck language\'s `Intl.DateTimeFormat` names), dates (2024-03, 2024-03-15, 15.03.2024) and numbers (a strictly increasing sequence). Years and numbers must increase; months, periods and weeks without a year may wrap once (Nov, Dec, Jan); digits of any script count. A reversed run (2026, 2025, 2024) is not in time. Only when the labels are not one family, a category title (the category axis title, else the category column\'s name) that names a time field (Year, Quarter, Month, Week, Day, Date, Period, Time, Fiscal year, or the deck language\'s word) makes distinct labels time ordered. P1, P2 (priorities) and an English T1 (a tier) are not periods.\n\n**Validator.** Two info findings (content) say where Few\'s advice is not followed; they never change the drawing: `opf/chart-dual-axis` for a combo chart with a `secondaryAxis` (two charts read more truly than one with two scales) and `opf/chart-pie-many-slices` for a pie or doughnut of more than five categories (compare them with bars). See [validate.md](validate.md).\n\n**Not in this change.** Bars are not sorted by value (the author\'s order is kept), chart types are not changed, and rotated category labels keep LH-93\'s rule. The waterfall roles, the value list beside a pie, the values inside stacked segments and the reference marks followed in LH-107 to LH-110 ([Chart marks](#chart-marks-waterfall-roles-value-lists-stacked-labels-reference-marks)).\n\n## Chart marks: waterfall roles, value lists, stacked labels, reference marks\n\nStatus: LH-107 to LH-110 (layout harvest, from the Claude Design chart comparison: chart corpus s09, s13, s14, s16, s17, s18, s19, s24). Composition decides them with the rest of the chart layer (core `chart-marks.ts`, on `chart.layer`); the preview draws them and the PPTX export writes them. As with [Defaults follow Few](#defaults-follow-few), an explicit option wins (`dataLabels` and `legend` keep the chart as authored, `colors` keeps a waterfall\'s palette positions) and `fromPptx` does not write a default back as an option.\n\n| Mark | Rule | PowerPoint |\n| --- | --- | --- |\n| Waterfall roles (LH-107, `layer.waterfall`) | Each bar has a role (core `waterfallRoles`): the inferred total (above) and, when there is one, the first bar it runs from ("2024 profit") are **totals**; the rest are **increases** or **decreases** by sign. Totals take the strong color, the scheme\'s `dark2` when it keeps 3:1 against the backdrop and a color difference of 20 (CIE76) from the accent, else the text color (a dark slide); increases take the series color at full strength; decreases the first context neutral (core `chartWaterfallColors`), the light gray when the bars are labeled. Without `dataLabels`, every bar carries its value: a step signed (`+9.3`, `\u22127.4` with U+2212), a total unsigned and bold (`waterfallLabelText`), over the bar (a decrease: under it); when the widest label does not fit its category band, there are no labels and the value axis stays. With the labels, the value axis and its gridlines go (unless it has a title), and the column\'s name (or the value axis title) becomes the caption above the plot ("Operating profit ($M)"). Connectors between steps are dashed (LH-125: 1 pt, 4 on and 3 off, in the axis line color). | The native waterfall (`cx:`, the default `chartex: \'auto\'`) carries it all: each bar\'s `cx:dataPt` in its role color, `cx:dataLabels pos="outEnd"` with the signed number format `"+"F;"\u2212"F;F` (F: the column\'s format, else General; `waterfallSignedFormat`) and a `cx:dataLabel` per total in F, bold; the value axis `hidden="1"` without gridlines; the caption as `cx:title` (`align="min"`, bold). PowerPoint draws its connector lines (`cx:visibility connectorLines="1"`) with the series\' line (native check 2026-11-03: its width, dash and color; the chart style part\'s line entries change nothing), so the series\' `cx:spPr` carries `a:ln w="12700"` with `a:prstDash val="dash"` in the axis line color and each bar\'s `cx:dataPt` an `a:ln` with `a:noFill` (the bars have no outline). The clustered-column fallback (`mc:Fallback`) is unchanged. |\n| Value list (LH-108, `layer.valueList`) | A pie or one-series doughnut without `legend` or `dataLabels`, of two to eight categories with a value (`CHART_VALUE_LIST_MAX_ROWS`), lists them beside it instead of naming its slices (core `chartValueList`): the values\' unit (the value column\'s name or the value axis title) over the value column, then one row per category, a swatch in the slice\'s color, the category and its value right-aligned in the column\'s format, a hairline between rows; the rows the title names (the LH-105 focus) bold in the text color, the others in the chart text color. The list takes the end of the chart box (the start right to left), 45% of it or what its text needs, with two text sizes before it; rows are up to 2.4 lines apart and at least 1.25, centered on the box. **When:** the list is drawn only when the pie keeps the radius it has alone (90% of half the box\'s shorter side) beside it, or 80% of it when a slice is under 10% of the total (`CHART_VALUE_LIST_SMALL_SLICE`) or the slice names would not all sit inside their slices: then names leave the pie anyway. So a pie in a wide box (the whole body) lists, and a pie in a half-width column keeps its slice names (or its legend). | The pie is drawn in core\'s square (the plot area\'s inner manual layout), with no legend and no labels. The list is native shapes over the chart frame, each tagged `OPF_CHART_MARK_V1` (src/chart-marks.js): text boxes for the unit, names and values, rectangles for the swatches and lines for the rules. They are drawn for the plot core pinned and do not follow the chart if it is moved by hand. |\n| Stacked values and names (LH-109, `layer.stack`) | A stacked column or area chart (and its 100% form) of two to six series without `dataLabels` or `legend` draws each segment\'s value inside it (in the color that contrasts with the segment) when its text and a quarter text size fit the column\'s width (90% of the category band on an area) and a text line fits the segment\'s height (core `chartStack`, `stack.values`). An area\'s first and last points carry no value (a centered label would hang outside the band), and a 100% chart none (the axis reads shares; the raw values would contradict it). The series are named beside the last column (the end of the last band, a text size and a half clear of an edge-to-edge area\'s end value): a swatch and the name, centered on the segment\'s middle, moved apart only to keep a text line between names and never more than a line from their segment (`placeStackNames`); the bold name is the series the title names. The header row keeps its caption only, and the plot leaves a gutter for the names. When the names cannot be placed so, the chart keeps its header legend. The plot is pinned either way (`layer.plot`). | The values are the chart\'s own data labels (`c:dLbls` with `c:showVal`, `c:dLblPos ctr` on columns; an area point has no label position, so PowerPoint places it itself: not yet checked natively), each series\' text in the color that contrasts with it, and one `c:dLbl` with `c:delete` per segment whose value does not fit. The names are tagged native shapes over the frame (a swatch and a text box each); the plot area keeps core\'s inner layout and there is no `c:legend`. Import reads values-only center labels on a stacked chart as the default (no `dataLabels`). |\n| Explicit reference lines (LH-110, `chart.referenceLines` \u2192 `layer.references`) | Optional ordered value-axis annotations on column, bar, line, line-with-markers, area and combo charts. Author a finite numeric value, optional verbatim label, axis and independent color/width/dash stroke. Absence or an empty array draws none. Titles and subtitles never create a threshold or a period band. Every target expands automatic bounds only on its associated axis. | Vertical charts with at least two categories use native constant helper line series and optional native endpoint labels, spanning first-to-last category centers. Horizontal bars and singleton-category charts use fixed ordinary line/text overlays. See the explicit contract and editing limits below. |\n\n### Explicit reference lines\n\nThe authoritative schema supports `chart.referenceLines`; the composition, SVG renderer and PPTX exporter/importer implement the contract below. This replaces the earlier title-derived thresholds and period bands. No bands API is introduced. The [complete example](../examples/technical/explicit-chart-reference-lines.opf.json) covers the native/fallback split; [localized labels](../examples/technical/localized-chart-references.opf.json) are authored text, independent of title parsing.\n\n```json\n{\n "type": "line",\n "data": {"columns": ["Month", "Availability"], "rows": [["Jan", 92], ["Feb", 96], ["Mar", 97]]},\n "referenceLines": [\n {"value": 95, "label": "Target 95", "stroke": {"color": "accent2", "width": 2, "dash": "dash"}}\n ]\n}\n```\n\nThe main data line retains its existing solid default. A reference stroke is independent of every data series.\n\nA [singleton combo example](../examples/technical/singleton-combo-reference-lines.opf.json) places Revenue180 on the primary value axis and Margin0.25 (25% under `0%`) on the actual secondary value axis. Both references expand their own bounds. With one category, both are full-plot line/text overlays; they remain fixed after independent PowerPoint chart/data/axis edits. The exporter records each overlay\'s explicit current category/value axis IDs, and import requires the same unique reciprocal native pair and unchanged geometry/style/text binding. Reordering axis declarations alone is harmless; swapped, duplicate or missing associations preserve ordinary shapes with a diagnostic. Older multi-axis overlay receipts without explicit pairs also remain ordinary shapes; re-export their OPF source to create current receipts.\n\n| Property | Meaning and default |\n| --- | --- |\n| `referenceLines` | Optional array. Absent/`[]` means none. Authored order, duplicates and values equal to data are retained; no two-line cap or inferred-range cutoff. Nonempty arrays are supported only by `column`, `bar`, `line`, `line-with-markers`, `area` and `combo`, the types with one value axis for every series. On any other type, the stacked and 100% stacked types among them, a nonempty array is the located error `opf/chart-reference-unsupported-type` at `referenceLines`: a reference is never dropped silently. In the editor, a chart-type switch to such a type refuses (`chart-reference-lines-unsupported`) unless the caller passes `removeReferenceLines: true`, which removes them in the same step and reports them. |\n| `value` | Required finite number in the associated value axis\'s data units. With a `0%` column format, `0.25` means 25%, and `25` means 2500%. Strings are invalid; neither labels nor titles select units, and there is no 0\u20131 clamp. |\n| `axis` | `"value"` by default. `"secondary"` requires an actual combo secondary value axis. Category/X references are outside this scope. Invalid associations produce located validation errors. |\n| `label` | Optional nonblank plain text, shown verbatim. No label or numeric text is synthesized. |\n| `labelPosition` | `"end"` by default, or `"start"`. Requires a label. Horizontal endpoints mirror in RTL; vertical bar-reference endpoints mean top/bottom. |\n| `stroke` | A [Line](schema-reference.md#line): `{ color, width, dash }` with every part optional, or `"none"` to draw only the label. The same definition styles table cell borders. |\n| `stroke.color` | Existing ColorRef: hex, theme role/slot, variable or color transform. Default is the effective chart-text neutral. |\n| `stroke.width` | 0\u201364 reference pixels at a 720px short edge; default 4/3 (one point before slide scaling). Zero (the same as `"none"`) hides only the stroke; its value still expands bounds and its label remains. PowerPoint draws a line of width 0 as a hairline, so the export writes it fully transparent. |\n| `stroke.dash` | `"solid"`, `"dash"` or `"dot"`; default `"dash"`. The narrow stroke deliberately excludes gradients, arrows, compound and sketch effects. |\n\nEvery reference participates in its own axis\'s automatic nice bounds, zero anchoring and sibling-axis sharing. Combo primary and secondary bounds come from shared composition. Labels use chart typography and their logical endpoint, with clearance for half the reference stroke width. In authored order, placement checks ordinary data-line/marker ink, the bars of a column, bar or combo chart, the filled area of an area chart and preceding reference labels, trying the preferred adjacent side, then the opposite side, then the same two places at the other end of the line (RR-105: a label is never drawn on a mark while a free place exists at either end; the import still returns the authored `labelPosition`). If none fits, the preferred position and all text remain with an overflow/collision diagnostic, and a label that sits on a bar or an area stands on a plate of the chart\'s surface color (a filled data label in PowerPoint) so it reads against the mark. Labels never shrink, disappear or move their numeric reference line to make room. A reference never changes which marks a chart emphasizes: the focus the slide\'s texts name is drawn exactly as on the same chart without references, and `highlight` (an empty one included, which switches derived emphasis off) still decides it. So that a title still cannot move the plot, a chart with references keeps its series names at regular weight: a bold focused name is wider and would change the direct-label gutter. Fixed chart/data/frame title or subtitle edits leave references, bounds, plot, spans and label coordinates unchanged. General slide reflow can change the chart frame.\n\n**PowerPoint editing limits.** The five vertical types with two or more categories export each reference as an owned constant native line series, markerless and excluded from ordinary legends/default data labels, with independent color/width/dash and an optional native endpoint custom-text label. Each helper series is named after its reference\'s label ("Reference" when it has none, " 2", " 3" added to keep names unique against the data series, the category heading and other helpers), in its name cache and as the workbook column heading Edit Data shows; a reader that lists helpers in the legend, such as Keynote, which also draws no reference labels, shows that name. SVG and PPTX both span the first-to-last category centers. Native references follow chart transforms and value axes. Existing exports pin bounds, so changing data does not promise automatic rescaling. Helpers contain repeated values over the exported workbook range: adding categories requires extending the range, and editing just one target cell can make a helper nonconstant. Horizontal bars and single-category charts instead use full-plot editable ordinary line/text overlays. These overlays stay fixed after chart movement, resizing, axis, legend or data edits in PowerPoint; re-export OPF to recompute them.\n\n**Import ownership.** An unchanged export imports each reference\'s stroke as the document wrote it: an absent stroke stays absent, a partial one stays partial, `"none"` stays `"none"` and a scheme color keeps its name; `axis` and, with a label, `labelPosition` come back written out (`"value"`, `"end"` when the document left them out). A line restyled in PowerPoint imports its current paint. Verified versioned helper ownership is classified before native chart groups. Constant helpers restore their current values, supported styles and labels once, excluded from ordinary data. Names never establish ownership. Nonconstant, ambiguous or stripped helper ownership retains all ordinary series and cached values with diagnostics. Same-axis ordinary line groups coalesce into one line chart; mixed marker choices produce a diagnostic. Separate-axis all-line groups require an OPF combo: the first current series becomes primary-axis columns, with a named representation/axis diagnostic and every numeric series/order retained. If an uncertain mixed area/line chart cannot be expressed by the current OPF combo model, import retains all data/order as a combo and explicitly diagnoses the area-to-column representation change; axis or duplicate-name ambiguity is also diagnosed. If per-series category caches disagree, the single OPF category axis uses the first series labels with a diagnostic; all numeric series remain. This is data preservation, not visual parity. For fallback overlays, the exact authored value is restored only after versioned, hash-bound current line/label geometry and style plus chart plot/axis/frame binding prove the overlay unchanged; metadata removal or any relevant edit keeps visible shapes with a diagnostic and no stale reference. Verified unchanged overlays restore/consume once; edited or uncertain overlays remain visible ordinary shapes without a stale duplicate reference. Legacy V1 inferred line, label and band shapes remain visible ordinary shapes with diagnostics.\n\n\n**Stacked bars, edge-to-edge areas and the doughnut hole (LH-125).** The marks above gain three follow-ups from the same comparison (chart corpus s10, s16, s19):\n\n- **Horizontal stacked bars** (`stacked-bar`, `100pct-stacked-bar`; two to six series without `dataLabels` or `legend`) draw each segment\'s value inside it when its text and a quarter text size fit the segment\'s length and a text line fits the bar\'s thickness (a band over 1.5; not on a 100% chart) and name their series in a row above the plot: each name (a swatch and the name) starts where its series\' segment starts in the first bar, left to right (`placeBarNames`; `stack.names.above`). When two names would meet (a hairline segment) or the last would leave the chart, the header legend stays. Core lays the plot out as the preview lays out a horizontal bar chart (`horizontalStackPlot`: the category gutter, the value labels below, the names row between the header and the plot) and pins it (`layer.plot`); the preview draws it there and the PPTX export writes it as the plot area\'s inner layout, so the names stand over the segments in PowerPoint too. The value labels sit at the bottom in PowerPoint (`c:valAx` `c:tickLblPos nextTo`; PptxGenJS\'s default `low` put them at the top of a bar chart whose categories run down).A stacked bar chart whose bars align to a table\'s rows (LH-115, `chart.layer.rows`) uses the table\'s plot instead: the pinned plot and the names row go, the header keeps its legend and the values that fit the aligned segments are printed (`restackForRows`). A side legend (a legend of more than two rows, or an entry wider than the chart) takes its width off the pinned plot, as the preview lays it out. **LH-142: labels or an axis, not both.** When every segment with a value carries its value (and the chart is not 100% and has no value axis title), the value axis, its tick labels and its gridlines are dropped (`stack.valueAxis === false`, core `chartValueAxisHidden`, which a small chart\'s `small.valueAxis` answers too): the plot is laid out without the tick row, the preview draws no ticks, gridlines or axis line, and PPTX writes `c:valAx` with `c:delete val="1"` and no gridlines. One segment too narrow for its value keeps the axis; a chart aligned to a table\'s rows keeps it too.\n- **A stacked area runs edge to edge** (`stack.edge`, any `stacked-area` or `100pct-stacked-area` of two or more categories): the category axis crosses on the tick marks (`c:crossBetween val="midCat"`), the first category on the plot\'s start and the last on its end, with the plot keeping half of the end category labels\' width beyond its edges (`chartPlotInset`) and a fifth of a text size more under the labels, clear of the value axis\'s zero. The first and last points of each band hold their values inside the band, left-aligned at the start edge and right-aligned at the end edge (`stack.ends`, `areaEnd`; the first category is at the right edge right to left): a value fits when its text lies within half a category band and the band is a text line tall at both ends of the text. PPTX: the chart\'s own labels at those points are deleted and the values are tagged text boxes (`stack-end`) in the color that contrasts with the band.\n- **A doughnut prints its focus value in its hole** (`valueList.hole`, `doughnutHole`): when a doughnut with a value list has one slice the title names (the LH-105 focus), that slice\'s value stands in the hole in twice the chart text size, bold, in the slice\'s color made legible as text, with the slice\'s category under it at the chart text size when it fits (84% of the hole\'s width, both lines within 70% of its height); a value that does not fit at 1.25 text sizes leaves the hole empty. The hole is half the doughnut\'s radius in both engines. PPTX: tagged text boxes (`hole-value`, `hole-name`) centered in core\'s square.\n\n**The doughnut hole (LH-182).** A doughnut\'s hole takes the surface the chart stands on, so a deck watermark or a background motif behind the chart does not show through it (only through the hole: around the doughnut it still shows). Core composes the doughnut\'s square and hole (`layer.doughnut`, `chartDoughnut`): the value list\'s square when the doughnut has one (LH-108), else the preview\'s square (the box less its padding and the category legend at the end, 90% of half the shorter side); a doughnut with chart options (`legend`, `axisTitles`, `dataLabels`) has none and keeps an open hole in both engines. The preview draws the doughnut in that square with a surface-colored disk in the hole; the PPTX export pins the plot area to the square (`c:manualLayout`, layoutTarget inner) and lays an ellipse in the surface color under the chart frame at the hole (`c:holeSize` 50 is half the radius), tagged `OPF_CHART_MARK_V1` (role `hole`), which import consumes.\n\n**Thousands grouped by the deck language (LH-141).** Where the author wrote no number format, a whole number of four integer digits or more prints with its thousands grouped by the deck (or slide) language\'s locale (`groupNumber`, OPF\'s locale table: "6,240" in English and for a deck without a language, "6.240" in German, "\u0666,\u0662\u0664\u0660" in Saudi Arabic; Spanish groups only from five digits). LH-106: every label, tick and percentage, grouped or not, is in the language\'s own digits and decimal separator, so 999 and 1,000 agree (see [numbers in the language\'s own digits](design-resolution.md#numbers-in-the-languages-own-digits-lh-106-opf-034)). This covers the default value labels (a small chart\'s, a stacked chart\'s segments, a pie\'s or a line\'s), the pie value list, the doughnut hole value, a line\'s end labels and a metric\'s numeric `value` (a string value is the author\'s text and is never rewritten; a metric has no format field). The rule is per series: a series groups when every value in it is a whole number and one has four digits (`groupsThousands`), so a series with a fraction keeps the General form ("6240.5"). In PowerPoint the series\' own data labels take the number format `#,##0` (`GROUPED_LABEL_CODE`; the cache and the value axis keep General, and PowerPoint draws the separators of the viewer\'s region), so its labels agree with the preview. A format the author wrote (a `DataColumn` `format`) is never regrouped. The value axis follows the same rule (`groupsAxisTicks`): an axis of a column, bar, line or area chart with no number format of its own (its first series\' format) whose ticks are whole numbers reaching four digits groups its tick labels by the deck language, and PowerPoint\'s value axis takes `#,##0` (`sourceLinked="0"`); an axis format the author wrote and a 100% (share) axis stay as they are. Not covered: the labels and axes of a waterfall, funnel, treemap, histogram, pareto, combo or scatter chart.\n\n**Thousands grouping across chart constructs (LH-153).** The same rule reaches labels and axes beyond the ordinary category charts. A waterfall\'s labels (the sign stays outside the grouped number: "+3,200", "\u22121,450"), a funnel\'s, a treemap\'s value labels and a histogram\'s or Pareto chart\'s bars group by the deck language when their column has no format and holds whole numbers reaching four digits; a histogram of a lone value column plots bin counts, which always group. Their value axes, a combo chart\'s two value axes and a scatter chart\'s Y axis (and a box and whisker chart\'s) group by a rule decided from the plotted values alone (`groupsDataRange`: whole numbers, one of four digits, spanning at least 100 from zero for a column or a waterfall and from the lowest value otherwise), so the preview and PowerPoint agree. Combo primary and secondary scales now come from shared composition; PowerPoint retains its own scale selection only for constructs without composed bounds. A scatter chart\'s X axis groups only over a span of 1000 or more, so a column of years ("1990" to "2020") never reads "1,990". In PowerPoint a classic part\'s value axis, and a chartex part\'s labels and axes (the signed waterfall format `"+"#,##0;"\u2212"#,##0;#,##0`, a binned axis), take `#,##0`; a format the author wrote is never regrouped and a scatter chart\'s X cache keeps General.\n\n**Axis titles of a horizontal stacked bar (LH-154).** The pinned plot of a horizontal stacked bar chart (`horizontalStackPlot`) leaves the bands the preview carves for its axis titles: a value axis title takes one text line under the tick labels and a category axis title one text line before the row names, so neither overlaps them in either engine.\n\n**Neighboring series (LH-94).** Every series the scheme supplies stands at least 11 CIE L* from the series before it (`CHART_SERIES_MIN_LIGHTNESS_STEP`) in every default color scheme, on light and dark surfaces, strong and softened: a series closer than that is moved along the lightness axis (its hue and as much chroma as sRGB allows kept) to the nearest lightness that keeps its contrast floor (`separateNeighbors`), so `opf/chart-color-only` reports no lightness pair for a chart on a gallery scheme. An authored `chart.colors` entry is never moved. The last slice of a pie beside its first is LH-161\'s.\n\n**A pie\'s last slice beside its first (LH-161).** A pie or doughnut is a circle: its last slice touches its first, so the same step holds there. `chartSlicePlan(fill, palette, count, { legible })` takes the colors a chart draws and, when the last of `count` slices (a scheme color, never an authored one) is closer than 11 CIE L* to the first, moves that one slice along the lightness axis (hue and as much chroma as sRGB allows kept) by at most `CHART_SLICE_MAX_SHIFT` (20 L*, so it still belongs to the palette) to the nearest lightness that keeps its contrast floor and the step from both its neighbors (a color difference under `CHART_SERIES_MIN_DIFFERENCE` from any other slice costs more the further it falls). Where no lightness within 20 L* clears both steps, the palette color stays and the chart is *bordered* (`bordered: true`): every slice of that chart gets a `CHART_SLICE_SEPARATOR_PX` (2 px at the 720-px reference) border in the surface color, which separates the wrap pair by shape. The preview reads the plan per chart (`sliceColors`, `sliceBordered`: the slice outline is the surface color at 2 px), the PPTX export writes the moved slice as an sRGB literal (never the scheme accent it came from) or each data point\'s line (`c:dPt` `a:ln`, 1.5 pt, in the surface color, the slide\'s `bg1` where it is the background), and `opf/chart-color-only` judges the plan\'s colors and accepts a bordered wrap pair. Every other slice keeps the palette color, so a pie of any size differs from the series palette in at most its last slice. Over the 14 gallery schemes, 4 surfaces and 3 to 12 slices (560 pies) 268 have a wrap pair: 116 are recolored (largest move 16.4 L*, median 9.1) and 152 are bordered; the other 292 are unchanged. Fewer than three slices and more than the palette holds (the colors repeat) change nothing; a treemap or funnel has no circle and no wrap pair.\n\n**Waterfall numeric axes (RR-105).** Core shares the running-total minimum, maximum and major interval with native PPTX, including a hidden value axis. The plan respects null gaps, negative steps, terminal totals, label space and axis titles. PowerPoint still chooses the inner plot margins of its Office 2016 ChartEx constructs automatically; exact inner-plot placement is not pinned as it is for classic charts. A shared numeric scale does not establish identical plot bounds.\n\n**Histogram bins and labels (LH-160).** Core decides a histogram\'s or Pareto chart\'s bins from the chart box (`layer.histogram`, `chartHistogram`), and both engines read it. PowerPoint\'s chartex category axis has no label interval and wraps a long bin label onto two overlapping lines, so "label every nth bin" is not available to the native chart; what both engines can do alike is draw bins that can be labeled. **Bins:** Scott\'s count (Office\'s automatic bins) is capped at the number of bins the plot can label one beside another, each taking `HISTOGRAM_LABEL_SLOT` (1.8) chart text sizes of plot width and never fewer than `HISTOGRAM_MIN_BINS` (5); a chart with room keeps Scott\'s count, and the count is written as `cx:binCount`. **Edge labels:** the edges are rounded to the decimals the bin width needs (`histogramEdgeDecimals`: the fewest decimals that keep every rounded edge within a tenth of a bin of the true one, so edges that already are whole numbers stay whole: "(8333, 11250]" for a bin 2900 wide, "(7.4, 11.1]" for one 3.7 wide), written as the category axis number format (`cx:numFmt`, `0` or `0.0`...; PowerPoint applies it to its bin labels, native check 2026-11-05), which keeps each label on one line. An edge is rounded as PowerPoint rounds it under that format (`histogramEdgeText`, RR-105): its decimal value to 15 significant digits, half away from zero, so 1.2 + 1.85 reads 3.1 in both engines (`toFixed` would read the binary 3.0499999999999998 as 3.0). **Value axis (RR-105):** the value axis of a histogram and a Pareto chart is core\'s too (`layer.histogram.valueAxis`, `niceScale` over the bars, zero-based, with as many intervals as the estimated plot height holds), and so is a Pareto chart\'s percentage step (`layer.histogram.percentUnit`); the preview draws them and the native chartex part writes them as `cx:valScaling` `min`, `max` and `majorUnit` (the percentage axis 0 to 1 with that step), because PowerPoint\'s automatic chartex axis follows its own rule. **Value labels:** per-bar data labels the author asked for are dropped (`layer.histogram.valueLabels === false`, neither engine draws them, the classic fallback included) when the widest label with half a text size of air is wider than its bar\'s slot, the rule of the small chart\'s labels (LH-111): about a dozen bars of a half-width chart, more on a wide one. A chart over a category column keeps its rows (only the value labels follow the fit rule) and its category labels stay PowerPoint\'s and the preview\'s own.\n\n**Negative categorical histograms (RR-105).** A histogram with category/value columns can contain signed values in OPF. PowerPoint\'s native histogram category aggregation omits negative categories even when its cache contains them. PPTX export therefore uses an editable native clustered column chart for this data in every `chartex` mode, including `native`, and reports `chartex-fallback`. Every category, value and series is retained; automatic axis bounds can include the negatives. This fallback imports as a `column` chart with its data, so it does not restore the authored histogram type. Nonnegative category data still uses native aggregation in `auto`/`native`; a single numeric column containing negative raw observations still uses native histogram binning. The fallback does not imply that every Office version or other ChartEx construct has been qualified.\n\n**Import.** `fromPptx` consumes the tagged `OPF_CHART_MARK_V1` shapes (they are the chart\'s defaults, not content) and reads the chart they belong to as having no legend option; a waterfall\'s signed labels (a `"+"` number format) and a stacked chart\'s center value labels import as no `dataLabels`; a native waterfall without labels imports as `dataLabels: false` (labels too wide to fit draw the same).\n\n## What each chart type supports (axis titles, legend, data labels)\n\n`chartOptionSupport(target)` in `@openpresentation/opf/composition` returns this table; the validator, the preview, the exporter and the importer all follow it. An option a type cannot show is **adapted** (dropped, or reset to the default) and reported as a `chart-option-adapted` diagnostic by the validator (a warning), the renderer and the exporter (`onDiagnostic`). It is never silently lost and never fails the render.\n\n| Type (catalog ids) | Axis titles | Legend | Data label content | Data label positions (default) |\n| --- | --- | --- | --- | --- |\n| clustered column, bar (`column`, `bar`) | category, value | yes | category, value | center, inside-end, inside-base, outside-end (outside-end) |\n| stacked and 100% stacked column, bar | category, value | yes | category, value | center, inside-end, inside-base (center) |\n| line, stacked line, with markers | category, value | yes | category, value | above, below, left, right, center (above) |\n| area, stacked area, 100% stacked area | category, value | yes | category, value | none: the label sits in the area at each category |\n| scatter | category (X), value (Y) | yes | category (X value), value (Y) | above, below, left, right, center (above) |\n| pie | none | yes | category, value, percent | center, inside-end, outside-end (outside-end) |\n| doughnut | none | yes | category, value, percent | none: labels sit in the ring |\n| radar, with markers, filled | none | yes | category, value | none |\n| histogram, pareto | category, value | none | category, value | center, inside-end, inside-base, outside-end (outside-end) |\n| waterfall | category, value | none | category, value | center, inside-end, inside-base, outside-end (outside-end) |\n| funnel | category | none | category, value | none (center) |\n| treemap | none | none | category, value | none (center) |\n| box and whisker | category, value | yes | none | none |\n| combo (`combo`) | category, value, secondary | yes | category, value | columns: center, inside-end, inside-base, outside-end (outside-end); lines: above, below, left, right, center (above) |\n| world (region map) | none | none | none | none |\n\nA chart type outside the catalog is never adapted.\n\n## Combo charts\n\nStatus: FA-15 (format audit). A `combo` chart draws clustered columns and line series in one plot, for an amount beside a rate such as revenue and margin %:\n\n```json\n{\n "chart": {\n "type": "combo",\n "data": {\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, { "name": "Margin", "format": "0%" }],\n "rows": [["Q1", 12.4, 0.31], ["Q2", 18.1, 0.34], ["Q3", 21.7, 0.29], ["Q4", 26.3, 0.37]]\n },\n "line": ["Margin"],\n "secondaryAxis": ["Margin"],\n "axisTitles": { "category": "Quarter", "value": "Revenue ($M)", "secondary": "Margin" }\n }\n}\n```\n\n| Field | Values | Absent means |\n| --- | --- | --- |\n| `line` | plotted series names, at least one | the last plotted series is the line |\n| `secondaryAxis` | line series names | every series uses the primary (left) value axis |\n| `axisTitles.secondary` | string | no secondary axis title |\n\n- **The plan.** Every plotted series (the `mapping.series` or the positional rule) is drawn as clustered columns, except the ones `line` names, which are lines with markers. At least one series stays columns, so a `line` that names every series draws the first as columns. A one-series combo chart is drawn as columns. Core\'s `resolveChartData` returns the plan as `combo` (`{ role: "bar" | "line", axis: "primary" | "secondary" }` per series) and orders the series columns first, then the primary-axis lines, then the secondary-axis lines, so the preview, the PPTX series order and the legend agree.\n- **The secondary axis.** `secondaryAxis` puts line series on a value axis at the right (at the left right to left). It has its own automatic scale and its tick labels use the number format of its first series\' column (`DataColumn.format`, for example `0%`); the primary axis uses the first column series\' format. Gridlines follow the primary axis. `axisTitles.secondary` titles it, rotated like the primary value title.\n- **Labels.** One `dataLabels` applies to both parts: column labels sit outside the end and line labels above the points by default; `center` applies to both; a position only one part takes (`inside-end`, `inside-base`, `outside-end` for columns; `above`, `below`, `left`, `right` for lines) applies to that part and the other keeps its default, with a `chart-option-adapted` note. `resolveChartOptions` returns the column position as `dataLabels.position` and the line position as `dataLabels.linePosition`.\n- **Legend.** As for other multi-series charts (right by default, or `legend`); a column series has a square key and a line series a line with a marker.\n- **Validation.** A `line` or `secondaryAxis` name that is not a column of the data is a `chart-mapping-unknown-column` error. A name that is not plotted, a `secondaryAxis` name that is not a line, a `line` that names every series and a one-series combo chart are `chart-mapping-adapted` warnings. `line`, `secondaryAxis` and `axisTitles.secondary` on any other chart type, and `axisTitles.secondary` on a combo chart without `secondaryAxis`, are `chart-option-adapted` warnings.\n- **PPTX.** One `c:plotArea` holds a clustered column `c:barChart` (primary axes) and a `c:lineChart` with markers. Secondary-axis lines form a second `c:lineChart` on a second `c:valAx` (`axPos r`, `crosses max`) and a deleted second `c:catAx`; the embedded workbook holds every series. Import reads such a plot area (one clustered column group, one or two line groups) back as `combo` with `line` (when it is not the default), `secondaryAxis`, the secondary title and the label position.\n- **Editor.** The chart type picker offers `combo` for data with two or more series, the chart options panel sets which series are lines and which lines use the secondary axis, and switching to another type removes the three fields.\n\n## How the engines draw and write them\n\nThe preview (opf-render) and the PPTX export (opf-pptx) both read `resolveChartOptions(chart, chartOptionTarget(chart.type))`, so they agree on which options apply and with which content and position. The highlight adds `resolveChartOptions(...).highlight` (the names that survive the type\'s support table), `chartHighlightMarks(highlight, resolvedData)` (which series and which rows are named) and `chartHighlightColors` (the two colors).\n\n- **Preview.** A legend, and the axis titles, are carved from the chart box before the plot is laid out: the legend at its edge, then the titles next to the axes. Only a chart that uses a field changes; a chart without them draws the same SVG as before. A vertical axis title is rotated 270 degrees, as PowerPoint draws it.\n- **PPTX, classic charts** (column, bar, line, area, pie, doughnut, scatter, radar): `c:catAx/c:title` and `c:valAx/c:title` (rich text, `c:overlay val="0"`), `c:legend/c:legendPos` (`t`, `b`, `l`, `r`; no `c:legend` for `none`) and a `c:dLbls` per series with `c:dLblPos`, `c:showVal`, `c:showCatName`, `c:showPercent` and an explicit `c:separator`, number format `General` (RR-54: the series column format, as `toExcelNumberFormat` writes it, when its `DataColumn` has one; see [chart-table-data.md](chart-table-data.md)).\n- **PPTX, chartex** (histogram, pareto, waterfall, funnel, treemap, box and whisker): `cx:axis/cx:title`, `cx:legend pos`, and `cx:dataLabels pos` with `cx:visibility` and `cx:separator`. Their fallback for apps without chartex support is a picture of the preview, which draws the options as the preview does; when that picture cannot be drawn, the classic fallback chart carries the same classic options.\n- **Highlight (FA-14), preview.** A highlighted mark is filled with the accent color, every other mark with the muted color; series keep their order (the highlighted one is not moved on top), as PowerPoint draws them. A chart without a highlight never calls the highlight code.\n- **Highlight (FA-14), PPTX.** Series colors go into `c:ser/c:spPr` (and `c:marker/c:spPr` on line, scatter and radar series); a per-point color is a `c:dPt` with `c:idx`: `c:dPt/c:spPr` on a column or bar, a circular `c:dPt/c:marker` on a line, the slice fill on a pie or doughnut. The accent is `a:schemeClr val="accent1"` when the deck theme holds the primary exactly (so re-theming in PowerPoint recolors it) and an `a:srgbClr` literal when the contrast adjustment moved it; the muted color is always an `a:srgbClr` literal, because a mix of two theme colors is not one scheme color with `lumMod`/`lumOff`. Data labels inside a mark are written per point where the mark colors differ. Chartex constructs are unchanged.\n- **Import.** `fromPptx` reads the same parts back into `axisTitles`, `legend` and `dataLabels`. A legend equal to the default for that chart (right for multi-series, pie and doughnut; none otherwise) is not recorded, so decks that never set the field import unchanged. Anything the three fields cannot express (per-series label overrides, number formats, rich-text titles, manual layouts) is reported with a diagnostic and not invented. The highlight is not inferred from the colors (a native chart\'s fills do not say which names were highlighted, and a hand-colored chart must not turn into a highlight): in `full` provenance mode the exporter records the authored `highlight` in the chart\'s `OPF_DATA_V1` data record, and `fromPptx` restores it while the chart\'s cached data is unchanged. With `provenance: false` or `\'references-only\'`, or after the data was edited in PowerPoint (`chart-data-provenance-changed`), the chart imports without a highlight and keeps the colors it shows.\n\n## Text alternative\n\n`Chart.alt` (FA-09) is a string: what the chart shows, in a sentence or two (the point and the key numbers), not "a chart". Unlike the three options above it changes no geometry.\n\n- **Preview.** The chart\'s SVG group carries `role="img"` and `aria-label`; the role makes the drawn marks inside presentational, so the label is the chart\'s one announcement. The text beside the chart stays reachable: the slide is a labeled group, not an image (see [Accessibility of the preview](content-payloads.md#accessibility-of-the-preview)).\n- **PPTX.** The value is the chart frame\'s `p:nvGraphicFramePr/p:cNvPr/@descr`, the same attribute pictures use, on classic charts and on chartex (Office 2016) frames. `fromPptx` reads it back into `alt`. Without `alt` (RR-105) the frame carries a generated description, the chart type with its series and categories in plain English ("Column chart: Sales and Cost by Quarter, 3 categories"), so PowerPoint does not report missing alternative text; import leaves a description in the generated form out of the document (also a stale one: PowerPoint keeps the description when a series or a column is renamed), and reads any other text as `alt`. A table without `alt` is described by its column names and row count the same way.\n- **Empty string.** `""` marks the chart decorative, like an empty `Asset.alt`: the preview writes no label and hides the group (`aria-hidden`), and the PPTX frame carries PowerPoint\'s own "Mark as decorative" marker (the `adec:decorative` extension of `p:cNvPr`), not `descr=""`, which PowerPoint writes for any shape without alt text. Import reads the marker back as `alt: ""`. A chart nearly always carries a message, so `opf/chart-text-alternative` reports it as info.\n- **Validate.** `opf/chart-text-alternative` passes a chart with a non-blank `alt`. Without `alt` it still passes when text, a table or a subtitle sits beside the chart; otherwise it reports the chart and offers a quick fix that focuses the `alt` field. `opf/poor-alt-text` flags a bare "chart", a URL, a leading "chart of" and alt text over 250 characters.\n\n## Defaults and geometry\n\nA chart that sets none of the four fields draws its type\'s defaults, including the [chart layer](#chart-layer-small-charts-and-the-header-row) of column, bar, line, area and combo charts. A chart with options reserves space for its legend and titles, so its geometry differs from a chart without them. The implementations require coordinated Core, renderer, PPTX and editor versions; use the [compatibility matrix](compatibility-matrix.md).\n\n## Not in this change\n\nPer-series data label overrides (column number formats are RR-54, [chart-table-data.md](chart-table-data.md)), a rotated or rich-text axis title, a chart title, a legend that overlays the plot, manual plot-area layout, secondary axes outside combo charts, and trendlines. Charts from external spreadsheets stay descoped (the `ChartDataSource` form was removed from the schema).\n\nA doughnut hole takes the surface color in both engines even when the chart has an explicit legend position or data labels (LH-182). Core retains the current circular plot after legend space is reserved; the preview fills the hole, and PPTX pins that plot with a surface-colored ellipse under the chart. This surface-only mark is consumed on import without discarding authored legend or label options.\n\n## Data-dependent chart drawings\n\nThe preview and PPTX share the draw plan below. These are representation adaptations, with native editing and layout fidelity qualified separately. The source chart stays unchanged. A public type-adaptation warning is not emitted for every family; the diagnostic column states the actual validation behavior.\n\n| Source and data | Shared drawing | Data treatment | Validation diagnostic |\n| --- | --- | --- | --- |\n| World map whose labels are mostly non-places, such as Q1\u2013Q4 | Clustered columns (`map-as-columns`) | Every numeric series and data order retained | No dedicated adaptation warning |\n| Pareto with at least two numeric series | Clustered columns (`pareto-as-columns`), without a cumulative curve | Every series and category retained in data order | `opf/chart-mapping-adapted` |\n| Box-and-whisker with one value per unique category | One distribution per series (`box-per-series`) | All numeric observations retained; categories become a shared group named after the category column | No dedicated adaptation warning |\n| Pie or doughnut with at least two numeric series | One concentric doughnut ring per series (`nested-rings`), first series innermost | Every series/category/value retained | No dedicated adaptation warning |\n| Scatter with a nonnumeric X column | Numeric series against category positions 1, 2, \u2026 (`scatter-by-position`) | Numeric series retained; the unusable X column is omitted from the drawing | `opf/chart-series-dropped` names the omitted X column |\n\nOther one-series constructs can leave additional series out and report `opf/chart-series-dropped`; this differs from an all-series-preserving adaptation. A multi-series pie becoming nested rings is not a claim that its second series was lost.\n\n## Multi-series Pareto adaptation\n\nA Pareto chart sorts one numeric series and draws its cumulative share. When the source has two or more numeric series, OPF preserves every series and category in data order as clustered columns in both the preview and PPTX. Validation reports `opf/chart-mapping-adapted` at the chart\'s `type`. It does not claim that these clustered columns are a Pareto chart, and does not discard a baseline series to produce a cumulative curve. Use one numeric series for the Pareto representation.\n\n### Validation and conversion reports\n\n`opf validate` and `validate` perform semantic chart checks. Drawing conversions through `opf convert` or the Node `convert` API also retain the selected `opf/chart-mapping-adapted` and `opf/chart-series-dropped` warnings for SVG, PNG, PDF and full-slide image-mode PPTX. Warnings follow the actual drawn slide selection, appear once per affected chart, and leave output bytes unchanged. Native PPTX retains its existing `pptx/chart-data-adapted` exporter notices for representation changes or omitted series, without a duplicate core advisory. Converting between deck text formats keeps its format/reference-only reporting contract. Direct renderer/exporter callbacks are separate from the Node conversion report; use semantic validation when reviewing the source data.\n\nThe PPTX exporter also owns its adaptation notices with `charts: "picture"`; core forwarding applies to full-slide image-mode PPTX (`as: "images"`), avoiding duplicate warnings in both routes.\n'
21
+ "markdown": '# Chart options: axis titles, legend, data labels, highlight, series colors and the value axis\n\nStatus: RR-35 (release readiness) for axis titles, legend and data labels, FA-14 (format audit) for `highlight`, and RR-89 and RR-92 (core 0.21.0) for series colors (`chart.colors`) and the computed value axis. The first four fields change geometry only for charts that use the first three fields, and colors only for charts that use `highlight`. Use the coordinated package set in the [compatibility matrix](compatibility-matrix.md); schema support alone does not establish native visual fidelity.\n\n## Native export data domains and limitations\n\nPowerPoint\'s native categorical Pareto aggregation can omit negative categories even when its workbook and caches retain them. A single-series Pareto with signed category values therefore exports, in default/auto/native modes, as an editable classic combo: descending signed columns plus an explicit positive-only cumulative-share line on a secondary 0\u20131 axis. Negative values remain visible bars and do not subtract from the cumulative share. The cumulative cells are static values: native bar edits do not recalculate them. Import returns the actual combo with its sorted/derived series, not the original Pareto source form. Positive categorical Pareto and raw-sample binning retain their native constructs. Explicit `chartex: "fallback"` retains the documented column-only representation and its adaptation diagnostic.\n\nA categorical histogram exported as classic columns keeps the preview\'s broad bars (6% gap) and composed histogram value-axis bounds and unit. It is still a column representation, with an adaptation diagnostic where native aggregation cannot display signed category data; it does not establish native histogram editability or complete visual parity.\n\nNative funnel labels have a separate Office limitation: PowerPoint can ignore the written label color and choose its own contrast color, observed as white where the renderer uses black. Export reports `export-lossy` with `feature: "funnel-label-color"` when native funnel labels are enabled. The chart remains editable. XML contrast checks establish only the requested paint, not the physical color PowerPoint renders.\n\n## The fields\n\nFour optional fields on the `Chart` object (the fourth, `highlight`, has [its own section](#chart-emphasis-highlight) below):\n\n```json\n{\n "chart": {\n "type": "column",\n "data": { "columns": ["Quarter", "Revenue"], "rows": [["Q1", 12], ["Q2", 18]] },\n "axisTitles": { "category": "Quarter", "value": "Revenue ($M)" },\n "legend": "bottom",\n "dataLabels": { "content": ["value"], "position": "outside-end" }\n }\n}\n```\n\n| Field | Values | Absent means |\n| --- | --- | --- |\n| `axisTitles` | `{ category?: string, value?: string, secondary?: string }` (`secondary`: combo charts) | no axis titles (today) |\n| `legend` | `none`, `top`, `bottom`, `left`, `right` | a line chart of two to four series names its series at the [line ends](#defaults-follow-few) and a pie or one-series doughnut names its slices, with no legend (each falls back to its legend when the names do not fit); a column, bar, area or combo chart of two to four series shows its legend in the [header row](#chart-layer-small-charts-and-the-header-row) above the plot; other multi-series charts and pie and doughnut charts a legend at the right; none for a single-series chart |\n| `dataLabels` | `true`, `false` or `{ content?, position?, separator? }` | no data labels, except on a [small chart](#chart-layer-small-charts-and-the-header-row), which labels its values, and the [direct labels](#defaults-follow-few) of line, pie and doughnut charts; the funnel and treemap constructs keep the labels they draw by default (values, category names) |\n\n`axisTitles.category` titles the axis that carries the row labels: the horizontal axis of a column, line, area, histogram, pareto, waterfall and box-and-whisker chart, the **vertical** axis of a bar chart and the X axis of a scatter chart. `axisTitles.value` titles the other one. A named `legend` position shows the legend there even for a single-series chart; `none` hides it.\n\n`dataLabels: true` is `{ "content": ["value"], "position": "auto" }`. `dataLabels: false` draws no labels: on a small chart it switches the default value labels off and brings the value axis back, and on the funnel and treemap constructs, which label their marks by default, it removes those labels (`resolveChartOptions` reports `dataLabelsOff`). In the object form:\n\n- `content`: any of `category`, `value`, `percent` (default `["value"]`). A label shows the selected parts in the fixed order category, value, percent, joined by `separator` (default `", "`). Values print in the General number format (twelve significant digits), `percent` as the integer share of the total (`0%`), `category` as the category name (the X value on a scatter chart).\n- `position`: `auto` (default), `center`, `inside-end`, `inside-base`, `outside-end`, `above`, `below`, `left`, `right`. `auto` is the type\'s default in the table below; the engines write that concrete position, so the preview and PowerPoint do not each pick their own.\n- `separator`: text between the parts.\n\n## Chart emphasis: `highlight`\n\nHighlighting the one series or category that carries the message, and muting the rest, is the main data-storytelling technique. The content stays semantic: `highlight` names series and categories, and the engines pick the colors from the theme. There is no color field.\n\n```json\n{\n "chart": {\n "type": "column",\n "data": { "columns": ["Quarter", "Revenue", "Costs"], "rows": [["Q1", 12, 8], ["Q2", 18, 11], ["Q3", 24, 15]] },\n "highlight": { "series": ["Revenue"], "categories": ["Q3"] }\n }\n}\n```\n\n| Field | Meaning |\n| --- | --- |\n| `highlight.series` | Value columns (series) whose marks are highlighted: every mark of each named series. Names match the data column names after any `fields` selection; a series is a plotted value column. |\n| `highlight.categories` | Row labels (the category column, or `mapping.category`) whose marks are highlighted: a column or bar of every series, a line\'s points, a pie or doughnut slice. Labels match as text (the number `2024` as `"2024"`) and a label shared by several rows highlights each of them. |\n\n**The rule.** When `highlight` is present, a mark is highlighted if its series OR its category is listed. Highlighted marks take the deck\'s primary (accent) color; every other mark takes a muted neutral derived from the theme. With both lists given, a bar of series `Revenue` in any category is highlighted, and so is a bar of category `Q3` in any series. A chart without `highlight` keeps its colors, byte for byte. A highlight that names nothing the chart plots (for example a column that is the category column) leaves the chart as if it had none.\n\n**The colors** come from core\'s `chartHighlightColors(surface, primary, text)`, which the preview and the PPTX export both call with the chart\'s backdrop (the card or the slide background: no chart has a panel, LH-105), the deck primary and the chart text color:\n\n- the accent is the primary color, kept at 3:1 contrast against the panel by `chartColorForFill` (a primary that already has that contrast is used unchanged);\n- the muted color is the panel mixed 30% of the way toward the text color: a light gray on a light panel and a dim gray on a dark one, in the panel\'s own hue. If that is under 1.6:1 against the panel, the mix moves toward the text color until it holds, so a muted mark is always visible and always quieter than the text.\n\nData labels stay readable: a label inside a mark takes the text color that contrasts with that mark\'s own color (core `textColorForFill`), so a label on a muted bar contrasts with the muted fill, as one on an accent bar does with the accent. Labels outside marks keep the chart text color. The legend shows each series in the color its marks have: accent for a highlighted series, muted otherwise. (A multi-series chart that highlights only categories mutes every series alike, so its legend keys look the same; name the series too when the legend matters.)\n\n**Validation.** A name that matches no data column (`series`) or no row label (`categories`) is a `chart-highlight-unknown-name` **error**, found by `resolveChartData` like `chart-mapping-unknown-column`. A series name that is a column but not plotted as a series (the category or X column, or a column `mapping.series` leaves out) is a `chart-highlight-adapted` warning and highlights nothing. A part the chart type cannot highlight is dropped with a `chart-option-adapted` diagnostic (option `highlight.series` or `highlight.categories`). `highlight` must name at least one series or category, and each list has no duplicates.\n\n### What each chart type highlights\n\n`chartOptionSupport(target).highlight` returns `{ series, categories }`; the validator, the preview, the exporter and the editor all follow it.\n\n| Type (catalog ids) | Series | Categories | What is drawn |\n| --- | --- | --- | --- |\n| clustered column, bar | yes | yes | the series\' columns or bars; a category\'s column or bar in every series |\n| stacked and 100% stacked column, bar | yes | yes | the same, per segment |\n| line, stacked line, with markers | yes | yes | a series\' line and markers; a category highlight draws a marker on each series at that category (on a line without markers, only there) |\n| area, stacked area, 100% stacked area | yes | no | the series\' area |\n| scatter | yes | no | the series\' markers (a scatter point label is not a category) |\n| radar, with markers, filled | yes | no | the series\' line (or fill) and markers |\n| pie, doughnut | no | yes | the slice of each named category (a pie plots one series, so a series name is meaningless); **every other slice takes the one muted neutral**, so the unhighlighted slices look alike and a legend cannot tell them apart (name the slices with `dataLabels` `category`, or leave `highlight` out, or write `"highlight": { "categories": [] }`, which also turns off a highlight the title would derive, to keep every slice its own palette color) |\n| histogram, pareto, waterfall, funnel, treemap, box and whisker, world, combo | no | no | not supported: dropped with `chart-option-adapted` |\n\nThe Office 2016 (chartex) constructs are left out on purpose. Their marks take their colors from the construct\'s chart style, and a per-point color (`cx:dataPt`) would need native verification this change does not have; the waterfall also already colors its marks by increase, decrease and total. They draw and export as before.\n\n## Series colors\n\nSeries colors follow the deck\'s color scheme by default: the same chart takes the colors of whichever scheme the deck uses (`design.colorScheme`, the theme\'s scheme, a catalog record, a built-in such as `vibes`, or an inline scheme with slot overrides). To set the color of one series, slice or category, list colors in [`chart.colors`](#setting-colors-chartcolors); a position it does not list keeps the deck palette.\n\nCore\'s `chartSeriesPalette(colorScheme)` (on `@openpresentation/opf/composition`) returns the twelve colors the preview, the PPTX export and the `chart-color-only` accessibility rule all use, in this order:\n\n| Series | Color |\n| --- | --- |\n| 1 to 6 | `accent1` to `accent6` of the resolved color scheme (a slot the scheme leaves out takes the engine default scheme\'s slot) |\n| 7 to 12 | the same six accents mixed 40% toward white, in the same order (series 7 is a tint of `accent1`) |\n\nSeries `i` takes color `i`; a pie, doughnut, treemap or funnel colors category `i` with color `i`. A chart with more than twelve series repeats the list (and `chart-color-only` says so). The `primary`, `secondary` and `accent` role overrides do not reorder the list: series 1 to 3 are always `accent1` to `accent3`, the slots the PPTX export writes as theme colors.\n\nBoth engines then pass the list through `chartPaletteForFill(backdrop, palette, { legible: chartSchemeSeries(chart.colors, colorScheme), soften: true })`, which keeps every series at 3:1 contrast against the backdrop the chart stands on (the card, or the slide background; LH-105: no chart has a panel) and apart from its neighbors, so on a dark panel the colors are lightened, never merged. On a dark panel every series that comes from the scheme (not from an authored `colors` entry) reaches 4.5:1, and series 2 keeps a lightness step of at least 20 (CIE L*) from series 1, so the first two series never read as one blue (LH-55). The palette is read in tiers of six (series 1 to 6, then 7 to 12): a color is kept apart from the colors of its own and earlier tiers only, so the tints never pull the six accents towards each other. Plan a chart\'s series order for the scheme: put the series that carries the message first (accent1 is the deck\'s primary), and keep a chart to six series or fewer so no tint is needed. The `highlight` colors above are separate: they come from the primary and the panel, not from this list.\n\nA host that validates with its own palette passes `ValidateOptions.chartPalette`; without it the rule judges each slide\'s own scheme.\n\n### Setting colors: `chart.colors`\n\n`colors` lists colors by position and replaces the palette color of that position; the rest of the palette is unchanged.\n\n```json\n{\n "chart": {\n "type": "column",\n "data": { "columns": ["Quarter", "Revenue", "Costs"], "rows": [["Q1", 12, 8], ["Q2", 18, 11]] },\n "colors": ["accent3", "#7B241C"]\n }\n}\n```\n\n- **Position.** Entry `i` is the color of series `i` (the `i`-th plotted value column), of slice or category `i` on a pie, doughnut, treemap or funnel chart, and of the `i`-th color a histogram, pareto, waterfall or box-and-whisker chart draws with (the first color for its bars, the second for its line or negative bars, the third for a waterfall total; a waterfall with `colors` keeps these positions instead of the role colors of [Chart marks](#chart-marks-waterfall-roles-value-lists-stacked-labels-reference-marks)). Up to 24 entries; positions past the last entry keep the deck palette.\n- **Values.** Any `ColorRef`: a hex color, a color-scheme slot or role (`accent3`, `secondary`), or a `var:<id>` color variable. A scheme name follows the deck if its scheme changes and is written to PowerPoint as a theme color; a hex color stays as written. Alpha is dropped. An entry that cannot be resolved is ignored (the palette color of its position is used) and `opf/chart-colors-adjusted` says so.\n- **Contrast.** Colors still pass through `chartPaletteForFill`: one with under 3:1 contrast against the backdrop is drawn lighter or darker, and series are kept apart. `opf/chart-colors-adjusted` warns when that happens to an authored color, and `opf/chart-color-only` judges the authored colors for color-blind and greyscale collisions.\n- **Highlight wins.** With `chart.highlight`, highlighted marks take the primary color and every other mark the muted neutral, whatever `colors` says.\n- **Engines.** Core resolves the list with `chartSeriesPalette(colorScheme, chart.colors, { roles, variables })` (and `resolveChartColors` for the entries alone); the preview and the PPTX export pass the result to `chartPaletteForFill` as before.\n\n## Value axis\n\nA column, bar, line or area chart (standard, stacked and 100% stacked) has one value axis, and composition computes it: `composeSlide` puts `{ min, max, majorUnit }` on the composed chart item as `chart.valueAxis`. The preview draws that axis and the PPTX export writes it as `c:min`, `c:max` and `c:majorUnit`, so PowerPoint and Keynote show the same gridlines as the preview instead of choosing their own major unit. A 100% stacked chart\'s axis is a fraction (`max: 1` is 100%) and carries `percent: true`. Combo, scatter, pie and the Office 2016 constructs have no computed axis (`chart` is absent); each engine keeps drawing them as before.\n\n**Radar layout (RR-105).** Core lays a radar out once (`chartRadarLayout`, `chart.layer.radar`): its value axis (`axis: { min, max, majorUnit }`, `niceScale` with `endOnTick` and as many intervals as the web\'s radius holds lines of text), which the preview draws and the PPTX export writes as the radar\'s `c:valAx` scaling, and where its default legend (two or more series, no `legend` option) stands. The legend moves under the web (`legend: "bottom"`, `legendBox`) when that gives the web a radius at least `RADAR_BOTTOM_LEGEND_GAIN` (1.1) times larger than a side legend does, as in a box taller than it is wide; the export writes it as `c:legendPos b` at core\'s box (a manual layout) with the plot area above it, and the import reads that legend back as the default, not as `legend: "bottom"`. In automatic composition a radar\'s box is at most square (other charts at most 4:3 landscape in a cell), so three radars in a row are as tall as they are wide.\n\n**Sibling charts (LH-33, LH-93).** Column, bar, line and area charts on one slide that run the same way, are both 100% stacked or both not, and plot one unit (the same first-series number format, or the same series names when unformatted) share one value axis (`shareSiblingChartAxes`). Column, line and area charts of such a set also share one plot height, so equal values stand equally tall: core lays each member\'s plot out as the preview does (`chartPlotInset`: under the header row or a top legend, above a bottom legend, the category axis title and the category labels, beside the value axis title, the tick labels and a side legend), and `shareSiblingPlots` gives the set the shortest plot\'s height. Charts side by side (boxes that overlap by half the shorter one\'s height) share one plot top and baseline; a chart in another row keeps its own baseline. The plot is stored as an inset from the chart box, `chart.layer.plot` (`{ left, top, right, bottom }`, slide pixels); the preview draws its plot there and the PPTX export writes it as the plot area\'s manual layout (`c:plotArea` `c:manualLayout`, `layoutTarget inner`), so PowerPoint draws the same plot. Horizontal bar charts of such a set (LH-93 remainder), whose value axis runs across, share one plot too (`horizontalBarPlot`, laid out as the preview lays a horizontal bar chart out): charts side by side share one plot top and height (their category bands line up), charts one above another start their plots at the same x, and every member takes the set\'s narrowest plot width, so one value is one bar length on every chart. A horizontal chart with chart options or drawn on a table\'s rows (LH-115) keeps its own plot, and so does the rest of its set. Stacked and percentage-stacked siblings share their final plot too; afterward their original-size direct names/values are fitted again, restoring the existing legend or numeric axis when the common plot needs it.\n\nThe scale is core\'s `niceScale(dataMin, dataMax, maxIntervals, { percent })`: zero is on the axis (always for bars and areas; for a line only when the data does not sit in the top sixth of its range), the data gets 5% headroom, and the major unit is the smallest 1, 2 or 5 times a power of ten that fits `maxIntervals` intervals. `maxIntervals` is `maxIntervalsFor(length, labelExtent)`, at most `CHART_MAX_INTERVALS` (6, LH-105), where `length` is the plot\'s extent along the value axis estimated from the chart box (without measuring text) and `labelExtent` is the space one tick label needs: a column, line or area chart has `box height - 2 x pad - 1.5 x line height` (less a line for a category axis title, and a line plus a pad for a top or bottom legend) over 1.2 line heights, a bar chart `70% of the box width - 2 x pad - text size` over 4 text sizes. Here pad is `10 x scale`, text size is `chartTextSize(...) x scale` px and line height is 1.5 text sizes. `chartTextSize({ width, height, scale, minFontSize })` is the chart text size the preview draws: `CHART_TEXT_PX` (20 px at the 1280 x 720 reference, 15 pt), shrunk only when the box is small (at most 1/18 of the box height and 1/30 of its width, whole pixels) and never below `minFontSize` (default 16), with `scale = min(slide width, slide height) / 720`. A chart in a short box therefore has fewer, larger intervals (0 to 800 in steps of 100 in a tall box, steps of 200 in a short one); a tall box always gets six at most (0 to 800 in steps of 200). An axis with room for three intervals or more is never tightened to one (LH-105): when no equal division of the tightened end fits, a finer end is tried (data peaking at 116: 0 to 125 with ticks every 50, not 0 and 140).\n\nThe axis maximum stays near the data (LH-59): it is at most `CHART_AXIS_MAX_OVERSHOOT` (a quarter) of the plotted range above the data maximum, 1.25 x the maximum on a zero-based axis. When the first major tick above the headroom lies further out (a short axis of one or two intervals: data peaking at 124 on an axis of 0 to 200), the axis ends at the first multiple of the largest finer 1, 2 or 5 unit within that bound (150). The ticks keep the major unit when the last one is at most half a unit below that end (0 to 40 in tens, ending at 45; the end is then not a labeled tick, as PowerPoint draws a `c:max` off the major unit); otherwise the end is divided into as many equal intervals as fit, each a multiple of that unit (0, 400, 800 for data peaking at 760; 0 and 150 in one interval), with zero kept on a tick. Every chart the preview scales this way follows the rule: the column, bar, line and area axis core composes (and the PPTX export writes), the histogram, pareto, waterfall and box-and-whisker constructs and the scatter axes. The radar and the combo chart keep the end on a tick (`niceScale(..., { endOnTick: true })`): the radar\'s outer ring and the combo chart\'s shared gridlines are the axis end. Only the maximum is tightened; a negative minimum keeps its major-unit tick, so zero stays on a gridline in PowerPoint too.\n\n**Native horizontal category names (LH-93).** Category names sit in the physical left gutter in both LTR and RTL; horizontal bars retain a top-to-bottom category axis and left-to-right numeric axis in RTL. When the computed numeric minimum is negative, PPTX writes `c:catAx/c:tickLblPos low`, so Office does not attach the names to the zero crossing. It keeps the axis crossing, bounds, fonts and authored axis titles/legend/data-label options. Ordinary nonnegative exports retain their previous bytes. A horizontal chart with explicit options still uses Office\'s automatic inner-plot dimensions: its native width/height can differ from the preview, an inherited limitation untouched by this label correction. No invented plot inset or exact options-plot parity is claimed.\n\n**Bar width and gap (LH-176).** Clustered columns and bars leave a gap of 1.5 bar widths between categories and stand side by side; stacked and 100% stacked ones leave half a bar width and stand on one another (`CHART_BAR_GAP_WIDTH`: DrawingML `c:gapWidth` 150 and 50, `c:overlap` 0 and 100). The gap is a share of one bar, as PowerPoint reads it, so a category of `n` clustered series holds bars of `band / (n + 1.5)` (`chartBarGeometry`): the preview draws that geometry, the PPTX export writes the same gap width and overlap, and a small chart\'s labels fit against the same bar slot. Before LH-176 the preview read the gap as a share of the whole cluster and drew two series\' bars about a third thinner than PowerPoint.\n\n## Category order and waterfall totals\n\nA bar chart (`bar`, `stacked-bar`, `100pct-stacked-bar`) lists its categories top to bottom in data order, the first series at the top of each cluster. The PPTX export writes PowerPoint\'s reversed category axis (`c:catAx` `c:orientation val="maxMin"`) with the value axis crossing at the last category (`c:valAx` `c:crosses val="max"`), so the value labels stay at the bottom and PowerPoint draws what the preview draws. Column, line and area charts keep their order (reversed only for right-to-left slides).\n\nA waterfall\'s bars float from the running total. OPF has no total marker, so core\'s `waterfallSteps(values)` infers one: the **last** value is a total when at least two values precede it and it equals their sum (to twelve significant digits), as in Start 100, +24, -8, End 116. A total bar stands on zero and does not add to the running total; its color and label follow the waterfall roles (LH-107, [Chart marks](#chart-marks-waterfall-roles-value-lists-stacked-labels-reference-marks)), or with `colors` the third palette color (increases the first, decreases the second); the native PPTX waterfall (`chartex: \'native\'`) writes it as `cx:subtotals`, which PowerPoint draws the same way. Any other last value is one more step; intermediate subtotals are not inferred.\n\n## Chart layer: small charts and the header row\n\nStatus: LH-03 and LH-81 (layout harvest). Two defaults make a plain chart read like a designed one. Composition decides them once per chart item, from the chart, its resolved data and its box, and puts them on the composed item as `chart.layer` (core `chartLayer`, on `@openpresentation/opf/composition`); the preview and the PPTX export both draw that decision.\n\n**Small charts (LH-03).** A clustered column, bar or line chart (`column`, `bar`, `line`, `line-with-markers`) of one or two series, each of at most sixteen points (`SMALL_CHART_MAX_SERIES`, `SMALL_CHART_MAX_POINTS`), whose value labels fit beside each other at the chart text size (a column or line label no wider than the room between neighboring marks, a bar label no taller than its bar\'s slot). The fit decides, not a count (LH-111; the limit was eight points): twelve monthly columns are labeled when their labels fit, and a focus\'s context marks then take the light labeled gray (below). Such a chart:\n\n- labels every mark with its value, at the type\'s default position (outside the end of a column or bar, above a line point), in the column\'s number format;\n- draws no value axis: no tick labels, no gridlines and no value axis line (the category axis line stays at zero). The PPTX value axis is deleted (`c:delete val="1"`) and has no `c:majorGridlines`; the composed axis still sets the scale. Nothing reads a length from zero, so a line\'s scale drops zero once its minimum is at least 0.75 of its maximum (LH-119, `CHART_LABELED_ZERO_SHARE`; every other chart keeps PowerPoint\'s rule, zero dropped only when every value is in the top sixth of the range);\n- draws no chart panel: the chart stands on the card or the slide background, and its colors and labels are judged against that backdrop (LH-105 made this every chart\'s default);\n- on a one-series column or bar chart whose categories run in time (LH-105, see [Defaults follow Few](#defaults-follow-few)) and whose slide title names none of them, draws the last point that has a value in a stronger shade of the series color and every other point in the series color (LH-95, core `chartEmphasisColors`). The shade is the series color mixed away from the backdrop, towards black on a light backdrop and towards white on a dark one, just far enough to stand 15 L* (CIE) from it (`CHART_EMPHASIS_MIN_LIGHTNESS_STEP`), so the emphasis shows; moving away from the backdrop only raises the contrast, so every bar keeps 3:1 against the backdrop (`CHART_EMPHASIS_MIN_CONTRAST`; a bar is a graphical object under WCAG 1.4.11). A series color too close to black or white for that step is shaded the other way, still at 3:1. This emphasizes the last bar in all 84 gallery theme x color scheme x light and dark combinations (a faded tint of the other bars, LH-03\'s first rule, found room in 36). The PPTX export writes the series in its color and the emphasized point as one `c:dPt`.\n\n**Header row (LH-81).** A column, bar, line, area or combo chart of any grouping draws a row above the plot. Its caption, bold at the chart text size in the text color, sits at the start of the row (the right edge right to left). A caption is generated only when it adds to the legend: one series gives `<series> by <category>` ("Count by stage"), the series part being the value axis title or the series name; two or more series give a caption only from a value axis title ("Revenue ($M) by quarter"), since the legend already names them. The category part is the category axis title or the category column\'s name in sentence case: a plain capitalised word is lower-cased, and an acronym or proper-looking token (all capitals, an internal capital or a digit: "Q1", "ARR", "FY27") stays as written. Outside English decks the caption is the series part alone. Two to four series show their legend in the same row (at its end) or, when caption and legend do not fit together, at the start of a second row. LH-143: a legend wider than the row wraps its entries onto a second row (`CHART_HEADER_LEGEND_ROWS`) instead of moving to the side, so the decision does not depend on the font an engine measures it in (the preview\'s font measured a legend too wide for the row while the PPTX export\'s narrower font fitted it, so the same chart had two plot widths); only an entry wider than the row, or a legend of more than two rows, keeps the side legend. The plot then takes the chart\'s whole width, and PowerPoint lays the entries out in the legend\'s box (one row when its font fits them). In PowerPoint the caption is the chart title, and title, legend (`legendPos t`) and plot area (`layoutTarget outer`) carry the positions core computed as `c:manualLayout`.\n\n**Ring names (LH-92).** A doughnut of two or more rings (LH-60\'s nested rings: a pie or doughnut of several series) colors its slices by category, and its legend names the categories, so each ring names its series inside the ring, on its largest slice (`chart.layer.rings`, core `chartRingLabels`). The name is that slice\'s label: alone, or before the slice\'s own label with the labels\' separator ("FY24, 40%"), in the color that contrasts with the slice. The PPTX export writes it as the slice\'s `c:dLbl` with `c:showSerName val="1"`, which PowerPoint draws in the ring, first among the label\'s parts; import reads the other slices for the chart\'s own labels. A pie drawn as rings labels inside its rings as a doughnut does (no `c:dLblPos`).\n\n**An explicit option wins.** `dataLabels: false` keeps a small chart\'s value axis and draws no labels; an explicit `dataLabels` is drawn as written (a label without the value, or a value axis title, keeps the value axis); `highlight` and `colors` keep their colors (no emphasis); a `legend` option keeps that legend and draws no header row; a payload `caption` replaces the header caption (the legend still moves into the header).\n\n**Import.** `fromPptx` does not write these defaults back: value labels on a chart the small-chart rule covers (by type and counts) and a header legend (`legendPos t` with a manual layout) import as no option, so an exported deck imports with the options it was authored with. LH-105: every chart area is unfilled now, so a small chart is recognized by its deleted value axis; a small chart whose value axis has a title (its axis is kept) imports its default labels as `dataLabels: true`, which draws the same chart.\n\nNative chart-series name edits import from the current native cached reference or direct text value. Numeric point selectors keep their series index; a name selector that no longer exists reports a finding and keeps the actual overlay position. The native header legend uses a manual box sized for the exported names. A longer rename in PowerPoint can omit another legend entry while its data and bars remain intact. Import the edited file, review its findings and export the current OPF again to recompose the header at the retained text size. Longer names can require this reflow; native editing keeps the authored box size.\n\n## Defaults follow Few\n\nStatus: LH-105 (layout harvest). The defaults follow Stephen Few (*Show Me the Numbers*; *Information Dashboard Design*): every pixel of ink shows data, color is for what matters, labels sit at the data. Composition decides them with the rest of the [chart layer](#chart-layer-small-charts-and-the-header-row) (`chart.layer`), and the preview and the PPTX export draw the same. Every explicit option still wins, and `fromPptx` does not write a default back as an option.\n\n| Default | Rule | Why (Few) |\n| --- | --- | --- |\n| No panel | No chart draws a panel (the gray card surface it had): it stands on its card or the slide background, and its series, labels and text are judged against that backdrop (`chartPaletteForFill`, `textColorForFill`). The PPTX chart and plot areas are `a:noFill`, and so is a chartex chart area. | Non-data ink: a panel frames nothing the reader needs. |\n| Soft series colors | A series from the scheme takes its accent softened: core `softenChartPalette` (on `chartPaletteForFill(..., { soften: true })`) moves its HSL lightness `CHART_SERIES_SOFT_MIX` (25%) of the way towards the backdrop\'s and lowers its saturation by the same share (`satMod` 75%, `lumMod` 75%, `lumOff` 25% on white), or by less, in 1% steps, where the full move would take it under 3:1 against the backdrop (4.5:1 for a scheme series on a dark backdrop, LH-55) or closer to a neighboring series than the palette had them, capped at 11 L* (20 between series 1 and 2 on a dark backdrop). An authored `colors` entry is drawn as written. The PPTX export writes a softened accent as the theme color with those transforms (`<a:schemeClr val="accent1"><a:satMod/><a:lumMod/><a:lumOff/></a:schemeClr>`, `chartSoftColors`), so re-theming in PowerPoint keeps it soft. | Soft colors for ordinary data; strong color is kept for emphasis. |\n| Emphasis from the title | The slide title and subtitle are matched against the chart\'s series names, category names and (one series) values (core `chartTitleFocus`, `chart.layer.focus`): words of any script compared with `Intl.Collator` at base sensitivity in the deck language, a possessive dropped and a plural matching its singular; a name of several words also matches by the words it does not share with every other name ("Enterprise NPS" beside "Mid-market NPS" by "Enterprise"); a unit in parentheses is not part of a name; a month name matches the category of that month (November and Nov, in English and the deck language); a number in the title matches the categories with that value at the precision written (1,790; 31; 20% for a percent column). The focus is a proper subset: on a chart of several series the series named, else the categories named, else (every series named) the one named first; on one series or a pie, the categories named or whose values are printed. The focused marks keep their full-strength color and the other marks take the context neutrals (core `chartContextColors`): grays in the backdrop\'s hue, the backdrop mixed towards the text color, one per context series (or slice, or stacked segment) in the order they come, the first the strongest and each next one 11 L* lighter, so neighboring context series stay apart; each keeps a color difference of 20 (CIE76) from the focused colors, which a gray beside a colored focus has by its chroma. The context reaches 3:1 against the backdrop where it is read against an axis, and only 1.6:1 (`CHART_CONTEXT_LABELED_MIN_CONTRAST`, a light gray) where every context mark carries its text: a small chart\'s value labels, the names at the line ends, the names on the slices (WCAG 1.4.11 does not ask 3:1 of a graphic whose information the text gives; `chart.layer.focus.labeled`). That light floor is for filled marks (columns, bars, areas, slices): a context mark drawn as a stroke (every line series, a combo\'s line) keeps 3:1 even when labeled, because the line is the data and a thin line at 1.6:1 all but disappears (core `chartSeriesStrokes` and `chartFocusContextColors`, which the preview and the PPTX export both read). The PPTX export writes a gray that equals a neutral as that scheme color (`tx1` with `lumMod`/`lumOff`). Column, bar, line, area, pie and one-series doughnut charts; not combo charts or the chartex constructs. | Color only for what the message is about; the rest is context, light where it is labeled. |\n| Emphasis from the slide (LH-113) | When the title names nothing, the focus comes from the slide\'s other texts: every text block, list entry, quote and chart `alt` (core `slideFocusSources`, `chartSlideFocus`). Each is matched as the title is, with conservative rules: stop words never name a key; a proper name of several capitalized words matches by its first word ("Corvid" for "Corvid Plastics"); a printed quantity (3.1%, $71M) is a value, not a name; a range ("from March to August", "range from 71 in APAC to 78 in the Americas") names nothing; coordinated keys ("Engineering and support") are named together, and otherwise the key a sentence names first is its subject; a paragraph over 140 characters that names more than one key and a list that names keys in two or more entries name nothing; and the focus is what every naming source agrees on. The same focus highlights a table\'s rows (`table.highlight`, [content payloads](content-payloads.md#highlighted-rows)) on the same slide. | The message is often in the sentence beside the chart, or in the chart\'s own alt, not the title. |\n| Emphasis only over time | Without a title focus, a small one-series column or bar chart emphasizes its last point (LH-03, LH-95) only when its categories run forward in time (core `chartCategoriesInTime`, below). Its emphasized point takes the series color at full strength (or a stronger shade of it, 15 L* from the soft color); the others keep the soft color. | The last point is the latest one only in time; on nominal categories it is just the last one written. |\n| Line ends instead of a legend | A line chart (`line`, `line-with-markers`, stacked lines) of two to four series without `legend` or `dataLabels`, every series having a value in the last row, names each series at its last point: its last value as its data labels print it, then its name ("61 Enterprise NPS"), in the series color made legible as text (`chartSeriesLabelColor`, 4.5:1), bold for a series the title names (`chart.layer.endLabels`). The plot leaves a gutter for the names at its end (`chart.layer.plot`; the left right to left). Names closer than a text line move apart, never more than a line from their point; when they cannot (or when the gutter would turn the category labels the legend layout keeps level), the chart keeps its header legend. A small two-series line chart gives its value labels and hidden value axis up for the end labels. The header row keeps only its caption. PPTX: the last point\'s `c:dLbl` with the text as written (`c:tx c:rich`, value first, which PowerPoint\'s own field order would reverse), `c:showSerName`, `c:dLblPos r` (`l` right to left) and a manual layout offset where the name moved; no `c:legend`; the plot area\'s inner manual layout. Area charts keep their legend: PowerPoint has no label position for an area point. | Direct labels: the eye does not travel between a key and the data. |\n| Names on the slices | A pie or one-series doughnut without `legend` or `dataLabels` names each slice with a value (`chart.layer.slices`): inside the slice when the name\'s text fits there at the slice\'s inside end (a doughnut: in its ring), in the color that contrasts with the slice; else, on a pie, outside its end. The outside names shrink the pie as outside labels do. A doughnut name that does not fit its ring, outside names that would touch each other or leave the chart box, or a pie shrunk under 30% of its room (`CHART_SLICE_LABEL_MIN_RADIUS`) keep the side legend. PPTX: one `c:dLbl` per slice with `c:showCatName`, `c:dLblPos inEnd` or `outEnd` (none on a doughnut), `c:showLeaderLines`; no `c:legend`. A doughnut of several series (nested rings) keeps its legend. | Labels at the data, not in a key. |\n| Fewer intervals | The value axis has at most `CHART_MAX_INTERVALS` (6) intervals of 1, 2 or 5 times a power of ten (it was 8, and `maxIntervalsFor` capped at 10); an axis with room for three intervals is not tightened to one. Gridlines stay light (`gridline`, tx1 at 15%), horizontal on column, line and area charts and vertical on bar charts; no tick marks on either axis (`c:majorTickMark none`). | A few well-rounded ticks; gridlines only as faint as they must be. |\n\n**Time order** (`chartCategoriesInTime(labels, { title, language })`). Categories run in time when every label is one family of time point running forward: years (2024, FY24, FY 2025, \'24; a span FY24/25), periods (Q1 to Q4, H1 and H2, M1 to M12, and outside English T1 to T4 and S1 and S2, with an optional year: Q1 2024, 2024 Q1, Q1\'24, FY24 Q3, 1Q24), weeks and steps (W12, Week 3, Day 4, Sprint 5, and the deck language\'s words for year, quarter, month, week and day from `Intl.DisplayNames`), months (January, Jan, Sept, with an optional year, in English and the deck language\'s `Intl.DateTimeFormat` names), dates (2024-03, 2024-03-15, 15.03.2024) and numbers (a strictly increasing sequence). Years and numbers must increase; months, periods and weeks without a year may wrap once (Nov, Dec, Jan); digits of any script count. A reversed run (2026, 2025, 2024) is not in time. Only when the labels are not one family, a category title (the category axis title, else the category column\'s name) that names a time field (Year, Quarter, Month, Week, Day, Date, Period, Time, Fiscal year, or the deck language\'s word) makes distinct labels time ordered. P1, P2 (priorities) and an English T1 (a tier) are not periods.\n\n**Validator.** Two info findings (content) say where Few\'s advice is not followed; they never change the drawing: `opf/chart-dual-axis` for a combo chart with a `secondaryAxis` (two charts read more truly than one with two scales) and `opf/chart-pie-many-slices` for a pie or doughnut of more than five categories (compare them with bars). See [validate.md](validate.md).\n\n**Not in this change.** Bars are not sorted by value (the author\'s order is kept), chart types are not changed, and rotated category labels keep LH-93\'s rule. The waterfall roles, the value list beside a pie, the values inside stacked segments and the reference marks followed in LH-107 to LH-110 ([Chart marks](#chart-marks-waterfall-roles-value-lists-stacked-labels-reference-marks)).\n\n## Chart marks: waterfall roles, value lists, stacked labels, reference marks\n\nStatus: LH-107 to LH-110 (layout harvest, from the Claude Design chart comparison: chart corpus s09, s13, s14, s16, s17, s18, s19, s24). Composition decides them with the rest of the chart layer (core `chart-marks.ts`, on `chart.layer`); the preview draws them and the PPTX export writes them. As with [Defaults follow Few](#defaults-follow-few), an explicit option wins (`dataLabels` and `legend` keep the chart as authored, `colors` keeps a waterfall\'s palette positions) and `fromPptx` does not write a default back as an option.\n\n| Mark | Rule | PowerPoint |\n| --- | --- | --- |\n| Waterfall roles (LH-107, `layer.waterfall`) | Each bar has a role (core `waterfallRoles`): the inferred total (above) and, when there is one, the first bar it runs from ("2024 profit") are **totals**; the rest are **increases** or **decreases** by sign. Totals take the strong color, the scheme\'s `dark2` when it keeps 3:1 against the backdrop and a color difference of 20 (CIE76) from the accent, else the text color (a dark slide); increases take the series color at full strength; decreases the first context neutral (core `chartWaterfallColors`), the light gray when the bars are labeled. Without `dataLabels`, every bar carries its value: a step signed (`+9.3`, `\u22127.4` with U+2212), a total unsigned and bold (`waterfallLabelText`), over the bar (a decrease: under it); when the widest label does not fit its category band, there are no labels and the value axis stays. With the labels, the value axis and its gridlines go (unless it has a title), and the column\'s name (or the value axis title) becomes the caption above the plot ("Operating profit ($M)"). Connectors between steps are dashed (LH-125: 1 pt, 4 on and 3 off, in the axis line color). | The native waterfall (`cx:`, the default `chartex: \'auto\'`) carries it all: each bar\'s `cx:dataPt` in its role color, `cx:dataLabels pos="outEnd"` with the signed number format `"+"F;"\u2212"F;F` (F: the column\'s format, else General; `waterfallSignedFormat`) and a `cx:dataLabel` per total in F, bold; the value axis `hidden="1"` without gridlines; the caption as `cx:title` (`align="min"`, bold). PowerPoint draws its connector lines (`cx:visibility connectorLines="1"`) with the series\' line (native check 2026-11-03: its width, dash and color; the chart style part\'s line entries change nothing), so the series\' `cx:spPr` carries `a:ln w="12700"` with `a:prstDash val="dash"` in the axis line color and each bar\'s `cx:dataPt` an `a:ln` with `a:noFill` (the bars have no outline). The clustered-column fallback (`mc:Fallback`) is unchanged. |\n| Value list (LH-108, `layer.valueList`) | A pie or one-series doughnut without `legend` or `dataLabels`, of two to eight categories with a value (`CHART_VALUE_LIST_MAX_ROWS`), lists them beside it instead of naming its slices (core `chartValueList`): the values\' unit (the value column\'s name or the value axis title) over the value column, then one row per category, a swatch in the slice\'s color, the category and its value right-aligned in the column\'s format, a hairline between rows; the rows the title names (the LH-105 focus) bold in the text color, the others in the chart text color. The list takes the end of the chart box (the start right to left), 45% of it or what its text needs, with two text sizes before it; rows are up to 2.4 lines apart and at least 1.25, centered on the box. **When:** the list is drawn only when the pie keeps the radius it has alone (90% of half the box\'s shorter side) beside it, or 80% of it when a slice is under 10% of the total (`CHART_VALUE_LIST_SMALL_SLICE`) or the slice names would not all sit inside their slices: then names leave the pie anyway. So a pie in a wide box (the whole body) lists, and a pie in a half-width column keeps its slice names (or its legend). | The pie is drawn in core\'s square (the plot area\'s inner manual layout), with no legend and no labels. The list is native shapes over the chart frame, each tagged `OPF_CHART_MARK_V1` (src/chart-marks.js): text boxes for the unit, names and values, rectangles for the swatches and lines for the rules. They are drawn for the plot core pinned and do not follow the chart if it is moved by hand. |\n| Stacked values and names (LH-109, `layer.stack`) | A stacked column or area chart (and its 100% form) of two to six series without `dataLabels` or `legend` draws each segment\'s value inside it (in the color that contrasts with the segment) when its text and a quarter text size fit the column\'s width (90% of the category band on an area) and a text line fits the segment\'s height (core `chartStack`, `stack.values`). An area\'s first and last points carry no value (a centered label would hang outside the band), and a 100% chart none (the axis reads shares; the raw values would contradict it). The series are named beside the last column (the end of the last band, a text size and a half clear of an edge-to-edge area\'s end value): a swatch and the name, centered on the segment\'s middle, moved apart only to keep a text line between names and never more than a line from their segment (`placeStackNames`); the bold name is the series the title names. The header row keeps its caption only, and the plot leaves a gutter for the names. When the names cannot be placed so, the chart keeps its header legend. The plot is pinned either way (`layer.plot`). | The values are the chart\'s own data labels (`c:dLbls` with `c:showVal`, `c:dLblPos ctr` on columns; an area point has no label position, so PowerPoint places it itself: not yet checked natively), each series\' text in the color that contrasts with it, and one `c:dLbl` with `c:delete` per segment whose value does not fit. The names are tagged native shapes over the frame (a swatch and a text box each); the plot area keeps core\'s inner layout and there is no `c:legend`. Import reads values-only center labels on a stacked chart as the default (no `dataLabels`). |\n| Explicit reference lines (LH-110, `chart.referenceLines` \u2192 `layer.references`) | Optional ordered value-axis annotations on column, bar, line, line-with-markers, area and combo charts. Author a finite numeric value, optional verbatim label, axis and independent color/width/dash stroke. Absence or an empty array draws none. Titles and subtitles never create a threshold or a period band. Every target expands automatic bounds only on its associated axis. | Vertical charts with at least two categories use native constant helper line series and optional native endpoint labels, spanning first-to-last category centers. Horizontal bars and singleton-category charts use fixed ordinary line/text overlays. See the explicit contract and editing limits below. |\n\n### Explicit reference lines\n\nThe authoritative schema supports `chart.referenceLines`; the composition, SVG renderer and PPTX exporter/importer implement the contract below. This replaces the earlier title-derived thresholds and period bands. No bands API is introduced. The [complete example](../examples/technical/explicit-chart-reference-lines.opf.json) covers the native/fallback split; [localized labels](../examples/technical/localized-chart-references.opf.json) are authored text, independent of title parsing.\n\n```json\n{\n "type": "line",\n "data": {"columns": ["Month", "Availability"], "rows": [["Jan", 92], ["Feb", 96], ["Mar", 97]]},\n "referenceLines": [\n {"value": 95, "label": "Target 95", "stroke": {"color": "accent2", "width": 2, "dash": "dash"}}\n ]\n}\n```\n\nThe main data line retains its existing solid default. A reference stroke is independent of every data series.\n\nA [singleton combo example](../examples/technical/singleton-combo-reference-lines.opf.json) places Revenue180 on the primary value axis and Margin0.25 (25% under `0%`) on the actual secondary value axis. Both references expand their own bounds. With one category, both are full-plot line/text overlays; they remain fixed after independent PowerPoint chart/data/axis edits. The exporter records each overlay\'s explicit current category/value axis IDs, and import requires the same unique reciprocal native pair and unchanged geometry/style/text binding. Reordering axis declarations alone is harmless; swapped, duplicate or missing associations preserve ordinary shapes with a diagnostic. Older multi-axis overlay receipts without explicit pairs also remain ordinary shapes; re-export their OPF source to create current receipts.\n\n| Property | Meaning and default |\n| --- | --- |\n| `referenceLines` | Optional array. Absent/`[]` means none. Authored order, duplicates and values equal to data are retained; no two-line cap or inferred-range cutoff. Nonempty arrays are supported only by `column`, `bar`, `line`, `line-with-markers`, `area` and `combo`, the types with one value axis for every series. On any other type, the stacked and 100% stacked types among them, a nonempty array is the located error `opf/chart-reference-unsupported-type` at `referenceLines`: a reference is never dropped silently. In the editor, a chart-type switch to such a type refuses (`chart-reference-lines-unsupported`) unless the caller passes `removeReferenceLines: true`, which removes them in the same step and reports them. |\n| `value` | Required finite number in the associated value axis\'s data units. With a `0%` column format, `0.25` means 25%, and `25` means 2500%. Strings are invalid; neither labels nor titles select units, and there is no 0\u20131 clamp. |\n| `axis` | `"value"` by default. `"secondary"` requires an actual combo secondary value axis. Category/X references are outside this scope. Invalid associations produce located validation errors. |\n| `label` | Optional nonblank plain text, shown verbatim. No label or numeric text is synthesized. |\n| `labelPosition` | `"end"` by default, or `"start"`. Requires a label. Horizontal endpoints mirror in RTL; vertical bar-reference endpoints mean top/bottom. |\n| `stroke` | A [Line](schema-reference.md#line): `{ color, width, dash }` with every part optional, or `"none"` to draw only the label. The same definition styles table cell borders. |\n| `stroke.color` | Existing ColorRef: hex, theme role/slot, variable or color transform. Default is the effective chart-text neutral. |\n| `stroke.width` | 0\u201364 reference pixels at a 720px short edge; default 4/3 (one point before slide scaling). Zero (the same as `"none"`) hides only the stroke; its value still expands bounds and its label remains. PowerPoint draws a line of width 0 as a hairline, so the export writes it fully transparent. |\n| `stroke.dash` | `"solid"`, `"dash"` or `"dot"`; default `"dash"`. The narrow stroke deliberately excludes gradients, arrows, compound and sketch effects. |\n\nEvery reference participates in its own axis\'s automatic nice bounds, zero anchoring and sibling-axis sharing. Combo primary and secondary bounds come from shared composition. Labels use chart typography and their logical endpoint, with clearance for half the reference stroke width. In authored order, placement checks ordinary data-line/marker ink, the bars of a column, bar or combo chart, the filled area of an area chart and preceding reference labels, trying the preferred adjacent side, then the opposite side, then the same two places at the other end of the line (RR-105: a label is never drawn on a mark while a free place exists at either end; the import still returns the authored `labelPosition`). If none fits, the preferred position and all text remain with an overflow/collision diagnostic, and a label that sits on a bar or an area stands on a plate of the chart\'s surface color (a filled data label in PowerPoint) so it reads against the mark. Labels never shrink, disappear or move their numeric reference line to make room. A reference never changes which marks a chart emphasizes: the focus the slide\'s texts name is drawn exactly as on the same chart without references, and `highlight` (an empty one included, which switches derived emphasis off) still decides it. So that a title still cannot move the plot, a chart with references keeps its series names at regular weight: a bold focused name is wider and would change the direct-label gutter. Fixed chart/data/frame title or subtitle edits leave references, bounds, plot, spans and label coordinates unchanged. General slide reflow can change the chart frame.\n\n**PowerPoint editing limits.** The five vertical types with two or more categories export each reference as an owned constant native line series, markerless and excluded from ordinary legends/default data labels, with independent color/width/dash and an optional native endpoint custom-text label. Each helper series is named after its reference\'s label ("Reference" when it has none, " 2", " 3" added to keep names unique against the data series, the category heading and other helpers), in its name cache and as the workbook column heading Edit Data shows; a reader that lists helpers in the legend, such as Keynote, which also draws no reference labels, shows that name. SVG and PPTX both span the first-to-last category centers. Native references follow chart transforms and value axes. Existing exports pin bounds, so changing data does not promise automatic rescaling. Helpers contain repeated values over the exported workbook range: adding categories requires extending the range, and editing just one target cell can make a helper nonconstant. Horizontal bars and single-category charts instead use full-plot editable ordinary line/text overlays. These overlays stay fixed after chart movement, resizing, axis, legend or data edits in PowerPoint; re-export OPF to recompute them.\n\n**Import ownership.** An unchanged export imports each reference\'s stroke as the document wrote it: an absent stroke stays absent, a partial one stays partial, `"none"` stays `"none"` and a scheme color keeps its name; `axis` and, with a label, `labelPosition` come back written out (`"value"`, `"end"` when the document left them out). A line restyled in PowerPoint imports its current paint. Verified versioned helper ownership is classified before native chart groups. Constant helpers restore their current values, supported styles and labels once, excluded from ordinary data. Names never establish ownership. Nonconstant, ambiguous or stripped helper ownership retains all ordinary series and cached values with diagnostics. Same-axis ordinary line groups coalesce into one line chart; mixed marker choices produce a diagnostic. Separate-axis all-line groups require an OPF combo: the first current series becomes primary-axis columns, with a named representation/axis diagnostic and every numeric series/order retained. If an uncertain mixed area/line chart cannot be expressed by the current OPF combo model, import retains all data/order as a combo and explicitly diagnoses the area-to-column representation change; axis or duplicate-name ambiguity is also diagnosed. If per-series category caches disagree, the single OPF category axis uses the first series labels with a diagnostic; all numeric series remain. This is data preservation, not visual parity. For fallback overlays, the exact authored value is restored only after versioned, hash-bound current line/label geometry and style plus chart plot/axis/frame binding prove the overlay unchanged; metadata removal or any relevant edit keeps visible shapes with a diagnostic and no stale reference. Verified unchanged overlays restore/consume once; edited or uncertain overlays remain visible ordinary shapes without a stale duplicate reference. Legacy V1 inferred line, label and band shapes remain visible ordinary shapes with diagnostics.\n\n\n**Stacked bars, edge-to-edge areas and the doughnut hole (LH-125).** The marks above gain three follow-ups from the same comparison (chart corpus s10, s16, s19):\n\n- **Horizontal stacked bars** (`stacked-bar`, `100pct-stacked-bar`; two to six series without `dataLabels` or `legend`) draw each segment\'s value inside it when its text and a quarter text size fit the segment\'s length and a text line fits the bar\'s thickness (a band over 1.5; not on a 100% chart) and name their series in a row above the plot: each name (a swatch and the name) starts where its series\' segment starts in the first bar, left to right (`placeBarNames`; `stack.names.above`). When two names would meet (a hairline segment) or the last would leave the chart, the header legend stays. Core lays the plot out as the preview lays out a horizontal bar chart (`horizontalStackPlot`: the category gutter, the value labels below, the names row between the header and the plot) and pins it (`layer.plot`); the preview draws it there and the PPTX export writes it as the plot area\'s inner layout, so the names stand over the segments in PowerPoint too. The value labels sit at the bottom in PowerPoint (`c:valAx` `c:tickLblPos nextTo`; PptxGenJS\'s default `low` put them at the top of a bar chart whose categories run down).A stacked bar chart whose bars align to a table\'s rows (LH-115, `chart.layer.rows`) uses the table\'s plot instead: the pinned plot and the names row go, the header keeps its legend and the values that fit the aligned segments are printed (`restackForRows`). A side legend (a legend of more than two rows, or an entry wider than the chart) takes its width off the pinned plot, as the preview lays it out. **LH-142: labels or an axis, not both.** When every segment with a value carries its value (and the chart is not 100% and has no value axis title), the value axis, its tick labels and its gridlines are dropped (`stack.valueAxis === false`, core `chartValueAxisHidden`, which a small chart\'s `small.valueAxis` answers too): the plot is laid out without the tick row, the preview draws no ticks, gridlines or axis line, and PPTX writes `c:valAx` with `c:delete val="1"` and no gridlines. One segment too narrow for its value keeps the axis; a chart aligned to a table\'s rows keeps it too.\n- **A stacked area runs edge to edge** (`stack.edge`, any `stacked-area` or `100pct-stacked-area` of two or more categories): the category axis crosses on the tick marks (`c:crossBetween val="midCat"`), the first category on the plot\'s start and the last on its end, with the plot keeping half of the end category labels\' width beyond its edges (`chartPlotInset`) and a fifth of a text size more under the labels, clear of the value axis\'s zero. The first and last points of each band hold their values inside the band, left-aligned at the start edge and right-aligned at the end edge (`stack.ends`, `areaEnd`; the first category is at the right edge right to left): a value fits when its text lies within half a category band and the band is a text line tall at both ends of the text. PPTX: the chart\'s own labels at those points are deleted and the values are tagged text boxes (`stack-end`) in the color that contrasts with the band.\n- **A doughnut prints its focus value in its hole** (`valueList.hole`, `doughnutHole`): when a doughnut with a value list has one slice the title names (the LH-105 focus), that slice\'s value stands in the hole in twice the chart text size, bold, in the slice\'s color made legible as text, with the slice\'s category under it at the chart text size when it fits (84% of the hole\'s width, both lines within 70% of its height); a value that does not fit at 1.25 text sizes leaves the hole empty. The hole is half the doughnut\'s radius in both engines. PPTX: tagged text boxes (`hole-value`, `hole-name`) centered in core\'s square.\n\n**The doughnut hole (LH-182).** A doughnut\'s hole takes the surface the chart stands on, so a deck watermark or a background motif behind the chart does not show through it (only through the hole: around the doughnut it still shows). Core composes the doughnut\'s square and hole (`layer.doughnut`, `chartDoughnut`): the value list\'s square when the doughnut has one (LH-108), else the preview\'s square (the box less its padding and the category legend at the end, 90% of half the shorter side); a doughnut with chart options (`legend`, `axisTitles`, `dataLabels`) has none and keeps an open hole in both engines. The preview draws the doughnut in that square with a surface-colored disk in the hole; the PPTX export pins the plot area to the square (`c:manualLayout`, layoutTarget inner) and lays an ellipse in the surface color under the chart frame at the hole (`c:holeSize` 50 is half the radius), tagged `OPF_CHART_MARK_V1` (role `hole`), which import consumes.\n\n**Thousands grouped by the deck language (LH-141).** Where the author wrote no number format, a whole number of four integer digits or more prints with its thousands grouped by the deck (or slide) language\'s locale (`groupNumber`, OPF\'s locale table: "6,240" in English and for a deck without a language, "6.240" in German, "\u0666,\u0662\u0664\u0660" in Saudi Arabic; Spanish groups only from five digits). LH-106: every label, tick and percentage, grouped or not, is in the language\'s own digits and decimal separator, so 999 and 1,000 agree (see [numbers in the language\'s own digits](design-resolution.md#numbers-in-the-languages-own-digits-lh-106-opf-034)). This covers the default value labels (a small chart\'s, a stacked chart\'s segments, a pie\'s or a line\'s), the pie value list, the doughnut hole value, a line\'s end labels and a metric\'s numeric `value` (a string value is the author\'s text and is never rewritten; a metric has no format field). The rule is per series: a series groups when every value in it is a whole number and one has four digits (`groupsThousands`), so a series with a fraction keeps the General form ("6240.5"). In PowerPoint the series\' own data labels take the number format `#,##0` (`GROUPED_LABEL_CODE`; the cache and the value axis keep General, and PowerPoint draws the separators of the viewer\'s region), so its labels agree with the preview. A format the author wrote (a `DataColumn` `format`) is never regrouped. The value axis follows the same rule (`groupsAxisTicks`): an axis of a column, bar, line or area chart with no number format of its own (its first series\' format) whose ticks are whole numbers reaching four digits groups its tick labels by the deck language, and PowerPoint\'s value axis takes `#,##0` (`sourceLinked="0"`); an axis format the author wrote and a 100% (share) axis stay as they are. Not covered: the labels and axes of a waterfall, funnel, treemap, histogram, pareto, combo or scatter chart.\n\n**Thousands grouping across chart constructs (LH-153).** The same rule reaches labels and axes beyond the ordinary category charts. A waterfall\'s labels (the sign stays outside the grouped number: "+3,200", "\u22121,450"), a funnel\'s, a treemap\'s value labels and a histogram\'s or Pareto chart\'s bars group by the deck language when their column has no format and holds whole numbers reaching four digits; a histogram of a lone value column plots bin counts, which always group. Their value axes, a combo chart\'s two value axes and a scatter chart\'s Y axis (and a box and whisker chart\'s) group by a rule decided from the plotted values alone (`groupsDataRange`: whole numbers, one of four digits, spanning at least 100 from zero for a column or a waterfall and from the lowest value otherwise), so the preview and PowerPoint agree. Combo primary and secondary scales now come from shared composition; PowerPoint retains its own scale selection only for constructs without composed bounds. A scatter chart\'s X axis groups only over a span of 1000 or more, so a column of years ("1990" to "2020") never reads "1,990". In PowerPoint a classic part\'s value axis, and a chartex part\'s labels and axes (the signed waterfall format `"+"#,##0;"\u2212"#,##0;#,##0`, a binned axis), take `#,##0`; a format the author wrote is never regrouped and a scatter chart\'s X cache keeps General.\n\n**Axis titles of a horizontal stacked bar (LH-154).** The pinned plot of a horizontal stacked bar chart (`horizontalStackPlot`) leaves the bands the preview carves for its axis titles: a value axis title takes one text line under the tick labels and a category axis title one text line before the row names, so neither overlaps them in either engine.\n\n**Neighboring series (LH-94).** Every series the scheme supplies stands at least 11 CIE L* from the series before it (`CHART_SERIES_MIN_LIGHTNESS_STEP`) in every default color scheme, on light and dark surfaces, strong and softened: a series closer than that is moved along the lightness axis (its hue and as much chroma as sRGB allows kept) to the nearest lightness that keeps its contrast floor (`separateNeighbors`), so `opf/chart-color-only` reports no lightness pair for a chart on a gallery scheme. An authored `chart.colors` entry is never moved. The last slice of a pie beside its first is LH-161\'s.\n\n**A pie\'s last slice beside its first (LH-161).** A pie or doughnut is a circle: its last slice touches its first, so the same step holds there. `chartSlicePlan(fill, palette, count, { legible })` takes the colors a chart draws and, when the last of `count` slices (a scheme color, never an authored one) is closer than 11 CIE L* to the first, moves that one slice along the lightness axis (hue and as much chroma as sRGB allows kept) by at most `CHART_SLICE_MAX_SHIFT` (20 L*, so it still belongs to the palette) to the nearest lightness that keeps its contrast floor and the step from both its neighbors (a color difference under `CHART_SERIES_MIN_DIFFERENCE` from any other slice costs more the further it falls). Where no lightness within 20 L* clears both steps, the palette color stays and the chart is *bordered* (`bordered: true`): every slice of that chart gets a `CHART_SLICE_SEPARATOR_PX` (2 px at the 720-px reference) border in the surface color, which separates the wrap pair by shape. The preview reads the plan per chart (`sliceColors`, `sliceBordered`: the slice outline is the surface color at 2 px), the PPTX export writes the moved slice as an sRGB literal (never the scheme accent it came from) or each data point\'s line (`c:dPt` `a:ln`, 1.5 pt, in the surface color, the slide\'s `bg1` where it is the background), and `opf/chart-color-only` judges the plan\'s colors and accepts a bordered wrap pair. Every other slice keeps the palette color, so a pie of any size differs from the series palette in at most its last slice. Over the 14 gallery schemes, 4 surfaces and 3 to 12 slices (560 pies) 268 have a wrap pair: 116 are recolored (largest move 16.4 L*, median 9.1) and 152 are bordered; the other 292 are unchanged. Fewer than three slices and more than the palette holds (the colors repeat) change nothing; a treemap or funnel has no circle and no wrap pair.\n\n**Waterfall numeric axes (RR-105).** Core shares the running-total minimum, maximum and major interval with native PPTX, including a hidden value axis. The plan respects null gaps, negative steps, terminal totals, label space and axis titles. PowerPoint still chooses the inner plot margins of its Office 2016 ChartEx constructs automatically; exact inner-plot placement is not pinned as it is for classic charts. A shared numeric scale does not establish identical plot bounds.\n\n**Histogram bins and labels (LH-160).** Core decides a histogram\'s or Pareto chart\'s bins from the chart box (`layer.histogram`, `chartHistogram`), and both engines read it. PowerPoint\'s chartex category axis has no label interval and wraps a long bin label onto two overlapping lines, so "label every nth bin" is not available to the native chart; what both engines can do alike is draw bins that can be labeled. **Bins:** Scott\'s count (Office\'s automatic bins) is capped at the number of bins the plot can label one beside another, each taking `HISTOGRAM_LABEL_SLOT` (1.8) chart text sizes of plot width and never fewer than `HISTOGRAM_MIN_BINS` (5); a chart with room keeps Scott\'s count, and the count is written as `cx:binCount`. **Edge labels:** the edges are rounded to the decimals the bin width needs (`histogramEdgeDecimals`: the fewest decimals that keep every rounded edge within a tenth of a bin of the true one, so edges that already are whole numbers stay whole: "(8333, 11250]" for a bin 2900 wide, "(7.4, 11.1]" for one 3.7 wide), written as the category axis number format (`cx:numFmt`, `0` or `0.0`...; PowerPoint applies it to its bin labels, native check 2026-11-05), which keeps each label on one line. An edge is rounded as PowerPoint rounds it under that format (`histogramEdgeText`, RR-105): its decimal value to 15 significant digits, half away from zero, so 1.2 + 1.85 reads 3.1 in both engines (`toFixed` would read the binary 3.0499999999999998 as 3.0). **Value axis (RR-105):** the value axis of a histogram and a Pareto chart is core\'s too (`layer.histogram.valueAxis`, `niceScale` over the bars, zero-based, with as many intervals as the estimated plot height holds), and so is a Pareto chart\'s percentage step (`layer.histogram.percentUnit`); the preview draws them and the native chartex part writes them as `cx:valScaling` `min`, `max` and `majorUnit` (the percentage axis 0 to 1 with that step), because PowerPoint\'s automatic chartex axis follows its own rule. **Value labels:** per-bar data labels the author asked for are dropped (`layer.histogram.valueLabels === false`, neither engine draws them, the classic fallback included) when the widest label with half a text size of air is wider than its bar\'s slot, the rule of the small chart\'s labels (LH-111): about a dozen bars of a half-width chart, more on a wide one. A chart over a category column keeps its rows (only the value labels follow the fit rule) and its category labels stay PowerPoint\'s and the preview\'s own.\n\n**Negative categorical histograms (RR-105).** A histogram with category/value columns can contain signed values in OPF. PowerPoint\'s native histogram category aggregation omits negative categories even when its cache contains them. PPTX export therefore uses an editable native clustered column chart for this data in every `chartex` mode, including `native`, and reports `chartex-fallback`. Every category, value and series is retained; automatic axis bounds can include the negatives. This fallback imports as a `column` chart with its data, so it does not restore the authored histogram type. Nonnegative category data still uses native aggregation in `auto`/`native`; a single numeric column containing negative raw observations still uses native histogram binning. The fallback does not imply that every Office version or other ChartEx construct has been qualified.\n\n**Import.** `fromPptx` consumes the tagged `OPF_CHART_MARK_V1` shapes (they are the chart\'s defaults, not content) and reads the chart they belong to as having no legend option; a waterfall\'s signed labels (a `"+"` number format) and a stacked chart\'s center value labels import as no `dataLabels`; a native waterfall without labels imports as `dataLabels: false` (labels too wide to fit draw the same).\n\n## What each chart type supports (axis titles, legend, data labels)\n\n`chartOptionSupport(target)` in `@openpresentation/opf/composition` returns this table; the validator, the preview, the exporter and the importer all follow it. An option a type cannot show is **adapted** (dropped, or reset to the default) and reported as a `chart-option-adapted` diagnostic by the validator (a warning), the renderer and the exporter (`onDiagnostic`). It is never silently lost and never fails the render.\n\n| Type (catalog ids) | Axis titles | Legend | Data label content | Data label positions (default) |\n| --- | --- | --- | --- | --- |\n| clustered column, bar (`column`, `bar`) | category, value | yes | category, value | center, inside-end, inside-base, outside-end (outside-end) |\n| stacked and 100% stacked column, bar | category, value | yes | category, value | center, inside-end, inside-base (center) |\n| line, stacked line, with markers | category, value | yes | category, value | above, below, left, right, center (above) |\n| area, stacked area, 100% stacked area | category, value | yes | category, value | none: the label sits in the area at each category |\n| scatter | category (X), value (Y) | yes | category (X value), value (Y) | above, below, left, right, center (above) |\n| pie | none | yes | category, value, percent | center, inside-end, outside-end (outside-end) |\n| doughnut | none | yes | category, value, percent | none: labels sit in the ring |\n| radar, with markers, filled | none | yes | category, value | none |\n| histogram, pareto | category, value | none | category, value | center, inside-end, inside-base, outside-end (outside-end) |\n| waterfall | category, value | none | category, value | center, inside-end, inside-base, outside-end (outside-end) |\n| funnel | category | none | category, value | none (center) |\n| treemap | none | none | category, value | none (center) |\n| box and whisker | category, value | yes | none | none |\n| combo (`combo`) | category, value, secondary | yes | category, value | columns: center, inside-end, inside-base, outside-end (outside-end); lines: above, below, left, right, center (above) |\n| world (region map) | none | none | none | none |\n\nA chart type outside the catalog is never adapted.\n\n## Combo charts\n\nStatus: FA-15 (format audit). A `combo` chart draws clustered columns and line series in one plot, for an amount beside a rate such as revenue and margin %:\n\n```json\n{\n "chart": {\n "type": "combo",\n "data": {\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, { "name": "Margin", "format": "0%" }],\n "rows": [["Q1", 12.4, 0.31], ["Q2", 18.1, 0.34], ["Q3", 21.7, 0.29], ["Q4", 26.3, 0.37]]\n },\n "line": ["Margin"],\n "secondaryAxis": ["Margin"],\n "axisTitles": { "category": "Quarter", "value": "Revenue ($M)", "secondary": "Margin" }\n }\n}\n```\n\n| Field | Values | Absent means |\n| --- | --- | --- |\n| `line` | plotted series names, at least one | the last plotted series is the line |\n| `secondaryAxis` | line series names | every series uses the primary (left) value axis |\n| `axisTitles.secondary` | string | no secondary axis title |\n\n- **The plan.** Every plotted series (the `mapping.series` or the positional rule) is drawn as clustered columns, except the ones `line` names, which are lines with markers. At least one series stays columns, so a `line` that names every series draws the first as columns. A one-series combo chart is drawn as columns. Core\'s `resolveChartData` returns the plan as `combo` (`{ role: "bar" | "line", axis: "primary" | "secondary" }` per series) and orders the series columns first, then the primary-axis lines, then the secondary-axis lines, so the preview, the PPTX series order and the legend agree.\n- **The secondary axis.** `secondaryAxis` puts line series on a value axis at the right (at the left right to left). It has its own automatic scale and its tick labels use the number format of its first series\' column (`DataColumn.format`, for example `0%`); the primary axis uses the first column series\' format. Gridlines follow the primary axis. `axisTitles.secondary` titles it, rotated like the primary value title.\n- **Labels.** One `dataLabels` applies to both parts: column labels sit outside the end and line labels above the points by default; `center` applies to both; a position only one part takes (`inside-end`, `inside-base`, `outside-end` for columns; `above`, `below`, `left`, `right` for lines) applies to that part and the other keeps its default, with a `chart-option-adapted` note. `resolveChartOptions` returns the column position as `dataLabels.position` and the line position as `dataLabels.linePosition`.\n- **Legend.** As for other multi-series charts (right by default, or `legend`); a column series has a square key and a line series a line with a marker.\n- **Validation.** A `line` or `secondaryAxis` name that is not a column of the data is a `chart-mapping-unknown-column` error. A name that is not plotted, a `secondaryAxis` name that is not a line, a `line` that names every series and a one-series combo chart are `chart-mapping-adapted` warnings. `line`, `secondaryAxis` and `axisTitles.secondary` on any other chart type, and `axisTitles.secondary` on a combo chart without `secondaryAxis`, are `chart-option-adapted` warnings.\n- **PPTX.** One `c:plotArea` holds a clustered column `c:barChart` (primary axes) and a `c:lineChart` with markers. Secondary-axis lines form a second `c:lineChart` on a second `c:valAx` (`axPos r`, `crosses max`) and a deleted second `c:catAx`; the embedded workbook holds every series. Import reads such a plot area (one clustered column group, one or two line groups) back as `combo` with `line` (when it is not the default), `secondaryAxis`, the secondary title and the label position.\n- **Editor.** The chart type picker offers `combo` for data with two or more series, the chart options panel sets which series are lines and which lines use the secondary axis, and switching to another type removes the three fields.\n\n## How the engines draw and write them\n\nThe preview (opf-render) and the PPTX export (opf-pptx) both read `resolveChartOptions(chart, chartOptionTarget(chart.type))`, so they agree on which options apply and with which content and position. The highlight adds `resolveChartOptions(...).highlight` (the names that survive the type\'s support table), `chartHighlightMarks(highlight, resolvedData)` (which series and which rows are named) and `chartHighlightColors` (the two colors).\n\n- **Preview.** A legend, and the axis titles, are carved from the chart box before the plot is laid out: the legend at its edge, then the titles next to the axes. Only a chart that uses a field changes; a chart without them draws the same SVG as before. A vertical axis title is rotated 270 degrees, as PowerPoint draws it.\n- **PPTX, classic charts** (column, bar, line, area, pie, doughnut, scatter, radar): `c:catAx/c:title` and `c:valAx/c:title` (rich text, `c:overlay val="0"`), `c:legend/c:legendPos` (`t`, `b`, `l`, `r`; no `c:legend` for `none`) and a `c:dLbls` per series with `c:dLblPos`, `c:showVal`, `c:showCatName`, `c:showPercent` and an explicit `c:separator`, number format `General` (RR-54: the series column format, as `toExcelNumberFormat` writes it, when its `DataColumn` has one; see [chart-table-data.md](chart-table-data.md)).\n- **PPTX, chartex** (histogram, pareto, waterfall, funnel, treemap, box and whisker): `cx:axis/cx:title`, `cx:legend pos`, and `cx:dataLabels pos` with `cx:visibility` and `cx:separator`. Their fallback for apps without chartex support is a picture of the preview, which draws the options as the preview does; when that picture cannot be drawn, the classic fallback chart carries the same classic options.\n- **Highlight (FA-14), preview.** A highlighted mark is filled with the accent color, every other mark with the muted color; series keep their order (the highlighted one is not moved on top), as PowerPoint draws them. A chart without a highlight never calls the highlight code.\n- **Highlight (FA-14), PPTX.** Series colors go into `c:ser/c:spPr` (and `c:marker/c:spPr` on line, scatter and radar series); a per-point color is a `c:dPt` with `c:idx`: `c:dPt/c:spPr` on a column or bar, a circular `c:dPt/c:marker` on a line, the slice fill on a pie or doughnut. The accent is `a:schemeClr val="accent1"` when the deck theme holds the primary exactly (so re-theming in PowerPoint recolors it) and an `a:srgbClr` literal when the contrast adjustment moved it; the muted color is always an `a:srgbClr` literal, because a mix of two theme colors is not one scheme color with `lumMod`/`lumOff`. Data labels inside a mark are written per point where the mark colors differ. Chartex constructs are unchanged.\n- **Import.** `fromPptx` reads the same parts back into `axisTitles`, `legend` and `dataLabels`. A legend equal to the default for that chart (right for multi-series, pie and doughnut; none otherwise) is not recorded, so decks that never set the field import unchanged. Anything the three fields cannot express (per-series label overrides, number formats, rich-text titles, manual layouts) is reported with a diagnostic and not invented. The highlight is not inferred from the colors (a native chart\'s fills do not say which names were highlighted, and a hand-colored chart must not turn into a highlight): in `full` provenance mode the exporter records the authored `highlight` in the chart\'s `OPF_DATA_V1` data record, and `fromPptx` restores it while the chart\'s cached data is unchanged. With `provenance: false` or `\'references-only\'`, or after the data was edited in PowerPoint (`chart-data-provenance-changed`), the chart imports without a highlight and keeps the colors it shows.\n\n## Text alternative\n\n`Chart.alt` (FA-09) is a string: what the chart shows, in a sentence or two (the point and the key numbers), not "a chart". Unlike the three options above it changes no geometry.\n\n- **Preview.** The chart\'s SVG group carries `role="img"` and `aria-label`; the role makes the drawn marks inside presentational, so the label is the chart\'s one announcement. The text beside the chart stays reachable: the slide is a labeled group, not an image (see [Accessibility of the preview](content-payloads.md#accessibility-of-the-preview)).\n- **PPTX.** The value is the chart frame\'s `p:nvGraphicFramePr/p:cNvPr/@descr`, the same attribute pictures use, on classic charts and on chartex (Office 2016) frames. `fromPptx` reads it back into `alt`. Without `alt` (RR-105) the frame carries a generated description, the chart type with its series and categories in plain English ("Column chart: Sales and Cost by Quarter, 3 categories"), so PowerPoint does not report missing alternative text; import leaves a description in the generated form out of the document (also a stale one: PowerPoint keeps the description when a series or a column is renamed), and reads any other text as `alt`. A table without `alt` is described by its column names and row count the same way.\n- **Empty string.** `""` marks the chart decorative, like an empty `Asset.alt`: the preview writes no label and hides the group (`aria-hidden`), and the PPTX frame carries PowerPoint\'s own "Mark as decorative" marker (the `adec:decorative` extension of `p:cNvPr`), not `descr=""`, which PowerPoint writes for any shape without alt text. Import reads the marker back as `alt: ""`. A chart nearly always carries a message, so `opf/chart-text-alternative` reports it as info.\n- **Validate.** `opf/chart-text-alternative` passes a chart with a non-blank `alt`. Without `alt` it still passes when text, a table or a subtitle sits beside the chart; otherwise it reports the chart and offers a quick fix that focuses the `alt` field. `opf/poor-alt-text` flags a bare "chart", a URL, a leading "chart of" and alt text over 250 characters.\n\n## Defaults and geometry\n\nA chart that sets none of the four fields draws its type\'s defaults, including the [chart layer](#chart-layer-small-charts-and-the-header-row) of column, bar, line, area and combo charts. A chart with options reserves space for its legend and titles, so its geometry differs from a chart without them. The implementations require coordinated Core, renderer, PPTX and editor versions; use the [compatibility matrix](compatibility-matrix.md).\n\n## Not in this change\n\nPer-series data label overrides (column number formats are RR-54, [chart-table-data.md](chart-table-data.md)), a rotated or rich-text axis title, a chart title, a legend that overlays the plot, manual plot-area layout, secondary axes outside combo charts, and trendlines. Charts from external spreadsheets stay descoped (the `ChartDataSource` form was removed from the schema).\n\nA doughnut hole takes the surface color in both engines even when the chart has an explicit legend position or data labels (LH-182). Core retains the current circular plot after legend space is reserved; the preview fills the hole, and PPTX pins that plot with a surface-colored ellipse under the chart. This surface-only mark is consumed on import without discarding authored legend or label options.\n\n## Data-dependent chart drawings\n\nThe preview and PPTX share the draw plan below. These are representation adaptations, with native editing and layout fidelity qualified separately. The source chart stays unchanged. A public type-adaptation warning is not emitted for every family; the diagnostic column states the actual validation behavior.\n\n| Source and data | Shared drawing | Data treatment | Validation diagnostic |\n| --- | --- | --- | --- |\n| World map whose labels are mostly non-places, such as Q1\u2013Q4 | Clustered columns (`map-as-columns`) | Every numeric series and data order retained | No dedicated adaptation warning |\n| Pareto with at least two numeric series | Clustered columns (`pareto-as-columns`), without a cumulative curve | Every series and category retained in data order | `opf/chart-mapping-adapted` |\n| Box-and-whisker with one value per unique category | One distribution per series (`box-per-series`) | All numeric observations retained; categories become a shared group named after the category column | No dedicated adaptation warning |\n| Pie or doughnut with at least two numeric series | One concentric doughnut ring per series (`nested-rings`), first series innermost | Every series/category/value retained | No dedicated adaptation warning |\n| Scatter with a nonnumeric X column | Numeric series against category positions 1, 2, \u2026 (`scatter-by-position`) | Numeric series retained; the unusable X column is omitted from the drawing | `opf/chart-series-dropped` names the omitted X column |\n\nOther one-series constructs can leave additional series out and report `opf/chart-series-dropped`; this differs from an all-series-preserving adaptation. A multi-series pie becoming nested rings is not a claim that its second series was lost.\n\n## Multi-series Pareto adaptation\n\nA Pareto chart sorts one numeric series and draws its cumulative share. When the source has two or more numeric series, OPF preserves every series and category in data order as clustered columns in both the preview and PPTX. Validation reports `opf/chart-mapping-adapted` at the chart\'s `type`. It does not claim that these clustered columns are a Pareto chart, and does not discard a baseline series to produce a cumulative curve. Use one numeric series for the Pareto representation.\n\n### Validation and conversion reports\n\n`opf validate` and `validate` perform semantic chart checks. Drawing conversions through `opf convert` or the Node `convert` API also retain the selected `opf/chart-mapping-adapted` and `opf/chart-series-dropped` warnings for SVG, PNG, PDF and full-slide image-mode PPTX. Warnings follow the actual drawn slide selection, appear once per affected chart, and leave output bytes unchanged. Native PPTX retains its existing `pptx/chart-data-adapted` exporter notices for representation changes or omitted series, without a duplicate core advisory. Converting between deck text formats keeps its format/reference-only reporting contract. Direct renderer/exporter callbacks are separate from the Node conversion report; use semantic validation when reviewing the source data.\n\nThe PPTX exporter also owns its adaptation notices with `charts: "picture"`; core forwarding applies to full-slide image-mode PPTX (`as: "images"`), avoiding duplicate warnings in both routes.\n'
22
22
  },
23
23
  {
24
24
  "slug": "chart-table-data",
25
25
  "file": "docs/chart-table-data.md",
26
26
  "title": "Chart and table data: numbers, formats, datasets and series mapping",
27
- "markdown": '# Chart and table data: numbers, formats, datasets and series mapping\n\nStatus: RR-54 (release readiness). Additive schema plus one behaviour fix (strict chart numbers). These features are shipped in the coordinated package line; use the [compatibility matrix](compatibility-matrix.md) for the verified set. This page is the contract the four packages implement; change it here first.\n\n## Decisions (vetoable)\n\nRecorded 2026-10-05 for the owner, who asked for all five recommendations of the chart/table data review at once:\n\n1. **One strict chart number rule in core.** The preview read `"12%"` as a gap and `"1e6"` as 1000000; the exporter stripped every non-numeric character (`"1e6"` became 16, `"(5)"` became 5, `"Q1"` became 1). Both engines now call core `chartNumber`, which follows the existing data-import rule. A string that is not a strict decimal number is a gap in both engines and a `chart-value-not-numeric` warning, never a guessed value. Decks whose chart cells held `"12%"` or `"$5"` export a gap where they used to export 12 or 5.\n How a gap draws (RR-105): a line breaks; an unstacked area ends at the points beside the gap and stands on the axis there, so a point with gaps on both sides draws no area; a stacked or 100% stacked area keeps the gap\'s layer at zero thickness, so the layers above still rest on the running total. A gap has no data label. The PPTX export writes the gap as an omitted `c:pt` with `c:dispBlanksAs val="gap"` on line and area charts (before 0.34 it wrote `span`, so PowerPoint joined a line across the gap while the preview broke it).\n2. **`ChartDataSource` is removed from the schema.** No engine resolved it ([opf#240](https://github.com/OpenPresentation/opf/issues/240), descoped), so the format-audit program (FA-07, 2026-10-06) deleted it, with its `chart-data-source-unresolved` warning. A future data-resolver design re-adds it when it is built. Inline data records where it came from with `data.source`, which engines never read.\n3. **Number formats use the variables syntax.** One pattern language for `NumberVariable.format`, column formats and cell formats. Core converts it to an Excel format code for the PPTX export and back on import.\n4. **Datasets are top-level and shared.** A chart or a table references one with `{ "dataset": "<id>" }`. Core inlines references before composition, so the engines keep plotting and laying out inline data.\n5. **Series mapping is by column name.** `chart.mapping` picks the category, X and series columns. Absent keeps today\'s positional rule exactly.\n\nA document that uses none of the new fields validates, previews and exports byte-for-byte as before, except for decision 1 on non-numeric strings.\n\n## Schema\n\n### Number formats\n\n`NumberFormat` is a string with the `NumberVariable.format` syntax: an optional literal prefix, a numeric part made of `#`, `0`, `,` (grouping) and `.` (decimals), and an optional literal suffix. A `%` in the prefix or suffix multiplies the value by 100. Examples: `#,##0`, `0.0%`, `$#,##0.00`, `#,##0 units`. An invalid pattern is a `number-format-invalid` error. A format applies only to number values; strings, booleans, `null` and rich runs display unchanged.\n\nTwo spellings display differently in Excel, so prefer the alternatives in charts that are exported: optional decimals only (`0.##`) show a whole number as `5` in core and the preview but as `5.` (with a trailing point) in Excel, and an all-`#` integer part (`#`, `#,###`) shows zero as `0` in core but as nothing in Excel. Use `0.0#`-style decimals with at least one `0`, or a whole-number format, and an integer part that ends in `0`.\n\n### Columns\n\n`DataColumn` is `{ "name": string, "format"?: NumberFormat }`. Anywhere a chart or dataset column is a string, it may be a `DataColumn`; the string form is `{ "name": value }` with no format.\n\n```json\n"chart": {\n "type": "column",\n "data": {\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, { "name": "Margin", "format": "0%" }],\n "rows": [["Q1", 12.4, 0.31], ["Q2", 18.1, 0.34]]\n }\n}\n```\n\nA table column header may also be a `DataColumn`. A `StyledTableCell` gains an optional `format`:\n- on a body cell, it formats that cell\'s number value;\n- on a header cell (in `columns`), it is the column\'s format, the same as a `DataColumn` header.\n\nA body cell\'s own format wins over the column\'s.\n\n```json\n"table": {\n "columns": ["Region", { "name": "Revenue", "format": "$#,##0.0" }, { "value": "Growth", "style": { "align": "end" }, "format": "0%" }],\n "rows": [["EMEA", 8.2, 0.4], ["APAC", 6.1, { "value": 0.52, "format": "0.0%" }]]\n}\n```\n\n### Data source provenance\n\n`DataSourceRef` is `{ "src": string, "sheet"?, "range"?, "fields"?: string[], "retrieved"?: string (ISO date or date-time), "description"?: string }`. It records where inline data or a dataset came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import. It may appear as `ChartData.source` and `Dataset.source`.\n\nThere is no chart data source by file or asset (`chart.data` with `src`, `sheet`, `range`, `columns`): that form is removed (opf#240, descoped) and is a schema error. Import the data inline with `columns`/`rows` and record its origin in `source`.\n\n### Datasets\n\nTop-level `datasets` maps ids (the `assets` id pattern) to a `Dataset`:\n\n```json\n{\n "datasets": {\n "revenue": {\n "title": "Revenue by quarter",\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, "Costs"],\n "rows": [["Q1", 12, 8], ["Q2", 18, 11], ["Q3", 24, 15]],\n "source": { "src": "./data/revenue.csv", "retrieved": "2026-10-05" }\n }\n }\n}\n```\n\nRows hold `ChartDataCell` scalars (string, number, boolean, null). A `DatasetRef` is `{ "dataset": "<id>", "fields"?: string[] }`; `fields` selects and orders columns by name, each at most once (a repeated name is a schema error).\n- **Chart:** `chart.data` may be a `DatasetRef`. It is the second `oneOf` branch beside `ChartData`.\n- **Table:** a table is either inline (`rows` required, optional `columns`) or dataset-backed (`dataset` required, optional `fields`, and no `rows` or `columns`). Dataset tables take their headers and column formats from the dataset; per-cell styles need an inline table.\n\nValidation:\n- an unknown dataset id is a `dataset-unknown` error;\n- an unknown field is a `dataset-field-unknown` error;\n- duplicate column names in a dataset, or in chart data that a `mapping` or `fields` addresses, are a `data-column-duplicate` error;\n- a dataset nothing references is the warning `opf/unused-dataset` (category `references`).\n\n### Series mapping\n\n`chart.mapping` is `{ "category"?: string, "x"?: string, "series"?: string[] }`, naming columns after any `fields` selection:\n- `category`: the label column. Default: the first column.\n- `x`: the X column of an XY (scatter) chart. Default, today\'s rule: the second column (the first when `category` names the second), and only when the chart has three or more columns. With two columns there is no X column: the second column is the one series, plotted against row numbers. An `x` that leaves no series (two columns, or every series dropped) is a `chart-mapping-adapted` warning and that column is plotted as the series. A chart is XY when its type resolves (deprecated ids through their replacement) to the scatter construct of `chartOptionTarget`. An `x` equal to the category is a `chart-mapping-adapted` warning and the default is used. On a chart type without an X axis it is dropped with a `chart-mapping-adapted` warning.\n- `series`: the plotted columns, in order. Default: every column that is not `category` or `x`.\n\nAn unknown name is a `chart-mapping-unknown-column` error. A series that repeats the category or X column is a `chart-mapping-adapted` warning and is dropped. Mapping only reorders and selects columns; single-series constructs still plot one series (see [Chart fallbacks](#chart-fallbacks-lh-60)).\n\n### Chart fallbacks (LH-60)\n\nSome data does not fit the chart type it is written for. Core\'s `chartDrawPlan(chart, resolved, { language })` (on `@openpresentation/opf` and `/composition`) decides from the data alone how the preview and the PPTX export draw such a chart, so both draw the same:\n\n| Data | Drawn as | PPTX |\n| --- | --- | --- |\n| `world` over category labels of which fewer than half are places (`isPlaceLabel`: CLDR region names in English and the deck language, upper-case region codes, US states, Canadian provinces, Australian states, common aliases) | clustered columns of every series (`map-as-columns`) | a `c:barChart`, in every `chartex` mode |\n| `pareto` of two or more numeric series (a Pareto chart sorts one series and draws its cumulative share; LH-175) | clustered columns of every series in data order (`pareto-as-columns`) | a `c:barChart`, in every `chartex` mode |\n| `box-and-whisker` with one value per category (no label repeats, two rows or more) | one box per series: the rows form one group named after the category column (`box-per-series`) | the chartex box-and-whisker with that one category |\n| `pie` or `doughnut` of several series | a doughnut of nested rings, the first series innermost, each ring colored by category and named on its largest slice (`nested-rings`; LH-92, see chart-options.md) | one `c:doughnutChart` with a `c:ser` per series, each naming its series in one `c:dLbl` |\n| `scatter` whose X column holds no number | every series against the category position 1, 2, 3, ...; the X column is not drawn (`scatter-by-position`) | X values 1 to n |\n\nThe PPTX export reports a fallback as `chart-data-adapted` with `adaptation: \'chart-fallback\'` and records the authored data, so `fromPptx` restores it (a pie of several series imports as a doughnut). A construct that plots one series (treemap, histogram with categories, a Pareto chart of one numeric series, waterfall, funnel, a map of places, a one-series pie) still draws the first; `validate` names the others, and a scatter X column without numbers, in the warning `opf/chart-series-dropped` (`chartDrawDiagnostics`).\n\n## Core runtime API\n\nExported from `@openpresentation/opf` and `@openpresentation/opf/data` (module `src/chart-data.ts`; the resolvers are also on `@openpresentation/opf/composition`). Inputs are typed `unknown` so engines can pass any parsed chart, table or document; the result types are exported (`ResolvedChartData`, `ResolvedTableData`, `DataDiagnostic`, `DataColumn`, `DataSourceRef`, `Dataset`, `DatasetRef`, `ChartMapping`, `DataCellValue`, `DataTableCell`, `DataTableHeader`, `DataStyledCell`).\n\n```ts\n/** Strict chart number: finite numbers, and strings in strict decimal syntax (trimmed). Everything else is null (a gap), including "+5", ".5", "5.", "007" and plain digit strings beyond the safe integer range (usually identifiers that would lose digits); a decimal or exponent form such as "1e20" is a number. */\nexport function chartNumber(value: unknown): number | null;\n/** Format a number with a NumberFormat; an absent or invalid format prints the General form (String(value)). */\nexport function formatDataNumber(value: number, format?: string): string;\n/** Why a NumberFormat is invalid (the number-format-invalid message), or undefined when it is valid or absent. */\nexport function numberFormatError(format: unknown): string | undefined;\n/** NumberFormat -> Excel format code ("General" when absent or invalid). Literal prefix/suffix text is quoted as one run ("0.0 m/s" -> \'0.0 "m/s"\'), so \'/\' (Excel\'s fraction bar), \'E+\', \'@\', \'*\', \'_\' and \'?\' are never bare (native check opf#387); placeholders are written \'#\' before \'0\' ("0#" -> "#0"). */\nexport function toExcelNumberFormat(format?: string): string;\n/** Excel format code -> NumberFormat, or undefined when the code has no exact NumberFormat equivalent (General, sections, scaling commas, and placeholder orders Excel reads by position such as "0#" or "0.#0"). */\nexport function fromExcelNumberFormat(code: string): string | undefined;\n/** Pure: a copy of the document where every chart and table DatasetRef is replaced by inline data (columns as DataColumn when a format applies, rows copied; a chart also takes the dataset\'s `source`). `datasets` stays in place. Unknown ids, and references naming an unknown field, are left as they are. */\nexport function inlineDatasets<T>(document: T): T;\n/** One table or chart in inline form (a dataset reference copied from document.datasets); anything else is returned as is. */\nexport function inlineTableData<T>(table: T, document?: unknown): T;\nexport function inlineChartData<T>(chart: T, document?: unknown): T;\n/**\n * Resolve a chart\'s data to the canonical positional table: [category, (x,) ...series]. hasX is true when columns[1] is the X\n * column: an XY chart with three or more resolved columns (with two, the second column is the series against row numbers).\n * Category cells are kept as authored; X and series cells pass through chartNumber. Data with a single column has no\n * category: that column is the chart\'s values and passes through chartNumber too (with chart-value-not-numeric per cell).\n * Inline ChartData, a DatasetRef (needs the document) and mapping are resolved here.\n * options.path is the chart\'s JSON Pointer, the base of diagnostic paths (dataset cells report at /datasets/<id>/...).\n */\nexport function resolveChartData(chart: unknown, document?: unknown, options?: { path?: string }):\n | { ok: true; columns: string[]; hasX: boolean; formats: (string | undefined)[]; rows: (string | number | boolean | null)[][]; source?: DataSourceRef; dataset?: string; diagnostics: DataDiagnostic[] }\n | { ok: false; reason: "dataset-unknown" | "no-rows" | "no-columns"; message: string; diagnostics: DataDiagnostic[] };\n/** Resolve a table (inline or dataset-backed) to headers, rows and per-column formats. */\nexport function resolveTableData(table: unknown, document?: unknown, options?: { path?: string }):\n { columns?: DataTableHeader[]; rows: DataTableCell[][]; formats: (string | undefined)[]; dataset?: string; diagnostics: DataDiagnostic[] };\n/** Display value of a table cell: a number with a valid format (cell, else column) becomes formatted text (a styled cell keeps its style with the text as value); anything else is returned unchanged. */\nexport function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string): DataTableCell;\n/** Migration help (see below): the patch that stores one chart value column\'s text as numbers with the format that shows the same text, or undefined. */\nexport function suggestChartNumberFix(chart: unknown, document?: unknown, options?: { path?: string; column?: number | string }):\n { patches: { op: "replace"; path: string; value: unknown }[]; column: number; name: string; format: string } | undefined;\n/** Helpers: dataset-level diagnostics (duplicate names, invalid formats), unreferenced dataset ids, the XY test, the DatasetRef test. */\nexport function datasetDiagnostics(document: unknown): DataDiagnostic[];\nexport function unusedDatasets(document: unknown): string[];\nexport function isXYChartType(type: unknown): boolean;\nexport function isDatasetRef(value: unknown): value is DatasetRef;\n```\n\n`DataDiagnostic` is `{ code, severity: "error" | "warning", path, message }`, with the codes above plus `chart-value-not-numeric`. `chartNumber` runs after variables are filled. Before filling, the validator does not warn on a `var:<id>` cell whose variable is a number. `chart-value-not-numeric` is reported for any value cell that `chartNumber` rejects (strings and booleans), never for `null` or `""`. An unknown `fields` entry is a `dataset-field-unknown` error and `resolveChartData`/`resolveTableData` leave that column out. `number-format-invalid` applies to `DataColumn.format` and `StyledTableCell.format`; `NumberVariable.format` keeps its existing check (`variable-format` where it is used), so no existing document gains an error.\n\n`validate` reports the codes as `opf/<code>` rule ids: the errors are `format` findings, `opf/chart-value-not-numeric` and `opf/chart-mapping-adapted` are `content` warnings, `opf/chart-data-source-unresolved` is a `references` warning, and `references` adds `opf/unused-dataset`. The raw schema issue of a finding is in its `validation` field (`validation.params.code`).\n\n### Migration help\n\nDecks written before the strict rule often hold display text in chart cells. When every text cell of a value column (an X or series column, or a lone column) is written in one display style that a NumberFormat reproduces exactly, `suggestChartNumberFix` returns the fix, and `validate` attaches it to each of the column\'s `opf/chart-value-not-numeric` warnings as `fixes: [{ id: "store-chart-numbers", title, kind: "patch", safe: false, patch }]` (a [finding fix](finding-schema-reference.md); core never applies it):\n\n- `"12%"`, `"8.5%"` become 0.12 and 0.085 with the column format `0.#%`;\n- `"$1,234"`, `"$56"` become 1234 and 56 with `$#,##0` (also `\u20AC`, `\xA3`, `\xA5`);\n- `"1,234.5"`, `"999"` become 1234.5 (the plain number stays) with `#,##0.##`.\n\nThe patch replaces each text cell with its number and the column with a `DataColumn` that has the format; a dataset column is fixed in the dataset, so every chart and table that uses it changes, and its tables show the same text. A style is one optional leading minus, one optional currency symbol, digits (grouped in threes or plain), optional decimals and an optional `%`. There is no fix when the column already has a format, when styles are mixed (`"12%"` beside `"$5"` or beside the number 0.5), for accounting negatives `"(5)"`, `"$-5"`, a decimal comma (`"1.234,5"`), units (`"5 units"`), `".5"` or `"007"`, for mixed grouping (`"1,234"` beside `"5678"`), or when one format cannot show every value as written (`"$5"` beside `"$5.50"`). Every fixed value is checked: `formatDataNumber(value, format)` equals the text as written.\n\nCore composition, table layout and pagination accept dataset-backed tables and charts by inlining first. Table layout measures the formatted text. Markdown conversion, diff, merge, patch, validate and format keep the new fields. In detail:\n\n- `composeSlide` inlines a dataset-backed `table` or `chart` from `options.presentation.datasets`, so the composed item\'s `value` (and `payload`) is the inline copy; the item `path` still points at the authored field. `layoutTable(value, box, { presentation })` does the same, and each body cell\'s `TableCellLayout.value` is its display value (`tableCellDisplayValue`); `input` stays the authored cell. A DataColumn header shows its `name` (`path` ends in `.name`).\n- `paginateSlide`/`paginate` validate a slide with the deck\'s `datasets` (and `references`). A dataset table that has to be split is written to the continuation slides as inline tables (the slide that fits is returned unchanged, with its reference).\n- `convertContent` keeps a dataset reference between chart and table (`fields` too; `mapping` is reported as lost) and needs `options.presentation` to convert a dataset table to any other kind. Inline conversions keep DataColumn formats and report lost number formats and `source`. Slide-level conversions validate with the document\'s datasets; slide-only structure edits skip the dataset checks they cannot make.\n- Markdown writes the new fields in its embedded YAML form (lossless); `datasets` go to the front matter. `format` orders `datasets`, `mapping`, `source` and `DataColumn` keys by the schema. `diff` reports changes under `datasets` in their own category. The chart rules of `validate` read resolved chart data (DataColumn names, dataset charts).\n- Variables: `resolveVariables` walks `datasets` like any other content, so `{{id}}` tokens and whole `var:<id>` cells in dataset rows are filled before engines inline the reference.\n- `opf ingest --dataset <id>` (CLI) writes the imported columns and rows into `datasets.<id>` and references it. Re-importing into an existing dataset keeps its title, description and the format of each column whose name is unchanged; `source.src` names the imported file relative to the deck file\'s folder with `/` separators (stdin: no source), and `source.retrieved` is set only by `--date YYYY-MM-DD`; the command never reads the clock.\n- The generated `Table` type now has `rows?` (a dataset table has none) and `dataset?`/`fields?`; TypeScript callers that read `table.rows` handle the dataset form (or call `resolveTableData`).\n\n## Engines\n\nAll three engines read core\'s functions when they exist and fall back to their previous behaviour on a core without RR-54, so each can ship before or after core. A document that uses none of the new fields renders, exports and edits byte for byte as before (renderer: all 805 slides of the core examples; PPTX: 21 golden digests; editor: identical patches).\n\n### Preview (opf-render, [opf-render#127](https://github.com/OpenPresentation/opf-render/pull/127))\n\n- **Data:** every chart path reads `resolveChartData`: the catalog charts, the chartex constructs, scatter, pie and doughnut, single-column charts, and the legacy sketch. Its own `chartNumber` delegates to core\'s, so `"0x10"` is now a gap too. Data that does not resolve keeps the "No chart data" placeholder. A document with an unknown dataset or mapping column fails validation (`invalid-opf`) like any other invalid document.\n- **Formats:**\n - Data labels use their series\' format, through `formatDataNumber`.\n - Value-axis ticks use the first plotted series\' format, as Excel does for a source-linked axis.\n - The scatter X axis and X labels use the X column\'s format.\n - Percent axes (100% stacked, pareto) and pie percent labels stay percent.\n - A histogram of a lone column plots counts and takes no format.\n- **Tables:** cells draw core layout\'s display text, so a body cell\'s own `format` wins over its column\'s.\n- **Tracing:** the editor relies on each drawn part\'s authored path.\n - Every part of a dataset-backed chart or table traces to its authored `slides.N.chart` or `slides.N.table` path, because it has no rows of its own.\n - A chart with `mapping` traces each part to the authored column index.\n\n### PPTX export (opf-pptx, [opf-pptx#171](https://github.com/OpenPresentation/opf-pptx/pull/171))\n\n- **Numbers:** the export resolves data through `resolveChartData`, and the lenient `parsedNumber`/`numericValue` are removed. Non-numeric strings export as gaps, with one `chart-value-not-numeric` diagnostic per chart that carries a `count`.\n- **Classic charts:** `toExcelNumberFormat` codes are written as:\n - the series `c:numCache/c:formatCode` (added where PptxGenJS writes none, such as pie and doughnut);\n - the series and chart-group data-label `c:numFmt sourceLinked="0"`;\n - the value-axis `c:numFmt`. The first plotted series\' format is used, a scatter X axis takes the X column\'s, and a 100% stacked axis keeps `0%`.\n - Labels that show percentages keep PowerPoint\'s percent form.\n- **Chartex:** `cx:lvl formatCode` and the value-label and value-axis `cx:numFmt`, except on binned constructs.\n- **Embedded workbook:** custom `numFmt` entries from id 164, with cell styles on every value cell, so Edit Data shows the formats.\n- **Tables:** tables export core layout\'s display text.\n- **Datasets and mapping:** a chart that uses them exports exactly like its inline equivalent.\n- **Provenance:** in `full` mode, `OPF_DATASETS_V1` holds the `datasets` map. `OPF_DATA_V1` sits on each chart or table frame that uses a new field and holds the authored `data`, `mapping` and table form (and, FA-14, a chart\'s `highlight`, which then also records its inline `data`; see [chart-options.md](chart-options.md)), plus a hash of the cached names, values and format codes. `references-only` mode and `provenance: false` write neither tag.\n\n### PPTX import (opf-pptx)\n\n- **With provenance:** `datasets` is restored before document provenance validates. A frame\'s dataset reference, `mapping`, formats and `source` are restored only while the cache hash still matches. If PowerPoint (or a person) changed the values, the native values import and a diagnostic says why, such as `chart-data-provenance-changed` or `table-dataset-unavailable`. The hash compares format codes in core\'s canonical form (`fromExcelNumberFormat`), so PowerPoint\'s re-spellings on save (`\\$#,##0.0` for `$#,##0.0`, `#,##0\\ "units"` for `#,##0 "units"`, native check [opf#385](https://github.com/OpenPresentation/opf/pull/385)) still match; a General code counts as no code.\n\nDecorative ChartEx titles are excluded from chart-data evidence. A plain PowerPoint save can rewrite a title from `cx:rich` to `cx:txData/cx:v` without changing the data. That rewrite, or a display-caption rename, keeps an unchanged chart\'s authored data form; it must not introduce a synthetic `Row` column. The cached categories, numeric values, series names and number formats still control whether provenance can restore the authored form.\n- **Without provenance:** a cache `formatCode` that `fromExcelNumberFormat` maps back becomes that column\'s `{ name, format }`, for both classic and chartex charts. Core returns the canonical spelling, such as `#,##0 units` for `#,##0 "units"`. Other codes are reported as `chart-number-format-adapted` and never invented.\n- **Cached values:** these follow the strict rule as well. XML decimal forms (`+5`, `.5`, `007`) are numbers; anything else is a gap with a diagnostic, never a stripped number or 0.\n\n### Editor (opf-editor, [opf-editor#92](https://github.com/OpenPresentation/opf-editor/pull/92))\n\n- **DataColumn headers:** the data grid shows a `DataColumn` header\'s `name`. Rename, insert, delete, move and paste keep each column\'s format.\n- **Chart cells:** they follow `chartNumber`. Text that is not a number is refused with the reason, and a stored string read as a gap is flagged.\n- **Shared datasets:** a dataset-backed chart or table is edited at `/datasets/<id>` through `fields`.\n - Hidden columns keep their data.\n - A column added while `fields` is set goes to both the dataset and `fields`.\n - A rename updates every `fields` and `mapping` that names the column, in the same patch.\n - Deleting a column another item uses is refused with `dataset-column-in-use`.\n - The status line says how many items share the dataset, and "Use a copy of the data" (`detachGridDataset`) inlines one item\'s data.\n- **Format and mapping:**\n - A per-column format field (`setGridColumnFormat`) is checked with `numberFormatError`.\n - A "Chart columns" panel (`setChartMapping`) sets the category, the X column (XY charts only) and the series, and writes only what differs from the default.\n- **Import:** "Store as a shared dataset" (`prepareDatasetImport`) imports into `datasets.<id>`, as `opf ingest --dataset` does.\n- **Other panels:** the table style panel and `table-options` refuse a dataset table with `table-dataset-backed`. Find and replace also searches dataset text.\n- **Undo:** each edit is one undoable patch.\n\n### Native PowerPoint checks\n\nWanted before release:\n- formatted data labels and value axes;\n- Edit Data shows the workbook cell formats with no repair prompt;\n- no repair prompt for the frame `custDataLst`;\n- after a plain save in PowerPoint, the data tags and cache hash survive;\n- the two spellings above (`0.##` on a whole number, `#` on zero) show as described.\n\nSample decks are written by the PPTX branch under `artifacts/rr-54-native/`.\n\n## Not in this change\n\n- Resolving a data source by file or asset, or refreshing `source` ([opf#240](https://github.com/OpenPresentation/opf/issues/240)).\n- Date axes and date formats.\n- Per-series colors: shipped later as `chart.colors`; see [chart-options.md](chart-options.md#setting-colors-chartcolors). (Columns with line series, optionally on a secondary axis, are the `combo` chart type: [chart-options.md](chart-options.md#combo-charts).)\n- Formulas.\n- Rich text in dataset cells.\n'
27
+ "markdown": '# Chart and table data: numbers, formats, datasets and series mapping\n\nStatus: RR-54 (release readiness). Additive schema plus one behaviour fix (strict chart numbers). These features are shipped in the coordinated package line; use the [compatibility matrix](compatibility-matrix.md) for the verified set. This page is the contract the four packages implement; change it here first.\n\n## Decisions (vetoable)\n\nRecorded 2026-10-05 for the owner, who asked for all five recommendations of the chart/table data review at once:\n\n1. **One strict chart number rule in core.** The preview read `"12%"` as a gap and `"1e6"` as 1000000; the exporter stripped every non-numeric character (`"1e6"` became 16, `"(5)"` became 5, `"Q1"` became 1). Both engines now call core `chartNumber`, which follows the existing data-import rule. A string that is not a strict decimal number is a gap in both engines and a `chart-value-not-numeric` warning, never a guessed value. Decks whose chart cells held `"12%"` or `"$5"` export a gap where they used to export 12 or 5.\n How a gap draws (RR-105): a line breaks; an unstacked area ends at the points beside the gap and stands on the axis there, so a point with gaps on both sides draws no area; a stacked or 100% stacked area keeps the gap\'s layer at zero thickness, so the layers above still rest on the running total. A gap has no data label. The PPTX export writes the gap as an omitted `c:pt` with `c:dispBlanksAs val="gap"` on line and area charts (before 0.34 it wrote `span`, so PowerPoint joined a line across the gap while the preview broke it).\n2. **`ChartDataSource` is removed from the schema.** No engine resolved it ([opf#240](https://github.com/OpenPresentation/opf/issues/240), descoped), so the format-audit program (FA-07, 2026-10-06) deleted it, with its `chart-data-source-unresolved` warning. A future data-resolver design re-adds it when it is built. Inline data records where it came from with `data.source`, which engines never read.\n3. **Number formats use the variables syntax.** One pattern language for `NumberVariable.format`, column formats and cell formats. Core converts it to an Excel format code for the PPTX export and back on import.\n4. **Datasets are top-level and shared.** A chart or a table references one with `{ "dataset": "<id>" }`. Core inlines references before composition, so the engines keep plotting and laying out inline data.\n5. **Series mapping is by column name.** `chart.mapping` picks the category, X and series columns. Absent keeps today\'s positional rule exactly.\n\nA document that uses none of the new fields validates, previews and exports byte-for-byte as before, except for decision 1 on non-numeric strings.\n\n## Schema\n\n### Number formats\n\n`NumberFormat` is a string with the `NumberVariable.format` syntax: an optional literal prefix, a numeric part made of `#`, `0`, `,` (grouping) and `.` (decimals), and an optional literal suffix. A `%` in the prefix or suffix multiplies the value by 100. Sections: a format is one to three `;`-separated sections, `positive;negative;zero`, each a pattern as above, with Excel\'s meaning. With one section every number uses it (a negative number prints a leading `-`). With two, the first formats positive numbers and zero and the second negative numbers; with three, the third formats zero. A negative section formats the absolute value and prints no minus of its own, so its literal text carries the sign: `"+0%;-0%"` shows `+12%` and `-5%`, and `"0;(0)"` shows `(5)`. As in Excel the section is chosen by the value\'s sign, not by its rounded text, so `-0.4` under `"0;(0)"` shows `(0)`; only an exact zero takes the third section. Four or more sections, an empty section or a section without a numeric part is a `number-format-invalid` error. There is no text section, no color (`[Red]`) and no condition (`[>100]`). The PPTX export writes the sections as the same Excel sections. A waterfall whose column format has sections shows every bar, steps and totals, through that format and adds no sign of its own (`"+0.0;(0.0)"` gives `+4.5` and `(2.5)`; the native labels carry the sections as written); without sections a step still gets `+` or `\u2212`. A title\'s percent ("20%") names a value through the section that formats it. Examples: `#,##0`, `0.0%`, `$#,##0.00`, `#,##0 units`. An invalid pattern is a `number-format-invalid` error. A format applies only to number values; strings, booleans, `null` and rich runs display unchanged.\n\nTwo spellings display differently in Excel, so prefer the alternatives in charts that are exported: optional decimals only (`0.##`) show a whole number as `5` in core and the preview but as `5.` (with a trailing point) in Excel, and an all-`#` integer part (`#`, `#,###`) shows zero as `0` in core but as nothing in Excel. Use `0.0#`-style decimals with at least one `0`, or a whole-number format, and an integer part that ends in `0`.\n\n### Columns\n\n`DataColumn` is `{ "name": string, "format"?: NumberFormat }`. Anywhere a chart or dataset column is a string, it may be a `DataColumn`; the string form is `{ "name": value }` with no format.\n\n```json\n"chart": {\n "type": "column",\n "data": {\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, { "name": "Margin", "format": "0%" }],\n "rows": [["Q1", 12.4, 0.31], ["Q2", 18.1, 0.34]]\n }\n}\n```\n\nA table column header may also be a `DataColumn`. A `StyledTableCell` gains an optional `format`:\n- on a body cell, it formats that cell\'s number value;\n- on a header cell (in `columns`), it is the column\'s format, the same as a `DataColumn` header.\n\nA body cell\'s own format wins over the column\'s.\n\n```json\n"table": {\n "columns": ["Region", { "name": "Revenue", "format": "$#,##0.0" }, { "value": "Growth", "style": { "align": "end" }, "format": "0%" }],\n "rows": [["EMEA", 8.2, 0.4], ["APAC", 6.1, { "value": 0.52, "format": "0.0%" }]]\n}\n```\n\n### Data source provenance\n\n`DataSourceRef` is `{ "src": string, "sheet"?, "range"?, "fields"?: string[], "retrieved"?: string (ISO date or date-time), "description"?: string }`. It records where inline data or a dataset came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import. It may appear as `ChartData.source` and `Dataset.source`.\n\nThere is no chart data source by file or asset (`chart.data` with `src`, `sheet`, `range`, `columns`): that form is removed (opf#240, descoped) and is a schema error. Import the data inline with `columns`/`rows` and record its origin in `source`.\n\n### Datasets\n\nTop-level `datasets` maps ids (the `assets` id pattern) to a `Dataset`:\n\n```json\n{\n "datasets": {\n "revenue": {\n "title": "Revenue by quarter",\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, "Costs"],\n "rows": [["Q1", 12, 8], ["Q2", 18, 11], ["Q3", 24, 15]],\n "source": { "src": "./data/revenue.csv", "retrieved": "2026-10-05" }\n }\n }\n}\n```\n\nRows hold `ChartDataCell` scalars (string, number, boolean, null). A `DatasetRef` is `{ "dataset": "<id>", "fields"?: string[] }`; `fields` selects and orders columns by name, each at most once (a repeated name is a schema error).\n- **Chart:** `chart.data` may be a `DatasetRef`. It is the second `oneOf` branch beside `ChartData`.\n- **Table:** a table is either inline (`rows` required, optional `columns`) or dataset-backed (`dataset` required, optional `fields`, and no `rows` or `columns`). Dataset tables take their headers and column formats from the dataset; per-cell styles need an inline table.\n\nValidation:\n- an unknown dataset id is a `dataset-unknown` error;\n- an unknown field is a `dataset-field-unknown` error;\n- duplicate column names in a dataset, or in chart data that a `mapping` or `fields` addresses, are a `data-column-duplicate` error;\n- a dataset nothing references is the warning `opf/unused-dataset` (category `references`).\n\n### Series mapping\n\n`chart.mapping` is `{ "category"?: string, "x"?: string, "series"?: string[] }`, naming columns after any `fields` selection:\n- `category`: the label column. Default: the first column.\n- `x`: the X column of an XY (scatter) chart. Default, today\'s rule: the second column (the first when `category` names the second), and only when the chart has three or more columns. With two columns there is no X column: the second column is the one series, plotted against row numbers. An `x` that leaves no series (two columns, or every series dropped) is a `chart-mapping-adapted` warning and that column is plotted as the series. A chart is XY when its type resolves (deprecated ids through their replacement) to the scatter construct of `chartOptionTarget`. An `x` equal to the category is a `chart-mapping-adapted` warning and the default is used. On a chart type without an X axis it is dropped with a `chart-mapping-adapted` warning.\n- `series`: the plotted columns, in order. Default: every column that is not `category` or `x`.\n\nAn unknown name is a `chart-mapping-unknown-column` error. A series that repeats the category or X column is a `chart-mapping-adapted` warning and is dropped. Mapping only reorders and selects columns; single-series constructs still plot one series (see [Chart fallbacks](#chart-fallbacks-lh-60)).\n\n### Chart fallbacks (LH-60)\n\nSome data does not fit the chart type it is written for. Core\'s `chartDrawPlan(chart, resolved, { language })` (on `@openpresentation/opf` and `/composition`) decides from the data alone how the preview and the PPTX export draw such a chart, so both draw the same:\n\n| Data | Drawn as | PPTX |\n| --- | --- | --- |\n| `world` over category labels of which fewer than half are places (`isPlaceLabel`: CLDR region names in English and the deck language, upper-case region codes, US states, Canadian provinces, Australian states, common aliases) | clustered columns of every series (`map-as-columns`) | a `c:barChart`, in every `chartex` mode |\n| `pareto` of two or more numeric series (a Pareto chart sorts one series and draws its cumulative share; LH-175) | clustered columns of every series in data order (`pareto-as-columns`) | a `c:barChart`, in every `chartex` mode |\n| `box-and-whisker` with one value per category (no label repeats, two rows or more) | one box per series: the rows form one group named after the category column (`box-per-series`) | the chartex box-and-whisker with that one category |\n| `pie` or `doughnut` of several series | a doughnut of nested rings, the first series innermost, each ring colored by category and named on its largest slice (`nested-rings`; LH-92, see chart-options.md) | one `c:doughnutChart` with a `c:ser` per series, each naming its series in one `c:dLbl` |\n| `scatter` whose X column holds no number | every series against the category position 1, 2, 3, ...; the X column is not drawn (`scatter-by-position`) | X values 1 to n |\n\nThe PPTX export reports a fallback as `chart-data-adapted` with `adaptation: \'chart-fallback\'` and records the authored data, so `fromPptx` restores it (a pie of several series imports as a doughnut). A construct that plots one series (treemap, histogram with categories, a Pareto chart of one numeric series, waterfall, funnel, a map of places, a one-series pie) still draws the first; `validate` names the others, and a scatter X column without numbers, in the warning `opf/chart-series-dropped` (`chartDrawDiagnostics`).\n\n## Core runtime API\n\nExported from `@openpresentation/opf` and `@openpresentation/opf/data` (module `src/chart-data.ts`; the resolvers are also on `@openpresentation/opf/composition`). Inputs are typed `unknown` so engines can pass any parsed chart, table or document; the result types are exported (`ResolvedChartData`, `ResolvedTableData`, `DataDiagnostic`, `DataColumn`, `DataSourceRef`, `Dataset`, `DatasetRef`, `ChartMapping`, `DataCellValue`, `DataTableCell`, `DataTableHeader`, `DataStyledCell`).\n\n```ts\n/** Strict chart number: finite numbers, and strings in strict decimal syntax (trimmed). Everything else is null (a gap), including "+5", ".5", "5.", "007" and plain digit strings beyond the safe integer range (usually identifiers that would lose digits); a decimal or exponent form such as "1e20" is a number. */\nexport function chartNumber(value: unknown): number | null;\n/** Format a number with a NumberFormat; an absent or invalid format prints the General form (String(value)). */\nexport function formatDataNumber(value: number, format?: string): string;\n/** Why a NumberFormat is invalid (the number-format-invalid message), or undefined when it is valid or absent. */\nexport function numberFormatError(format: unknown): string | undefined;\n/** NumberFormat -> Excel format code ("General" when absent or invalid). Literal prefix/suffix text is quoted as one run ("0.0 m/s" -> \'0.0 "m/s"\'), so \'/\' (Excel\'s fraction bar), \'E+\', \'@\', \'*\', \'_\' and \'?\' are never bare (native check opf#387); placeholders are written \'#\' before \'0\' ("0#" -> "#0"). */\nexport function toExcelNumberFormat(format?: string): string;\n/** Excel format code -> NumberFormat, or undefined when the code has no exact NumberFormat equivalent (General, sections, scaling commas, and placeholder orders Excel reads by position such as "0#" or "0.#0"). */\nexport function fromExcelNumberFormat(code: string): string | undefined;\n/** Pure: a copy of the document where every chart and table DatasetRef is replaced by inline data (columns as DataColumn when a format applies, rows copied; a chart also takes the dataset\'s `source`). `datasets` stays in place. Unknown ids, and references naming an unknown field, are left as they are. */\nexport function inlineDatasets<T>(document: T): T;\n/** One table or chart in inline form (a dataset reference copied from document.datasets); anything else is returned as is. */\nexport function inlineTableData<T>(table: T, document?: unknown): T;\nexport function inlineChartData<T>(chart: T, document?: unknown): T;\n/**\n * Resolve a chart\'s data to the canonical positional table: [category, (x,) ...series]. hasX is true when columns[1] is the X\n * column: an XY chart with three or more resolved columns (with two, the second column is the series against row numbers).\n * Category cells are kept as authored; X and series cells pass through chartNumber. Data with a single column has no\n * category: that column is the chart\'s values and passes through chartNumber too (with chart-value-not-numeric per cell).\n * Inline ChartData, a DatasetRef (needs the document) and mapping are resolved here.\n * options.path is the chart\'s JSON Pointer, the base of diagnostic paths (dataset cells report at /datasets/<id>/...).\n */\nexport function resolveChartData(chart: unknown, document?: unknown, options?: { path?: string }):\n | { ok: true; columns: string[]; hasX: boolean; formats: (string | undefined)[]; rows: (string | number | boolean | null)[][]; source?: DataSourceRef; dataset?: string; diagnostics: DataDiagnostic[] }\n | { ok: false; reason: "dataset-unknown" | "no-rows" | "no-columns"; message: string; diagnostics: DataDiagnostic[] };\n/** Resolve a table (inline or dataset-backed) to headers, rows and per-column formats. */\nexport function resolveTableData(table: unknown, document?: unknown, options?: { path?: string }):\n { columns?: DataTableHeader[]; rows: DataTableCell[][]; formats: (string | undefined)[]; dataset?: string; diagnostics: DataDiagnostic[] };\n/** Display value of a table cell: a number with a valid format (cell, else column) becomes formatted text (a styled cell keeps its style with the text as value); anything else is returned unchanged. */\nexport function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string): DataTableCell;\n/** Migration help (see below): the patch that stores one chart value column\'s text as numbers with the format that shows the same text, or undefined. */\nexport function suggestChartNumberFix(chart: unknown, document?: unknown, options?: { path?: string; column?: number | string }):\n { patches: { op: "replace"; path: string; value: unknown }[]; column: number; name: string; format: string } | undefined;\n/** Helpers: dataset-level diagnostics (duplicate names, invalid formats), unreferenced dataset ids, the XY test, the DatasetRef test. */\nexport function datasetDiagnostics(document: unknown): DataDiagnostic[];\nexport function unusedDatasets(document: unknown): string[];\nexport function isXYChartType(type: unknown): boolean;\nexport function isDatasetRef(value: unknown): value is DatasetRef;\n```\n\n`DataDiagnostic` is `{ code, severity: "error" | "warning", path, message }`, with the codes above plus `chart-value-not-numeric`. `chartNumber` runs after variables are filled. Before filling, the validator does not warn on a `var:<id>` cell whose variable is a number. `chart-value-not-numeric` is reported for any value cell that `chartNumber` rejects (strings and booleans), never for `null` or `""`. An unknown `fields` entry is a `dataset-field-unknown` error and `resolveChartData`/`resolveTableData` leave that column out. `number-format-invalid` applies to `DataColumn.format` and `StyledTableCell.format`; `NumberVariable.format` keeps its existing check (`variable-format` where it is used), so no existing document gains an error.\n\n`validate` reports the codes as `opf/<code>` rule ids: the errors are `format` findings, `opf/chart-value-not-numeric` and `opf/chart-mapping-adapted` are `content` warnings, `opf/chart-data-source-unresolved` is a `references` warning, and `references` adds `opf/unused-dataset`. The raw schema issue of a finding is in its `validation` field (`validation.params.code`).\n\n### Migration help\n\nDecks written before the strict rule often hold display text in chart cells. When every text cell of a value column (an X or series column, or a lone column) is written in one display style that a NumberFormat reproduces exactly, `suggestChartNumberFix` returns the fix, and `validate` attaches it to each of the column\'s `opf/chart-value-not-numeric` warnings as `fixes: [{ id: "store-chart-numbers", title, kind: "patch", safe: false, patch }]` (a [finding fix](finding-schema-reference.md); core never applies it):\n\n- `"12%"`, `"8.5%"` become 0.12 and 0.085 with the column format `0.#%`;\n- `"$1,234"`, `"$56"` become 1234 and 56 with `$#,##0` (also `\u20AC`, `\xA3`, `\xA5`);\n- `"1,234.5"`, `"999"` become 1234.5 (the plain number stays) with `#,##0.##`.\n\nThe patch replaces each text cell with its number and the column with a `DataColumn` that has the format; a dataset column is fixed in the dataset, so every chart and table that uses it changes, and its tables show the same text. A style is one optional leading minus, one optional currency symbol, digits (grouped in threes or plain), optional decimals and an optional `%`. There is no fix when the column already has a format, when styles are mixed (`"12%"` beside `"$5"` or beside the number 0.5), for accounting negatives `"(5)"`, `"$-5"`, a decimal comma (`"1.234,5"`), units (`"5 units"`), `".5"` or `"007"`, for mixed grouping (`"1,234"` beside `"5678"`), or when one format cannot show every value as written (`"$5"` beside `"$5.50"`). Every fixed value is checked: `formatDataNumber(value, format)` equals the text as written.\n\nCore composition, table layout and pagination accept dataset-backed tables and charts by inlining first. Table layout measures the formatted text. Markdown conversion, diff, merge, patch, validate and format keep the new fields. In detail:\n\n- `composeSlide` inlines a dataset-backed `table` or `chart` from `options.presentation.datasets`, so the composed item\'s `value` (and `payload`) is the inline copy; the item `path` still points at the authored field. `layoutTable(value, box, { presentation })` does the same, and each body cell\'s `TableCellLayout.value` is its display value (`tableCellDisplayValue`); `input` stays the authored cell. A DataColumn header shows its `name` (`path` ends in `.name`).\n- `paginateSlide`/`paginate` validate a slide with the deck\'s `datasets` (and `references`). A dataset table that has to be split is written to the continuation slides as inline tables (the slide that fits is returned unchanged, with its reference).\n- `convertContent` keeps a dataset reference between chart and table (`fields` too; `mapping` is reported as lost) and needs `options.presentation` to convert a dataset table to any other kind. Inline conversions keep DataColumn formats and report lost number formats and `source`. Slide-level conversions validate with the document\'s datasets; slide-only structure edits skip the dataset checks they cannot make.\n- Markdown writes the new fields in its embedded YAML form (lossless); `datasets` go to the front matter. `format` orders `datasets`, `mapping`, `source` and `DataColumn` keys by the schema. `diff` reports changes under `datasets` in their own category. The chart rules of `validate` read resolved chart data (DataColumn names, dataset charts).\n- Variables: `resolveVariables` walks `datasets` like any other content, so `{{id}}` tokens and whole `var:<id>` cells in dataset rows are filled before engines inline the reference.\n- `opf ingest --dataset <id>` (CLI) writes the imported columns and rows into `datasets.<id>` and references it. Re-importing into an existing dataset keeps its title, description and the format of each column whose name is unchanged; `source.src` names the imported file relative to the deck file\'s folder with `/` separators (stdin: no source), and `source.retrieved` is set only by `--date YYYY-MM-DD`; the command never reads the clock.\n- The generated `Table` type now has `rows?` (a dataset table has none) and `dataset?`/`fields?`; TypeScript callers that read `table.rows` handle the dataset form (or call `resolveTableData`).\n\n## Engines\n\nAll three engines read core\'s functions when they exist and fall back to their previous behaviour on a core without RR-54, so each can ship before or after core. A document that uses none of the new fields renders, exports and edits byte for byte as before (renderer: all 805 slides of the core examples; PPTX: 21 golden digests; editor: identical patches).\n\n### Preview (opf-render, [opf-render#127](https://github.com/OpenPresentation/opf-render/pull/127))\n\n- **Data:** every chart path reads `resolveChartData`: the catalog charts, the chartex constructs, scatter, pie and doughnut, single-column charts, and the legacy sketch. Its own `chartNumber` delegates to core\'s, so `"0x10"` is now a gap too. Data that does not resolve keeps the "No chart data" placeholder. A document with an unknown dataset or mapping column fails validation (`invalid-opf`) like any other invalid document.\n- **Formats:**\n - Data labels use their series\' format, through `formatDataNumber`.\n - Value-axis ticks use the first plotted series\' format, as Excel does for a source-linked axis.\n - The scatter X axis and X labels use the X column\'s format.\n - Percent axes (100% stacked, pareto) and pie percent labels stay percent.\n - A histogram of a lone column plots counts and takes no format.\n- **Tables:** cells draw core layout\'s display text, so a body cell\'s own `format` wins over its column\'s.\n- **Tracing:** the editor relies on each drawn part\'s authored path.\n - Every part of a dataset-backed chart or table traces to its authored `slides.N.chart` or `slides.N.table` path, because it has no rows of its own.\n - A chart with `mapping` traces each part to the authored column index.\n\n### PPTX export (opf-pptx, [opf-pptx#171](https://github.com/OpenPresentation/opf-pptx/pull/171))\n\n- **Numbers:** the export resolves data through `resolveChartData`, and the lenient `parsedNumber`/`numericValue` are removed. Non-numeric strings export as gaps, with one `chart-value-not-numeric` diagnostic per chart that carries a `count`.\n- **Classic charts:** `toExcelNumberFormat` codes are written as:\n - the series `c:numCache/c:formatCode` (added where PptxGenJS writes none, such as pie and doughnut);\n - the series and chart-group data-label `c:numFmt sourceLinked="0"`;\n - the value-axis `c:numFmt`. The first plotted series\' format is used, a scatter X axis takes the X column\'s, and a 100% stacked axis keeps `0%`.\n - Labels that show percentages keep PowerPoint\'s percent form.\n- **Chartex:** `cx:lvl formatCode` and the value-label and value-axis `cx:numFmt`, except on binned constructs.\n- **Embedded workbook:** custom `numFmt` entries from id 164, with cell styles on every value cell, so Edit Data shows the formats.\n- **Tables:** tables export core layout\'s display text.\n- **Datasets and mapping:** a chart that uses them exports exactly like its inline equivalent.\n- **Provenance:** in `full` mode, `OPF_DATASETS_V1` holds the `datasets` map. `OPF_DATA_V1` sits on each chart or table frame that uses a new field and holds the authored `data`, `mapping` and table form (and, FA-14, a chart\'s `highlight`, which then also records its inline `data`; see [chart-options.md](chart-options.md)), plus a hash of the cached names, values and format codes. `references-only` mode and `provenance: false` write neither tag.\n\n### PPTX import (opf-pptx)\n\n- **With provenance:** `datasets` is restored before document provenance validates. A frame\'s dataset reference, `mapping`, formats and `source` are restored only while the cache hash still matches. If PowerPoint (or a person) changed the values, the native values import and a diagnostic says why, such as `chart-data-provenance-changed` or `table-dataset-unavailable`. The hash compares format codes in core\'s canonical form (`fromExcelNumberFormat`), so PowerPoint\'s re-spellings on save (`\\$#,##0.0` for `$#,##0.0`, `#,##0\\ "units"` for `#,##0 "units"`, native check [opf#385](https://github.com/OpenPresentation/opf/pull/385)) still match; a General code counts as no code.\n\nDecorative ChartEx titles are excluded from chart-data evidence. A plain PowerPoint save can rewrite a title from `cx:rich` to `cx:txData/cx:v` without changing the data. That rewrite, or a display-caption rename, keeps an unchanged chart\'s authored data form; it must not introduce a synthetic `Row` column. The cached categories, numeric values, series names and number formats still control whether provenance can restore the authored form.\n- **Without provenance:** a cache `formatCode` that `fromExcelNumberFormat` maps back becomes that column\'s `{ name, format }`, for both classic and chartex charts. Core returns the canonical spelling, such as `#,##0 units` for `#,##0 "units"`. Other codes are reported as `chart-number-format-adapted` and never invented.\n- **Cached values:** these follow the strict rule as well. XML decimal forms (`+5`, `.5`, `007`) are numbers; anything else is a gap with a diagnostic, never a stripped number or 0.\n\n### Editor (opf-editor, [opf-editor#92](https://github.com/OpenPresentation/opf-editor/pull/92))\n\n- **DataColumn headers:** the data grid shows a `DataColumn` header\'s `name`. Rename, insert, delete, move and paste keep each column\'s format.\n- **Chart cells:** they follow `chartNumber`. Text that is not a number is refused with the reason, and a stored string read as a gap is flagged.\n- **Shared datasets:** a dataset-backed chart or table is edited at `/datasets/<id>` through `fields`.\n - Hidden columns keep their data.\n - A column added while `fields` is set goes to both the dataset and `fields`.\n - A rename updates every `fields` and `mapping` that names the column, in the same patch.\n - Deleting a column another item uses is refused with `dataset-column-in-use`.\n - The status line says how many items share the dataset, and "Use a copy of the data" (`detachGridDataset`) inlines one item\'s data.\n- **Format and mapping:**\n - A per-column format field (`setGridColumnFormat`) is checked with `numberFormatError`.\n - A "Chart columns" panel (`setChartMapping`) sets the category, the X column (XY charts only) and the series, and writes only what differs from the default.\n- **Import:** "Store as a shared dataset" (`prepareDatasetImport`) imports into `datasets.<id>`, as `opf ingest --dataset` does.\n- **Other panels:** the table style panel and `table-options` refuse a dataset table with `table-dataset-backed`. Find and replace also searches dataset text.\n- **Undo:** each edit is one undoable patch.\n\n### Native PowerPoint checks\n\nWanted before release:\n- formatted data labels and value axes;\n- Edit Data shows the workbook cell formats with no repair prompt;\n- no repair prompt for the frame `custDataLst`;\n- after a plain save in PowerPoint, the data tags and cache hash survive;\n- the two spellings above (`0.##` on a whole number, `#` on zero) show as described.\n\nSample decks are written by the PPTX branch under `artifacts/rr-54-native/`.\n\n## Not in this change\n\n- Resolving a data source by file or asset, or refreshing `source` ([opf#240](https://github.com/OpenPresentation/opf/issues/240)).\n- Date axes and date formats.\n- Per-series colors: shipped later as `chart.colors`; see [chart-options.md](chart-options.md#setting-colors-chartcolors). (Columns with line series, optionally on a secondary axis, are the `combo` chart type: [chart-options.md](chart-options.md#combo-charts).)\n- Formulas.\n- Rich text in dataset cells.\n'
28
28
  },
29
29
  {
30
30
  "slug": "ci-cd",
@@ -36,7 +36,7 @@ var docsData = Object.freeze([
36
36
  "slug": "cli",
37
37
  "file": "docs/cli.md",
38
38
  "title": "The `opf` CLI",
39
- "markdown": '# The `opf` CLI\n\nThe CLI (`@openpresentation/cli`, binary `opf`, Node 22 or later; verified on Node 24) creates, checks, edits, converts and\ninspects decks (see [its README](../packages/cli/README.md)). `opf validate` is the one checker ([validate](validate.md)).\n`opf convert` is the one command that changes formats: a deck form, PDF, PPTX, PNG and SVG. Every command runs core\'s\nfunctions, the ones applications call from [`@openpresentation/opf`](node.md); the commands add the flags, the JSON report and\nthe exit codes.\n\nEverything is deterministic and local: no network, no model, no telemetry, no system fonts. The same document, options and\ninstalled package versions give the same bytes on every operating system.\n\n## Commands\n\n| Command | What it does |\n| --- | --- |\n| `opf create [output] [--title <text> \\| --example <slug>]` | A one-slide starter deck, or one of core\'s bundled examples (`opf catalog examples` lists them). |\n| `opf validate <file\\|dir\\|->...` | The one checker: format, references, policy, accessibility, layout, content. Several files, folders and stdin in one run; `--format json\\|text\\|github`. |\n| `opf convert <input> <output>` | Any change of format: `.json`, `.opf.yaml`, `.opf.md` (and a plain `.md` input), `.pptx`, `.pdf`, `.png`, `.svg`, `.zip`, or stdin and stdout. |\n| `opf edit <file> [output] --patch <patch>` | A JSON Patch, applied whole or not at all, the result checked. |\n| `opf format <file>... [output]` | Canonical key order and layout, in the form the file has. |\n| `opf diff <a> <b>` | What changed between two decks (`--format text\\|json\\|patch`). |\n| `opf merge <base> <ours> <theirs> [output]` | A three-way merge; conflicts are listed. |\n| `opf stats <file>` | Neutral facts about a deck (`--format json\\|text`). |\n| `opf paginate <input> [output]` | Overflowing slides split into continuation slides, measured with the renderer\'s fonts when it is installed. |\n| `opf embed <input> [output]` | The catalog records a deck references, copied into it. |\n| `opf fill <template> <data> [output]` | A template\'s variables filled: one deck per record (the output is a name pattern), or `--combine`. The second argument is always the data (`-` for stdin). |\n| `opf ingest <data> [output] --as table\\|chart` | CSV, TSV or JSON rows as a table or chart slide, alone or added `--into` a deck. |\n| `opf doctor [deck]` | Which formats this install can write, and the one command that installs what is missing. |\n| `opf schemas`, `opf schema [name] [pointer]` | The OPF schemas. `opf schemas` lists the `@openpresentation/opf` version each came from next to its id, and `opf --version` names the schema id ([schema versioning](schema-versioning.md)). |\n| `opf catalogs`, `opf catalog <kind> [id]`, `opf catalog examples [slug]` | The pptx.gallery catalog (`@openpresentation/gallery`) and the bundled example decks. |\n| `opf skills <install\\|update\\|status>` | The six bundled agent skills. |\n| `opf mcp` | Runs the MCP server of `@openpresentation/mcp` on stdio when that package is installed; otherwise prints `npx -y @openpresentation/mcp` and exits 2. See [the MCP server](mcp.md). |\n\n`opf <command> --help` (or `-h`, or `opf help <command>`) prints a command\'s flags and examples.\n\nRemoved in 0.18 (each is a usage error, exit 2, that names its replacement): `opf render`, `opf export`, `opf import`,\n`opf from-md`, `opf to-md`, `opf from-yaml` and `opf to-yaml` (all `opf convert`), `opf create --from` (`opf convert`), and the\nflags `--output`, `--out`, `--out-dir` and `--name` (a positional output), `--input-format` (`--from`), `--json` (reports are\nJSON), `--dry-run` (stdout), `--data` (fill\'s second argument) and the deck values of `--format` (`--to`).\n\n## One output convention\n\nEvery command that writes a deck takes the same arguments:\n\n| Form | Meaning |\n| --- | --- |\n| `opf embed deck.opf.json` | No output: the deck goes to stdout, the report to stderr. `-` says the same. |\n| `opf embed deck.opf.json out.opf.json` | An output after the inputs: written atomically (a temporary sibling, then a rename); an existing file needs `--force`. |\n| `opf embed deck.opf.json -i` | `-i` (`--in-place`) rewrites the input, refusing if it changed since it was read. Not for stdin, and not with an output. |\n| `opf embed deck.opf.json --check` | Writes nothing and exits 1 when the command would change something: `format --check` (not canonical), `embed --check` (not self-contained) and `paginate --check` (a slide overflows). |\n\nThe form written is the output\'s extension (`.json`, `.opf.yaml`/`.yml`, `.opf.md`), else `--to json|yaml|md`, else the form\nthat was read. An existing output is refused before anything is printed or written.\n\n`opf fill` writes one deck per record through a file name pattern: `{n}` is the record number (padded to the width of the largest, the rule of `opf convert`), `{column}` a slug of that\ncolumn\'s value (`opf fill t.opf.md clients.csv decks/qbr-{client}.opf.md`); `--combine` writes one deck with every record\'s slides.\n\n## What each flag means\n\n| Flag | Meaning |\n| --- | --- |\n| `--format json\\|text\\|github\\|patch` | The report format only: `json` (the default), `text`, `github` (validate\'s workflow annotations) or `patch` (diff\'s JSON Patch). |\n| `--from json\\|yaml\\|md` | The form of a deck input: stdin, and names that say none. Without it, a name ending `.json`, `.opf.yaml`, `.yaml`, `.yml` or `.opf.md` says the form, and text that starts with `{` or `[` is JSON; anything else is a usage error that asks for `--from yaml\\|md`. `opf convert` also takes `--from pptx`. |\n| `--to json\\|yaml\\|md` | The form of a deck output, for stdout and names that say none. `opf convert` also takes `pdf`, `pptx`, `png`, `svg` and `zip`. A `--to` that disagrees with the output\'s extension is refused. |\n| `--data-format csv\\|tsv\\|json` | The form of the data of `opf fill` and `opf ingest` (default: the extension, else JSON when it starts with `{` or `[`, else CSV). |\n| `--fail-on error\\|warning\\|info` | Findings at or above this severity fail the command (exit 1) and nothing is written (default `error`). |\n| `--force` | Replace an existing output. |\n\n## Install\n\n**Published set (2026-10-24):** CLI 0.26.1 (core `^0.26.1`, Gallery `^0.26.1`,\noptional renderer/PPTX `^0.26.1`) with core, renderer, PPTX, editor and Gallery 0.26.1. Use the complete pinned [quickstart installation](quickstart.md#versions) and its\nrequired font/converter peers.\n\nDeck forms (JSON, YAML, Markdown) need nothing beyond the CLI. PDF, PNG and SVG need `@openpresentation/opf-render`; PPTX output\nand `.pptx` input also need `@openpresentation/opf-pptx`. Both are **optional peer dependencies** of the CLI and of core (decision\nRR-27, below), loaded the first time a command needs them, from beside the CLI first and from the working directory second.\n\n`opf doctor` says what this install can write and prints the one command that installs the rest:\n\n```sh\nopf doctor --format text # per format: ready, or what is missing; then one install command\nopf doctor deck.opf.md # JSON; with a deck, a PDF needs sharp only when the deck has pictures, and the deck\'s script fonts are checked\n```\n\nThe command matches the package manager that runs the CLI (`npm_config_user_agent`: npm, pnpm, yarn or bun) and the way the CLI\nis installed: global (`npm install -g ...`), a project (`npm install ...`), or one npx run (`npx -p @openpresentation/cli -p ... opf <command>`).\nA conversion that misses a peer exits 2 with `code: "peer-not-installed"` (or `peer-too-old`), and its `install` field and message\ncarry that one command for the format asked for. What each output needs beside `@openpresentation/opf-render`:\n\n| Output | Also install |\n| --- | --- |\n| every drawn format (the office font pack) | `@expo-google-fonts/roboto@0.4.3 @expo-google-fonts/roboto-mono@0.4.2 @expo-google-fonts/caladea@0.4.2 @expo-google-fonts/arimo@0.4.3 @expo-google-fonts/tinos@0.4.2 @expo-google-fonts/cousine@0.4.3 @expo-google-fonts/gelasio@0.4.1 @expo-google-fonts/noto-sans@0.4.2` |\n| `png` | `@resvg/resvg-js@^2.6.2 sharp@^0.35.5` |\n| `pdf` | nothing for text in the default vector mode; `pdf-lib@^1.17.1` for `--raster`; `sharp@^0.35.5` when the deck has pictures |\n| `svg` | the fonts only |\n| `pptx`, a `.pptx` input | `@openpresentation/opf-pptx` |\n\n### Fonts for a deck in another script\n\n`opf doctor` with no deck reports what the install can write and says nothing about a deck\'s scripts. `opf doctor deck.opf.json` also runs the script-font check `opf convert` runs (it prepares the bundled fonts for the deck, so it needs `@openpresentation/opf-render`; nothing is drawn): the script packages the deck\'s text needs that are not installed are listed with their versions under `scriptFonts.missing` (and as `fonts/script-font-not-installed` findings), are added to `missing` and to the one `install` command, and make `svg`, `png`, `pdf`, `pdf-raster` and `pptx` not `ready`. `scriptFonts.checked` is `false`, with a `reason`, when the check could not run (no renderer, or fonts that cannot be prepared), and the text output then does not say the deck is ready. (Before CLI 0.34.1, doctor listed `svg` and `pdf` as `ready` for a deck with an Arabic slide and the conversion then failed.) The office pack covers Latin, Greek and Cyrillic; each other script (Arabic, Hebrew, Thai, the Indic scripts, Chinese, Japanese, Korean and the rest) is one optional `@expo-google-fonts/noto-*` package, and a deck needs the ones for the scripts it draws. To find them and install them:\n\n1. Ask doctor: `opf doctor deck.opf.json --format text` lists the missing script packages and prints the install command (skip to step 2). Or convert the deck once to a throwaway file: `opf convert deck.opf.json check.svg --force`. A missing script font exits 1 with a `fonts/script-font-not-installed` finding per package, each naming the package and the version, for example `@expo-google-fonts/noto-naskh-arabic@0.4.5` and `@expo-google-fonts/noto-sans-arabic@0.4.3` for Arabic text, followed by a `render/missing-glyph` error. (A slide that sets a Noto font scheme itself, such as `noto-sans-arabic`, gets the same finding for the package of the scheme\'s font, and the error names it too: "No local font face for \'Noto Naskh Arabic\'... install @expo-google-fonts/noto-naskh-arabic@0.4.5". Before 0.34.1 that error said only "load the \'scripts\' font pack", and `opf validate` still reports the failed layout as `opf/layout-failed` with that message, not as a `fonts/` finding.)\n2. Install what the findings name, at the versions they name, next to the CLI: `npm install @expo-google-fonts/noto-naskh-arabic@0.4.5 @expo-google-fonts/noto-sans-arabic@0.4.3` in the project that holds `@openpresentation/cli` (a global CLI takes `npm install -g`; `pnpm add`, `yarn add` and `bun add` work the same way).\n3. Convert again. When it succeeds, the report\'s `fonts.scripts` lists `detected` (for example `Arab`), `packages` (the ones used) and `notInstalled` (empty when nothing is missing). Check that list for every deck with more than one script, then export the PDF, PNG, SVG or PPTX.\n\n`opf stats deck.opf.json` lists `fonts.families` (the families the deck names, such as `Noto Naskh Arabic`) but not the packages, and not the script of text that has no font of its own. The package versions are pinned by `@openpresentation/opf-render` (its `package.json` lists every `@expo-google-fonts/*` package it uses, including those for Hebrew, Thai, Devanagari, `noto-sans-jp`, `noto-sans-kr`, `noto-sans-sc` and `noto-sans-tc`). The site\'s starter project ships the eight office-pack fonts only, so a deck with an Arabic slide needs the two Arabic packages above added to it.\n\n## From code\n\nThe engine the commands run is core\'s `@openpresentation/opf` in Node, which an application imports instead of spawning `opf`.\nIn Node, `validate`, `stats`, `paginate`, `embed` and `edit` register the gallery (`@openpresentation/gallery`) when a call names none, as the commands\ndo, so `opf validate deck` and `validate(deck)` agree:\n\n```ts\nimport * as opf from "@openpresentation/opf";\n\nawait opf.convert("deck.opf.md", "deck.pdf"); // opf convert deck.opf.md deck.pdf\nconst deck = await opf.open("deck.pptx"); // opf convert deck.pptx -\nconst { files } = await opf.convert(deck, { format: "png", scale: 2 }); // bytes, nothing written\nconst { presentation } = opf.edit(deck, patch); // opf edit deck --patch patch.json\nconst { decks } = opf.fill(template, csvText); // opf fill template data.csv out-{n}.opf.json\n```\n\nThe options are the flags in camel case (`--raster` is `raster: true`, `--fonts` is `fonts` (a folder or a list of folders),\n`--asset-dir` is `assetDir`, `--include-hidden` is `includeHidden`). The commands refuse an existing output without `--force`;\n`convert` replaces it unless `overwrite: false`. See [OPF files in Node](node.md).\n\n## `opf convert`\n\n```sh\nopf convert deck.opf.md deck.pdf\nopf convert deck.opf.md slides/deck.png --slides 1,3-5 --scale 2 # slides/deck-1.png, -3, -4, -5\nopf convert deck.opf.md "slides/slide-{n}.png" # slides/slide-1.png, slide-2.png, ... (always numbered)\nopf convert deck.opf.md slides.zip --to svg\nopf convert deck.pptx deck.opf.md --signals signals.json\nopf convert outline.md deck.opf.yaml # a plain .md input is OPF Markdown\nopf convert deck.opf.json deck.opf.yaml --schema-comment\nopf convert deck.opf.md - --to pdf > deck.pdf\n```\n\n| Output | Written as |\n| --- | --- |\n| `.pdf`, `.pptx` | one file |\n| `.png`, `.svg` | one file per slide beside the output, named after it: `slides/deck.png` writes `slides/deck-1.png`, `-2`, ... (the deck\'s slide numbers). One selected slide, or a one-slide deck, is written to the output itself. The extension is the format: `deck.png` is always PNG. With `{n}` in the output (`"slides/slide-{n}.png"`) the files are always numbered, even for one slide or one selected slide, and `{n}` is the deck\'s slide number (2 and 5 with `--slides 2,5`). `{n}` is the only placeholder: any other `{key}`, and `{n}` in `.pdf`, `.pptx`, `.zip` or a deck form, is a usage error (exit 2, `invalid-option`). |\n\nNumbers are padded with zeros to the width of the largest number written: `1`...`9` for slides 1 to 9, `01`...`99` up to 99, `001` from 100. With `--slides` the width comes from the largest slide selected (`--slides 2,5` gives `deck-2.png`, `deck-5.png`). The same rule pads `{n}` in `opf fill` (the largest record number) and the zip entries below.\n| `.zip` | one archive of the slides, its entries named as the plain `.png` and `.svg` files above (`slides.zip` holds `slides-1.png`, ...; always numbered, and no `{n}` in the archive\'s own name): PNG, or SVG with `--to svg`. Entries are stored with a fixed timestamp, so the archive is byte-identical everywhere. |\n| `.json`, `.opf.yaml`, `.yml`, `.opf.md` | the deck in that form |\n| `-` | stdout, with `--to`: one file (`pdf`, `pptx`, `zip`, a deck form, or one slide as `png` or `svg`) |\n\nA flag applies only when its format is involved; anywhere else it is a usage error (exit 2, `option-not-applicable`):\n\n| Involved | Flags |\n| --- | --- |\n| a Markdown input | `--split auto\\|rules\\|headings` (default `auto`: slides at `---` lines, and an outline with none at its `#` headings), `--title <text>` (the deck name unless the front matter sets one) |\n| a YAML input | `--aliases` (expand anchors, aliases and merge keys, at most 100) |\n| a `.pptx` input | `--signals <file>` (also write the raw per-shape layout and style signals, `fromPptx` with `signals: true`) |\n| a YAML output | `--schema-comment` (the `# yaml-language-server: $schema=...` line) |\n| a Markdown output | `--drop-unsupported` (leave out what the dialect has no syntax for and list it as loss, instead of embedding it as YAML in a fence) |\n| pdf, png, svg | `--slides 1,3-5` (one-based; `2-` to the end), `--include-hidden` |\n| pdf, png, svg, pptx | `--paginate` or `--keep-slides`, `--date YYYY-MM-DD`, `--fonts <dir>` (repeatable), `--asset-dir <dir>` |\n| png, raster pdf, pptx `--as images` | `--scale 0.1-8` (1 draws the 1280 x 720 reference slide at 1280 x 720 pixels; the pictures of `--as images` default to 2) |\n| pdf | `--raster` (each page a picture instead of selectable vector text) |\n| svg | `--text fonts\\|system\\|paths` (embed the faces the slide uses, none, or draw glyph outlines) |\n| pptx | `--charts auto\\|native\\|picture`, `--diagrams shapes\\|picture`, `--images compatible\\|preserve`, `--provenance full\\|references-only\\|none`, `--body-text measured\\|native`, `--slide-numbers static\\|live`, `--typefaces selected\\|safe`, `--as native\\|images` |\n\nA `.pptx` input is imported, checked and then written or drawn; `findings` holds both steps (`import/` rules from the importer).\nPer-slide images and the PDF skip slides marked `hidden: true` unless `--include-hidden`; slides named with `--slides` are always\nwritten, and the report lists the slides left out in `skippedHidden`. The PPTX keeps a hidden slide as a hidden slide.\n\n**Overfull slides (LH-90).** By default a slide of sibling blocks of one kind (eight timelines, five tables; each block may\nbring the notes that follow it) that overflows at its readability floor is drawn as several slides of the same layout, split\nbetween whole blocks, in every format, so the preview and the PPTX agree. Each such slide is a `render/slide-continued` or\n`pptx/slide-continued` warning and an entry of the report field `continued` (`slide`, the `slides` it became, `kind`, and\n`blocks` and `units` per slide); `--slides` and the file names count the slides drawn. `--paginate` splits every overflowing\nslide instead (as `opf paginate` does), and `--keep-slides` draws every slide as written, overlapping where it overflows.\n\n### PPTX text (RR-88, RR-91)\n\nBy default (`--body-text measured`) a wrapped paragraph becomes one text box per line, laid out exactly as the preview draws it, so editing a line in PowerPoint or Keynote does not reflow the rest. `--body-text native` opts in to whole paragraphs: a text, bullets or numbered-list region is one body that the application re-wraps when edited. In both modes every slide title is the Title placeholder (opf-pptx 0.34.0): a wrapped title is re-wrapped by the application where its line breaks are proven to match the preview, and otherwise keeps the preview\'s lines as fixed line breaks. What native mode cannot carry (groups, cards, nested or described lists, restarted numbering) stays measured and is reported as `native-body-fallback`. A slide recomposed as the automatic grid at the readability floor (LH-83) keeps its native bodies too (LH-91): the first binds to the Body placeholder of a variant of its layout named `<layout> (automatic grid)`. `--slide-numbers` decides a footer such as `{{slide.number}} / {{deck.slideCount}}`: `live` (the default since RR-102) keeps the slide-number field in PowerPoint\'s Slide Number placeholder, so Insert > Header & Footer shows Slide number checked and PowerPoint renumbers it, and Keynote draws it as the digit alone because it drops the words next to a live number; `static` writes the number as fixed text, so Keynote shows the words around it. A footer that is only `{{slide.number}}` stays a live field in both modes (the total is always fixed text). Both flags need an opf-pptx that reads them (0.22.0 or later); an older one is refused (`peer-too-old`) rather than ignoring them, and they are exit 2 for any other output.\n\n**Which to choose.** Pick `measured` (the default) when the deck is final and the PPTX is a delivery format: every line sits where the preview put it, and the deck is edited in OPF. Pick `native` when people will edit the text in PowerPoint or Keynote: a longer bullet wraps and numbered lists renumber. Native text is re-wrapped by the application\'s own fonts and engine, so line breaks can differ from the preview; native wrapping is not yet qualified in every application, and anything it cannot carry (see above) stays measured with a `native-body-fallback` finding, so read the findings. `--slide-numbers live` is the default because the PPTX is a PowerPoint file first: the number is PowerPoint\'s own and follows slides moved, added or deleted there. Choose `static` for a deck that will be opened in Keynote, which replaces any paragraph that holds a live slide-number field with the number alone, so `{{slide.number}} / {{deck.slideCount}}` shows only the digit; the cost is that PowerPoint does not renumber a static number. The total, `{{deck.slideCount}}`, is fixed text in both (PowerPoint has no slide-count field).\n\n### PPTX fonts and pictures (LH-28, LH-20)\n\nA PPTX names its fonts; it does not embed them. A viewer that lacks a named family substitutes another one, and its lines can break where the preview\'s did not. The default (`--typefaces selected`) writes the families the deck chose, and the report notes the ones that are not Office-safe (`pptx/typeface-not-office-safe`, info). Office-safe means two things: the family ships with every Windows and macOS machine, and OPF measures it exactly through a metric-compatible open face. The font policy table gives four: Arial, Courier New, Georgia and Times New Roman. `--typefaces safe` writes each Latin text family as one of them and lays the text out with it, so every viewer breaks lines where the file does. A metric twin keeps its exact widths (Arimo and Liberation Sans become Arial, Tinos Times New Roman, Cousine Courier New, Gelasio Georgia). Any other family follows its font scheme\'s type: sans-serif becomes Arial, serif Georgia, monospace Courier New. The line breaks then follow the safe family, not the preview\'s. East Asian and complex-script fonts, symbol, emoji and math families keep their names. Each replacement is reported once (`pptx/typeface-replaced`, info).\n\nFor a file that will be opened in LibreOffice, `--charts picture` writes the chartex types (treemap, waterfall, funnel, box and whisker, ...) as clustered column charts, which LibreOffice draws; with the default `auto` it shows them as unsupported ([LibreOffice interoperability](libreoffice.md#charts)).\n\n`--as images` is a fidelity fallback: each slide becomes one full-bleed PNG picture, drawn by the same renderer and fonts as the PNG preview (at `--scale`, default 2, which gives 2560 x 1440 for a 16:9 slide). The speaker notes, hidden slides and sections are kept, and each picture\'s alternative text is the slide\'s text, so screen readers can read it. The file looks the same in every viewer and needs no fonts, but nothing in it is editable text, and an import gives picture slides, not the deck. The options that shape text, charts and records (`--typefaces`, `--body-text`, `--charts`, `--diagrams`, `--images`, `--provenance`, `--slide-numbers`) do not apply to it (exit 2).\n\n## The other commands\n\n- **`opf create`** writes a starter deck (`--title`) or a bundled example (`--example <slug>`, from `opf catalog examples`).\n- **`opf validate`** checks files, folders (their `*.opf.json`, `*.opf.yaml`, `*.opf.yml` and `*.opf.md`, sorted, skipping\n `node_modules` and dot folders) and `-`. One input prints its report; several print `{ command, ok, files: [reports], counts }`.\n The exit status is the worst over every file. `--format github` prints `::error`, `::warning` and `::notice` annotations with the\n file, line and column. See [validate](validate.md).\n- **`opf paginate`** measures the page breaks with the fonts `opf convert --paginate` draws with when `@openpresentation/opf-render`\n is installed (`layout: "measured"`); without it they are estimated (`layout: "estimated"`) and `hint` names the install command.\n- **`opf fill`** reads CSV, TSV or JSON data; a blank cell keeps the variable\'s declared value; an unfilled required variable fails\n unless `--partial`; `--examples` fills from the declared examples. The second argument is always the data, whatever its name\n (`-` reads it from stdin), and the third is the output; a template alone fills from its own values, to stdout.\n- **`opf ingest`** gives the same slide id and bytes for the same inputs; `--dataset <id>` stores the rows in the deck\'s datasets.\n\n## Reports and errors\n\nEvery command that reports prints one envelope:\n\n```json\n{ "command": "convert", "ok": true, "input": { "file": "/abs/deck.opf.md", "sha256": "\u2026", "bytes": 1234 },\n "outputs": [{ "file": "/abs/deck.pdf", "sha256": "\u2026", "bytes": 56789, "mediaType": "application/pdf" }],\n "findings": [], "counts": { "error": 0, "warning": 0, "info": 0 }, "format": "pdf", "\u2026": "\u2026" }\n```\n\n`input` is `null` when nothing was read and a list when several were (diff, merge, fill). The report is on stdout, or on stderr when\nstdout carries the document. Findings have the [`opf validate`](validate.md) shape (`ruleId`, `severity`, `category`, JSON Pointer\n`path`, `message`, `help`, and `location` when read from text); engine findings carry the prefix `render/`, `pptx/`, `pdf/`,\n`fonts/`, `import/` or `cli/`. The lookup commands (`schemas`, `schema`, `catalogs`, `catalog`, `--version`) print the data asked for.\n\nErrors are `{ command, ok: false, code, error, ... }` on stderr. The message states the fix: a missing argument names it and\nprints the usage, an unknown command, option or value suggests the nearest one ("Did you mean --check?"), and a removed command\nor flag names its replacement. Codes include `usage`, `unknown-command`, `unknown-option`, `removed-command`, `removed-option`,\n`missing-argument`, `extra-argument`, `missing-value`, `invalid-value`, `option-not-applicable`, `unknown-input-format`,\n`input-not-found`, `invalid-json`, `invalid-yaml`, `invalid-markdown`, `invalid-document`, `findings-at-fail-on`,\n`output-exists`, `merge-conflict`, `fill-failed`, `peer-not-installed` and `peer-too-old`.\n\nExit `0`: success (warnings allowed). Exit `1`: an invalid document, a finding at or above `--fail-on`, an existing output, a\nmerge conflict, or a `--check` that found a change. Exit `2`: usage, a read or I/O problem, text that is not valid JSON, YAML or\nMarkdown, or a missing or too-old peer. (`opf validate` reports text that does not parse as a finding, exit 1.)\n\n## Fonts\n\nThe renderer\'s bundled open font pack (the office pack: Carlito, Intos for Aptos, the open families font schemes select and the\nopen replacements the font policy routes proprietary families to) with the visual substitution policy, plus the files from\n`--fonts`. **System fonts are never loaded**, and nothing is downloaded. Font substitutions are listed under\n`fonts.substitutions` in the report. The PPTX keeps the font names the document chose.\n\nScripts beyond Latin, Greek and Cyrillic need the optional Noto script packages of the renderer (`@expo-google-fonts/noto-sans-jp`\nand so on); install the ones named in the `fonts/script-font-not-installed` diagnostic next to the CLI. A standalone SVG\n(`--text fonts`, the default) embeds the faces its text uses; `--text system` omits all font bytes; `--text paths` draws the text\nas glyph outlines (the real text kept invisible beside it for selection and search), so the SVG needs no font.\n\n## Images and assets\n\nRelative image paths and `file:` paths resolve against the input\'s folder (or `--asset-dir`). Only `.png`, `.jpg`, `.jpeg`,\n`.gif`, `.webp` and `.svg` files whose content matches are read, and only inside that folder (symlinks are resolved first). URLs\nare never fetched. For SVG and PNG an unreadable image draws the renderer\'s placeholder with an `unresolved-asset` or\n`cli/asset-blocked` warning. For PPTX (opf-pptx 0.24.1 and later) an unreadable or blocked local path and an unresolved remote URL\nare one case: the deck exports without that image (an unavailable-image placeholder, or the fallback background for a background\npicture) and the report carries a `pptx/unresolved-asset` warning. Use `--fail-on warning` to reject that output before any file is\nwritten. Before opf-pptx 0.24.1 an unreadable or blocked local path stopped the export (`pptx/asset-unresolved`, an error).\n\n## Markdown and YAML\n\nJSON stays the canonical form of a deck. YAML (`deck.opf.yaml`) and Markdown (`deck.opf.md`) are authoring forms of the same data,\nand every command that reads or writes a deck reads and writes all three:\n\n```sh\nopf convert deck.md deck.opf.json # Markdown in the OPF dialect (or an outline) to a deck\nopf convert deck.opf.json deck.opf.md # a deck as Markdown that reads back unchanged\nopf convert deck.opf.yaml deck.opf.json --aliases # strict YAML (--aliases expands anchors)\nopf validate deck.opf.yaml deck.opf.md # every command reads .yaml, .yml and .opf.md\nopf edit deck.opf.md --patch changes.json -i # the file stays Markdown\nopf format deck.opf.md --check # canonical Markdown\nopf validate - --from yaml < deck.txt # stdin and other names: --from\n```\n\nSee [Markdown and outlines](markdown.md) and [OPF as YAML](yaml.md). A syntax error exits 2 with the line and column (`opf\nvalidate` reports it as a `yaml/<rule>` or `markdown/<rule>` finding and exits 1); a command that rewrites a YAML file does not\nkeep its comments and says so on stderr, and one that has to put content into an `opf-slide`/`opf-block` fence says so too.\n\n## Runtime choices\n\n- **Peers, not bundled.** opf-render and opf-pptx are optional peer dependencies loaded lazily. opf-pptx pulls the native `sharp`\n engine, opf-render `resvg`, `fontkit` and the font packs (about 135 MB installed); bundling them would make the small CLI\n impossible to install offline or on a locked-down agent host, and validating or editing a deck would pay for it.\n- **JSON reports.** `--format text` gives human-readable output where a command has it; `--format github` gives CI annotations.\n- **No clock.** `--date` is explicit so a rerun tomorrow gives the same bytes.\n- **Fonts are the bundled pack plus `--fonts`.** Never system fonts (owner font policy).\n- **Stored zip entries.** Deflate output differs between zlib builds, which would make archive hashes host-dependent.\n\n## Catalog names\n\n`opf catalogs` lists canonical camelCase names such as `colorSchemes` and `fontSchemes`, and `examples`. `opf catalog` also\naccepts the website-style `color-schemes`, `font-schemes` and `chart-types` spellings.\n'
39
+ "markdown": '# The `opf` CLI\n\nThe CLI (`@openpresentation/cli`, binary `opf`, Node 22 or later; verified on Node 24) creates, checks, edits, converts and\ninspects decks (see [its README](../packages/cli/README.md)). `opf validate` is the one checker ([validate](validate.md)).\n`opf convert` is the one command that changes formats: a deck form, PDF, PPTX, PNG and SVG. Every command runs core\'s\nfunctions, the ones applications call from [`@openpresentation/opf`](node.md); the commands add the flags, the JSON report and\nthe exit codes.\n\nEverything is deterministic and local: no network, no model, no telemetry, no system fonts. The same document, options and\ninstalled package versions give the same bytes on every operating system.\n\n## Commands\n\n| Command | What it does |\n| --- | --- |\n| `opf create [output] [--title <text> [--language <tag>] \\| --example <slug>]` | A one-slide starter deck (language `en-US` unless `--language`), or one of core\'s bundled examples with the image files it names copied into `assets/` (`opf catalog examples` lists them). |\n| `opf validate <file\\|dir\\|->...` | The one checker: format, references, policy, accessibility, layout, content. Several files, folders and stdin in one run; `--format json\\|text\\|github`. |\n| `opf convert <input> <output>` | Any change of format: `.json`, `.opf.yaml`, `.opf.md` (and a plain `.md` input), `.pptx`, `.pdf`, `.png`, `.svg`, `.zip`, or stdin and stdout. |\n| `opf edit <file> [output] --patch <patch>` | A JSON Patch, applied whole or not at all, the result checked. |\n| `opf format <file>... [output]` | Canonical key order and layout, in the form the file has. |\n| `opf diff <a> <b>` | What changed between two decks (`--format text\\|json\\|patch`). |\n| `opf merge <base> <ours> <theirs> [output]` | A three-way merge; conflicts are listed. |\n| `opf stats <file>` | Neutral facts about a deck (`--format json\\|text`). |\n| `opf paginate <input> [output]` | Overflowing slides split into continuation slides, measured with the renderer\'s fonts when it is installed. |\n| `opf embed <input> [output]` | The catalog records a deck references, copied into it. |\n| `opf fill <template> <data> [output]` | A template\'s variables filled: one deck per record (the output is a name pattern), or `--combine`. The second argument is always the data (`-` for stdin). |\n| `opf ingest <data> [output] --as table\\|chart` | CSV, TSV or JSON rows as a table or chart slide, alone or added `--into` a deck. |\n| `opf doctor [deck]` | Which formats this install can write, and the one command that installs what is missing. |\n| `opf schemas`, `opf schema [name] [pointer]` | The OPF schemas. `opf schemas` lists the `@openpresentation/opf` version each came from next to its id, and `opf --version` names the schema id ([schema versioning](schema-versioning.md)). |\n| `opf catalogs`, `opf catalog <kind> [id]`, `opf catalog examples [slug]` | The pptx.gallery catalog (`@openpresentation/gallery`) and the bundled example decks. |\n| `opf skills <install\\|update\\|status>` | The six bundled agent skills. |\n| `opf mcp` | Runs the MCP server of `@openpresentation/mcp` on stdio when that package is installed; otherwise prints `npx -y @openpresentation/mcp` and exits 2. See [the MCP server](mcp.md). |\n\n`opf <command> --help` (or `-h`, or `opf help <command>`) prints a command\'s flags and examples.\n\nRemoved in 0.18 (each is a usage error, exit 2, that names its replacement): `opf render`, `opf export`, `opf import`,\n`opf from-md`, `opf to-md`, `opf from-yaml` and `opf to-yaml` (all `opf convert`), `opf create --from` (`opf convert`), and the\nflags `--output`, `--out`, `--out-dir` and `--name` (a positional output), `--input-format` (`--from`), `--json` (reports are\nJSON), `--dry-run` (stdout), `--data` (fill\'s second argument) and the deck values of `--format` (`--to`).\n\n## One output convention\n\nEvery command that writes a deck takes the same arguments:\n\n| Form | Meaning |\n| --- | --- |\n| `opf embed deck.opf.json` | No output: the deck goes to stdout, the report to stderr. `-` says the same. |\n| `opf embed deck.opf.json out.opf.json` | An output after the inputs: written atomically (a temporary sibling, then a rename); an existing file needs `--force`. |\n| `opf embed deck.opf.json -i` | `-i` (`--in-place`) rewrites the input, refusing if it changed since it was read. Not for stdin, and not with an output. |\n| `opf embed deck.opf.json --check` | Writes nothing and exits 1 when the command would change something: `format --check` (not canonical), `embed --check` (not self-contained) and `paginate --check` (a slide overflows). |\n\nThe form written is the output\'s extension (`.json`, `.opf.yaml`/`.yml`, `.opf.md`), else `--to json|yaml|md`, else the form\nthat was read. An existing output is refused before anything is printed or written.\n\n`opf fill` writes one deck per record through a file name pattern: `{n}` is the record number (padded to the width of the largest, the rule of `opf convert`), `{column}` a slug of that\ncolumn\'s value (`opf fill t.opf.md clients.csv decks/qbr-{client}.opf.md`); `--combine` writes one deck with every record\'s slides.\n\n## What each flag means\n\n| Flag | Meaning |\n| --- | --- |\n| `--format json\\|text\\|github\\|patch` | The report format only: `json` (the default), `text`, `github` (validate\'s workflow annotations) or `patch` (diff\'s JSON Patch). |\n| `--from json\\|yaml\\|md` | The form of a deck input: stdin, and names that say none. Without it, a name ending `.json`, `.opf.yaml`, `.yaml`, `.yml` or `.opf.md` says the form, and text that starts with `{` or `[` is JSON; anything else is a usage error that asks for `--from yaml\\|md`. `opf convert` also takes `--from pptx`. |\n| `--to json\\|yaml\\|md` | The form of a deck output, for stdout and names that say none. `opf convert` also takes `pdf`, `pptx`, `png`, `svg` and `zip`. A `--to` that disagrees with the output\'s extension is refused. |\n| `--data-format csv\\|tsv\\|json` | The form of the data of `opf fill` and `opf ingest` (default: the extension, else JSON when it starts with `{` or `[`, else CSV). |\n| `--fail-on error\\|warning\\|info` | Findings at or above this severity fail the command (exit 1) and nothing is written (default `error`). |\n| `--force` | Replace an existing output. |\n\n## Install\n\n**Published set (2026-10-24):** CLI 0.26.1 (core `^0.26.1`, Gallery `^0.26.1`,\noptional renderer/PPTX `^0.26.1`) with core, renderer, PPTX, editor and Gallery 0.26.1. Use the complete pinned [quickstart installation](quickstart.md#versions) and its\nrequired font/converter peers.\n\nDeck forms (JSON, YAML, Markdown) need nothing beyond the CLI. PDF, PNG and SVG need `@openpresentation/opf-render`; PPTX output\nand `.pptx` input also need `@openpresentation/opf-pptx`. Both are **optional peer dependencies** of the CLI and of core (decision\nRR-27, below), loaded the first time a command needs them, from beside the CLI first and from the working directory second.\n\n`opf doctor` says what this install can write and prints the one command that installs the rest:\n\n```sh\nopf doctor --format text # per format: ready, or what is missing; then one install command\nopf doctor deck.opf.md # JSON; with a deck, the answer is that deck\'s: its font packages, its script fonts, sharp only when it has pictures\n```\n\nFont packages are per deck: opf-render loads only the faces a deck\'s fonts use (Roboto for a Roboto design, Cousine for one that\nnames Consolas), and each `@expo-google-fonts/*` package is an optional peer. So `opf doctor` without a deck counts only the\nrenderer and the converters as `ready` and lists the font packages apart (`fontPackages.others`). With a deck it prepares the\ndeck\'s faces as `opf convert` does (nothing is drawn) and answers for that deck: a font package its faces need that is not\ninstalled is listed under `deckFonts.missing` with the faces that need it (`deckFonts.faces`), reported as a\n`fonts/font-package-not-installed` finding, added to the drawn formats\' `missing` and to `install`; the font packages the\ndeck does not use are listed apart (`fontPackages.others`, with `unusedByDeck: true` once all its faces were prepared) and never\nmake a format `missing`, so doctor and convert agree. `opf validate` reports the same `fonts/font-package-not-installed`\nwarning (exit 1 only under `--fail-on warning`) and then estimates the layout instead of measuring it with another face; `opf\nconvert` of such a deck stops with `font-resource-unavailable`, naming the package, its faces and the install line. Doctor exits\n0 whenever its arguments are right, in both formats: it reports, and `ok` (or the text) is the verdict.\n\nThe command matches the package manager that runs the CLI (`npm_config_user_agent`: npm, pnpm, yarn or bun) and the way the CLI\nis installed: global (`npm install -g ...`), a project (`npm install ...`), or one npx run (`npx -p @openpresentation/cli -p ... opf <command>`).\nA conversion that misses a peer exits 2 with `code: "peer-not-installed"` (or `peer-too-old`), and its `install` field and message\ncarry that one command for the format asked for. What each output needs beside `@openpresentation/opf-render`:\n\n| Output | Also install |\n| --- | --- |\n| a drawn format, for the font packages the deck\'s faces use (`opf doctor deck` names them; all of them are) | `@expo-google-fonts/roboto@0.4.3 @expo-google-fonts/roboto-mono@0.4.2 @expo-google-fonts/caladea@0.4.2 @expo-google-fonts/arimo@0.4.3 @expo-google-fonts/tinos@0.4.2 @expo-google-fonts/cousine@0.4.3 @expo-google-fonts/gelasio@0.4.1 @expo-google-fonts/noto-sans@0.4.2` |\n| `png` | `@resvg/resvg-js@^2.6.2 sharp@^0.35.5` |\n| `pdf` | nothing for text in the default vector mode; `pdf-lib@^1.17.1` for `--raster`; `sharp@^0.35.5` when the deck has pictures |\n| `svg` | the deck\'s font packages only |\n| `pptx`, a `.pptx` input | `@openpresentation/opf-pptx` |\n\n### Fonts for a deck in another script\n\n`opf doctor` with no deck reports what the install can write and says nothing about a deck\'s scripts. `opf doctor deck.opf.json` also runs the script-font check `opf convert` runs (it prepares the bundled fonts for the deck, so it needs `@openpresentation/opf-render`; nothing is drawn): the script packages the deck\'s text needs that are not installed are listed with their versions under `scriptFonts.missing` (and as `fonts/script-font-not-installed` findings), are added to `missing` and to the one `install` command, and make `svg`, `png`, `pdf`, `pdf-raster` and `pptx` not `ready`. `scriptFonts.checked` is `false`, with a `reason`, when the check could not run (no renderer, or fonts that cannot be prepared), and the text output then does not say the deck is ready. (Before CLI 0.34.1, doctor listed `svg` and `pdf` as `ready` for a deck with an Arabic slide and the conversion then failed.) The office pack covers Latin, Greek and Cyrillic; each other script (Arabic, Hebrew, Thai, the Indic scripts, Chinese, Japanese, Korean and the rest) is one optional `@expo-google-fonts/noto-*` package, and a deck needs the ones for the scripts it draws. To find them and install them:\n\n1. Ask doctor: `opf validate deck.opf.json` reports the same `fonts/script-font-not-installed` warnings (package and version, with the global, project and npx install forms). `opf doctor deck.opf.json --format text` lists the missing script packages and prints the install command (skip to step 2). Or convert the deck once to a throwaway file: `opf convert deck.opf.json check.svg --force`. A missing script font exits 1 with a `fonts/script-font-not-installed` finding per package, each naming the package and the version, for example `@expo-google-fonts/noto-naskh-arabic@0.4.5` and `@expo-google-fonts/noto-sans-arabic@0.4.3` for Arabic text, followed by a `render/missing-glyph` error. (A slide that sets a Noto font scheme itself, such as `noto-sans-arabic`, gets the same finding for the package of the scheme\'s font, and the error names it too: "No local font face for \'Noto Naskh Arabic\'... install @expo-google-fonts/noto-naskh-arabic@0.4.5". Before 0.34.1 that error said only "load the \'scripts\' font pack", and `opf validate` still reports the failed layout as `opf/layout-failed` with that message, not as a `fonts/` finding.)\n2. Install what the findings name, at the versions they name, next to the CLI: `npm install @expo-google-fonts/noto-naskh-arabic@0.4.5 @expo-google-fonts/noto-sans-arabic@0.4.3` in the project that holds `@openpresentation/cli` (a global CLI takes `npm install -g`; `pnpm add`, `yarn add` and `bun add` work the same way).\n3. Convert again. When it succeeds, the report\'s `fonts.scripts` lists `detected` (for example `Arab`), `packages` (the ones used) and `notInstalled` (empty when nothing is missing). Check that list for every deck with more than one script, then export the PDF, PNG, SVG or PPTX.\n\n`opf stats deck.opf.json` lists `fonts.families` (the families the deck names, such as `Noto Naskh Arabic`) but not the packages, and not the script of text that has no font of its own. The package versions are pinned by `@openpresentation/opf-render` (its `package.json` lists every `@expo-google-fonts/*` package it uses, including those for Hebrew, Thai, Devanagari, `noto-sans-jp`, `noto-sans-kr`, `noto-sans-sc` and `noto-sans-tc`). The site\'s starter project ships the eight office-pack fonts only, so a deck with an Arabic slide needs the two Arabic packages above added to it.\n\n## From code\n\nThe engine the commands run is core\'s `@openpresentation/opf` in Node, which an application imports instead of spawning `opf`.\nIn Node, `validate`, `stats`, `paginate`, `embed` and `edit` register the gallery (`@openpresentation/gallery`) when a call names none, as the commands\ndo, so `opf validate deck` and `validate(deck)` agree:\n\n```ts\nimport * as opf from "@openpresentation/opf";\n\nawait opf.convert("deck.opf.md", "deck.pdf"); // opf convert deck.opf.md deck.pdf\nconst deck = await opf.open("deck.pptx"); // opf convert deck.pptx -\nconst { files } = await opf.convert(deck, { format: "png", scale: 2 }); // bytes, nothing written\nconst { presentation } = opf.edit(deck, patch); // opf edit deck --patch patch.json\nconst { decks } = opf.fill(template, csvText); // opf fill template data.csv out-{n}.opf.json\n```\n\nThe options are the flags in camel case (`--raster` is `raster: true`, `--fonts` is `fonts` (a folder or a list of folders),\n`--asset-dir` is `assetDir`, `--include-hidden` is `includeHidden`). The commands refuse an existing output without `--force`;\n`convert` replaces it unless `overwrite: false`. See [OPF files in Node](node.md).\n\n## `opf convert`\n\n```sh\nopf convert deck.opf.md deck.pdf\nopf convert deck.opf.md slides/deck.png --slides 1,3-5 --scale 2 # slides/deck-1.png, -3, -4, -5\nopf convert deck.opf.md "slides/slide-{n}.png" # slides/slide-1.png, slide-2.png, ... (always numbered)\nopf convert deck.opf.md slides.zip --to svg\nopf convert deck.pptx deck.opf.md --signals signals.json\nopf convert outline.md deck.opf.yaml # a plain .md input is OPF Markdown\nopf convert deck.opf.json deck.opf.yaml --schema-comment\nopf convert deck.opf.md - --to pdf > deck.pdf\n```\n\n| Output | Written as |\n| --- | --- |\n| `.pdf`, `.pptx` | one file |\n| `.png`, `.svg` | one file per slide beside the output, named after it: `slides/deck.png` writes `slides/deck-1.png`, `-2`, ... (the deck\'s slide numbers). One selected slide, or a one-slide deck, is written to the output itself. The extension is the format: `deck.png` is always PNG. With `{n}` in the output (`"slides/slide-{n}.png"`) the files are always numbered, even for one slide or one selected slide, and `{n}` is the deck\'s slide number (2 and 5 with `--slides 2,5`). `{n}` is the only placeholder: any other `{key}`, and `{n}` in `.pdf`, `.pptx`, `.zip` or a deck form, is a usage error (exit 2, `invalid-option`). |\n\nNumbers are padded with zeros to the width of the largest number written: `1`...`9` for slides 1 to 9, `01`...`99` up to 99, `001` from 100. With `--slides` the width comes from the largest slide selected (`--slides 2,5` gives `deck-2.png`, `deck-5.png`). The same rule pads `{n}` in `opf fill` (the largest record number) and the zip entries below.\n| `.zip` | one archive of the slides, its entries named as the plain `.png` and `.svg` files above (`slides.zip` holds `slides-1.png`, ...; always numbered, and no `{n}` in the archive\'s own name): PNG, or SVG with `--to svg`. Entries are stored with a fixed timestamp, so the archive is byte-identical everywhere. |\n| `.json`, `.opf.yaml`, `.yml`, `.opf.md` | the deck in that form |\n| `-` | stdout, with `--to`: one file (`pdf`, `pptx`, `zip`, a deck form, or one slide as `png` or `svg`) |\n\nA flag applies only when its format is involved; anywhere else it is a usage error (exit 2, `option-not-applicable`):\n\n| Involved | Flags |\n| --- | --- |\n| a Markdown input | `--split auto\\|rules\\|headings` (default `auto`: slides at `---` lines, and an outline with none at its `#` headings), `--title <text>` (the deck name unless the front matter sets one) |\n| a YAML input | `--aliases` (expand anchors, aliases and merge keys, at most 100) |\n| a `.pptx` input | `--signals <file>` (also write the raw per-shape layout and style signals, `fromPptx` with `signals: true`) |\n| a YAML output | `--schema-comment` (the `# yaml-language-server: $schema=...` line) |\n| a Markdown output | `--drop-unsupported` (leave out what the dialect has no syntax for and list it as loss, instead of embedding it as YAML in a fence) |\n| pdf, png, svg | `--slides 1,3-5` (one-based; `2-` to the end), `--include-hidden` |\n| pdf, png, svg, pptx | `--paginate` or `--keep-slides`, `--date YYYY-MM-DD`, `--fonts <dir>` (repeatable), `--asset-dir <dir>` |\n| png, raster pdf, pptx `--as images` | `--scale 0.1-8` (1 draws the 1280 x 720 reference slide at 1280 x 720 pixels; the pictures of `--as images` default to 2) |\n| pdf | `--raster` (each page a picture instead of selectable vector text) |\n| svg | `--text fonts\\|system\\|paths` (embed the faces the slide uses, none, or draw glyph outlines) |\n| pptx | `--charts auto\\|native\\|picture`, `--diagrams shapes\\|picture`, `--images compatible\\|preserve`, `--provenance full\\|references-only\\|none`, `--body-text measured\\|native`, `--slide-numbers static\\|live`, `--typefaces selected\\|safe`, `--as native\\|images` |\n\nA `.pptx` input is imported, checked and then written or drawn; `findings` holds both steps (`import/` rules from the importer).\nPer-slide images and the PDF skip slides marked `hidden: true` unless `--include-hidden`; slides named with `--slides` are always\nwritten, and the report lists the slides left out in `skippedHidden`. The PPTX keeps a hidden slide as a hidden slide.\n\n**Overfull slides (LH-90).** By default a slide of sibling blocks of one kind (eight timelines, five tables; each block may\nbring the notes that follow it) that overflows at its readability floor is drawn as several slides of the same layout, split\nbetween whole blocks, in every format, so the preview and the PPTX agree. Each such slide is a `render/slide-continued` or\n`pptx/slide-continued` warning and an entry of the report field `continued` (`slide`, the `slides` it became, `kind`, and\n`blocks` and `units` per slide); `--slides` and the file names count the slides drawn. `--paginate` splits every overflowing\nslide instead (as `opf paginate` does), and `--keep-slides` draws every slide as written, overlapping where it overflows.\n\n### PPTX text (RR-88, RR-91)\n\nBy default (`--body-text measured`) a wrapped paragraph becomes one text box per line, laid out exactly as the preview draws it, so editing a line in PowerPoint or Keynote does not reflow the rest. `--body-text native` opts in to whole paragraphs: a text, bullets or numbered-list region is one body that the application re-wraps when edited. In both modes every slide title is the Title placeholder (opf-pptx 0.34.0): a wrapped title is re-wrapped by the application where its line breaks are proven to match the preview, and otherwise keeps the preview\'s lines as fixed line breaks. What native mode cannot carry (groups, cards, nested or described lists, restarted numbering) stays measured and is reported as `native-body-fallback`. A slide recomposed as the automatic grid at the readability floor (LH-83) keeps its native bodies too (LH-91): the first binds to the Body placeholder of a variant of its layout named `<layout> (automatic grid)`. `--slide-numbers` decides a footer such as `{{slide.number}} / {{deck.slideCount}}`: `live` (the default since RR-102) keeps the slide-number field in PowerPoint\'s Slide Number placeholder, so Insert > Header & Footer shows Slide number checked and PowerPoint renumbers it, and Keynote draws it as the digit alone because it drops the words next to a live number; `static` writes the number as fixed text, so Keynote shows the words around it. A footer that is only `{{slide.number}}` stays a live field in both modes (the total is always fixed text). Both flags need an opf-pptx that reads them (0.22.0 or later); an older one is refused (`peer-too-old`) rather than ignoring them, and they are exit 2 for any other output.\n\n**Which to choose.** Pick `measured` (the default) when the deck is final and the PPTX is a delivery format: every line sits where the preview put it, and the deck is edited in OPF. Pick `native` when people will edit the text in PowerPoint or Keynote: a longer bullet wraps and numbered lists renumber. Native text is re-wrapped by the application\'s own fonts and engine, so line breaks can differ from the preview; native wrapping is not yet qualified in every application, and anything it cannot carry (see above) stays measured with a `native-body-fallback` finding, so read the findings. `--slide-numbers live` is the default because the PPTX is a PowerPoint file first: the number is PowerPoint\'s own and follows slides moved, added or deleted there. Choose `static` for a deck that will be opened in Keynote, which replaces any paragraph that holds a live slide-number field with the number alone, so `{{slide.number}} / {{deck.slideCount}}` shows only the digit; the cost is that PowerPoint does not renumber a static number. The total, `{{deck.slideCount}}`, is fixed text in both (PowerPoint has no slide-count field).\n\n### PPTX fonts and pictures (LH-28, LH-20)\n\nA PPTX names its fonts; it does not embed them. A viewer that lacks a named family substitutes another one, and its lines can break where the preview\'s did not. The default (`--typefaces selected`) writes the families the deck chose, and the report notes the ones that are not Office-safe (`pptx/typeface-not-office-safe`, info). Office-safe means two things: the family ships with every Windows and macOS machine, and OPF measures it exactly through a metric-compatible open face. The font policy table gives four: Arial, Courier New, Georgia and Times New Roman. `--typefaces safe` writes each Latin text family as one of them and lays the text out with it, so every viewer breaks lines where the file does. A metric twin keeps its exact widths (Arimo and Liberation Sans become Arial, Tinos Times New Roman, Cousine Courier New, Gelasio Georgia). Any other family follows its font scheme\'s type: sans-serif becomes Arial, serif Georgia, monospace Courier New. The line breaks then follow the safe family, not the preview\'s. East Asian and complex-script fonts, symbol, emoji and math families keep their names. Each replacement is reported once (`pptx/typeface-replaced`, info).\n\nFor a file that will be opened in LibreOffice, `--charts picture` writes the chartex types (treemap, waterfall, funnel, box and whisker, ...) as clustered column charts, which LibreOffice draws; with the default `auto` it shows them as unsupported ([LibreOffice interoperability](libreoffice.md#charts)).\n\n`--as images` is a fidelity fallback: each slide becomes one full-bleed PNG picture, drawn by the same renderer and fonts as the PNG preview (at `--scale`, default 2, which gives 2560 x 1440 for a 16:9 slide). The speaker notes, hidden slides and sections are kept, and each picture\'s alternative text is the slide\'s text, so screen readers can read it. The file looks the same in every viewer and needs no fonts, but nothing in it is editable text, and an import gives picture slides, not the deck. The options that shape text, charts and records (`--typefaces`, `--body-text`, `--charts`, `--diagrams`, `--images`, `--provenance`, `--slide-numbers`) do not apply to it (exit 2).\n\n## The other commands\n\n- **`opf create`** writes a starter deck (`--title`, `--language`, default `en-US`) or a bundled example (`--example <slug>`, from `opf catalog examples`) together with the image files it names, copied into `assets/` next to the output (an existing file is refused unless `--force`).\n- **`opf validate`** checks files, folders (their `*.opf.json`, `*.opf.yaml`, `*.opf.yml` and `*.opf.md`, sorted, skipping\n `node_modules` and dot folders) and `-`. One input prints its report; several print `{ command, ok, files: [reports], counts }`.\n The exit status is the worst over every file. `--format github` prints `::error`, `::warning` and `::notice` annotations with the\n file, line and column. See [validate](validate.md).\n- **`opf paginate`** measures the page breaks with the fonts `opf convert --paginate` draws with when `@openpresentation/opf-render`\n is installed (`layout: "measured"`); without it they are estimated (`layout: "estimated"`) and `hint` names the install command.\n- **`opf fill`** reads CSV, TSV or JSON data; a blank cell keeps the variable\'s declared value; an unfilled required variable fails\n unless `--partial`; `--examples` fills from the declared examples. The second argument is always the data, whatever its name\n (`-` reads it from stdin), and the third is the output; a template alone fills from its own values, to stdout.\n- **`opf ingest`** gives the same slide id and bytes for the same inputs; `--dataset <id>` stores the rows in the deck\'s datasets.\n\n## Reports and errors\n\nEvery command that reports prints one envelope:\n\n```json\n{ "command": "convert", "ok": true, "input": { "file": "/abs/deck.opf.md", "sha256": "\u2026", "bytes": 1234 },\n "outputs": [{ "file": "/abs/deck.pdf", "sha256": "\u2026", "bytes": 56789, "mediaType": "application/pdf" }],\n "findings": [], "counts": { "error": 0, "warning": 0, "info": 0 }, "format": "pdf", "\u2026": "\u2026" }\n```\n\n`input` is `null` when nothing was read and a list when several were (diff, merge, fill). The report is on stdout, or on stderr when\nstdout carries the document. Findings have the [`opf validate`](validate.md) shape (`ruleId`, `severity`, `category`, JSON Pointer\n`path`, `message`, `help`, and `location` when read from text); engine findings carry the prefix `render/`, `pptx/`, `pdf/`,\n`fonts/`, `import/` or `cli/`. The lookup commands (`schemas`, `schema`, `catalogs`, `catalog`, `--version`) print the data asked for.\n\nErrors are `{ command, ok: false, code, error, ... }` on stderr. The message states the fix: a missing argument names it and\nprints the usage, an unknown command, option or value suggests the nearest one ("Did you mean --check?"), and a removed command\nor flag names its replacement. Codes include `usage`, `unknown-command`, `unknown-option`, `removed-command`, `removed-option`,\n`missing-argument`, `extra-argument`, `missing-value`, `invalid-value`, `option-not-applicable`, `unknown-input-format`,\n`input-not-found`, `invalid-json`, `invalid-yaml`, `invalid-markdown`, `invalid-document`, `findings-at-fail-on`,\n`output-exists`, `merge-conflict`, `fill-failed`, `peer-not-installed` and `peer-too-old`.\n\nExit `0`: success (warnings allowed). Exit `1`: an invalid document, a finding at or above `--fail-on`, an existing output, a\nmerge conflict, or a `--check` that found a change. Exit `2`: usage, a read or I/O problem, text that is not valid JSON, YAML or\nMarkdown, or a missing or too-old peer. (`opf validate` reports text that does not parse as a finding, exit 1.)\n\n## Fonts\n\nThe renderer\'s bundled open font pack (the office pack: Carlito, Intos for Aptos, the open families font schemes select and the\nopen replacements the font policy routes proprietary families to) with the visual substitution policy, plus the files from\n`--fonts`. **System fonts are never loaded**, and nothing is downloaded. Font substitutions are listed under\n`fonts.substitutions` in the report. The PPTX keeps the font names the document chose.\n\nScripts beyond Latin, Greek and Cyrillic need the optional Noto script packages of the renderer (`@expo-google-fonts/noto-sans-jp`\nand so on); install the ones named in the `fonts/script-font-not-installed` diagnostic next to the CLI. A standalone SVG\n(`--text fonts`, the default) embeds the faces its text uses; `--text system` omits all font bytes; `--text paths` draws the text\nas glyph outlines (the real text kept invisible beside it for selection and search), so the SVG needs no font.\n\n## Images and assets\n\nRelative image paths and `file:` paths resolve against the input\'s folder (or `--asset-dir`). Only `.png`, `.jpg`, `.jpeg`,\n`.gif`, `.webp` and `.svg` files whose content matches are read, and only inside that folder (symlinks are resolved first). URLs\nare never fetched. For SVG and PNG an unreadable image draws the renderer\'s placeholder with an `unresolved-asset` or\n`cli/asset-blocked` warning. For PPTX (opf-pptx 0.24.1 and later) an unreadable or blocked local path and an unresolved remote URL\nare one case: the deck exports without that image (an unavailable-image placeholder, or the fallback background for a background\npicture) and the report carries a `pptx/unresolved-asset` warning. Use `--fail-on warning` to reject that output before any file is\nwritten. Before opf-pptx 0.24.1 an unreadable or blocked local path stopped the export (`pptx/asset-unresolved`, an error).\n\n## Markdown and YAML\n\nJSON stays the canonical form of a deck. YAML (`deck.opf.yaml`) and Markdown (`deck.opf.md`) are authoring forms of the same data,\nand every command that reads or writes a deck reads and writes all three:\n\n```sh\nopf convert deck.md deck.opf.json # Markdown in the OPF dialect (or an outline) to a deck\nopf convert deck.opf.json deck.opf.md # a deck as Markdown that reads back unchanged\nopf convert deck.opf.yaml deck.opf.json --aliases # strict YAML (--aliases expands anchors)\nopf validate deck.opf.yaml deck.opf.md # every command reads .yaml, .yml and .opf.md\nopf edit deck.opf.md --patch changes.json -i # the file stays Markdown\nopf format deck.opf.md --check # canonical Markdown\nopf validate - --from yaml < deck.txt # stdin and other names: --from\n```\n\nSee [Markdown and outlines](markdown.md) and [OPF as YAML](yaml.md). A syntax error exits 2 with the line and column (`opf\nvalidate` reports it as a `yaml/<rule>` or `markdown/<rule>` finding and exits 1); a command that rewrites a YAML file does not\nkeep its comments and says so on stderr, and one that has to put content into an `opf-slide`/`opf-block` fence says so too.\n\n## Runtime choices\n\n- **Peers, not bundled.** opf-render and opf-pptx are optional peer dependencies loaded lazily. opf-pptx pulls the native `sharp`\n engine, opf-render `resvg`, `fontkit` and the font packs (about 135 MB installed); bundling them would make the small CLI\n impossible to install offline or on a locked-down agent host, and validating or editing a deck would pay for it.\n- **JSON reports.** `--format text` gives human-readable output where a command has it; `--format github` gives CI annotations.\n- **No clock.** `--date` is explicit so a rerun tomorrow gives the same bytes.\n- **Fonts are the bundled pack plus `--fonts`.** Never system fonts (owner font policy).\n- **Stored zip entries.** Deflate output differs between zlib builds, which would make archive hashes host-dependent.\n\n## Catalog names\n\n`opf catalogs` lists canonical camelCase names such as `colorSchemes` and `fontSchemes`, and `examples`. `opf catalog` also\naccepts the website-style `color-schemes`, `font-schemes` and `chart-types` spellings.\n'
40
40
  },
41
41
  {
42
42
  "slug": "compatibility-matrix",
@@ -54,7 +54,7 @@ var docsData = Object.freeze([
54
54
  "slug": "content-payloads",
55
55
  "file": "docs/content-payloads.md",
56
56
  "title": "Content Payloads",
57
- "markdown": '# Content Payloads\n\nSlide content lives directly on a slide as a full-slide payload, in layout-agnostic `blocks`, or inside a promoted region key such as `start`, `center+end`, or `top:start`.\n\nThe slide-level `title`, `subtitle` and `tag` are not payloads, but like `text` and `quote.text` they accept a string or `TextRun[]` (colored words, bold, links, `cite`/`footnote` markers); see [Rich text](rich-text.md#rich-headings-and-quotes).\n\n**Run-in headings (LH-63).** A plain `text` whose first line is 40 characters or fewer, ends where the author broke the line and has a body after it that is longer than the line, draws that line as a bold heading over its body ("Option A: focused pilot" over its two sentences), as Claude Design sets the options of a comparison. A text with no such line whose first line opens with a short "Label:" (one to six words, under 40 characters, then a space and a detail) draws the label in bold. A first line that ends a sentence or opens a list entry is body text, and a text written as `TextRun[]` stays as the author formatted it. The document is unchanged: core composes the text as runs of the same characters (`item.runs`), the guarded rule `run-in` keeps them only when no text on the slide reads smaller than as written, and the preview and the PowerPoint export draw them. A text in LH-06\'s foot band or pill draws as written.\n\nThe optional payload `type` can make intent explicit, but OPF should usually infer the content kind from the field present:\n\n| Field | Inferred type | Notes |\n| --- | --- | --- |\n| `text` | `text` | Plain string or `TextRun[]`. |\n| `bullets` | `text` | Prose bullets: plain talking points, usually `string[]`. |\n| `items` | `list` | Structured list: entries that share a shape or carry a `description`; `string[]` or `ListItem[]`. See [items versus bullets](#items-versus-bullets). |\n| `image` | `image` | Asset string shorthand or an image object with `src`, optional metadata and `callouts` (plain text panels over the picture). |\n| `video` | `video` | Asset reference shown as a media placeholder; an HTTP(S) source links from the PPTX. No embedded playback. See [Video references](#video-references). |\n| `chart` | `chart` | Chart object with `type` and tabular `data`. |\n| `table` | `table` | Table object with optional `columns` and required `rows`. |\n| `code` | `code` | String shorthand or `Code` object with `source`, `language`, `filename`, and `highlight`. |\n| `metric` | `metric` | String/number shorthand or `Metric` object with `value`, `label`, `description`, `unit`, `delta`, `trend`, and `sentiment`. |\n| `quote` | `quote` | String shorthand or `Quote` object with `text` (string or `TextRun[]`), `attribution`, `role`, `photo`, and `source`. |\n| `timeline` | `timeline` | Array shorthand or `Timeline` object with `name`, `description`, and `events`. |\n| `diagram` | `diagram` | Mermaid source string shorthand or `Diagram` object with `source`, `syntax` and `alt`. See [Diagram](#diagram). |\n\n## Video references\n\nA `video` accepts an asset string or an `Asset` object with `src` and optional metadata. The preview draws a media placeholder with a play badge and a caption, not a player. The caption is the video\'s title, else its source, else "Media"; an `asset:` reference is followed to the registry entry first (a title written on the value wins), so the caption is never the asset id (RR-105). PPTX export writes the same editable shapes and caption, with a hyperlink when the resolved source is HTTP(S); local references remain captions. It does not fetch or embed a video file or create a YouTube/Vimeo player. MP4/WebM sources are references, not playable media inside the exported deck. Keep that limitation beside any video example.\n\n## Items versus bullets\n\nBoth fields draw the same bulleted (or numbered) list: one marker, the same nesting `level`, rich-text entries and `numbering`, fitted by the same list engine. Nothing about the drawing differs. They differ in the kind they infer and in what an entry may carry:\n\n| | `bullets` | `items` |\n| --- | --- | --- |\n| Inferred kind | `text` | `list` |\n| Entry | string, `TextRun[]` or `{ text, level, start }` | string, `TextRun[]` or `{ text, description, level, start }` |\n| `description` | not allowed (a schema error) | supporting detail drawn under the entry |\n| Beside `text` in one block or region | allowed | an error (`list` and `text` are different kinds) |\n\n**The rule.** Use `bullets` for plain talking points: short lines that each stand alone. Use `items` when the entries share a shape (features, steps, options, risks) or any entry needs a `description`; never fold a heading and its detail into one string with a separator, that is what `description` is for. When in doubt, use `items`, because it can grow a `description` later without changing the payload kind. The editor helper `convertListForm` switches a payload between the two; going to `bullets` drops the descriptions.\n\n**How entries draw.** A nested entry steps in by one marker width. The bullets alternate `\u2022` and an en dash `\u2013` by level (`\u2022` at level 0, `\u2013` at 1, `\u2022` at 2), as PowerPoint\'s default levels do: glyphs every bundled face has (`\u25E6` and `\u25AA` are missing from most of them, Roboto among them, and drew as a missing-glyph box). A description draws under its entry at 0.82 of the list size in the secondary text color. A list of exactly one entry that has a description, with no `numbering`, draws as a heading over its text: the entry bold at 1.25 times the list size with no bullet and no indent, the description at the list size. The preview and the PowerPoint export draw the same.\n\nDo not give one payload both. In a block or a promoted region, `items` next to `bullets` is the error "content payload mixes fields from incompatible content types". At slide root it validates, as the shorthand for two blocks, and composes as two lists side by side; write two blocks on purpose if you want that. `numbering` applies to every list in the payload.\n\nA layout\'s placeholder kind (`list` or `text`) is what layout pickers match on (`layoutContent`), but composition does not refuse the other field and draws both the same way: the choice states what the content is, it is not a switch for the look.\n\n## Code highlight\n\n`code.highlight` marks lines of a code block: a line number or an inclusive `[start, end]` range, 1-based, for example `[3, [5, 7]]`. Lines are counted by line break in `code.source`; a line that wraps is still one line. The preview and the PPTX export draw a theme-derived band behind the marked lines and dim the others slightly; every line keeps at least 4.5:1 contrast against what it sits on (`codeHighlightColors`). The PPTX export draws one native rectangle per run of marked lines behind the per-line text boxes, and import restores `highlight` from the code provenance tag. A line past the last line, or a range written end before start, is the validation warning `code-highlight-out-of-range` or `code-highlight-range-reversed`, and engines ignore it. Pagination keeps each page\'s marked lines, renumbered from 1.\n\n## Color references\n\nEvery content color field \u2014 `TextRun.color`, styled table cell `style.fill` and `style.color`, and table cell border `color` \u2014 accepts three forms:\n\n- A literal hex color: `"#0F172A"`, `"#B42318CC"`.\n- A color-scheme slot or role name, resolved through the effective color scheme after design resolution: slots `accent1`\u2013`accent6`, `dark1`, `dark2`, `light1`, `light2`, `hyperlink`, `followedHyperlink`; roles `primary`, `secondary`, `accent`, `background`, `surface`, `surfaceAlt`, `text`, `textSecondary`. `surfaceAlt` is the alternate surface for banded table rows: core derives it from `surface` and `text` (`surfaceAltColor`), so it always differs visibly from the `surface` of the plain rows, on light and dark slides, and body text keeps 4.5:1 on it.\n- A variable reference `var:<id>` into the top-level `variables` map.\n\n```json\n{\n "variables": { "risk": "#B42318" },\n "slides": [\n {\n "title": "What Could Go Wrong",\n "items": [\n ["Two regions at ", { "text": "85% utilization", "color": "var:risk", "bold": true }],\n ["Mitigations ship in ", { "text": "November", "color": "accent2" }]\n ]\n }\n ]\n}\n```\n\nPrefer names and variables over literal hex: re-theming the deck updates every named reference, while a hex value stays frozen at authoring time. An unknown `var:` id is a validation warning, never an error; engines fall back to their default text color. The styled table cell and border color fields enforce the three forms at the schema level; run colors additionally accept any string so imported decks keep validating \u2014 unrecognized values warn, and renderers fall back to the theme color. See [`design-resolution.md`](./design-resolution.md) for the resolution rules.\n\n## Numbered lists\n\n`numbering` on an `items` or `bullets` payload draws numbers instead of bullets: a style name (`arabic`, `roman-upper`, `roman-lower`, `alpha-upper`, `alpha-lower`), a `{ style, start, suffix }` object, or an array with one entry per list level. PowerPoint export writes native auto-numbers and the preview draws the same numbers. See [numbered lists](numbered-lists.md).\n\n```json\n{ "items": ["Define", "Build", "Ship"], "numbering": { "style": "roman-lower", "suffix": "paren" } }\n```\n\n## Blocks\n\nUse slide-level `blocks` when a slide contains multiple content payloads, but exact placement should be inferred by the renderer. Blocks may contain a concrete content payload or a nested group with its own `blocks` and optional `composition`. Groups cannot mix child blocks with leaf payload fields. See [dynamic composition](dynamic-composition.md) for nesting and inheritance rules.\n\nMark the one block or group that carries the slide\'s takeaway with `"emphasis": true`: it is drawn on a contrasting card (a dark card on a light slide, an accent card on a dark one) whose text reads at 4.5:1 or more. A slide has one emphasis; without one, a short last text after longer blocks is drawn as a band at the foot of the body, and a very short one after a lone long text as a pill (`"emphasis": false` opts a block out). See [Emphasis surface](dynamic-composition.md#emphasis-surface-lh-06).\n\n```json\n{\n "title": "Customer Feedback Summary",\n "blocks": [\n {\n "table": {\n "columns": ["Theme", "Mentions"],\n "rows": [\n ["Speed", 42],\n ["Ease of use", 31]\n ]\n }\n },\n {\n "quote": {\n "text": "The new workflow cut review time in half.",\n "attribution": "Operations Lead",\n "source": "Customer interview"\n }\n }\n ]\n}\n```\n\nAt slide root only, multiple content payload kinds are accepted as shorthand for the equivalent blocks form when there is no explicit `type`, no `blocks`, and no promoted region keys:\n\n```json\n{\n "title": "Habitat & Territory",\n "text": "Jaguars are strongly associated with presence of water and dense cover.",\n "items": [\n "Primary habitats include dense rainforests, swamps, and seasonally flooded wetlands.",\n "Solitary animals that establish and defend large territories."\n ]\n}\n```\n\nThe same shorthand works for other content kinds:\n\n```json\n{\n "title": "Evidence Snapshot",\n "chart": {\n "type": "line",\n "data": {\n "columns": ["Quarter", "Sightings"],\n "rows": [\n ["Q1", 12],\n ["Q2", 18]\n ]\n }\n },\n "quote": {\n "text": "Jaguar conservation depends on connected habitat.",\n "attribution": "Field researcher"\n }\n}\n```\n\n## Chart\n\nChart-specific fields are grouped under `chart`. Do not put loose chart data directly on a slide or region.\n\n```json\n{\n "title": "Revenue Trend",\n "chart": {\n "type": "line",\n "data": {\n "columns": ["Quarter", "Revenue", "Costs"],\n "rows": [\n ["Q1", 12, 8],\n ["Q2", 18, 11],\n ["Q3", 24, 15]\n ]\n }\n }\n}\n```\n\nInline chart data is tabular by default. Renderers convert `columns` and `rows` into series, axes, legends, and workbook data internally.\n\nGive every chart an `alt`: one or two sentences that say what the data shows (the point and the key numbers), not "a chart" or "bar chart". The preview names the chart with it (`role="img"`, `aria-label`) and the PowerPoint export writes it as the chart frame\'s alternative text (`descr`), which `fromPptx` reads back. `"alt": ""` marks a chart decorative, as an empty image `alt` does; `validate` (`opf/chart-text-alternative`) still reports it as info so the choice is reviewed. Without `alt`, text beside the chart (a subtitle, text or table) satisfies the rule. See [chart options](chart-options.md#text-alternative).\n\nValue cells are numbers. A string is read only in strict decimal syntax (`"12"`, `" -3.5 "`, `"1e6"`); anything else (`"12%"`, `"$5"`, `"(5)"`, `"1,234"`, `"Q1"`) is a gap in the preview and the export and a `chart-value-not-numeric` warning, never a guessed value. `null` and `""` are gaps without a warning. Core `chartNumber` is the one rule every engine uses (RR-54; before it the PPTX exporter stripped non-numeric characters, so `"12%"` exported as 12).\n\nA column is a string or a `DataColumn` with a number format, which the data labels, the value axis and the exported workbook use:\n\n```json\n{\n "chart": {\n "type": "column",\n "data": {\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, { "name": "Margin", "format": "0%" }],\n "rows": [["Q1", 12.4, 0.31], ["Q2", 18.1, 0.34]],\n "source": { "src": "./data/revenue.csv", "retrieved": "2026-10-05" }\n },\n "mapping": { "category": "Quarter", "series": ["Revenue"] }\n }\n}\n```\n\nFormats use the `NumberVariable.format` syntax (`#,##0`, `0.0%`, `$#,##0.00`, `#,##0 units`; a `%` multiplies by 100). `source` records provenance only; engines never read or refresh it. `mapping` picks the category, the X column of a scatter chart and the plotted series by column name; without it the first column is the category and every other column a series. Shared data lives in the top-level `datasets` map and a chart plots it with `"data": { "dataset": "revenue", "fields": ["Quarter", "Revenue"] }`. The full contract, with validation codes and the engine behaviour, is [Chart and table data](chart-table-data.md).\n\nChart data is inline columns and rows or a dataset. A data source by file or asset (`"data": { "src": "asset:revenue-csv", "columns": [...] }`) is not part of the format: no engine loaded it, and the validator rejects it. Import the data inline (with a `source`) or into a dataset instead.\n\n## Table\n\nTable-specific fields are grouped under `table`. Do not put loose `columns` or `rows` directly on a slide or region.\n\n```json\n{\n "title": "Pipeline",\n "table": {\n "columns": ["Stage", "Count", "Value"],\n "rows": [\n ["Qualified", 42, "$1.2M"],\n ["Proposal", 18, "$840K"]\n ]\n }\n}\n```\n\nA table may instead show a dataset: `"table": { "dataset": "revenue", "fields": ["Quarter", "Revenue"] }` (no `rows` or `columns`); it takes its headers, rows and column formats from the dataset, and per-cell styles need an inline table. A column header may be a `DataColumn` (`{ "name": "Revenue", "format": "$#,##0.0" }`) and a styled header or body cell takes a `format`; a number cell displays formatted (the body cell\'s own format wins over the column\'s), and `layoutTable` measures the formatted text. See [Chart and table data](chart-table-data.md).\n\n### Highlighted rows\n\n`table.highlight` names the body rows that carry the message by the text of their first cell, as `chart.highlight` names categories: `"highlight": { "rows": ["Southeast", "Southwest"] }`. The preview and the PPTX export draw those rows on an accent tint of the table surface (15% of the deck\'s primary color, mixed less where the cell text would fall under 4.5:1, core `tableHighlightColor`); a cell with its own `style.fill` keeps it. The export writes the tint as each cell\'s fill, and import restores the list. A name no row has is the validation error `table-highlight-unknown-name`.\n\nWithout `highlight`, a table highlights the rows its slide names (layout harvest LH-113, core `tableSlideFocus`): the title and subtitle first, else what the slide\'s other texts, list entries, quotes and chart alts name together ("Engineering and support carry 70% of the new roles" names the Engineering and Support rows; "Prices rise 3%" names the rows whose cells show 3%). The rules are conservative: a range ("from Q1 to Q4"), a list that names a row in two or more entries, a paragraph over 140 characters that names more than one row, and sources that disagree name nothing, and the focus is never every row. An empty `rows` list turns it off, and so does a body cell with its own fill. [Chart options](chart-options.md) describes the same focus for charts.\n\nTable body cells accept strings, numbers, booleans, or `null`. Since core 0.5.0, a cell or column header also accepts the same `TextRun[]` used by rich text:\n\n```json\n{\n "table": {\n "columns": [["Quarter ", {"text": "growth", "bold": true}], "Value"],\n "rows": [\n [["Up ", {"text": "12%", "color": "#008800"}], 12]\n ]\n }\n}\n```\n\nUse the published Node 24 set (`node scripts/registry-plan.mjs`) and the [compatibility matrix](compatibility-matrix.md) for exact pins and evidence. Core measures run styles when checking overflow and keeps each row intact when paginating. The renderer traces rich cells for the editor\'s existing formatting, typing and undo controls; the exporter emits editable native text runs. PPTX 0.4.0 introduced import of supported native character styles, paragraph defaults, theme fonts/colors, external links and significant whitespace as rich runs. Unstyled body cells remain strings, and cached display text cannot recover original scalar types or live fields. Conditional table styles, merged geometry and cell fills/borders/alignment remain limited; native PowerPoint visual parity is not yet verified.\n\n**Column alignment (LH-117).** A column aligns by how its cells read, not by their JSON type. When at least 75% of its body cells (one column wide, not empty; `TABLE_NUMERIC_SHARE`) read as numbers as they are shown, a number with an optional sign, currency, thousands separators, percent sign, scale or one-word unit (`"$42"`, `"+3%"`, `"14,500"`, `"$1.2M"`, `"50 GB"`, `"(1,200)"`, a JSON number in its format; core `numericText`), every cell of the column, its header too, aligns at the end edge. Every cell of any other column starts at the start edge, a JSON number among words included (`5` beside `"50 GB"` and `"Email"`). Dates, times, fractions and ranges (`"2026-11-02"`, `"10:30"`, `"24/7"`) read as text. A cell\'s own `style.align` wins, then its header\'s `style.align` (the column\'s alignment, for the body cells under it), then the design\'s `contentAlignment`. Right to left, the end of a column of numbers is drawn at the physical right, as before. The preview and the PowerPoint export draw the same alignment (core `layoutTable`), and an unchanged export imports without writing it back.\n\n**Table text size and bold.** Table text draws at the body size (about 19 pt, 25 reference pixels) and the whole table shrinks together toward `composition.minFontSize` when its rows do not fit, so a table next to bullets no longer reads smaller than they do. A run\'s own `fontSize` is drawn as written. `TableCellStyle` takes `bold` to make the whole cell bold; a numeric cell can be bold and still use its number `format` (`{"value": 18.1, "style": {"bold": true}}`), and a cell written as runs in a numeric column keeps the column\'s alignment.\n\nA table may carry an `alt` (FA-27), the same text alternative as `Chart.alt`: one or two sentences that say what the table shows (the point and the key numbers), not "a table". The preview names the table with it (a `role="group"` with `aria-label`; the cells stay readable) and the PowerPoint export writes it as the table frame\'s alternative text (`descr`), which `fromPptx` reads back. `"alt": ""` hides a purely decorative table, as an empty image `alt` does. Unlike a chart, a table needs no `alt`: a screen reader reads a native table cell by cell, so `validate` reports nothing when it is missing, and a table beside a chart still counts as that chart\'s text alternative. The `alt` is a summary read before the cells, which stay readable text (in PowerPoint too, where `descr` on a table frame does not hide its cells), so it is most useful for a large or dense table.\n\nCore 0.6.0 adds `layoutTable` from `@openpresentation/opf/composition`. It measures scalar and rich cells, keeps short rows compact, and gives wrapped or multiline rows the height they need. When space is constrained it reduces spare row height before shrinking text, and reports overflow when the minimum fitting size cannot fit. Pass the same `scale`, font family, measurement provider and effective `minFontSize` to each consumer. The returned row boxes, cell text boxes and fits are shared by the coordinated SVG and PPTX implementations; rich table cells use uniform line advances to match native cell paragraph spacing. Native viewer fidelity remains a separate verification boundary.\n\n## Captions\n\nAn `image`, `chart`, `table`, `video` or `diagram` payload takes a `caption`: a string, `TextRun[]`, or `{ "text", "position": "below" | "above", "align": "start" | "center" | "end" }` (defaults `below`, `start`). It sits beside the payload field on a block or promoted-region payload, or on the slide root when the root holds exactly one of those payloads; anywhere else it is a `caption-unsupported-payload` error.\n\n```json\n{\n "title": "Pipeline",\n "blocks": [\n { "image": "asset:funnel", "caption": "Figure 1. Pipeline by stage, Q3" },\n { "table": { "columns": ["Stage", "Count"], "rows": [["Qualified", 42]] }, "caption": { "text": "Table 1. Counts", "position": "above", "align": "center" } }\n ]\n}\n```\n\nCore composition reserves the caption band inside the block\'s region and shrinks the media by its height (`item.caption` carries the band, `item.box` is the media box); the preview and the PPTX export draw that band in the muted text colour at the caption size (0.6 of the body size, never under the readable floor). Captioned blocks are the only ones whose geometry changes. See [footnotes, citations and captions](footnotes-citations-captions.md).\n\n**Name and detail (LH-138).** A picture\'s caption that is one plain string with a colon and a space after one to six words and a detail after it ("Before: loose boxes, tape and paper") draws the words up to the first colon in bold and the detail in the regular weight, as Claude Design draws a pair of before and after pictures or a gallery of sites. A colon inside a word ("10:30", "https://") never splits, a caption written as `TextRun[]` stays as the author formatted it, and a chart, table, video or diagram caption is not split. The document is unchanged: core composes the caption as runs (`item.caption.text`), and the preview and the PowerPoint export draw them.\n\n## Code\n\nCode-specific fields are grouped under `code`. A string value is shorthand for `code.source`; use object form when syntax highlighting or a file label matters. In object form, `source` is required. `language` colours the code in the preview and the PowerPoint export (comments, strings, numbers, keywords, names and types, in colours from the deck theme); an unknown language stays plain and the text is never changed. See [dynamic composition](dynamic-composition.md#preview-polish-shared-by-preview-and-export-rr-07) for the supported languages.\n\n```json\n{\n "title": "Decision Rule",\n "code": {\n "source": "if risk > threshold:\\n escalate(owner)\\nelse:\\n approve(change)",\n "language": "python",\n "filename": "decision.py"\n }\n}\n```\n\n## Metric\n\nMetric-specific fields are grouped under `metric`. A string or number value is shorthand for `metric.value`; numeric values stay numeric and are formatted by renderers at display time (LH-141: a numeric `value` of four integer digits or more prints with its thousands grouped by the deck language, "6,240" or "6.240" in German; LH-106: every numeric `value` and `delta` is in the language\'s own digits, "\u0669\u0669\u0669" and "\u0661,\u0660\u0660\u0660" in `ar-SA`, or Latin ones with `ar-SA-u-nu-latn`; a string value is printed as written). Use object form when labels, descriptions, units, deltas, trends, or sentiment matter. A `trend` (`up`, `down`, `flat`) draws an arrow before the delta on its line ("\u2191 +7 pts"), or before the label without a delta, colored with the delta text, in the preview and the PowerPoint export (LH-53); the arrow always points the way the trend does, and its color follows `sentiment` (`positive` green, `negative` red, `neutral` the neutral text color). When `sentiment` is absent up is positive, down is negative and flat is neutral, so set it when the direction is not the verdict: a falling churn, cost or latency is `"trend": "down", "sentiment": "positive"`. Only the trend arrow and the delta text take the color, so `sentiment` has no visible effect on a metric without a `trend`. The trend word is not drawn in any language: it is the arrow\'s alternative text ("Trend: up") and stays in the source, which is where it is edited (see [dynamic composition](dynamic-composition.md#preview-polish-shared-by-preview-and-export-rr-07)).\n\nThe `metrics` v2 layout accepts metric blocks in its body region and flows them as a grid. For several metrics, use separate `{ "metric": ... }` entries in `blocks`; the content kind and payload key are `metric`. Choosing a layout does not reinterpret existing text as numeric data.\n\n```json\n{\n "title": "Operating Metric",\n "metric": {\n "value": "42%",\n "label": "Review cycle reduction",\n "description": "Median reduction across customer review workflows.",\n "delta": "+11 pts",\n "trend": "up"\n }\n}\n```\n\nA falling value that is good news keeps its downward arrow and takes the green:\n\n```json\n{\n "title": "Churn",\n "metric": {\n "value": "3.1%",\n "label": "Monthly churn",\n "delta": "-0.6 pts",\n "trend": "down",\n "sentiment": "positive"\n }\n}\n```\n\n## Quote\n\nQuote-specific fields are grouped under `quote`. A string value is shorthand for `quote.text`; use object form when attribution or citation matters. `text` is a string or `TextRun[]` with inline formatting; `attribution`, `role` and `source` are plain strings.\n\n```json\n{\n "title": "Customer Proof",\n "quote": {\n "text": "The new workflow made exceptions visible before they became escalations.",\n "attribution": "Priya Raman",\n "source": "Customer interview"\n }\n}\n```\n\nA testimonial attributes the quote to a person with a title and a face. `role` is the person\'s title and organization, and `photo` is their headshot, an `Asset` (a source string or an object with `src` and `alt`):\n\n```json\n{\n "title": "Customer Proof",\n "quote": {\n "text": "The new workflow made exceptions visible before they became escalations.",\n "attribution": "Priya Raman",\n "role": "VP Operations, Acme",\n "photo": { "src": "asset:priya-raman", "alt": "Priya Raman" },\n "source": "Customer interview, March 2026"\n }\n}\n```\n\nThe footer under the quote is the attribution, then the role on its own line, then the source after ` - ` on the last line. Without a `role` it is the single line it always was (`attribution - source`). With a `photo`, the headshot is a circle at the start edge of the footer row (the left in a left-to-right deck, the right in a right-to-left one), three times the footer font size across, and the footer lines sit beside it, centered on it. The photo is cropped to fill the circle, and its size follows the footer\'s font size when the readability floor shrinks the footer. Without a `photo` nothing else changes. The preview draws it with the circular clip that an image block uses for shape `circle`, and PowerPoint export writes a native picture with the `ellipse` geometry and the alt text as its description; importing that file restores `role` and `photo`. A photo needs alt text (the `opf/missing-alt-text` rule of `validate` checks `quote.photo`); an SVG photo exports as its PNG raster.\n\n**A quote card\'s mark (LH-78).** A quote beside other blocks on a card draws a decorative quotation mark at the start edge of the card\'s top (the left in a left-to-right deck, the right in a right-to-left one), in the primary color (the text color where the primary reads under 4.5:1 on the card), bold, up to 1.5 times the size of the quote\'s text. It is drawn in the card\'s own padding between the card\'s top edge and the text, at the largest step (1.5, 1.25, 1 times the text size) whose ink fills at most 70% of that padding, and a card with less padding than that draws none. Nothing moves and no size changes: the mark never takes room from the quote, so the quote keeps the size the size guard gave it. The mark stands for the quote\'s own opening quotation mark, so where it draws that opening mark is not drawn (in the drawing only: the document text is unchanged, the closing mark stays, and the body is fitted again without the mark at its size, never to more lines); in a language whose opening mark is low (\u201E \xAB, a corner bracket or a right-only mark) the same holds. The cards of one slide draw their marks together or not at all. The mark is the language\'s opening quotation mark (a low one is drawn as the high English mark), `QuoteLayout.mark` in core; the PowerPoint export writes it as one native text box tagged into the quote\'s group as decoration, records that the opening mark was hidden (`hiddenOpen` in the quote\'s manifest), and import consumes the mark and puts the opening mark back, so the authored text returns.\n\nA testimonial with room draws the photo as a tall portrait beside the quote instead (LH-132, as Claude Design sets a customer story): when the quote is at least 640 px wide (a quote alone on its slide, not three side by side or a quote beside other blocks), the picture takes 26% of its width at the start edge, at most 0.7 as wide as tall and never taller than the quote, rounded as a card is and cropped around the upper third, and the quote\'s text sits beside it, 40 px away and centered against it. The body and the footer keep the size they have beside the avatar (the body may take another line in the empty height); where they would not, the picture takes a narrower share, down to 72 px, and then the quote keeps the avatar. `portrait: "side"` asks for the portrait whatever the width (its text then fits what is left), `portrait: "avatar"` keeps the circle. Both engines draw core\'s frame (`QuoteLayout.photo` with its `focus`): the preview clips the picture to the rounded outline, PowerPoint writes a `roundRect` picture cropped with `a:srcRect`. A photo with no attribution, role or source still draws, alone in the footer row. The Markdown dialect has no native form for `role` and `photo`: a quote that carries them is written as an `opf` block, which round trips exactly, and a plain `> \u2014 Name, Title` line stays an attribution.\n\n## Timeline\n\nTimeline-specific fields are grouped under `timeline`. An array value is shorthand for `timeline.events`; use object form when the timeline needs a name or description. Timeline events use `when`, `what`, `description` and `status`. `status` is `done`, `current` or `planned` and marks progress: `done` is a filled marker with normal text, `current` ("we are here") is a ringed marker with a bold label, and `planned` is a hollow outlined marker with muted text. An event without a status draws as a plain filled marker. The connector is drawn in the primary color up to the current event (to the last done one when none is current), and a deck with a supported localized vocabulary adds a status word under each label when the timeline keeps its size with them. English uses Done, Current and Planned. Regional variants share their language vocabulary; Chinese scripts have distinct words. Unsupported generated translations keep the status markers and progress without inserting English, and authored event text stays intact. See [localized status words](dynamic-composition.md#localized-timeline-status-words). Schedule health (at risk, blocked) is not a status; say it in the event text. See [Dynamic composition](dynamic-composition.md#timeline-internals) for the exact drawing.\n\n```json\n{\n "title": "Rollout Plan",\n "timeline": {\n "name": "Regional Rollout",\n "description": "Major milestones for the rollout.",\n "events": [\n {\n "when": "Q1",\n "what": "Pilot",\n "description": "Launch with one operations team."\n },\n {\n "when": "Q2",\n "what": "Rollout",\n "description": "Expand to all regions."\n }\n ]\n }\n}\n```\n\nA roadmap with progress states:\n\n```json\n{\n "title": "Product roadmap",\n "timeline": [\n { "when": "Q1", "what": "Discovery", "status": "done" },\n { "when": "Q2", "what": "Pilot", "status": "current" },\n { "when": "Q3", "what": "Rollout", "status": "planned" }\n ]\n}\n```\n\n## Diagram\n\nThe [diagrams guide](diagrams.md) covers when to use one, the supported Mermaid families, styling, sizing and export in full; this section is the field reference.\n\nA `diagram` is a diagram written as text: [Mermaid](https://mermaid.js.org) source (Mermaid 12.1 syntax) , a [Graphviz DOT](diagrams.md#graphviz-dot) graph or a [PlantUML](diagrams.md#plantuml) diagram, drawn by the engines in the deck\'s own fonts and colors. A string is shorthand for `{ "source": value }` (Mermaid); the object form takes `source`, `syntax` (`"mermaid"`, the default, `"dot"` or `"plantuml"`) and `alt`. It is a root payload, a block or a promoted region, and a region of a layout template that accepts `diagram` takes it. The first line of the source names the diagram type; the built-in families are flowchart, sequence, class, state, ER, gantt, pie, quadrant, mindmap, timeline, journey, xychart, sankey, gitGraph, C4, block, architecture, kanban, packet, radar, treemap, venn, ishikawa, requirement, railroad, wardley, cynefin, treeView, eventmodeling, usecase, swimlane, agentflow and info. ZenUML is not supported. The drawing is done by [pele](https://pele.run) (MIT, no runtime dependencies, synchronous and DOM-free), so the preview, the PDF and the PPTX export need no browser. A DOT graph is read by OPF itself and laid out in layers by pele; a `layout` other than `dot` (neato, fdp, circo, twopi, ...) is refused with a finding. A PlantUML diagram is read by OPF too and drawn as the Mermaid family of its kind (sequence, class, state, activity, use case, component, mind map, gantt); other kinds and the preprocessor are refused with a finding.\n\n```json\n{\n "title": "Reviews decide what ships",\n "diagram": {\n "source": "flowchart LR\\n A[Brief] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| A",\n "alt": "A brief goes to review; approved work is built, rejected work returns to the brief."\n },\n "caption": "Figure 1. The review loop"\n}\n```\n\n- **Engines.** Core lays the diagram out with the deck\'s measured fonts at the largest size that fits its block (never under the readability floor, else a `text-overflow` finding) and paints it in the slide\'s colors and fonts; see [sizing](diagrams.md#sizing) and [how the deck styles a diagram](diagrams.md#how-the-deck-styles-a-diagram).\n- **`alt`.** The text alternative; without it engines derive one from the diagram type and its labels ([accessibility](diagrams.md#accessibility)). A diagram takes a `caption` like an image, chart, table or video.\n- **Errors.** A source that cannot be parsed is a finding with its line and column, and draws a "Diagram unavailable" placeholder ([errors and limits](diagrams.md#errors-and-limits)).\n- **PPTX and Markdown.** A native SVG picture over a PNG fallback that re-imports as the diagram ([exports](diagrams.md#exports)); a ```` ```mermaid ````, ```` ```dot ```` or ```` ```plantuml ```` fence in [Markdown](markdown.md).\n\nChoose the payload by what the content is: `chart` for numbers plotted on axes, `timeline` for dated or ordered events with a status, `diagram` for structure and flow (steps, systems, relationships, states, hierarchies) that Mermaid can draw. A Mermaid `pie` or `timeline` diagram is a quick picture; a `chart` or `timeline` payload keeps the data editable and gets the engines\' chart and timeline design.\n\n## Regions\n\nRegion keys address a 3\xD73 grid of rows (`top`, `middle`, `bottom`) and columns (`start`, `center`, `end`). The columns follow the deck\'s direction: `start` is the left column in a left-to-right deck and the right column in a right-to-left deck (see [Right-to-left decks](dynamic-composition.md#right-to-left-decks)).\n\n```\n start center end\n +--------------------+--------------------+--------------------+\n top | top:start | top:center | top:end |\n +--------------------+--------------------+--------------------+\n middle | middle:start | middle:center | middle:end |\n +--------------------+--------------------+--------------------+\n bottom | bottom:start | bottom:center | bottom:end |\n +--------------------+--------------------+--------------------+\n```\n\n- A bare column key (`start`) spans all three rows; a bare row key (`top`) spans all three columns.\n- `+` spans adjacent rows or columns: `center+end`, `top+middle`.\n- `row:column` combines the two: `top:start`, `middle+bottom:center+end`.\n- Keys on one slide must not overlap, and regions cannot be mixed with root payload fields.\n\nSpans compose into common slide shapes:\n\n```\n "start" + "center+end" "top" + "middle+bottom"\n (sidebar + main) (headline band + body)\n +----------+------------------+ +-------------------------------+\n | | | | top |\n | | | +-------------------------------+\n | start | center+end | | |\n | | | | middle+bottom |\n | | | | |\n +----------+------------------+ +-------------------------------+\n\n "top" + "middle+bottom:start" + "middle+bottom:center+end"\n (headline band, then sidebar + main)\n +---------------------------------------------+\n | top |\n +---------------+-----------------------------+\n | | |\n | middle+bottom | middle+bottom:center+end |\n | :start | |\n | | |\n +---------------+-----------------------------+\n```\n\nThe same payload objects work inside regions \u2014 here, the sidebar-plus-main shape:\n\n```json\n{\n "title": "Operating Snapshot",\n "start": {\n "table": {\n "columns": ["Metric", "Value"],\n "rows": [\n ["Revenue", "$4.2M"],\n ["Gross margin", "68%"]\n ]\n }\n },\n "center+end": {\n "chart": {\n "type": "line",\n "data": {\n "columns": ["Month", "Revenue"],\n "rows": [\n ["Jan", 3.4],\n ["Feb", 3.8],\n ["Mar", 4.2]\n ]\n }\n }\n }\n}\n```\n\n## Accessibility of the preview\n\nThe SVG preview and the PowerPoint export agree on what a reader can reach. The slide root is a labelled container (`role="group"`, `aria-roledescription="slide"`, `aria-label` set to the slide title), never an image: an image makes everything inside it presentational, so a screen reader would hear only the title. Text stays reachable, in the order it is drawn: tag, title and subtitle, the content in layout order, footnotes, then header and footer. That covers body text, list entries, quotes, metric values and labels, table cells, timeline entries, captions and furniture text.\n\nA picture with `alt` is an image with that name. Purely decorative drawing is hidden (`aria-hidden`): the background and its overlay, card frames, table cell fills and borders, dividers, timeline markers, watermarks, list bullets, a picture or chart whose `alt` is `""`, and a header or footer picture without `alt` (a logo repeated on every slide). A chart with `alt` is an image with that name, and its drawn marks are not announced separately. The deck element, the player and `renderDeckHtml` in `@openpresentation/opf-render` put the one slide container (region or figure) around the drawing, so a slide is announced once.\n\nTesting status (opf-render#170): this contract is the DOM and ARIA structure. It is checked with axe-core, the browser\'s accessibility tree and focus-order assertions, and it is **not tested with assistive technology**: no screen reader (NVDA, JAWS, VoiceOver, TalkBack) has been run against the preview, the deck element or the player (owner decision 2026-10-10). Forced colors are verified with Chromium\'s emulation only, not the Windows contrast theme (evidence).\n'
57
+ "markdown": '# Content Payloads\n\nSlide content lives directly on a slide as a full-slide payload, in layout-agnostic `blocks`, or inside a promoted region key such as `start`, `center+end`, or `top:start`.\n\nThe slide-level `title`, `subtitle` and `tag` are not payloads, but like `text` and `quote.text` they accept a string or `TextRun[]` (colored words, bold, links, `cite`/`footnote` markers); see [Rich text](rich-text.md#rich-headings-and-quotes).\n\n**Run-in headings (LH-63).** A plain `text` whose first line is 40 characters or fewer, ends where the author broke the line and has a body after it that is longer than the line, draws that line as a bold heading over its body ("Option A: focused pilot" over its two sentences), as Claude Design sets the options of a comparison. A text with no such line whose first line opens with a short "Label:" (one to six words, under 40 characters, then a space and a detail) draws the label in bold. A first line that ends a sentence or opens a list entry is body text, and a text written as `TextRun[]` stays as the author formatted it. The document is unchanged: core composes the text as runs of the same characters (`item.runs`), the guarded rule `run-in` keeps them only when no text on the slide reads smaller than as written, and the preview and the PowerPoint export draw them. A text in LH-06\'s foot band or pill draws as written.\n\nThe optional payload `type` can make intent explicit, but OPF should usually infer the content kind from the field present:\n\n| Field | Inferred type | Notes |\n| --- | --- | --- |\n| `text` | `text` | Plain string or `TextRun[]`. |\n| `bullets` | `text` | Prose bullets: plain talking points, usually `string[]`. |\n| `items` | `list` | Structured list: entries that share a shape or carry a `description`; `string[]` or `ListItem[]`. See [items versus bullets](#items-versus-bullets). |\n| `image` | `image` | Asset string shorthand or an image object with `src`, optional metadata and `callouts` (plain text panels over the picture). |\n| `video` | `video` | Asset reference shown as a media placeholder; an HTTP(S) source links from the PPTX. No embedded playback. See [Video references](#video-references). |\n| `chart` | `chart` | Chart object with `type` and tabular `data`. |\n| `table` | `table` | Table object with optional `columns` and required `rows`. |\n| `code` | `code` | String shorthand or `Code` object with `source`, `language`, `filename`, and `highlight`. |\n| `metric` | `metric` | String/number shorthand or `Metric` object with `value`, `label`, `description`, `unit`, `delta`, `trend`, and `sentiment`. |\n| `quote` | `quote` | String shorthand or `Quote` object with `text` (string or `TextRun[]`), `attribution`, `role`, `photo`, and `source`. |\n| `timeline` | `timeline` | Array shorthand or `Timeline` object with `name`, `description`, and `events`. |\n| `diagram` | `diagram` | Mermaid source string shorthand or `Diagram` object with `source`, `syntax` and `alt`. See [Diagram](#diagram). |\n\n## Video references\n\nA `video` accepts an asset string or an `Asset` object with `src` and optional metadata. The preview draws a media placeholder with a play badge and a caption, not a player. The caption is the video\'s title, else its source, else "Media"; an `asset:` reference is followed to the registry entry first (a title written on the value wins), so the caption is never the asset id (RR-105). PPTX export writes the same editable shapes and caption, with a hyperlink when the resolved source is HTTP(S); local references remain captions. It does not fetch or embed a video file or create a YouTube/Vimeo player. MP4/WebM sources are references, not playable media inside the exported deck. Keep that limitation beside any video example.\n\n## Items versus bullets\n\nBoth fields draw the same bulleted (or numbered) list: one marker, the same nesting `level`, rich-text entries and `numbering`, fitted by the same list engine. Nothing about the drawing differs. They differ in the kind they infer and in what an entry may carry:\n\n| | `bullets` | `items` |\n| --- | --- | --- |\n| Inferred kind | `text` | `list` |\n| Entry | string, `TextRun[]` or `{ text, level, start }` | string, `TextRun[]` or `{ text, description, level, start, icon, assistant, overlap }` (`assistant`: an org chart\'s assistant; `overlap`: the label of a Venn\'s common overlap; see [Trees and set overlap](smartart.md#trees-and-set-overlap-sh-21)) |\n| `description` | not allowed (a schema error) | supporting detail drawn under the entry |\n| Beside `text` in one block or region | allowed | an error (`list` and `text` are different kinds) |\n\n**The rule.** Use `bullets` for plain talking points: short lines that each stand alone. Use `items` when the entries share a shape (features, steps, options, risks) or any entry needs a `description`; never fold a heading and its detail into one string with a separator, that is what `description` is for. When in doubt, use `items`, because it can grow a `description` later without changing the payload kind. The editor helper `convertListForm` switches a payload between the two; going to `bullets` drops the descriptions.\n\n**How entries draw.** A nested entry steps in by one marker width. The bullets alternate `\u2022` and an en dash `\u2013` by level (`\u2022` at level 0, `\u2013` at 1, `\u2022` at 2), as PowerPoint\'s default levels do: glyphs every bundled face has (`\u25E6` and `\u25AA` are missing from most of them, Roboto among them, and drew as a missing-glyph box). A description draws under its entry at 0.82 of the list size in the secondary text color. A list of exactly one entry that has a description, with no `numbering`, draws as a heading over its text: the entry bold at 1.25 times the list size with no bullet and no indent, the description at the list size. The preview and the PowerPoint export draw the same.\n\nDo not give one payload both. In a block or a promoted region, `items` next to `bullets` is the error "content payload mixes fields from incompatible content types". At slide root it validates, as the shorthand for two blocks, and composes as two lists side by side; write two blocks on purpose if you want that. `numbering` applies to every list in the payload.\n\nA layout\'s placeholder kind (`list` or `text`) is what layout pickers match on (`layoutContent`), but composition does not refuse the other field and draws both the same way: the choice states what the content is, it is not a switch for the look.\n\n## Code highlight\n\n`code.highlight` marks lines of a code block: a line number or an inclusive `[start, end]` range, 1-based, for example `[3, [5, 7]]`. Lines are counted by line break in `code.source`; a line that wraps is still one line. The preview and the PPTX export draw a theme-derived band behind the marked lines and dim the others slightly; every line keeps at least 4.5:1 contrast against what it sits on (`codeHighlightColors`). The PPTX export draws one native rectangle per run of marked lines behind the per-line text boxes, and import restores `highlight` from the code provenance tag. A line past the last line, or a range written end before start, is the validation warning `code-highlight-out-of-range` or `code-highlight-range-reversed`, and engines ignore it. Pagination keeps each page\'s marked lines, renumbered from 1.\n\n## Color references\n\nEvery content color field \u2014 `TextRun.color`, styled table cell `style.fill` and `style.color`, and table cell border `color` \u2014 accepts three forms:\n\n- A literal hex color: `"#0F172A"`, `"#B42318CC"`.\n- A color-scheme slot or role name, resolved through the effective color scheme after design resolution: slots `accent1`\u2013`accent6`, `dark1`, `dark2`, `light1`, `light2`, `hyperlink`, `followedHyperlink`; roles `primary`, `secondary`, `accent`, `background`, `surface`, `surfaceAlt`, `text`, `textSecondary`. `surfaceAlt` is the alternate surface for banded table rows: core derives it from `surface` and `text` (`surfaceAltColor`), so it always differs visibly from the `surface` of the plain rows, on light and dark slides, and body text keeps 4.5:1 on it.\n- A variable reference `var:<id>` into the top-level `variables` map.\n\n```json\n{\n "variables": { "risk": "#B42318" },\n "slides": [\n {\n "title": "What Could Go Wrong",\n "items": [\n ["Two regions at ", { "text": "85% utilization", "color": "var:risk", "bold": true }],\n ["Mitigations ship in ", { "text": "November", "color": "accent2" }]\n ]\n }\n ]\n}\n```\n\nPrefer names and variables over literal hex: re-theming the deck updates every named reference, while a hex value stays frozen at authoring time. An unknown `var:` id is a validation warning, never an error; engines fall back to their default text color. The styled table cell and border color fields enforce the three forms at the schema level; run colors additionally accept any string so imported decks keep validating \u2014 unrecognized values warn, and renderers fall back to the theme color. See [`design-resolution.md`](./design-resolution.md) for the resolution rules.\n\n## Numbered lists\n\n`numbering` on an `items` or `bullets` payload draws numbers instead of bullets: a style name (`arabic`, `roman-upper`, `roman-lower`, `alpha-upper`, `alpha-lower`), a `{ style, start, suffix }` object, or an array with one entry per list level. PowerPoint export writes native auto-numbers and the preview draws the same numbers. See [numbered lists](numbered-lists.md).\n\n```json\n{ "items": ["Define", "Build", "Ship"], "numbering": { "style": "roman-lower", "suffix": "paren" } }\n```\n\n## Blocks\n\nUse slide-level `blocks` when a slide contains multiple content payloads, but exact placement should be inferred by the renderer. Blocks may contain a concrete content payload or a nested group with its own `blocks` and optional `composition`. Groups cannot mix child blocks with leaf payload fields. See [dynamic composition](dynamic-composition.md) for nesting and inheritance rules.\n\nMark the one block or group that carries the slide\'s takeaway with `"emphasis": true`: it is drawn on a contrasting card (a dark card on a light slide, an accent card on a dark one) whose text reads at 4.5:1 or more. A slide has one emphasis; without one, a short last text after longer blocks is drawn as a band at the foot of the body, and a very short one after a lone long text as a pill (`"emphasis": false` opts a block out). See [Emphasis surface](dynamic-composition.md#emphasis-surface-lh-06).\n\n```json\n{\n "title": "Customer Feedback Summary",\n "blocks": [\n {\n "table": {\n "columns": ["Theme", "Mentions"],\n "rows": [\n ["Speed", 42],\n ["Ease of use", 31]\n ]\n }\n },\n {\n "quote": {\n "text": "The new workflow cut review time in half.",\n "attribution": "Operations Lead",\n "source": "Customer interview"\n }\n }\n ]\n}\n```\n\nAt slide root only, multiple content payload kinds are accepted as shorthand for the equivalent blocks form when there is no explicit `type`, no `blocks`, and no promoted region keys:\n\n```json\n{\n "title": "Habitat & Territory",\n "text": "Jaguars are strongly associated with presence of water and dense cover.",\n "items": [\n "Primary habitats include dense rainforests, swamps, and seasonally flooded wetlands.",\n "Solitary animals that establish and defend large territories."\n ]\n}\n```\n\nThe same shorthand works for other content kinds:\n\n```json\n{\n "title": "Evidence Snapshot",\n "chart": {\n "type": "line",\n "data": {\n "columns": ["Quarter", "Sightings"],\n "rows": [\n ["Q1", 12],\n ["Q2", 18]\n ]\n }\n },\n "quote": {\n "text": "Jaguar conservation depends on connected habitat.",\n "attribution": "Field researcher"\n }\n}\n```\n\n## Chart\n\nChart-specific fields are grouped under `chart`. Do not put loose chart data directly on a slide or region.\n\n```json\n{\n "title": "Revenue Trend",\n "chart": {\n "type": "line",\n "data": {\n "columns": ["Quarter", "Revenue", "Costs"],\n "rows": [\n ["Q1", 12, 8],\n ["Q2", 18, 11],\n ["Q3", 24, 15]\n ]\n }\n }\n}\n```\n\nInline chart data is tabular by default. Renderers convert `columns` and `rows` into series, axes, legends, and workbook data internally.\n\nGive every chart an `alt`: one or two sentences that say what the data shows (the point and the key numbers), not "a chart" or "bar chart". The preview names the chart with it (`role="img"`, `aria-label`) and the PowerPoint export writes it as the chart frame\'s alternative text (`descr`), which `fromPptx` reads back. `"alt": ""` marks a chart decorative, as an empty image `alt` does; `validate` (`opf/chart-text-alternative`) still reports it as info so the choice is reviewed. Without `alt`, text beside the chart (a subtitle, text or table) satisfies the rule. See [chart options](chart-options.md#text-alternative).\n\nValue cells are numbers. A string is read only in strict decimal syntax (`"12"`, `" -3.5 "`, `"1e6"`); anything else (`"12%"`, `"$5"`, `"(5)"`, `"1,234"`, `"Q1"`) is a gap in the preview and the export and a `chart-value-not-numeric` warning, never a guessed value. `null` and `""` are gaps without a warning. Core `chartNumber` is the one rule every engine uses (RR-54; before it the PPTX exporter stripped non-numeric characters, so `"12%"` exported as 12).\n\nA column is a string or a `DataColumn` with a number format, which the data labels, the value axis and the exported workbook use:\n\n```json\n{\n "chart": {\n "type": "column",\n "data": {\n "columns": ["Quarter", { "name": "Revenue", "format": "$#,##0.0" }, { "name": "Margin", "format": "0%" }],\n "rows": [["Q1", 12.4, 0.31], ["Q2", 18.1, 0.34]],\n "source": { "src": "./data/revenue.csv", "retrieved": "2026-10-05" }\n },\n "mapping": { "category": "Quarter", "series": ["Revenue"] }\n }\n}\n```\n\nFormats use the `NumberVariable.format` syntax (`#,##0`, `0.0%`, `$#,##0.00`, `#,##0 units`; a `%` multiplies by 100). `source` records provenance only; engines never read or refresh it. `mapping` picks the category, the X column of a scatter chart and the plotted series by column name; without it the first column is the category and every other column a series. Shared data lives in the top-level `datasets` map and a chart plots it with `"data": { "dataset": "revenue", "fields": ["Quarter", "Revenue"] }`. The full contract, with validation codes and the engine behaviour, is [Chart and table data](chart-table-data.md).\n\nChart data is inline columns and rows or a dataset. A data source by file or asset (`"data": { "src": "asset:revenue-csv", "columns": [...] }`) is not part of the format: no engine loaded it, and the validator rejects it. Import the data inline (with a `source`) or into a dataset instead.\n\n## Table\n\nTable-specific fields are grouped under `table`. Do not put loose `columns` or `rows` directly on a slide or region.\n\n```json\n{\n "title": "Pipeline",\n "table": {\n "columns": ["Stage", "Count", "Value"],\n "rows": [\n ["Qualified", 42, "$1.2M"],\n ["Proposal", 18, "$840K"]\n ]\n }\n}\n```\n\nA table may instead show a dataset: `"table": { "dataset": "revenue", "fields": ["Quarter", "Revenue"] }` (no `rows` or `columns`); it takes its headers, rows and column formats from the dataset, and per-cell styles need an inline table. A column header may be a `DataColumn` (`{ "name": "Revenue", "format": "$#,##0.0" }`) and a styled header or body cell takes a `format`; a number cell displays formatted (the body cell\'s own format wins over the column\'s), and `layoutTable` measures the formatted text. See [Chart and table data](chart-table-data.md).\n\n### Highlighted rows\n\n`table.highlight` names the body rows that carry the message by the text of their first cell, as `chart.highlight` names categories: `"highlight": { "rows": ["Southeast", "Southwest"] }`. The preview and the PPTX export draw those rows on an accent tint of the table surface (15% of the deck\'s primary color, mixed less where the cell text would fall under 4.5:1, core `tableHighlightColor`); a cell with its own `style.fill` keeps it. The export writes the tint as each cell\'s fill, and import restores the list. A name no row has is the validation error `table-highlight-unknown-name`.\n\nWithout `highlight`, a table highlights the rows its slide names (layout harvest LH-113, core `tableSlideFocus`): the title and subtitle first, else what the slide\'s other texts, list entries, quotes and chart alts name together ("Engineering and support carry 70% of the new roles" names the Engineering and Support rows; "Prices rise 3%" names the rows whose cells show 3%). The rules are conservative: a range ("from Q1 to Q4"), a list that names a row in two or more entries, a paragraph over 140 characters that names more than one row, and sources that disagree name nothing, and the focus is never every row. An empty `rows` list turns it off, and so does a body cell with its own fill. [Chart options](chart-options.md) describes the same focus for charts.\n\nTable body cells accept strings, numbers, booleans, or `null`. Since core 0.5.0, a cell or column header also accepts the same `TextRun[]` used by rich text:\n\n```json\n{\n "table": {\n "columns": [["Quarter ", {"text": "growth", "bold": true}], "Value"],\n "rows": [\n [["Up ", {"text": "12%", "color": "#008800"}], 12]\n ]\n }\n}\n```\n\nUse the published Node 24 set (`node scripts/registry-plan.mjs`) and the [compatibility matrix](compatibility-matrix.md) for exact pins and evidence. Core measures run styles when checking overflow and keeps each row intact when paginating. The renderer traces rich cells for the editor\'s existing formatting, typing and undo controls; the exporter emits editable native text runs. PPTX 0.4.0 introduced import of supported native character styles, paragraph defaults, theme fonts/colors, external links and significant whitespace as rich runs. Unstyled body cells remain strings, and cached display text cannot recover original scalar types or live fields. Conditional table styles, merged geometry and cell fills/borders/alignment remain limited; native PowerPoint visual parity is not yet verified.\n\n**Column alignment (LH-117).** A column aligns by how its cells read, not by their JSON type. When at least 75% of its body cells (one column wide, not empty; `TABLE_NUMERIC_SHARE`) read as numbers as they are shown, a number with an optional sign, currency, thousands separators, percent sign, scale or one-word unit (`"$42"`, `"+3%"`, `"14,500"`, `"$1.2M"`, `"50 GB"`, `"(1,200)"`, a JSON number in its format; core `numericText`), every cell of the column, its header too, aligns at the end edge. Every cell of any other column starts at the start edge, a JSON number among words included (`5` beside `"50 GB"` and `"Email"`). Dates, times, fractions and ranges (`"2026-11-02"`, `"10:30"`, `"24/7"`) read as text. A cell\'s own `style.align` wins, then its header\'s `style.align` (the column\'s alignment, for the body cells under it), then the design\'s `contentAlignment`. Right to left, the end of a column of numbers is drawn at the physical right, as before. The preview and the PowerPoint export draw the same alignment (core `layoutTable`), and an unchanged export imports without writing it back.\n\n**Table text size and bold.** Table text draws at the body size (about 19 pt, 25 reference pixels) and the whole table shrinks together toward `composition.minFontSize` when its rows do not fit, so a table next to bullets no longer reads smaller than they do. A run\'s own `fontSize` is drawn as written. `TableCellStyle` takes `bold` to make the whole cell bold; a numeric cell can be bold and still use its number `format` (`{"value": 18.1, "style": {"bold": true}}`), and a cell written as runs in a numeric column keeps the column\'s alignment.\n\nA table may carry an `alt` (FA-27), the same text alternative as `Chart.alt`: one or two sentences that say what the table shows (the point and the key numbers), not "a table". The preview names the table with it (a `role="group"` with `aria-label`; the cells stay readable) and the PowerPoint export writes it as the table frame\'s alternative text (`descr`), which `fromPptx` reads back. `"alt": ""` hides a purely decorative table, as an empty image `alt` does. Unlike a chart, a table needs no `alt`: a screen reader reads a native table cell by cell, so `validate` reports nothing when it is missing, and a table beside a chart still counts as that chart\'s text alternative. The `alt` is a summary read before the cells, which stay readable text (in PowerPoint too, where `descr` on a table frame does not hide its cells), so it is most useful for a large or dense table.\n\nCore 0.6.0 adds `layoutTable` from `@openpresentation/opf/composition`. It measures scalar and rich cells, keeps short rows compact, and gives wrapped or multiline rows the height they need. When space is constrained it reduces spare row height before shrinking text, and reports overflow when the minimum fitting size cannot fit. Pass the same `scale`, font family, measurement provider and effective `minFontSize` to each consumer. The returned row boxes, cell text boxes and fits are shared by the coordinated SVG and PPTX implementations; rich table cells use uniform line advances to match native cell paragraph spacing. Native viewer fidelity remains a separate verification boundary.\n\n## Captions\n\nAn `image`, `chart`, `table`, `video` or `diagram` payload takes a `caption`: a string, `TextRun[]`, or `{ "text", "position": "below" | "above", "align": "start" | "center" | "end" }` (defaults `below`, `start`). It sits beside the payload field on a block or promoted-region payload, or on the slide root when the root holds exactly one of those payloads; anywhere else it is a `caption-unsupported-payload` error.\n\n```json\n{\n "title": "Pipeline",\n "blocks": [\n { "image": "asset:funnel", "caption": "Figure 1. Pipeline by stage, Q3" },\n { "table": { "columns": ["Stage", "Count"], "rows": [["Qualified", 42]] }, "caption": { "text": "Table 1. Counts", "position": "above", "align": "center" } }\n ]\n}\n```\n\nCore composition reserves the caption band inside the block\'s region and shrinks the media by its height (`item.caption` carries the band, `item.box` is the media box); the preview and the PPTX export draw that band in the muted text colour at the caption size (0.6 of the body size, never under the readable floor). Captioned blocks are the only ones whose geometry changes. See [footnotes, citations and captions](footnotes-citations-captions.md).\n\n**Name and detail (LH-138).** A picture\'s caption that is one plain string with a colon and a space after one to six words and a detail after it ("Before: loose boxes, tape and paper") draws the words up to the first colon in bold and the detail in the regular weight, as Claude Design draws a pair of before and after pictures or a gallery of sites. A colon inside a word ("10:30", "https://") never splits, a caption written as `TextRun[]` stays as the author formatted it, and a chart, table, video or diagram caption is not split. The document is unchanged: core composes the caption as runs (`item.caption.text`), and the preview and the PowerPoint export draw them.\n\n## Code\n\nCode-specific fields are grouped under `code`. A string value is shorthand for `code.source`; use object form when syntax highlighting or a file label matters. In object form, `source` is required. `language` colours the code in the preview and the PowerPoint export (comments, strings, numbers, keywords, names and types, in colours from the deck theme); an unknown language stays plain and the text is never changed. See [dynamic composition](dynamic-composition.md#preview-polish-shared-by-preview-and-export-rr-07) for the supported languages.\n\n```json\n{\n "title": "Decision Rule",\n "code": {\n "source": "if risk > threshold:\\n escalate(owner)\\nelse:\\n approve(change)",\n "language": "python",\n "filename": "decision.py"\n }\n}\n```\n\n## Metric\n\nMetric-specific fields are grouped under `metric`. A string or number value is shorthand for `metric.value`; numeric values stay numeric and are formatted by renderers at display time (LH-141: a numeric `value` of four integer digits or more prints with its thousands grouped by the deck language, "6,240" or "6.240" in German; LH-106: every numeric `value` and `delta` is in the language\'s own digits, "\u0669\u0669\u0669" and "\u0661,\u0660\u0660\u0660" in `ar-SA`, or Latin ones with `ar-SA-u-nu-latn`; a string value is printed as written). Use object form when labels, descriptions, units, deltas, trends, or sentiment matter. A `trend` (`up`, `down`, `flat`) draws an arrow before the delta on its line ("\u2191 +7 pts"), or before the label without a delta, colored with the delta text, in the preview and the PowerPoint export (LH-53); the arrow always points the way the trend does, and its color follows `sentiment` (`positive` green, `negative` red, `neutral` the neutral text color). When `sentiment` is absent up is positive, down is negative and flat is neutral, so set it when the direction is not the verdict: a falling churn, cost or latency is `"trend": "down", "sentiment": "positive"`. Only the trend arrow and the delta text take the color, so `sentiment` has no visible effect on a metric without a `trend`. The trend word is not drawn in any language: it is the arrow\'s alternative text ("Trend: up") and stays in the source, which is where it is edited (see [dynamic composition](dynamic-composition.md#preview-polish-shared-by-preview-and-export-rr-07)).\n\nThe `metrics` v2 layout accepts metric blocks in its body region and flows them as a grid. For several metrics, use separate `{ "metric": ... }` entries in `blocks`; the content kind and payload key are `metric`. Choosing a layout does not reinterpret existing text as numeric data.\n\n```json\n{\n "title": "Operating Metric",\n "metric": {\n "value": "42%",\n "label": "Review cycle reduction",\n "description": "Median reduction across customer review workflows.",\n "delta": "+11 pts",\n "trend": "up"\n }\n}\n```\n\nA falling value that is good news keeps its downward arrow and takes the green:\n\n```json\n{\n "title": "Churn",\n "metric": {\n "value": "3.1%",\n "label": "Monthly churn",\n "delta": "-0.6 pts",\n "trend": "down",\n "sentiment": "positive"\n }\n}\n```\n\n## Quote\n\nQuote-specific fields are grouped under `quote`. A string value is shorthand for `quote.text`; use object form when attribution or citation matters. `text` is a string or `TextRun[]` with inline formatting; `attribution`, `role` and `source` are plain strings.\n\n```json\n{\n "title": "Customer Proof",\n "quote": {\n "text": "The new workflow made exceptions visible before they became escalations.",\n "attribution": "Priya Raman",\n "source": "Customer interview"\n }\n}\n```\n\nA testimonial attributes the quote to a person with a title and a face. `role` is the person\'s title and organization, and `photo` is their headshot, an `Asset` (a source string or an object with `src` and `alt`):\n\n```json\n{\n "title": "Customer Proof",\n "quote": {\n "text": "The new workflow made exceptions visible before they became escalations.",\n "attribution": "Priya Raman",\n "role": "VP Operations, Acme",\n "photo": { "src": "asset:priya-raman", "alt": "Priya Raman" },\n "source": "Customer interview, March 2026"\n }\n}\n```\n\nThe footer under the quote is the attribution, then the role on its own line, then the source after ` - ` on the last line. Without a `role` it is the single line it always was (`attribution - source`). With a `photo`, the headshot is a circle at the start edge of the footer row (the left in a left-to-right deck, the right in a right-to-left one), three times the footer font size across, and the footer lines sit beside it, centered on it. The photo is cropped to fill the circle, and its size follows the footer\'s font size when the readability floor shrinks the footer. Without a `photo` nothing else changes. The preview draws it with the circular clip that an image block uses for shape `circle`, and PowerPoint export writes a native picture with the `ellipse` geometry and the alt text as its description; importing that file restores `role` and `photo`. A photo needs alt text (the `opf/missing-alt-text` rule of `validate` checks `quote.photo`); an SVG photo exports as its PNG raster.\n\n**A quote card\'s mark (LH-78).** A quote beside other blocks on a card draws a decorative quotation mark at the start edge of the card\'s top (the left in a left-to-right deck, the right in a right-to-left one), in the primary color (the text color where the primary reads under 4.5:1 on the card), bold, up to 1.5 times the size of the quote\'s text. It is drawn in the card\'s own padding between the card\'s top edge and the text, at the largest step (1.5, 1.25, 1 times the text size) whose ink fills at most 70% of that padding, and a card with less padding than that draws none. Nothing moves and no size changes: the mark never takes room from the quote, so the quote keeps the size the size guard gave it. The mark stands for the quote\'s own opening quotation mark, so where it draws that opening mark is not drawn (in the drawing only: the document text is unchanged, the closing mark stays, and the body is fitted again without the mark at its size, never to more lines); in a language whose opening mark is low (\u201E \xAB, a corner bracket or a right-only mark) the same holds. The cards of one slide draw their marks together or not at all. The mark is the language\'s opening quotation mark (a low one is drawn as the high English mark), `QuoteLayout.mark` in core; the PowerPoint export writes it as one native text box tagged into the quote\'s group as decoration, records that the opening mark was hidden (`hiddenOpen` in the quote\'s manifest), and import consumes the mark and puts the opening mark back, so the authored text returns.\n\nA testimonial with room draws the photo as a tall portrait beside the quote instead (LH-132, as Claude Design sets a customer story): when the quote is at least 640 px wide (a quote alone on its slide, not three side by side or a quote beside other blocks), the picture takes 26% of its width at the start edge, at most 0.7 as wide as tall and never taller than the quote, rounded as a card is and cropped around the upper third, and the quote\'s text sits beside it, 40 px away and centered against it. The body and the footer keep the size they have beside the avatar (the body may take another line in the empty height); where they would not, the picture takes a narrower share, down to 72 px, and then the quote keeps the avatar. `portrait: "side"` asks for the portrait whatever the width (its text then fits what is left), `portrait: "avatar"` keeps the circle. Both engines draw core\'s frame (`QuoteLayout.photo` with its `focus`): the preview clips the picture to the rounded outline, PowerPoint writes a `roundRect` picture cropped with `a:srcRect`. A photo with no attribution, role or source still draws, alone in the footer row. The Markdown dialect has no native form for `role` and `photo`: a quote that carries them is written as an `opf` block, which round trips exactly, and a plain `> \u2014 Name, Title` line stays an attribution.\n\n## Timeline\n\nTimeline-specific fields are grouped under `timeline`. An array value is shorthand for `timeline.events`; use object form when the timeline needs a name or description. Timeline events use `when`, `what`, `description` and `status`. `status` is `done`, `current` or `planned` and marks progress: `done` is a filled marker with normal text, `current` ("we are here") is a ringed marker with a bold label, and `planned` is a hollow outlined marker with muted text. An event without a status draws as a plain filled marker. The connector is drawn in the primary color up to the current event (to the last done one when none is current), and a deck with a supported localized vocabulary adds a status word under each label when the timeline keeps its size with them. English uses Done, Current and Planned. Regional variants share their language vocabulary; Chinese scripts have distinct words. Unsupported generated translations keep the status markers and progress without inserting English, and authored event text stays intact. See [localized status words](dynamic-composition.md#localized-timeline-status-words). Schedule health (at risk, blocked) is not a status; say it in the event text. See [Dynamic composition](dynamic-composition.md#timeline-internals) for the exact drawing.\n\n```json\n{\n "title": "Rollout Plan",\n "timeline": {\n "name": "Regional Rollout",\n "description": "Major milestones for the rollout.",\n "events": [\n {\n "when": "Q1",\n "what": "Pilot",\n "description": "Launch with one operations team."\n },\n {\n "when": "Q2",\n "what": "Rollout",\n "description": "Expand to all regions."\n }\n ]\n }\n}\n```\n\nA roadmap with progress states:\n\n```json\n{\n "title": "Product roadmap",\n "timeline": [\n { "when": "Q1", "what": "Discovery", "status": "done" },\n { "when": "Q2", "what": "Pilot", "status": "current" },\n { "when": "Q3", "what": "Rollout", "status": "planned" }\n ]\n}\n```\n\n## Diagram\n\nThe [diagrams guide](diagrams.md) covers when to use one, the supported Mermaid families, styling, sizing and export in full; this section is the field reference.\n\nA `diagram` is a diagram written as text: [Mermaid](https://mermaid.js.org) source (Mermaid 12.1 syntax) , a [Graphviz DOT](diagrams.md#graphviz-dot) graph or a [PlantUML](diagrams.md#plantuml) diagram, drawn by the engines in the deck\'s own fonts and colors. A string is shorthand for `{ "source": value }` (Mermaid); the object form takes `source`, `syntax` (`"mermaid"`, the default, `"dot"` or `"plantuml"`) and `alt`. It is a root payload, a block or a promoted region, and a region of a layout template that accepts `diagram` takes it. The first line of the source names the diagram type; the built-in families are flowchart, sequence, class, state, ER, gantt, pie, quadrant, mindmap, timeline, journey, xychart, sankey, gitGraph, C4, block, architecture, kanban, packet, radar, treemap, venn, ishikawa, requirement, railroad, wardley, cynefin, treeView, eventmodeling, usecase, swimlane, agentflow and info. ZenUML is not supported. The drawing is done by [pele](https://pele.run) (MIT, no runtime dependencies, synchronous and DOM-free), so the preview, the PDF and the PPTX export need no browser. A DOT graph is read by OPF itself and laid out in layers by pele; a `layout` other than `dot` (neato, fdp, circo, twopi, ...) is refused with a finding. A PlantUML diagram is read by OPF too and drawn as the Mermaid family of its kind (sequence, class, state, activity, use case, component, mind map, gantt); other kinds and the preprocessor are refused with a finding.\n\n```json\n{\n "title": "Reviews decide what ships",\n "diagram": {\n "source": "flowchart LR\\n A[Brief] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| A",\n "alt": "A brief goes to review; approved work is built, rejected work returns to the brief."\n },\n "caption": "Figure 1. The review loop"\n}\n```\n\n- **Engines.** Core lays the diagram out with the deck\'s measured fonts at the largest size that fits its block (never under the readability floor, else a `text-overflow` finding) and paints it in the slide\'s colors and fonts; see [sizing](diagrams.md#sizing) and [how the deck styles a diagram](diagrams.md#how-the-deck-styles-a-diagram).\n- **`alt`.** The text alternative; without it engines derive one from the diagram type and its labels ([accessibility](diagrams.md#accessibility)). A diagram takes a `caption` like an image, chart, table or video.\n- **Errors.** A source that cannot be parsed is a finding with its line and column, and draws a "Diagram unavailable" placeholder ([errors and limits](diagrams.md#errors-and-limits)).\n- **PPTX and Markdown.** A native SVG picture over a PNG fallback that re-imports as the diagram ([exports](diagrams.md#exports)); a ```` ```mermaid ````, ```` ```dot ```` or ```` ```plantuml ```` fence in [Markdown](markdown.md).\n\nChoose the payload by what the content is: `chart` for numbers plotted on axes, `timeline` for dated or ordered events with a status, `diagram` for structure and flow (steps, systems, relationships, states, hierarchies) that Mermaid can draw. A Mermaid `pie` or `timeline` diagram is a quick picture; a `chart` or `timeline` payload keeps the data editable and gets the engines\' chart and timeline design.\n\n## Regions\n\nRegion keys address a 3\xD73 grid of rows (`top`, `middle`, `bottom`) and columns (`start`, `center`, `end`). The columns follow the deck\'s direction: `start` is the left column in a left-to-right deck and the right column in a right-to-left deck (see [Right-to-left decks](dynamic-composition.md#right-to-left-decks)).\n\n```\n start center end\n +--------------------+--------------------+--------------------+\n top | top:start | top:center | top:end |\n +--------------------+--------------------+--------------------+\n middle | middle:start | middle:center | middle:end |\n +--------------------+--------------------+--------------------+\n bottom | bottom:start | bottom:center | bottom:end |\n +--------------------+--------------------+--------------------+\n```\n\n- A bare column key (`start`) spans all three rows; a bare row key (`top`) spans all three columns.\n- `+` spans adjacent rows or columns: `center+end`, `top+middle`.\n- `row:column` combines the two: `top:start`, `middle+bottom:center+end`.\n- Keys on one slide must not overlap, and regions cannot be mixed with root payload fields.\n\nSpans compose into common slide shapes:\n\n```\n "start" + "center+end" "top" + "middle+bottom"\n (sidebar + main) (headline band + body)\n +----------+------------------+ +-------------------------------+\n | | | | top |\n | | | +-------------------------------+\n | start | center+end | | |\n | | | | middle+bottom |\n | | | | |\n +----------+------------------+ +-------------------------------+\n\n "top" + "middle+bottom:start" + "middle+bottom:center+end"\n (headline band, then sidebar + main)\n +---------------------------------------------+\n | top |\n +---------------+-----------------------------+\n | | |\n | middle+bottom | middle+bottom:center+end |\n | :start | |\n | | |\n +---------------+-----------------------------+\n```\n\nThe same payload objects work inside regions \u2014 here, the sidebar-plus-main shape:\n\n```json\n{\n "title": "Operating Snapshot",\n "start": {\n "table": {\n "columns": ["Metric", "Value"],\n "rows": [\n ["Revenue", "$4.2M"],\n ["Gross margin", "68%"]\n ]\n }\n },\n "center+end": {\n "chart": {\n "type": "line",\n "data": {\n "columns": ["Month", "Revenue"],\n "rows": [\n ["Jan", 3.4],\n ["Feb", 3.8],\n ["Mar", 4.2]\n ]\n }\n }\n }\n}\n```\n\n## Accessibility of the preview\n\nThe SVG preview and the PowerPoint export agree on what a reader can reach. The slide root is a labelled container (`role="group"`, `aria-roledescription="slide"`, `aria-label` set to the slide title), never an image: an image makes everything inside it presentational, so a screen reader would hear only the title. Text stays reachable, in the order it is drawn: tag, title and subtitle, the content in layout order, footnotes, then header and footer. That covers body text, list entries, quotes, metric values and labels, table cells, timeline entries, captions and furniture text.\n\nA picture with `alt` is an image with that name. Purely decorative drawing is hidden (`aria-hidden`): the background and its overlay, card frames, table cell fills and borders, dividers, timeline markers, watermarks, list bullets, a picture or chart whose `alt` is `""`, and a header or footer picture without `alt` (a logo repeated on every slide). A chart with `alt` is an image with that name, and its drawn marks are not announced separately. The deck element, the player and `renderDeckHtml` in `@openpresentation/opf-render` put the one slide container (region or figure) around the drawing, so a slide is announced once.\n\nTesting status (opf-render#170): this contract is the DOM and ARIA structure. It is checked with axe-core, the browser\'s accessibility tree and focus-order assertions, and it is **not tested with assistive technology**: no screen reader (NVDA, JAWS, VoiceOver, TalkBack) has been run against the preview, the deck element or the player (owner decision 2026-10-10). Forced colors are verified with Chromium\'s emulation only, not the Windows contrast theme (evidence).\n'
58
58
  },
59
59
  {
60
60
  "slug": "conversions",
@@ -78,19 +78,19 @@ var docsData = Object.freeze([
78
78
  "slug": "design-resolution",
79
79
  "file": "docs/design-resolution.md",
80
80
  "title": "Design Resolution",
81
- "markdown": '# Design Resolution\n\nHow an engine decides the effective design for any given slide. The schema spreads these rules across field descriptions; this page states them once, as an algorithm.\n\n## Precedence\n\nFor every design field independently, the most specific source wins:\n\n```\n wins +--------------------------------------------------------+\n ^ | 1. slide design slides[i].design.* |\n | +--------------------------------------------------------+\n | | 2. deck design design.* on the presentation root |\n | +--------------------------------------------------------+\n | | 3. resolved theme colorScheme, fontScheme, |\n | | background, dimensions from the |\n | | theme record |\n | +--------------------------------------------------------+\n loses | 4. engine defaults e.g. spec/reference/ |\n v | engine-defaults.json |\n +--------------------------------------------------------+\n```\n\n1. **Slide design** \u2014 `slides[].design.*`\n2. **Deck design** \u2014 `design.*` on the presentation root\n3. **Resolved theme** \u2014 defaults carried by the theme record (`colorScheme`, `fontScheme`, `background`, `dimensions`)\n4. **Engine defaults** \u2014 [`spec/reference/engine-defaults.json`](../spec/reference/engine-defaults.json), compiled into core as `ENGINE_DEFAULT_THEME`, `ENGINE_DEFAULT_COLOR_SCHEME` and `ENGINE_DEFAULT_FONT_SCHEME`\n\nResolution is **per field**, not per object. A slide that sets only `design.contentAlignment` inherits everything else from the deck design; a deck that sets only `design.colorScheme` keeps the theme\'s font scheme and background.\n\nTwo field-level rules complete the picture:\n\n- **Base-plus-overrides within one object.** Wherever a reference object carries an `id` (`ColorScheme`, `FontScheme`, and the inline `Audience`, `Purpose` and `Tone`), the `id` resolves a catalog record as the base and sibling fields override the resolved record per key. `design.theme` is a reference string only. The string shorthand (`"colorScheme": "cool-horizon"`) is equivalent to setting only `id`.\n\n ```\n "colorScheme": { "id": "cool-horizon", "accent1": "#0F4C81" }\n\n catalog record "cool-horizon" sibling fields on the object\n accent1: "#2874A6" <-- replaced -- accent1: "#0F4C81"\n accent2: "#1B4F72" <-- kept\n light1: "#FFFFFF" <-- kept\n |\n v\n effective scheme: accent1 from the override, everything else\n from the record\n ```\n- **Explicit suppression.** `watermark`, `header`, and `footer` accept `false` to switch off an inherited value \u2014 distinct from omitting the field, which inherits.\n\nEvery reference inside this chain resolves the one way every content reference does: `catalogs.custom`, then the records embedded under `catalogs.default`, then the catalog the host registered for its source (`name:id` in `catalogs.<name>`, then the host catalog for its source); see [`how-opf-works.md`](./how-opf-works.md) and [the catalogs page](default-catalog.md).\n\n## Worked example 1: color scheme through every level\n\n```json\n{\n "design": {\n "theme": "classic",\n "colorScheme": "forest-green"\n },\n "slides": [\n { "title": "Inherits the deck" },\n {\n "title": "Slide override",\n "design": {\n "colorScheme": { "id": "cool-horizon", "accent1": "#0F4C81" }\n }\n }\n ]\n}\n```\n\n- Slide 1: the `classic` theme record supplies its own default color scheme, but the deck design sets `colorScheme` explicitly, so `forest-green` wins (level 2 beats level 3). Fonts, background, and dimensions still come from `classic`.\n- Slide 2: slide design beats deck design (level 1 beats level 2). The `cool-horizon` record resolves as the base, then `accent1` is replaced by `#0F4C81`. All other `cool-horizon` slots survive.\n\nThere is no ambiguity between "override" and "reference": every scheme value *is* a reference, and any sibling fields on the same object are overrides applied after the reference resolves.\n\n## Worked example 2: backgrounds and suppression\n\n```json\n{\n "design": {\n "theme": "minimal",\n "background": "light1",\n "footer": {\n "start": { "text": "Acme Corp" },\n "end": { "text": "{{slide.number}}" }\n }\n },\n "slides": [\n { "title": "Light slide on a theme that defaults to dark" },\n {\n "title": "Section divider",\n "design": {\n "background": {\n "type": "gradient",\n "gradient": {\n "angle": 90,\n "stops": [\n { "color": "#0B1B2B", "position": 0 },\n { "color": "#123A5F", "position": 1 }\n ]\n }\n },\n "footer": false\n }\n }\n ]\n}\n```\n\n- Slide 1: the deck-level `background: "light1"` overrides the `minimal` theme\'s default background (`dark2`). `light1` is a theme slot \u2014 it resolves through the effective color scheme, which itself resolved through the chain above.\n- Slide 2: the gradient replaces the deck background for this slide only, and `footer: false` suppresses the inherited footer rather than inheriting or replacing it.\n\n## Worked example 3: font scheme models\n\n```json\n{\n "design": {\n "fontScheme": {\n "id": "aptos",\n "code": "JetBrains Mono"\n }\n }\n}\n```\n\nThe `aptos` record supplies the OOXML pair (`major`/`minor`). The `code` role is an OPF-specific addition with no OOXML slot, so it layers on top without disturbing the pair. When serializing to PowerPoint, engines write `major`/`minor` to `majorFont`/`minorFont` and map abstract roles (`heading`, `body`) onto those slots. `accent` has no slot; the `code` family is written directly on code runs. The same slot-versus-role split applies to color schemes: OOXML slots (`accent1`\u2013`accent6`, `dark1/2`, `light1/2`) round-trip directly, abstract roles (`primary`, `text`, `surface`, \u2026) are mapped onto slots by the engine.\n\n### Code font\n\nThe `code` role resolves per key like every other override:\n\n1. `code` on the effective `design.fontScheme` object;\n2. `code` on the resolved font-scheme record (the `consolas` and `courier-new` records carry `"Consolas"` and `"Courier New"`);\n3. otherwise **Roboto Mono**, the documented fallback that `@openpresentation/opf-render` bundles.\n\nThe heading and body families are never reused as the code fallback, so choosing `aptos` still gives Roboto Mono code unless the deck sets `code`. `resolveFontFamilies()` in `@openpresentation/opf/composition` applies these rules for all engines.\n\n### Engine default font scheme\n\nThe last-resort font scheme applies only when neither the slide, the deck nor the resolved theme names one, or when the reference resolves nowhere. It is an engine default in code, not a catalog record: `ENGINE_DEFAULT_FONT_SCHEME` (`{ major: "Aptos Display", minor: "Aptos", languageFamily: "latin" }`, the drawing fields of the gallery\'s `aptos` scheme), recorded in [`engine-defaults.json`](../spec/reference/engine-defaults.json) and exported from the package root and `@openpresentation/opf/composition`. A document with no `design` uses the engine default theme (`ENGINE_DEFAULT_THEME`, which names no font scheme), so it gets Aptos in every engine without any catalog registered.\n\nEvery engine shares this one last resort, so a theme without `fontScheme` is measured, paginated, previewed and exported in the same fonts:\n\n| Engine | Last resort | Where |\n| --- | --- | --- |\n| Core pagination and validate | `ENGINE_DEFAULT_FONT_SCHEME` | `packages/javascript/src/design-records.ts` |\n| opf-render preview | core\'s `resolveSlideContext` | `src/svg.js` |\n| opf-editor composition and slide transfer | core\'s `resolveSlideContext` | `src/font-defaults.js` |\n| opf-pptx export | core\'s `resolveSlideContext` | `src/index.js` |\n\nAptos is not openly licensed, so no OPF package bundles it. Previews take the same path for the last resort as for any `aptos` deck:\n\n- **Estimated layout** (no `fonts`): the SVG names `Aptos` and `Aptos Display`, and the default raster engine draws them with its bundled sans-serif fallback (Roboto).\n- **Measured layout** with the opf-render office font pack (`loadFonts({pack: \'office\'})`): `Aptos` and `Aptos Display` resolve to Intos and Intos Display, metric-compatible replacements from the OPF font policy (0.000% mean width difference against Aptos 2.01), and the substitution report lists both. With only the base pack and `substitutionPolicy: "visual"` they fall back to the visual alternates Roboto and Carlito. The PPTX always names Aptos. See [font-fidelity.md](font-fidelity.md#font-policy-ff-31).\n- **Measured layout with only the base pack under the metric policy**: `font-unavailable` for Aptos, as for a document with no `design`. Supply licensed Aptos faces, allow visual substitution, or set a `fallbackFamily`.\n\n`packages/javascript/test/font-scheme-defaults.test.mjs` checks the shared default in core pagination, and each sibling repository has a parity test.\n\n### References that resolve nowhere\n\nA layout, theme, colour scheme or font scheme reference that neither the document embeds nor a registered catalog defines falls back, and no engine throws for it (unless the host asks for a strict export, `strictReferences`, which throws `OPFUnresolvedReferenceError`):\n\n- **Layout.** A slide with no `layout` is composed with **no layout record**, and that is not a finding: title, subtitle, tag and content are arranged automatically, a slide with no body payload is a cover (the title block vertically centred) and the design hints apply. A layout reference that resolves nowhere composes the same way. An engine never substitutes a different layout.\n- **Theme.** A theme reference that resolves nowhere uses the engine default theme (`ENGINE_DEFAULT_THEME`: the background and dimensions of the gallery\'s `minimal`).\n- **Colour scheme.** A colour-scheme reference that resolves nowhere uses `ENGINE_DEFAULT_COLOR_SCHEME` (the twelve slots of `cool-horizon`). The theme\'s own colour scheme counts as the reference when the deck and slide name none, and resolves in the theme\'s catalog group first. An object without an `id` is laid over the engine default, so a partial inline scheme keeps the slots it does not name.\n- **Font scheme.** A font-scheme reference that resolves nowhere uses `ENGINE_DEFAULT_FONT_SCHEME`. Sibling fields on an object reference still override it per key, so `{ "id": "no-such-scheme", "major": "Inter", "minor": "Inter" }` uses Inter, and a `code` role still applies. An object without `id` is an inline scheme on the same base and reports nothing.\n\nEach is one `unresolved-reference` diagnostic: `{ code, kind, reference, path, group, source?, fallback, message }`, with `path` where the reference is written (`slides.N.layout`, `slides.N.design.theme`, `design.colorScheme`, `design.fontScheme.id`, or `catalogs.<group>.themes.<id>.colorScheme` for a reference inside an embedded theme), `fallback` `automatic` for a layout and `engine-default` otherwise, and a message that names the reference and the catalog source it was looked for in. `validate` reports the same references as `opf/unresolved-reference` warnings.\n\n`resolveSlideContext(presentation, index, { catalogs, fonts })` (package root) applies these rules with the slide, deck and theme precedence above. It returns the `ComposeSlideOptions` for one slide (canvas, layout, families as `fontFamilies`, measurement, `slideNumber`, `slideCount`), the slide to compose and draw (`slide`, with `{{slide.number}}`, `{{slide.section}}` and `{{deck.slideCount}}` substituted for those numbers), the diagnostics, and `darkBackground` (the preview\'s decision: the one colour the background names, resolved through the colour scheme and the deck\'s `variables` so `var:brand`, a scheme slot or `primary`/`secondary`/`accent` work, has a WCAG relative luminance below 0.179; a gradient counts as light, a picture reads `light1`, a pattern its `backgroundColor`; no opacity is applied), which `composeSlide` uses to pick logo variants. `resolveDesignRecords` and `resolveFontScheme` expose the same resolution for hosts that need only the records. Core pagination continues with the fallbacks and passes each diagnostic to `onDiagnostic`.\n\n| Engine | Diagnostic channel | Reported |\n| --- | --- | --- |\n| Core pagination | `paginate(..., { onDiagnostic })` | once per path per call |\n| opf-render preview | `toSvg` `onDiagnostic` | once per path per rendered slide |\n| opf-editor | `session.composeSlide` / `paginateSlide` `onDiagnostic` option | once per call |\n| opf-pptx export | `toPptx(..., { onDiagnostic })` | once per path per export |\n\nEvery engine passes the catalogs its host registered (the `catalogs` option) to core, so a record a host registers resolves the same in preview, editor and export.\n\n## Color references in content\n\nContent color fields (`TextRun.color`, styled table cell `style.fill` / `style.color`, table cell border `color`) accept references as well as literal hex, and those references resolve through the same chain above:\n\n```\n "color": "accent2" slot name -> effective color scheme slot\n "color": "text" role name -> role-to-slot mapping, then the slot\n "color": "var:risk" variable -> top-level variables map\n "color": "#B42318" literal -> used as-is (frozen at authoring time)\n```\n\n- **Slot names** (`accent1`\u2013`accent6`, `dark1`, `dark2`, `light1`, `light2`, `hyperlink`, `followedHyperlink`) read the named slot from the *effective* color scheme \u2014 the one produced by the slide \u2192 deck \u2192 theme \u2192 engine-default precedence at the top of this page. A slide-level `design.colorScheme` override therefore recolors that slide\'s named runs too.\n- **Role names** (`primary`, `secondary`, `accent`, `background`, `surface`, `text`, `textSecondary`) resolve through one shared definition, `resolveColorRoles()`, which the opf-render preview, the PPTX export and `validate` all call, so the same deck draws the same colors in each. A role defined on the effective scheme wins; otherwise it defaults from a slot:\n\n | Role | Default (through the slide\'s variant; see [Color variants](#color-variants)) |\n | --- | --- |\n | `primary`, `secondary`, `accent` | the first three accents of the variant: `accent1`, `accent2`, `accent3` unless `variant.accents` reorders them |\n | `background` | the slide\'s own resolved background when it is one color (solid or pattern background color); else the variant\'s `bg1` (`light1` by default, the scheme\'s `background` role overriding it there). A gradient or picture background uses the variant, or its `tone`, or `light1`. |\n | `surface` | `bg2` of the variant: `light2` on a light slide, `dark2` on a dark one |\n | `text` | `tx1` of the variant: `dark1`, or `light1` on a dark slide. A `text` override applies on a light slide only, so a dark slide always keeps readable light text. |\n | `textSecondary` | `tx2` of the variant: `dark2`, or `light2` on a dark slide |\n\n A slide is dark when its background\'s WCAG relative luminance is under 0.179, the point where white and black text contrast equally.\n- **Links.** A link run (`link`) with no `color` of its own is drawn underlined in the scheme\'s `hyperlink` slot (the OOXML `hlink` color; Office blue `#0563C1` when the scheme sets none), in the preview and in the PPTX export (`a:schemeClr hlink` where the deck theme holds that color). Where that color has under 4.5:1 contrast against the slide background (the default Office blue on a dark slide), the slide\'s `text` color is used instead, as the slide tag does for a low-contrast primary color. A link run with its own `color` keeps it, and a `hyperlink` ColorRef always names the slot. `followedHyperlink` is written to the PPTX theme; a static preview cannot know which links were visited, so it draws every link in `hyperlink`.\n- **Variable references** (`var:<id>`) resolve against the document\'s top-level `variables` map, independent of the scheme. Variables are deck-scoped named colors \u2014 use them for values that have meaning (`var:risk`) or repeat across slides. An unknown id is a validation warning, never an error, and engines fall back to their default text color.\n\nThe styled table cell and border color fields enforce the reference forms at the schema level (a typo like `"acent2"` is a schema error there \u2014 neither hex, a known name, nor a `var:` reference). Run colors stay open strings so imported decks keep validating: an unrecognized run color is a validation warning, and renderers fall back to the theme text color \u2014 the same warn-don\'t-error posture unknown catalog ids get. Unknown `var:` ids are warnings everywhere.\n\n### Color variants\n\nA deck has one color scheme of twelve slots. A **variant** is a mapping over those same slots, as PowerPoint\'s `clrMap` is, never a second scheme: which slot is the background, and so which are the text and the alternate surface, plus an optional order for the accents. Everything OPF draws refers to the roles, so a slide that changes variant recolors text, lines, cards, chart furniture and code together.\n\n`variant` is a string, the same way `colorScheme` is: the slot that is the background.\n\n```json\n{\n "design": { "variant": "dark1" },\n "slides": [{ "title": "Light one", "design": { "variant": "light1" } }]\n}\n```\n\n`"dark1"` is `{ "background": "dark1" }`. The object form is only needed to reorder the accents: `{ "background": "light1", "accents": ["accent2", "accent1", "accent3", "accent4", "accent5", "accent6"] }`. Both forms are allowed on `design` and on `slides[n].design`, and what `resolveColorRoles` and `resolveSlideContext` return is always the normalized object (`normalizeColorVariant`).\n\n| `variant` (or `variant.background`) | bg1 | tx1 | bg2 | tx2 |\n| --- | --- | --- | --- | --- |\n| `light1` (default) | `light1` | `dark1` | `light2` | `dark2` |\n| `dark1` | `dark1` | `light1` | `dark2` | `light2` |\n| `light2` | `light2` | `dark1` | `light2` | `dark2` |\n| `dark2` | `dark2` | `light1` | `dark2` | `light2` |\n| `accent1` to `accent6` (LH-01) | the accent | `light1` or `dark1` | the accent | `light2` or `dark2`, else tx1\'s slot |\n\n(`light2` and `dark2` keep the background slot as the surface too, as a slide with that theme background has always been drawn, so the engine default theme, whose background is `dark2`, is unchanged.) An accent variant draws the slide on that accent with the scheme\'s light family (`light1`, `light2`) or dark family (`dark1`, `dark2`), whichever text slot has the higher contrast on the accent; where the family\'s tx2 is under 4.5:1 on it, tx2 maps to tx1\'s slot. No color is invented: the PowerPoint export writes it as a `clrMapOvr` with `bg1="accent1"`. `variant.accents` (object form) is a permutation of `accent1` to `accent6`; entry `i` is the slot drawn as accent `i + 1`, which reorders `primary`, `secondary`, `accent` and the chart series colors.\n\nWhich variant a slide has, from the most specific to the least (slide design, the slide\'s layout record\'s `design.variant` unless the deck or the theme draws a fixed background, deck design, then the theme record), at the first level that says anything:\n\n1. a `variant`;\n2. a theme-slot background (`"dark1"`, `{ "type": "theme", "slot": "dark1" }`), which is the variant of that slot, so `design.background` stays a shorthand;\n3. a picture or gradient background with a `tone` (`"dark"` or `"light"`), which is the `dark1` or `light1` variant. Without a tone a picture takes the tone its recolor, opacity and overlay imply ([images](image-treatments.md)); when they imply none, only a variant of a less specific level can apply, and with none the slide counts as light, as before;\n4. any other background (a solid or pattern color) decides by luminance (dark below 0.179), as before.\n\nA layout record\'s `design.variant` (LH-01) is a default a gallery layout gives, and a background the author fixed beats it (LH-103; docs/programs/layout-harvest/README.md, Decisions). From the most specific:\n\n1. The slide\'s own `variant` or `background` always wins.\n2. If the background the deck or the theme draws is **fixed**, the layout\'s variant does not apply: the slide keeps that background, and its text follows that background\'s `tone` or luminance, exactly as on a slide whose layout names no variant. Fixed is a hex color (the `"#0B1020"` shorthand or a solid\'s `color`), a solid whose color is a `var:` reference (whatever the variable holds: the author named a color of the deck\'s own, not a place in the scheme), a gradient, a pattern or a picture.\n3. If that background is **scheme-based** (none, so the theme\'s slot or the engine default applies; a theme slot, `"dark1"` or `{ "type": "theme" }`; a solid whose color is a scheme slot or role name, such as `accent2`, `primary` or `background`; or a deck `variant`), the layout\'s variant applies on top, ranking above the deck and the theme, unlike the layout\'s other design keys.\n4. Otherwise the deck, then the theme, then the engine default, as above.\n\nThe background the deck or the theme draws is the deck\'s own `background`, else the theme\'s, unless a deck `variant` hides the theme\'s (the slide is then the variant\'s bg1, which is scheme-based). A deck that sets both a fixed background and a `variant` keeps the background on every slide, the layout\'s included; its variant only maps the text and the surfaces. A theme whose own background is fixed counts the same as a deck\'s (no default theme has one). `deckBackgroundIsFixed(deckDesign, themeBackground)` and `isFixedBackground(definition)` (`/composition`) are the rule.\n\nWhere it applies, besides a variant the layout takes a value relative to the deck\'s own variant (the one the deck and the theme give), so a layout keeps the deck\'s tone:\n\n| Layout `design.variant` | Light deck (on `light1`) | Deck on `light2` | Dark deck (on `dark1`, an accent with light text, or a dark slot or role color) | Deck on `dark2` |\n| --- | --- | --- | --- | --- |\n| `surface`, the deck\'s secondary surface | `light2` | `light1` | `dark2` | `dark1` |\n| `brand`, the scheme\'s brand dark, with light text | `dark2` | `dark2` | `dark2` | `dark1` |\n| a variant (`accent1`, `dark1`, an object) | as written | as written | as written | as written |\n\nThe default `section` is `accent1`, `statement` and `quote` are `surface` and `closing` is `brand`, so a dark deck\'s statement stays dark and its closing still stands off the deck. In every default theme and color scheme, light or dark, their text and secondary text reach 4.5:1. Where it applies, the layout variant hides the deck\'s and the theme\'s scheme-based background (the slide is the variant\'s bg1); it never hides a fixed one, so a deck\'s brand photo or hard-coded color stays on its section, statement, quote and closing slides, and the PowerPoint export writes no `clrMapOvr` for them. Without an accent order of its own it keeps the deck\'s. `resolveSlideContext(...).resolved.layoutVariant` is the resolved variant when it decides the slide (undefined over a fixed background); `layoutColorVariant(layout, deck)` (`/composition`) resolves one record.\n\n**A message-only slide (LH-164).** A slide whose whole body is one display message takes the accent surface (`accent1`, the variant the gallery\'s `section` names, in the deck\'s accent order), as Claude Design draws a statement or a one-sentence slide. The body is one message when it is LH-09\'s `statement-message` (a text in a statement record, under a sentence title or a short label) or `display-message` (a lone text of at most 25 words in any script, no citation or footnote, no subtitle, in a layout of one body region with no grid and no picture area), and composition really draws it at display size (a deck whose texts sit on cards keeps its body text); a metric, a quote and everything with a second block keep the plain surface. It takes the layout variant\'s place and its conditions: the slide\'s own `design` sets neither a variant nor a background, and the deck and the theme draw no fixed background or author-chosen scheme color; a layout that names a variant of its own (`section`, `closing`, an authored one) keeps it, and a layout that names only `surface` (`statement`, `quote`) gives way to the accent. **Dark decks keep their background**: a deck or a theme record that sets a dark background or variant is a deliberate design that already gives its messages their emphasis (the engine default theme is no choice of the deck\'s). **A loud accent stays plain**: the accent must carry the slide\'s text at 4.5:1, differ from the deck\'s own surface and be calm enough to fill a slide, CIELCh lightness L* at most 60 and chroma C* at most 80 (`lchOf`, `MESSAGE_SURFACE_MAX_LIGHTNESS`, `MESSAGE_SURFACE_MAX_CHROMA`; Claude Design\'s blue, L* 46.6 and C* 33.8, and the deep purple, L* 38.3 and C* 75.3, qualify; the `boost` red-orange, `corporate-blue` and `vibes` do not). The brand color is never recolored; the slide keeps its plain surface. A deck never shows two accent surfaces on consecutive slides: after a slide that actually took one (judged by its own resolution), or one drawn on an accent by its layout (`section`) or its own variant, the next message slide keeps the plain surface, so a run of message slides alternates. Text colors follow the surface like any variant; a color the author set on a run that does not read on it draws in the nearest one that does, and an image watermark draws in the slide\'s text color so a mark made for the plain surface still reads (a one-color duotone in the export). `resolveSlideContext(...).resolved.messageSurface` `{ kind: \'statement-message\' | \'display-message\', variant }` is the reason (`layoutVariant` and `roles` already follow it), and `composeSlide` echoes it as `SlideComposition.surface`. The PowerPoint export writes the slide\'s `clrMapOvr` as it does for a section, so the surface is the theme\'s accent; an editor can offer the plain surface by setting the slide\'s own `design.variant`.\n\nA theme record can list the variants it offers (`variants`, from gallery 4): named values of `variant`, such as `light`, `light-alt`, `dark` and `dark-alt` on `minimal`, `classic` and `bold`. They are for pickers: choosing one writes its `variant` into `design.variant` (or a slide\'s), and the document keeps that value, not the entry id. The engines read only `design.variant`. There is no `dark` theme in the default catalog: a dark deck is a theme with a dark variant, for example `{ "theme": "classic", "variant": "dark1" }`.\n\nA slide\'s variant replaces the deck\'s whole, accent order included. `resolveSlideContext(...).resolved.roles` is the resolved record, and `resolveColorRoles(scheme, { variant, tone, background })` is the function: besides the colors it returns `variant`, `map` (bg1, tx1, bg2, tx2 and the accents; `clrMapAttributes(map)` gives the PowerPoint `clrMap` attributes for the master and for a slide\'s `clrMapOvr`), `accents` (the six colors in order) and `neutrals`.\n\n#### Scheme-derived neutrals\n\nLines and quiet colors are not fixed grey. `roles.neutrals` derives each from the map, as PowerPoint\'s chart styles do: the text color (tx1) at a share over the background (bg1), chosen as a DrawingML luminance transform of the slot so a PPTX can write `<a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr>` and the preview draws the same color. Each neutral is `{ slot, hex, lumMod?, lumOff?, alpha? }` (the transforms in thousandths of a percent; `hex` is the transform applied, `applyLuminance(slotHex, lumMod, lumOff)`).\n\n| Neutral | Derivation |\n| --- | --- |\n| `border` (also `roles.border`) | tx1 at 20% over bg1: card, rule and table borders |\n| `gridline` | tx1 at 15%: chart gridlines |\n| `axisLine` | tx1 at 25%: chart axis lines |\n| `chartText` | tx1 at 65%: chart axis labels and legend text |\n| `outline` | bg1: pie and treemap outlines, the video play icon, anything drawn on a mark |\n| `trendNeutral` | tx2: the neutral metric trend |\n| `codePanel` | The code block is a dark card on either map (LH-79). Light: tx1, or tx2 when tx1 is near-black (relative luminance 0.01 or less) and bg1 keeps 7:1 on tx2, so a navy theme draws a navy panel. Dark: bg1 at 70% of its lightness (`lumMod` 70000), a step below the slide; a near-black slide takes bg2 when it stands off, else bg1 lifted 6% towards tx1. Over a literal background the bg1 shade is a literal color |\n| `codeText` | bg1 or tx1, whichever reads better on the panel |\n| `codeComment` | the code text at 65% over the panel (comments and line numbers) |\n| `card` | The fill of a card (a composed item\'s `frameBox`, LH-54): the `surface` role, except on a dark slide where the surface does not stand off the background (under 1.1:1, as on the `dark2` variant, whose bg2 is the background) and no `surface` is authored. There the card is the background mixed towards tx1, from 7% until it reaches 1.25:1 (`#172C52` on the default `#011842`), a literal color |\n| `cardBorder` | The card\'s 1 px stroke: `border`, or on a mixed dark card that card mixed 12% towards tx1 (a literal color) |\n\n`codeSyntaxPaletteForRoles(roles)` builds the syntax palette from `codePanel`, `codeText`, `codeComment` and the variant\'s first three accents, and `codeHighlightColors(scheme, palette, codePanel.hex)` takes the panel the highlight band sits on. `readableSchemeColor(fill, roles)` returns bg1 or tx1 (as a scheme color), whichever reads on a fill the scheme does not name, for table header text and text on marks. The validator\'s contrast rules read the same roles, so a dark variant is checked against its own text and surface, and text in a card against `card`. The preview and the PPTX export draw a card with `card` and `cardBorder`, and color a metric in a card (its value and trend) against `card`.\n\n### Background colors are ColorRefs\n\nThe colors of a solid background (`SolidBackground.color`), of each gradient stop and of a pattern (`foregroundColor`, `backgroundColor`) take the same forms as the content fields above: a literal hex, a slot or role name, or a `var:<id>` reference. The schema keeps these fields as plain strings, so a reference validates; engines resolve it through `resolveColorRef()` against the effective color scheme and the deck `variables`, and a reference that resolves to nothing is drawn as the engine default (white for a background), as for any other unresolvable color. The default text color of the slide follows the resolved background. A PPTX export writes `a:schemeClr` where the deck theme holds the named slot or role exactly, and the resolved literal otherwise (FF-24 conventions).\n\n> **Decision, 2026-09-30 (agent decision, vetoable).** The spec coverage audit found that `SolidBackground.color` accepted `var:` and slot names (the field is a string) but both engines painted white, while [`content-item-design-overrides.md`](./content-item-design-overrides.md) already states that every color field must accept the ColorRef forms and never hex alone. Rather than tighten the schema (which would break documents that validate today), the engines resolve ColorRefs in backgrounds. The owner can veto this by restricting the three background color fields to `HexColor` in the schema and the engines to hex only.\n\n`@openpresentation/opf/composition` exports `resolveColorRef()` with the shared slot, role, variable, and hex rules above so renderers and exporters do not drift. Pass the effective color scheme, optional resolved role colors, the deck `variables` map, and a theme-text `fallback` for unrecognized references.\n\n## Script fonts and language\n\nOOXML gives each theme font (major and minor) three script slots: `latin`, East Asian (`ea`) and complex script (`cs`). The presentation `language` and the effective font scheme resolve to all three:\n\n```\n latin design font scheme heading/body (the chain above)\n eastAsian 1. design.fontScheme.eastAsian explicit slot\n complexScript 2. the scheme\'s own major/minor when languageFamily is ea / cs (or eastAsian /\n complexScript, the same values) and its\n languages list (language ids) is empty or\n names the language\n 3. the language\'s font scheme when the language\'s script uses the slot\n 4. the latin family otherwise\n```\n\n- A language record\'s `script` (ISO 15924) picks its slot. East Asian scripts (`Jpan`, `Hans`, `Hant`, `Kore`, ...) use `eastAsian`. Complex scripts (`Arab`, `Hebr`, `Deva`, `Thai`, ...) use `complexScript`. Latin, Cyrillic, Greek and other scripts use `latin`. `direction` defaults from the script (Arabic and Hebrew are right-to-left).\n- The language\'s `fontScheme` applies to PowerPoint output and `googleFontScheme` to Google Slides output. For Latin-script languages, the design font scheme always supplies the latin slot.\n- A language sets `lang`, the text direction and the script slots, and never the Latin scheme: only `design.fontScheme` (slide, then deck, then theme, then the shared default `aptos`) sets the latin fonts, and a language record\'s `fontScheme` is a default for its own script slot, not a deck font. The PPTX theme\'s `a:ea` and `a:cs` are written only for a slot a script font is selected for (the scheme\'s explicit slot or the language\'s script font) and stay empty otherwise, as in Office\'s own themes. See [Language contract](./programs/font-fidelity-everywhere/script-font-model.md#language-contract-ff-50-model-c) and [Theme slots](./programs/font-fidelity-everywhere/script-font-model.md#theme-slots-ff-49).\n- A Latin deck therefore repeats its heading/body family in `ea`/`cs`. A Japanese deck with `design.fontScheme: { "major": "Carlito", "minor": "Carlito" }` keeps the Latin family in `latin` and uses Meiryo (PowerPoint) or Noto Sans JP (Google Slides) in `ea`. `design.fontScheme.eastAsian` / `.complexScript` (`{ "major": ..., "minor": ... }`) name a script font explicitly, for example for CJK text inside a Latin deck.\n\n`@openpresentation/opf/composition` exports `resolveScriptFonts(document, { app, slideIndex })` (`app` is `"powerpoint"`, the default, or `"google-slides"`), and the package root exports `normalizeLanguageFamily(value)` (which reads a font scheme\'s `languageFamily`, `eastAsian` as `ea` and `complexScript` as `cs`). `resolveScriptFonts` returns the heading and body slots, the OOXML `lang` (a curated `ooxmlLang` culture tag such as `ja-JP` or `ms-MY`, or an authored region tag), the canonical `bcp47` tag, `script`, `direction`/`rtl`, and the per-script supplemental theme font. Renderers and exporters should use it rather than re-deriving slots. The model, the OOXML mapping and the open questions are in [`programs/font-fidelity-everywhere/script-font-model.md`](./programs/font-fidelity-everywhere/script-font-model.md). opf-render and opf-pptx implement it (FF-07, FF-19, FF-49).\n\n### Numbers in the language\'s own digits (LH-106, OPF 0.34)\n\nEvery number the engines generate from a numeric value is drawn in the numbering system of the language in effect: the slide\'s `language`, else the deck\'s. That covers a metric\'s numeric `value` and `delta`, chart data labels, value-axis ticks, percentages, the pie value list and the doughnut hole, table cells that hold numbers, step badges and agenda numerals, and number variables placed on a slide or in the header and footer. Text the author typed is never rewritten: a title that says "999" stays "999", and a string metric value is drawn as written.\n\nThe numbering system is the locale\'s own, as the Unicode CLDR data defines it: `ar-SA` and `ar-EG` draw Arabic-Indic digits (\u0669\u0669\u0669, \u0661,\u0660\u0660\u0660), `ar-AE`, `ar-MA`, `ar-DZ`, `ar-TN` and a bare `ar` draw Latin digits, `fa-IR` draws Persian digits (\u06F9\u06F9\u06F9, \u06F1\u066C\u06F0\u06F0\u06F0), `bn` draws Bengali digits, `hi-IN` and every `en-*` tag draw Latin digits. Digits, decimal and group separators, grouping (thousands, or the Indian lakh and crore in `hi-IN` and `en-IN`) and the percent sign all come from the same entry, so 999 and 1,000 are always drawn in the same system. To choose another, add the standard BCP 47 Unicode extension `-u-nu-<system>` to the tag:\n\n```json\n{ "language": "ar-SA-u-nu-latn", "slides": [{ "title": "\u0627\u0644\u0645\u0624\u0634\u0631\u0627\u062A", "metric": { "value": 1250, "label": "\u0627\u0644\u0639\u0645\u0644\u0627\u0621" } }] }\n```\n\nThis Saudi Arabic deck draws `1,250`; `ar-AE-u-nu-arab` draws `\u0661,\u0662\u0665\u0660` in an Emirati one. The extension is OPF\'s: PowerPoint\'s `lang` attribute is written without it (`ar-SA`), and the tag as written comes back from a PPTX round trip through the document\'s provenance.\n\n**OPF draws what PowerPoint draws.** A deck is seen in OPF\'s preview and in PowerPoint, so OPF draws a numbering system only where PowerPoint draws the same digits, with the same separators (vetoable decisions of 2026-11-12, from PowerPoint 16.0.20527):\n\n- OPF draws Latin, Arabic-Indic (`arab`), Persian (`arabext`), Devanagari (`deva`) and Bengali (`beng`) digits. Any other system (Thai, Myanmar, ...), the locale\'s own or one `-u-nu-` names, is drawn in Latin digits, and `opf/language-tag` warns about such an extension.\n- Arabic-Indic digits take the Latin comma, period and percent sign (`\u0661,\u0662\u0663\u0664.\u0665\u0660`, `\u0662\u0665%`), because PowerPoint draws its charts so; Persian digits take the Persian separators and percent sign (`\u06F1\u066C\u06F2\u06F3\u06F4\u066B\u06F5\u06F0`, `\u06F2\u06F5\u066A`). Every other locale uses its CLDR separators (`1.234,50` in German).\n- PowerPoint formats a native chart\'s values itself. The export prefixes every number format of a classic chart (column, bar, line, area, pie, doughnut, scatter, ...) on such a slide with PowerPoint\'s numeral shape (`[$-2000000]` Arabic-Indic, `[$-3000000]` Persian, `[$-4000000]` Devanagari, `[$-5000000]` Bengali), so PowerPoint draws the chart in the same digits; import removes the prefix again. The preview draws each such chart number left to right as one unit (digits, then the percent sign; a sign before the digits), as PowerPoint does in a right-to-left deck.\n- **Numbers that stay Latin in every language, because PowerPoint draws them, not OPF:** `{{slide.number}}` and `{{deck.slideCount}}` (the slide number exports as PowerPoint\'s live field, which PowerPoint draws in Latin digits); the markers of a numbered list (PowerPoint\'s auto-number: even its Hindi schemes take their digits from the paragraph\'s text, Devanagari beside Latin words); and every number of a chart PowerPoint draws with its second chart engine (waterfall, histogram, pareto, box and whisker, funnel, treemap), which draws Arabic-Indic digits with another decimal mark and a trailing minus sign. Step badges and agenda numerals export as text and keep the language\'s digits. Dates in headers and footers keep their fixed English month names and Latin digits, because PowerPoint\'s date field is written in English (United States).\n- **Known gap:** in PowerPoint, the language\'s digits in chart labels are drawn in PowerPoint\'s own font for that script, so they look larger or smaller than in the preview\'s bundled face.\n\nA number format the author wrote (`#,##0.00`, `0%`) decides whether a number groups and how many decimals it shows; its `,` and `.` are drawn as the locale\'s group and decimal separators, as Excel and PowerPoint read a format code, and its literal text stays as written.\n\nThe data is a table in `@openpresentation/opf` (`number-locale-data.ts`), read from the platform\'s `Intl` once by `scripts/build-number-locales.mjs` (with PowerPoint\'s Arabic-Indic separators as a stated override) and never at render time, so Node 22, 24 and 26, browsers and edge runtimes draw the same text whatever their ICU version. `formatNumber`, `formatPercentNumber`, `numberLocale`, `numberingSystemOf` and `plainLanguageTag` (exported by the package root and `@openpresentation/opf/composition`) are the one path the engines use. A deck whose generated digits are in a script its authored text does not use (an `ar-SA` deck titled "Q3" with the metric 1000) loads that script\'s font as well: `loadFonts({ scripts: \'auto\' })` and `fonts.ensure` consider the digits each slide\'s language generates.\n\n## Brand assets and layout hints\n\nThe 2026-09-30 spec coverage audit found that the deck logo, `organization.logo`, `speaker.photo`, `design.contentDirection`, `design.chartPrimary`, `design.listBullet` and `fontScheme.accent` validated, edited and round-tripped but changed nothing in any engine. This section states what they do now. Every rule below is implemented once, in `composeSlide()` and `resolveLogo()` of `@openpresentation/opf`, and consumed by the renderer and the exporter; the decisions marked **(vetoable)** are agent decisions the owner can overturn.\n\n### Layout templates and design\n\nAn OPF layout record (`opf-layout/v2`) is one ordered list of `regions`, declared once, in reading order, with a `direction` (`row` or `column`) and splits for two dimensions. A region has a `name`, a relative `size` and rules: accepted content kinds, role, flow, capacity and optional bleed. `layoutContent(record)` and `layoutStructure(record)` summarize those regions for hosts; `composeSlide()` reports their binding and boxes in `geometry.regions`. A slide may use `layout: "auto"` to bypass a record explicitly. [Layout templates](layout-templates.md) documents the binding and flow rules.\n\nThe effective `design` value of each key comes from the slide, then the deck, then the resolved theme, then the layout record, then the engine default. This includes `titleAlignment`, `contentAlignment`, `contentBox`, `contentDirection`, `chartPrimary`, `imageFit`, `listBullet` and `mirror`. `resolveDesignHints()` reports the supplying level, and `SlideComposition.design` holds the merged result. A layout\'s regions determine placement; `design.mirror` reverses its tracks, while the slide\'s own `composition` arranges the first primary flowing region. A top-level image block may still carry its own `placement` band. A layout sits on any slide background; it does not opt into a picture.\n\nThe `tag` (eyebrow) follows `titleAlignment` on every slide, and is start-aligned when none resolves, like the title, so a layout that centres its content does not centre the tag over a start-aligned title. The `subtitle` joins them whenever it sits in the title area (a cover, or a layout with no `subtitle` region of its own), so the heading group shares one alignment axis; a layout with a separate `subtitle` region keeps it on `contentAlignment`. Only the slide\'s own `design.contentAlignment` keeps the tag and that subtitle on content alignment, preserving the 2026-10-06 authoring decision.\n\n### Logos live on the organization (RR-71, OPF 0.18)\n\nA logo belongs to an organization. `Organization.logo` is one path or Asset for every shape, or up to four shapes:\n\n```json\n"organization": {\n "id": "acme", "name": "Acme",\n "logo": {\n "full": { "onLight": "./assets/acme-logo.svg", "onDark": "./assets/acme-logo-white.svg" },\n "icon": "./assets/acme-mark.svg"\n }\n}\n```\n\n`resolveLogo(presentation, slide, { shape, onDark, slideIndex, reference })` (`@openpresentation/opf/composition`) returns `{ source, path, shape, variant, reference, designPath? }` or `null`:\n\n```\n organization 1. options.reference var:organization.beta.logo.icon\n 2. slides[i].design.logo, then design.logo:\n false draws no logo; a reference picks the organization\n (and the shape, when it names one)\n 3. the primary organization role "primary", else the first\n shape the reference\'s shape, else options.shape (default full)\n missing shape -> full -> first of wordmark, stacked, icon\n variant onDark on a dark background, else onLight; a missing one uses\n the other; a plain asset is "default"\n path organization.logo, organization.1.logo.icon,\n organization.logo.full.onDark, ...\n```\n\nAn override that names an organization without a logo draws nothing: it never falls back to another organization. Hosts pass their own background luminance test as `composeSlide(..., { darkBackground })` (`resolveSlideContext` computes it); core never inspects colors.\n\nThe same logos are placed anywhere through slide-scoped built-in references (`var:organization.logo`, `var:organization.logo.icon`, `var:organization.beta.logo.wordmark`), which resolve for each slide\'s background: see [templates and variables](templates-and-variables.md#organization-logos).\n\n### Where the logo is drawn (vetoable)\n\n1. **Cover and section slides.** A slide with no body payload on a title-only template, after empty template regions collapse, or without a layout (the same rule that centers covers) draws the primary organization\'s `full` logo (or the `design.logo` override) at the top-left of the free area, inside the slide padding and below any header furniture. `composeSlide` returns it as `geometry.logo` (`{ box, shape, path, source, variant, reference, anchor: \'left\' }`): `x = area.left + padding`, `y` at the image-safe heading top, `height = 56` reference pixels at a 720-pixel short edge, `width = min(4 * height, free width)`. Headings start one gap below the box and the cover-centering rule centers the tag/title/subtitle group in the remaining span; the logo itself does not move. Consumers fit the image inside the box preserving its aspect ratio, anchored left and vertically centered (SVG `preserveAspectRatio="xMinYMid meet"`; PPTX computes the fitted size from the raster dimensions and places it at `box.x`). Nothing is drawn when no logo resolves or `design.logo` is `false`. **Content slides never get an automatic logo** (vetoable: it would move every content area).\n2. **Headers and footers.** A zone places a logo like any picture: `"image": "var:organization.logo.icon"`. `layoutFurniture` resolves the reference for the slide\'s background; the image part carries the asset in `image`, the organization path in `sourcePath` and the reference in `reference`. Without a logo the engine reports `unresolved-content` at `<zone>.image`. The zone\'s parts sit in one row (see [dynamic composition](dynamic-composition.md)).\n3. **Picture bullets.** See `listBullet` below: the `icon` shape.\n\n> **Decision, 2026-09-30 (agent decision, vetoable).** 84 of the 126 bundled example decks carry a logo, so 81 cover slides gain a logo and their heading group moves down. The placement (top-left, 56 px, full logo) and the content-slide exclusion are the reference-engine defaults; a layout-driven logo slot is a separate design.\n\n### `speaker.photo` is a built-in image variable (vetoable)\n\nNo reference engine draws a speaker photo by itself: the schema has no speaker slot on any slide and no slide-to-speaker link, and a speaker block on covers would be a separate design. The author places it explicitly with the built-in image variable (`"image": "var:speaker.photo"`, see [templates and variables](templates-and-variables.md#built-in-variables)); the field also round-trips through PPTX provenance.\n\n### `contentDirection`\n\nThe effective value follows the normal design precedence: slide, deck, theme, layout, engine default. On automatic slides `vertical` sets the root arrangement to `column` and `horizontal` to `row`, unless the slide explicitly sets `composition.mode`. Promoted regions keep their geometry and nested content groups keep their own composition.\n\nOn a v2 template, `contentDirection` changes every flowing region into a row or column without changing the template\'s regions. An atomic `flow: "none"` region remains atomic. Without the direction hint each region uses its declared flow. Layout records do not have `composition.mode`, `columns` or `weights`; their region list defines the grid.\n\n### `titleAlignment` and `contentAlignment` in right-to-left decks\n\n> **Decision, 2026-10-01 (RR-05, supervisor decision, vetoable).** Alignment is logical. `start` is the start edge and `end` the end edge of each paragraph (the values were `left` and `right` before 0.34): in a deck whose language is written right to left, an Arabic or Hebrew paragraph with the default (or authored) `start` is drawn against the right edge, with its bullets, indents and table cells to match, while an English paragraph in the same deck keeps the left edge. `center` is unchanged and a left-to-right deck is unchanged. `item.alignment` reports the effective value (slide design, then deck design, then the start edge) in the engine\'s words, `left` for `start` and `right` for `end`; `placement.lines[i].alignment` and the exported `algn` carry the physical edge. A right-to-left deck that wants a paragraph at its end edge sets `end`. See [Layout direction](programs/font-fidelity-everywhere/script-font-model.md#layout-direction-rr-05).\n\n**Numbers in right-to-left text (LH-118).** A number with a sign, a currency or a percent sign (`+16%`, `-2.5%`, `$42`; core `numberRanges`) reads left to right inside right-to-left text: "+16%" in an Arabic metric drew as "16%+". The preview wraps each such number in a left-to-right isolate (U+2066 ... U+2069, core `isolateNumbers`), in metric values, deltas and units, table cells, body text and chart text. PowerPoint draws the isolate characters as boxes, so the PPTX export writes each such number as its own `en-US` run (as RR-05 does for a Latin phrase), and writes a paragraph of only such a number left to right (`rtl="0"`) at the physical alignment it had, because PowerPoint still drew "16%+" for an `en-US` run in a right-to-left paragraph of no letters (checked with PowerPoint\'s own slide export). Import reads the split runs and the left-to-right number-only paragraph back as they were authored. Bare digits (`2026`, `1,200`, `10:30`) are unchanged: they read the same in either direction.\n\n### `chartPrimary`\n\nThe resolved `design.chartPrimary` applies on automatic slides only. It changes the root arrangement when the slide has no promoted regions, no `composition.mode` of its own, and its root nodes contain at least one chart leaf and at least one node that is not a chart. The **first chart node is primary** and the other root nodes form one synthetic sub-grid:\n\n- `start` / `end`: the root is a two-track row with weights `[3, 2]` (chart first for `start`, last for `end`; `start` is the left in a left-to-right deck and the right in a right-to-left deck); the rest arrange in `auto` mode inside their track.\n- `top` / `bottom`: a two-track column with weights `[3, 2]` (chart first for `top`).\n- `none`, or any other value: no change, the existing automatic grid with equal weight.\n\nAutomatic composition builds the primary chart track and a direct content group for the other root nodes, preserving the 3:2 chart weight and source content order. A v2 template remains authoritative and does not apply this automatic hint. OPF 0.19 removes the v1 record-construction helper `chartPrimaryLayout`; authors use `chart-beside` or a custom v2 template for an authored grid.\n\nThe synthetic container has no OPF path, so it records no `groups`, `flows` or explanation entry; the root decision has `reason: \'chart-primary\'` and `selectedColumns` 2 (row) or 1 (column). Explicit root `columns` and `weights` are ignored while the automatic hint applies. A chart inside a nested group, a chart-only root, or a single root `chart` payload leaves the arrangement unchanged. A slide using a v2 template follows that template instead.\n\n### `listBullet` (vetoable)\n\n`character` (the default) draws the current glyph marker. `image` draws the organization\'s icon logo (`resolveLogo(..., { shape: \'icon\', onDark })`: the primary organization\'s, or the organization and shape `design.logo` names) as a picture bullet: every `items`/`bullets` item in `composeSlide` and every `listEntries[]` entry of its fit carry `bulletImage: { source, path }`. Marker geometry is unchanged, and each entry carries `bulletBox`, where the image draws: a square of side `marker.fontSize * PICTURE_BULLET_SCALE` (0.65, exported) whose bottom sits on the marker baseline (`marker.y`) with its left edge at `marker.x`. The scale is what desktop PowerPoint draws for an `a:buBlip` at `a:buSzPct 100000` (what the exporter writes), measured as a square 10, 15, 16, 20 and 31 px wide at font sizes of 16, 24, 25, 32 and 48 px (0.625 to 0.646; the heights run a pixel more from anti-aliasing) with its bottom on the text baseline, in Arial, Aptos, Georgia and Courier New alike, so it does not depend on the typeface; the text start and hanging indent are identical in both. The exporter sets no size, because PowerPoint sizes the bullet itself; consumers that draw it themselves (the preview) use `bulletBox`. Vetoable: the constant is a measurement, not a rule of the format. When `image` is set and no logo resolves, the glyph stays and the slide reports one `unresolved-content` diagnostic at `slides.N.design.listBullet` or `design.listBullet`, only when the slide has a list. The renderer draws an `<image>` per marker; the exporter writes native picture bullets (`a:buBlip`).\n\n`none` draws no marker and no hanging indent, for lists that are a label with its explanation (pillars, team members, questions with answers). Every entry\'s text and description start at the left edge of the list box, and each `listEntries[]` marker is `{ none: true, text: \'\', indent: 0 }` (its `x`, `y` and `style` still give the first baseline and font). A nested `level` still steps in by 1.1 em. A list that sets `numbering` keeps its numbers, as it does for `image`. The preview draws nothing for the marker, and the exporter writes `a:buNone` with no margin or indent; a re-import reads the list back through the line roles recorded in the slide\'s provenance (a PPTX without that record keeps one text shape per line).\n\n### `listStyle` (LH-08, vetoable)\n\n`stack` draws each entry\'s text with its description under it, the entries close together. `rows` draws ruled rows: a hairline\n(`ListFit.rules`, `LIST_RULE_WIDTH` = 1 reference pixel in the scheme\'s `neutrals.border`) between two first-level entries, `LIST_ROWS_GAP`\n(0.8 em) between rows, and no bullet; a numbered list keeps its numbers. When every entry has a description and sits at the first level,\nthe labels are bold and, when the widest fits `LIST_ROWS_LABEL_SHARE` (40%) of the list\'s width on one line, sit in a column beside\ntheir descriptions with their first baselines aligned (the label column at the right in a right-to-left list); otherwise each\ndescription sits under its label. The preview draws the hairlines as SVG lines and the PPTX export as native line shapes (`OPF list rule\n<path> N`), at the same geometry. Text sizes keep their roles: the description is 0.82 of the list size, as in a stacked list.\n\nWithout a `listStyle` anywhere, a list of two or more first-level entries that each pair a short label (3 words or fewer and at most 32\ncharacters, no full stop: `isLabelText`) with a description is drawn as rows, under the size guard (the guarded rule `list-rows`): a\nslide keeps the rows only when no block reads smaller than it does with the list stacked. A list of questions with answers is ruled the\nsame way (`pair-rows`, LH-133), each question in a column of 40% of the width, and a glossary\'s terms draw in the accent; a few\nnumbered takeaways and an agenda with descriptions draw numerals beside their rows (LH-134). See\n[Questions and terms](dynamic-composition.md#questions-and-terms-lh-133). Every other list is stacked. Effective value:\nthe slide\'s design, the deck\'s, the theme\'s, then the layout record\'s.\n\n### Eyebrows (LH-32, LH-50)\n\nThe slide `tag` is an eyebrow: `EYEBROW_TAG_SIZE` (22 reference px, 0.4 of the title\'s role size; it was 16), bold, in the primary color (the text color\nwhen the primary is under 4.5:1 on the backdrop), and, where its script has case (`eyebrowCaps`: every letter cased and capitals of the\nsame length), in capitals with `EYEBROW_TRACKING` (0.08 em) of letter spacing. The document keeps the text as written: core sets\n`textStyle.caps` and `textStyle.tracking` and measures the capitals with the spacing (`textWidthMeasurer`, `measureTextOutline`); the\npreview draws the capitals with `letter-spacing`, and the PPTX export writes the authored text with `cap="all"` and `spc`, so it stays\neditable and imports as written. Arabic, Hebrew, CJK and other scripts without case keep their letters and spacing (tracking would break\nthe joining of a cursive script).\n\nA short label next to a longer text is that text\'s eyebrow (LH-50): a root text block of one line, 2 to 32 characters, 3 words or fewer\nand no full stop (`isLabelText`), right before a plain text block that is no label and at least twice as long (`eyebrowLabel`). The two\nare one block of the body: the label is bound to no region and takes no cell; it is drawn as an eyebrow at `eyebrowSize` of the paragraph (`EYEBROW_SHARE`, 0.6 of its size, from `EYEBROW_MIN_SIZE` 20 to\n`EYEBROW_MAX_SIZE` 24 reference px, and always under the paragraph\'s size: one step of the type scale under a paragraph of 20 px or less, never\nunder the floor), `EYEBROW_GAP` (half a gap) over\nthe paragraph, at the paragraph\'s x, width and alignment, and is listed before it (`ComposedItem.eyebrow`). On a card the eyebrow carries\nits paragraph\'s `frameBox`, and engines draw that card once, under the eyebrow. Blocks with a caption, an `emphasis` of their own, or on\na slide that pins a block to a region, are composed as written; a labeled paragraph is never LH-06\'s band or pill. The rule is guarded\n(`eyebrow`): the paragraphs keep at least the size they have with the label as a block of its own.\n\nThe same label heads a list or a group (LH-152), at the root or inside a group, instead of taking an equal-width cell beside it half a\nslide away: a label right before a list (`items` or `bullets`) or a group is that list\'s or group\'s eyebrow, and a group\'s first child that\nis a label, followed by two or more blocks none of which is a label, is the eyebrow of the whole group. A list\'s eyebrow is drawn as a\nparagraph\'s is. A group\'s eyebrow takes a band at the top of the group, sized for the first paragraph or list the group holds, and is drawn\nover the span its blocks finally cover (their cards included), at the content alignment, before them in reading order. Two groups with\neyebrows stay side by side or stacked as peers. An explicit arrangement (a `composition` mode, weights or columns of the slide or\nof the group) keeps its blocks as authored, a group of labels alone heads nothing, a root label before a root list stays a block on a\nlayout with a `sequence` region (LH-07 draws step badges on its lists), and two labels in a row are no eyebrows.\n\n### `fontScheme.accent`\n\n`resolveFontFamilies()` returns `accent` only when the effective scheme defines an `accent` role (a family string or a `Font` object). The slide `tag` (eyebrow) and the quote body use `fonts.accent ?? <current family>` (body for the tag, heading for the quote body); nothing else changes. The renderer loads and embeds it, the exporter writes it on those runs (`a:latin`) while the theme fonts stay major/minor, and import keeps restoring `design.fontScheme` from provenance. None of the bundled examples sets an accent font.\n\n## What is *not* part of this chain\n\nBeyond the color references above, content payloads carry no design controls in v1 \u2014 `position`, `fontSize` overrides at payload level, and the like were deliberately kept out while the content model stabilizes (see [`content-item-design-overrides.md`](./content-item-design-overrides.md); styled table cells and rich-text runs carry the only per-content styling, and their color fields take the reference forms above). The design system, plus layout hints (`titleAlignment`, `contentBox`, `chartPrimary`, ...) and dynamic composition, is the styling surface of an OPF document.\n'
81
+ "markdown": '# Design Resolution\n\nHow an engine decides the effective design for any given slide. The schema spreads these rules across field descriptions; this page states them once, as an algorithm.\n\n## Precedence\n\nFor every design field independently, the most specific source wins:\n\n```\n wins +--------------------------------------------------------+\n ^ | 1. slide design slides[i].design.* |\n | +--------------------------------------------------------+\n | | 2. deck design design.* on the presentation root |\n | +--------------------------------------------------------+\n | | 3. resolved theme colorScheme, fontScheme, |\n | | background, dimensions from the |\n | | theme record |\n | +--------------------------------------------------------+\n loses | 4. engine defaults e.g. spec/reference/ |\n v | engine-defaults.json |\n +--------------------------------------------------------+\n```\n\n1. **Slide design** \u2014 `slides[].design.*`\n2. **Deck design** \u2014 `design.*` on the presentation root\n3. **Resolved theme** \u2014 defaults carried by the theme record (`colorScheme`, `fontScheme`, `background`, `dimensions`)\n4. **Engine defaults** \u2014 [`spec/reference/engine-defaults.json`](../spec/reference/engine-defaults.json), compiled into core as `ENGINE_DEFAULT_THEME`, `ENGINE_DEFAULT_COLOR_SCHEME` and `ENGINE_DEFAULT_FONT_SCHEME`\n\nResolution is **per field**, not per object. A slide that sets only `design.contentAlignment` inherits everything else from the deck design; a deck that sets only `design.colorScheme` keeps the theme\'s font scheme and background.\n\nTwo field-level rules complete the picture:\n\n- **Base-plus-overrides within one object.** Wherever a reference object carries an `id` (`ColorScheme`, `FontScheme`, and the inline `Audience`, `Purpose` and `Tone`), the `id` resolves a catalog record as the base and sibling fields override the resolved record per key. `design.theme` is a reference string only. The string shorthand (`"colorScheme": "cool-horizon"`) is equivalent to setting only `id`.\n\n ```\n "colorScheme": { "id": "cool-horizon", "accent1": "#0F4C81" }\n\n catalog record "cool-horizon" sibling fields on the object\n accent1: "#2874A6" <-- replaced -- accent1: "#0F4C81"\n accent2: "#1B4F72" <-- kept\n light1: "#FFFFFF" <-- kept\n |\n v\n effective scheme: accent1 from the override, everything else\n from the record\n ```\n- **Explicit suppression.** `watermark`, `header`, and `footer` accept `false` to switch off an inherited value \u2014 distinct from omitting the field, which inherits.\n\nEvery reference inside this chain resolves the one way every content reference does: `catalogs.custom`, then the records embedded under `catalogs.default`, then the catalog the host registered for its source (`name:id` in `catalogs.<name>`, then the host catalog for its source); see [`how-opf-works.md`](./how-opf-works.md) and [the catalogs page](default-catalog.md).\n\n## Worked example 1: color scheme through every level\n\n```json\n{\n "design": {\n "theme": "classic",\n "colorScheme": "forest-green"\n },\n "slides": [\n { "title": "Inherits the deck" },\n {\n "title": "Slide override",\n "design": {\n "colorScheme": { "id": "cool-horizon", "accent1": "#0F4C81" }\n }\n }\n ]\n}\n```\n\n- Slide 1: the `classic` theme record supplies its own default color scheme, but the deck design sets `colorScheme` explicitly, so `forest-green` wins (level 2 beats level 3). Fonts, background, and dimensions still come from `classic`.\n- Slide 2: slide design beats deck design (level 1 beats level 2). The `cool-horizon` record resolves as the base, then `accent1` is replaced by `#0F4C81`. All other `cool-horizon` slots survive.\n\nThere is no ambiguity between "override" and "reference": every scheme value *is* a reference, and any sibling fields on the same object are overrides applied after the reference resolves.\n\n## Worked example 2: backgrounds and suppression\n\n```json\n{\n "design": {\n "theme": "minimal",\n "background": "light1",\n "footer": {\n "start": { "text": "Acme Corp" },\n "end": { "text": "{{slide.number}}" }\n }\n },\n "slides": [\n { "title": "Light slide on a theme that defaults to dark" },\n {\n "title": "Section divider",\n "design": {\n "background": {\n "type": "gradient",\n "gradient": {\n "angle": 90,\n "stops": [\n { "color": "#0B1B2B", "position": 0 },\n { "color": "#123A5F", "position": 1 }\n ]\n }\n },\n "footer": false\n }\n }\n ]\n}\n```\n\n- Slide 1: the deck-level `background: "light1"` overrides the `minimal` theme\'s default background (`dark2`). `light1` is a theme slot \u2014 it resolves through the effective color scheme, which itself resolved through the chain above.\n- Slide 2: the gradient replaces the deck background for this slide only, and `footer: false` suppresses the inherited footer rather than inheriting or replacing it.\n\n## Worked example 3: font scheme models\n\n```json\n{\n "design": {\n "fontScheme": {\n "id": "aptos",\n "code": "JetBrains Mono"\n }\n }\n}\n```\n\nThe `aptos` record supplies the OOXML pair (`major`/`minor`). The `code` role is an OPF-specific addition with no OOXML slot, so it layers on top without disturbing the pair. When serializing to PowerPoint, engines write `major`/`minor` to `majorFont`/`minorFont` and map abstract roles (`heading`, `body`) onto those slots. `accent` has no slot; the `code` family is written directly on code runs. The same slot-versus-role split applies to color schemes: OOXML slots (`accent1`\u2013`accent6`, `dark1/2`, `light1/2`) round-trip directly, abstract roles (`primary`, `text`, `surface`, \u2026) are mapped onto slots by the engine.\n\n### Code font\n\nThe `code` role resolves per key like every other override:\n\n1. `code` on the effective `design.fontScheme` object;\n2. `code` on the resolved font-scheme record (the `consolas` and `courier-new` records carry `"Consolas"` and `"Courier New"`);\n3. otherwise **Roboto Mono**, the documented fallback that `@openpresentation/opf-render` bundles.\n\nThe heading and body families are never reused as the code fallback, so choosing `aptos` still gives Roboto Mono code unless the deck sets `code`. `resolveFontFamilies()` in `@openpresentation/opf/composition` applies these rules for all engines.\n\n### Engine default font scheme\n\nThe last-resort font scheme applies only when neither the slide, the deck nor the resolved theme names one, or when the reference resolves nowhere. It is an engine default in code, not a catalog record: `ENGINE_DEFAULT_FONT_SCHEME` (`{ major: "Aptos Display", minor: "Aptos", languageFamily: "latin" }`, the drawing fields of the gallery\'s `aptos` scheme), recorded in [`engine-defaults.json`](../spec/reference/engine-defaults.json) and exported from the package root and `@openpresentation/opf/composition`. A document with no `design` uses the engine default theme (`ENGINE_DEFAULT_THEME`, which names no font scheme), so it gets Aptos in every engine without any catalog registered.\n\nEvery engine shares this one last resort, so a theme without `fontScheme` is measured, paginated, previewed and exported in the same fonts:\n\n| Engine | Last resort | Where |\n| --- | --- | --- |\n| Core pagination and validate | `ENGINE_DEFAULT_FONT_SCHEME` | `packages/javascript/src/design-records.ts` |\n| opf-render preview | core\'s `resolveSlideContext` | `src/svg.js` |\n| opf-editor composition and slide transfer | core\'s `resolveSlideContext` | `src/font-defaults.js` |\n| opf-pptx export | core\'s `resolveSlideContext` | `src/index.js` |\n\nAptos is not openly licensed, so no OPF package bundles it. Previews take the same path for the last resort as for any `aptos` deck:\n\n- **Estimated layout** (no `fonts`): the SVG names `Aptos` and `Aptos Display`, and the default raster engine draws them with its bundled sans-serif fallback (Roboto).\n- **Measured layout** with the opf-render office font pack (`loadFonts({pack: \'office\'})`): `Aptos` and `Aptos Display` resolve to Intos and Intos Display, metric-compatible replacements from the OPF font policy (0.000% mean width difference against Aptos 2.01), and the substitution report lists both. With only the base pack and `substitutionPolicy: "visual"` they fall back to the visual alternates Roboto and Carlito. The PPTX always names Aptos. See [font-fidelity.md](font-fidelity.md#font-policy-ff-31).\n- **Measured layout with only the base pack under the metric policy**: `font-unavailable` for Aptos, as for a document with no `design`. Supply licensed Aptos faces, allow visual substitution, or set a `fallbackFamily`.\n\n`packages/javascript/test/font-scheme-defaults.test.mjs` checks the shared default in core pagination, and each sibling repository has a parity test.\n\n### References that resolve nowhere\n\nA layout, theme, colour scheme or font scheme reference that neither the document embeds nor a registered catalog defines falls back, and no engine throws for it (unless the host asks for a strict export, `strictReferences`, which throws `OPFUnresolvedReferenceError`):\n\n- **Layout.** A slide with no `layout` is composed with **no layout record**, and that is not a finding: title, subtitle, tag and content are arranged automatically, a slide with no body payload is a cover (the title block vertically centred) and the design hints apply. A layout reference that resolves nowhere composes the same way. An engine never substitutes a different layout.\n- **Theme.** A theme reference that resolves nowhere uses the engine default theme (`ENGINE_DEFAULT_THEME`: the background and dimensions of the gallery\'s `minimal`).\n- **Colour scheme.** A colour-scheme reference that resolves nowhere uses `ENGINE_DEFAULT_COLOR_SCHEME` (the twelve slots of `cool-horizon`). The theme\'s own colour scheme counts as the reference when the deck and slide name none, and resolves in the theme\'s catalog group first. An object without an `id` is laid over the engine default, so a partial inline scheme keeps the slots it does not name.\n- **Font scheme.** A font-scheme reference that resolves nowhere uses `ENGINE_DEFAULT_FONT_SCHEME`. Sibling fields on an object reference still override it per key, so `{ "id": "no-such-scheme", "major": "Inter", "minor": "Inter" }` uses Inter, and a `code` role still applies. An object without `id` is an inline scheme on the same base and reports nothing.\n\nEach is one `unresolved-reference` diagnostic: `{ code, kind, reference, path, group, source?, fallback, message }`, with `path` where the reference is written (`slides.N.layout`, `slides.N.design.theme`, `design.colorScheme`, `design.fontScheme.id`, or `catalogs.<group>.themes.<id>.colorScheme` for a reference inside an embedded theme), `fallback` `automatic` for a layout and `engine-default` otherwise, and a message that names the reference and the catalog source it was looked for in. `validate` reports the same references as `opf/unresolved-reference` warnings.\n\n`resolveSlideContext(presentation, index, { catalogs, fonts })` (package root) applies these rules with the slide, deck and theme precedence above. It returns the `ComposeSlideOptions` for one slide (canvas, layout, families as `fontFamilies`, measurement, `slideNumber`, `slideCount`), the slide to compose and draw (`slide`, with `{{slide.number}}`, `{{slide.section}}` and `{{deck.slideCount}}` substituted for those numbers), the diagnostics, and `darkBackground` (the preview\'s decision: the one colour the background names, resolved through the colour scheme and the deck\'s `variables` so `var:brand`, a scheme slot or `primary`/`secondary`/`accent` work, has a WCAG relative luminance below 0.179; a gradient counts as light, a picture reads `light1`, a pattern its `backgroundColor`; no opacity is applied), which `composeSlide` uses to pick logo variants. `resolveDesignRecords` and `resolveFontScheme` expose the same resolution for hosts that need only the records. Core pagination continues with the fallbacks and passes each diagnostic to `onDiagnostic`.\n\n| Engine | Diagnostic channel | Reported |\n| --- | --- | --- |\n| Core pagination | `paginate(..., { onDiagnostic })` | once per path per call |\n| opf-render preview | `toSvg` `onDiagnostic` | once per path per rendered slide |\n| opf-editor | `session.composeSlide` / `paginateSlide` `onDiagnostic` option | once per call |\n| opf-pptx export | `toPptx(..., { onDiagnostic })` | once per path per export |\n\nEvery engine passes the catalogs its host registered (the `catalogs` option) to core, so a record a host registers resolves the same in preview, editor and export.\n\n## Color references in content\n\nContent color fields (`TextRun.color`, styled table cell `style.fill` / `style.color`, table cell border `color`) accept references as well as literal hex, and those references resolve through the same chain above:\n\n```\n "color": "accent2" slot name -> effective color scheme slot\n "color": "text" role name -> role-to-slot mapping, then the slot\n "color": "var:risk" variable -> top-level variables map\n "color": "#B42318" literal -> used as-is (frozen at authoring time)\n```\n\n- **Slot names** (`accent1`\u2013`accent6`, `dark1`, `dark2`, `light1`, `light2`, `hyperlink`, `followedHyperlink`) read the named slot from the *effective* color scheme \u2014 the one produced by the slide \u2192 deck \u2192 theme \u2192 engine-default precedence at the top of this page. A slide-level `design.colorScheme` override therefore recolors that slide\'s named runs too.\n- **Role names** (`primary`, `secondary`, `accent`, `background`, `surface`, `text`, `textSecondary`) resolve through one shared definition, `resolveColorRoles()`, which the opf-render preview, the PPTX export and `validate` all call, so the same deck draws the same colors in each. A role defined on the effective scheme wins; otherwise it defaults from a slot:\n\n | Role | Default (through the slide\'s variant; see [Color variants](#color-variants)) |\n | --- | --- |\n | `primary`, `secondary`, `accent` | the first three accents of the variant: `accent1`, `accent2`, `accent3` unless `variant.accents` reorders them |\n | `background` | the slide\'s own resolved background when it is one color (solid or pattern background color); else the variant\'s `bg1` (`light1` by default, the scheme\'s `background` role overriding it there). A gradient or picture background uses the variant, or its `tone`, or `light1`. |\n | `surface` | `bg2` of the variant: `light2` on a light slide, `dark2` on a dark one |\n | `text` | `tx1` of the variant: `dark1`, or `light1` on a dark slide. A `text` override applies on a light slide only, so a dark slide always keeps readable light text. |\n | `textSecondary` | `tx2` of the variant: `dark2`, or `light2` on a dark slide |\n\n A slide is dark when its background\'s WCAG relative luminance is under 0.179, the point where white and black text contrast equally.\n- **Links.** A link run (`link`) with no `color` of its own is drawn underlined in the scheme\'s `hyperlink` slot (the OOXML `hlink` color; Office blue `#0563C1` when the scheme sets none), in the preview and in the PPTX export (`a:schemeClr hlink` where the deck theme holds that color). Where that color has under 4.5:1 contrast against the slide background (the default Office blue on a dark slide), the slide\'s `text` color is used instead, as the slide tag does for a low-contrast primary color. A link run with its own `color` keeps it, and a `hyperlink` ColorRef always names the slot. `followedHyperlink` is written to the PPTX theme; a static preview cannot know which links were visited, so it draws every link in `hyperlink`.\n- **Variable references** (`var:<id>`) resolve against the document\'s top-level `variables` map, independent of the scheme. Variables are deck-scoped named colors \u2014 use them for values that have meaning (`var:risk`) or repeat across slides. An unknown id is a validation warning, never an error, and engines fall back to their default text color.\n\nThe styled table cell and border color fields enforce the reference forms at the schema level (a typo like `"acent2"` is a schema error there \u2014 neither hex, a known name, nor a `var:` reference). Run colors stay open strings so imported decks keep validating: an unrecognized run color is a validation warning, and renderers fall back to the theme text color \u2014 the same warn-don\'t-error posture unknown catalog ids get. Unknown `var:` ids are warnings everywhere.\n\n### Color variants\n\nA deck has one color scheme of twelve slots. A **variant** is a mapping over those same slots, as PowerPoint\'s `clrMap` is, never a second scheme: which slot is the background, and so which are the text and the alternate surface, plus an optional order for the accents. Everything OPF draws refers to the roles, so a slide that changes variant recolors text, lines, cards, chart furniture and code together.\n\n`variant` is a string, the same way `colorScheme` is: the slot that is the background.\n\n```json\n{\n "design": { "variant": "dark1" },\n "slides": [{ "title": "Light one", "design": { "variant": "light1" } }]\n}\n```\n\n`"dark1"` is `{ "background": "dark1" }`. The object form is only needed to reorder the accents: `{ "background": "light1", "accents": ["accent2", "accent1", "accent3", "accent4", "accent5", "accent6"] }`. Both forms are allowed on `design` and on `slides[n].design`, and what `resolveColorRoles` and `resolveSlideContext` return is always the normalized object (`normalizeColorVariant`).\n\n| `variant` (or `variant.background`) | bg1 | tx1 | bg2 | tx2 |\n| --- | --- | --- | --- | --- |\n| `light1` (default) | `light1` | `dark1` | `light2` | `dark2` |\n| `dark1` | `dark1` | `light1` | `dark2` | `light2` |\n| `light2` | `light2` | `dark1` | `light2` | `dark2` |\n| `dark2` | `dark2` | `light1` | `dark2` | `light2` |\n| `accent1` to `accent6` (LH-01) | the accent | `light1` or `dark1` | the accent | `light2` or `dark2`, else tx1\'s slot |\n\n(`light2` and `dark2` keep the background slot as the surface too, as a slide with that theme background has always been drawn, so the engine default theme, whose background is `dark2`, is unchanged.) An accent variant draws the slide on that accent with the scheme\'s light family (`light1`, `light2`) or dark family (`dark1`, `dark2`), whichever text slot has the higher contrast on the accent; where the family\'s tx2 is under 4.5:1 on it, tx2 maps to tx1\'s slot. No color is invented: the PowerPoint export writes it as a `clrMapOvr` with `bg1="accent1"`. `variant.accents` (object form) is a permutation of `accent1` to `accent6`; entry `i` is the slot drawn as accent `i + 1`, which reorders `primary`, `secondary`, `accent` and the chart series colors.\n\nWhich variant a slide has, from the most specific to the least (slide design, the slide\'s layout record\'s `design.variant` unless the deck or the theme draws a fixed background, deck design, then the theme record), at the first level that says anything:\n\n1. a `variant`;\n2. a theme-slot background (`"dark1"`, `{ "type": "theme", "slot": "dark1" }`), which is the variant of that slot, so `design.background` stays a shorthand;\n3. a picture or gradient background with a `tone` (`"dark"` or `"light"`), which is the `dark1` or `light1` variant. Without a tone a picture takes the tone its recolor, opacity and overlay imply ([images](image-treatments.md)); when they imply none, only a variant of a less specific level can apply, and with none the slide counts as light, as before;\n4. any other background (a solid or pattern color) decides by luminance (dark below 0.179), as before.\n\nA layout record\'s `design.variant` (LH-01) is a default a gallery layout gives, and a background the author fixed beats it (LH-103; docs/programs/layout-harvest/README.md, Decisions). From the most specific:\n\n1. The slide\'s own `variant` or `background` always wins.\n2. If the background the deck or the theme draws is **fixed**, the layout\'s variant does not apply: the slide keeps that background, and its text follows that background\'s `tone` or luminance, exactly as on a slide whose layout names no variant. Fixed is a hex color (the `"#0B1020"` shorthand or a solid\'s `color`), a solid whose color is a `var:` reference (whatever the variable holds: the author named a color of the deck\'s own, not a place in the scheme), a gradient, a pattern or a picture.\n3. If that background is **scheme-based** (none, so the theme\'s slot or the engine default applies; a theme slot, `"dark1"` or `{ "type": "theme" }`; a solid whose color is a scheme slot or role name, such as `accent2`, `primary` or `background`; or a deck `variant`), the layout\'s variant applies on top, ranking above the deck and the theme, unlike the layout\'s other design keys.\n4. Otherwise the deck, then the theme, then the engine default, as above.\n\nThe background the deck or the theme draws is the deck\'s own `background`, else the theme\'s, unless a deck `variant` hides the theme\'s (the slide is then the variant\'s bg1, which is scheme-based). A deck that sets both a fixed background and a `variant` keeps the background on every slide, the layout\'s included; its variant only maps the text and the surfaces. A theme whose own background is fixed counts the same as a deck\'s (no default theme has one). `deckBackgroundIsFixed(deckDesign, themeBackground)` and `isFixedBackground(definition)` (`/composition`) are the rule.\n\nWhere it applies, besides a variant the layout takes a value relative to the deck\'s own variant (the one the deck and the theme give), so a layout keeps the deck\'s tone:\n\n| Layout `design.variant` | Light deck (on `light1`) | Deck on `light2` | Dark deck (on `dark1`, an accent with light text, or a dark slot or role color) | Deck on `dark2` |\n| --- | --- | --- | --- | --- |\n| `surface`, the deck\'s secondary surface | `light2` | `light1` | `dark2` | `dark1` |\n| `brand`, the scheme\'s brand dark, with light text | `dark2` | `dark2` | `dark2` | `dark1` |\n| a variant (`accent1`, `dark1`, an object) | as written | as written | as written | as written |\n\nThe default `section` is `accent1`, `statement` and `quote` are `surface` and `closing` is `brand`, so a dark deck\'s statement stays dark and its closing still stands off the deck. In every default theme and color scheme, light or dark, their text and secondary text reach 4.5:1. Where it applies, the layout variant hides the deck\'s and the theme\'s scheme-based background (the slide is the variant\'s bg1); it never hides a fixed one, so a deck\'s brand photo or hard-coded color stays on its section, statement, quote and closing slides, and the PowerPoint export writes no `clrMapOvr` for them. Without an accent order of its own it keeps the deck\'s. `resolveSlideContext(...).resolved.layoutVariant` is the resolved variant when it decides the slide (undefined over a fixed background); `layoutColorVariant(layout, deck)` (`/composition`) resolves one record.\n\n**A message-only slide (LH-164).** A slide whose whole body is one display message takes the accent surface (`accent1`, the variant the gallery\'s `section` names, in the deck\'s accent order), as Claude Design draws a statement or a one-sentence slide. The body is one message when it is LH-09\'s `statement-message` (a text in a statement record, under a sentence title or a short label) or `display-message` (a lone text of at most 25 words in any script, no citation or footnote, no subtitle, in a layout of one body region with no grid and no picture area), and composition really draws it at display size (a deck whose texts sit on cards keeps its body text); a metric, a quote and everything with a second block keep the plain surface. It takes the layout variant\'s place and its conditions: the slide\'s own `design` sets neither a variant nor a background, and the deck and the theme draw no fixed background or author-chosen scheme color; a layout that names a variant of its own (`section`, `closing`, an authored one) keeps it, and a layout that names only `surface` (`statement`, `quote`) gives way to the accent. **Dark decks keep their background**: a deck or a theme record that sets a dark background or variant is a deliberate design that already gives its messages their emphasis (the engine default theme is no choice of the deck\'s). **A loud accent stays plain**: the accent must carry the slide\'s text at 4.5:1, differ from the deck\'s own surface and be calm enough to fill a slide, CIELCh lightness L* at most 60 and chroma C* at most 80 (`lchOf`, `MESSAGE_SURFACE_MAX_LIGHTNESS`, `MESSAGE_SURFACE_MAX_CHROMA`; Claude Design\'s blue, L* 46.6 and C* 33.8, and the deep purple, L* 38.3 and C* 75.3, qualify; the `boost` red-orange, `corporate-blue` and `vibes` do not). The brand color is never recolored; the slide keeps its plain surface. A deck never shows two accent surfaces on consecutive slides: after a slide that actually took one (judged by its own resolution), or one drawn on an accent by its layout (`section`) or its own variant, the next message slide keeps the plain surface, so a run of message slides alternates. Text colors follow the surface like any variant; a color the author set on a run that does not read on it draws in the nearest one that does, and an image watermark draws in the slide\'s text color so a mark made for the plain surface still reads (a one-color duotone in the export). `resolveSlideContext(...).resolved.messageSurface` `{ kind: \'statement-message\' | \'display-message\', variant }` is the reason (`layoutVariant` and `roles` already follow it), and `composeSlide` echoes it as `SlideComposition.surface`. The PowerPoint export writes the slide\'s `clrMapOvr` as it does for a section, so the surface is the theme\'s accent; an editor can offer the plain surface by setting the slide\'s own `design.variant`.\n\nA theme record can list the variants it offers (`variants`, from gallery 4): named values of `variant`, such as `light`, `light-alt`, `dark` and `dark-alt` on `minimal`, `classic` and `bold`. They are for pickers: choosing one writes its `variant` into `design.variant` (or a slide\'s), and the document keeps that value, not the entry id. The engines read only `design.variant`. There is no `dark` theme in the default catalog: a dark deck is a theme with a dark variant, for example `{ "theme": "classic", "variant": "dark1" }`.\n\nA slide\'s variant replaces the deck\'s whole, accent order included. `resolveSlideContext(...).resolved.roles` is the resolved record, and `resolveColorRoles(scheme, { variant, tone, background })` is the function: besides the colors it returns `variant`, `map` (bg1, tx1, bg2, tx2 and the accents; `clrMapAttributes(map)` gives the PowerPoint `clrMap` attributes for the master and for a slide\'s `clrMapOvr`), `accents` (the six colors in order) and `neutrals`.\n\n#### Scheme-derived neutrals\n\nLines and quiet colors are not fixed grey. `roles.neutrals` derives each from the map, as PowerPoint\'s chart styles do: the text color (tx1) at a share over the background (bg1), chosen as a DrawingML luminance transform of the slot so a PPTX can write `<a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr>` and the preview draws the same color. Each neutral is `{ slot, hex, lumMod?, lumOff?, alpha? }` (the transforms in thousandths of a percent; `hex` is the transform applied, `applyLuminance(slotHex, lumMod, lumOff)`).\n\n| Neutral | Derivation |\n| --- | --- |\n| `border` (also `roles.border`) | tx1 at 20% over bg1: card, rule and table borders |\n| `gridline` | tx1 at 15%: chart gridlines |\n| `axisLine` | tx1 at 25%: chart axis lines |\n| `chartText` | tx1 at 65%: chart axis labels and legend text |\n| `outline` | bg1: pie and treemap outlines, the video play icon, anything drawn on a mark |\n| `trendNeutral` | tx2: the neutral metric trend |\n| `codePanel` | The code block is a dark card on either map (LH-79). Light: tx1, or tx2 when tx1 is near-black (relative luminance 0.01 or less) and bg1 keeps 7:1 on tx2, so a navy theme draws a navy panel. Dark: bg1 at 70% of its lightness (`lumMod` 70000), a step below the slide; a near-black slide takes bg2 when it stands off, else bg1 lifted 6% towards tx1. Over a literal background the bg1 shade is a literal color |\n| `codeText` | bg1 or tx1, whichever reads better on the panel |\n| `codeComment` | the code text at 65% over the panel (comments and line numbers) |\n| `card` | The fill of a card (a composed item\'s `frameBox`, LH-54): the `surface` role, except on a dark slide where the surface does not stand off the background (under 1.1:1, as on the `dark2` variant, whose bg2 is the background) and no `surface` is authored. There the card is the background mixed towards tx1, from 7% until it reaches 1.25:1 (`#172C52` on the default `#011842`), a literal color |\n| `cardBorder` | The card\'s 1 px stroke: `border`, or on a mixed dark card that card mixed 12% towards tx1 (a literal color) |\n\n`codeSyntaxPaletteForRoles(roles)` builds the syntax palette from `codePanel`, `codeText`, `codeComment` and the variant\'s first three accents, and `codeHighlightColors(scheme, palette, codePanel.hex)` takes the panel the highlight band sits on. `readableSchemeColor(fill, roles)` returns bg1 or tx1 (as a scheme color), whichever reads on a fill the scheme does not name, for table header text and text on marks. The validator\'s contrast rules read the same roles, so a dark variant is checked against its own text and surface, and text in a card against `card`. The preview and the PPTX export draw a card with `card` and `cardBorder`, and color a metric in a card (its value and trend) against `card`.\n\n### Background colors are ColorRefs\n\nThe colors of a solid background (`SolidBackground.color`), of each gradient stop and of a pattern (`foregroundColor`, `backgroundColor`) take the same forms as the content fields above: a literal hex, a slot or role name, or a `var:<id>` reference. The schema keeps these fields as plain strings, so a reference validates; engines resolve it through `resolveColorRef()` against the effective color scheme and the deck `variables`, and a reference that resolves to nothing is drawn as the engine default (white for a background), as for any other unresolvable color. The default text color of the slide follows the resolved background. A PPTX export writes `a:schemeClr` where the deck theme holds the named slot or role exactly, and the resolved literal otherwise (FF-24 conventions).\n\n> **Decision, 2026-09-30 (agent decision, vetoable).** The spec coverage audit found that `SolidBackground.color` accepted `var:` and slot names (the field is a string) but both engines painted white, while [`content-item-design-overrides.md`](./content-item-design-overrides.md) already states that every color field must accept the ColorRef forms and never hex alone. Rather than tighten the schema (which would break documents that validate today), the engines resolve ColorRefs in backgrounds. The owner can veto this by restricting the three background color fields to `HexColor` in the schema and the engines to hex only.\n\n`@openpresentation/opf/composition` exports `resolveColorRef()` with the shared slot, role, variable, and hex rules above so renderers and exporters do not drift. Pass the effective color scheme, optional resolved role colors, the deck `variables` map, and a theme-text `fallback` for unrecognized references.\n\n## Script fonts and language\n\nOOXML gives each theme font (major and minor) three script slots: `latin`, East Asian (`ea`) and complex script (`cs`). The presentation `language` and the effective font scheme resolve to all three:\n\n```\n latin design font scheme heading/body (the chain above)\n eastAsian 1. design.fontScheme.eastAsian explicit slot\n complexScript 2. the scheme\'s own major/minor when languageFamily is ea / cs (or eastAsian /\n complexScript, the same values) and its\n languages list (language ids) is empty or\n names the language\n 3. the language\'s font scheme when the language\'s script uses the slot\n 4. the latin family otherwise\n```\n\n- A language record\'s `script` (ISO 15924) picks its slot. East Asian scripts (`Jpan`, `Hans`, `Hant`, `Kore`, ...) use `eastAsian`. Complex scripts (`Arab`, `Hebr`, `Deva`, `Thai`, ...) use `complexScript`. Latin, Cyrillic, Greek and other scripts use `latin`. `direction` defaults from the script (Arabic and Hebrew are right-to-left).\n- The language\'s `fontScheme` applies to PowerPoint output and `googleFontScheme` to Google Slides output. For Latin-script languages, the design font scheme always supplies the latin slot.\n- A language sets `lang`, the text direction and the script slots, and never the Latin scheme: only `design.fontScheme` (slide, then deck, then theme, then the shared default `aptos`) sets the latin fonts, and a language record\'s `fontScheme` is a default for its own script slot, not a deck font. The PPTX theme\'s `a:ea` and `a:cs` are written only for a slot a script font is selected for (the scheme\'s explicit slot or the language\'s script font) and stay empty otherwise, as in Office\'s own themes. See [Language contract](./programs/font-fidelity-everywhere/script-font-model.md#language-contract-ff-50-model-c) and [Theme slots](./programs/font-fidelity-everywhere/script-font-model.md#theme-slots-ff-49).\n- A Latin deck therefore repeats its heading/body family in `ea`/`cs`. A Japanese deck with `design.fontScheme: { "major": "Carlito", "minor": "Carlito" }` keeps the Latin family in `latin` and uses Meiryo (PowerPoint) or Noto Sans JP (Google Slides) in `ea`. `design.fontScheme.eastAsian` / `.complexScript` (`{ "major": ..., "minor": ... }`) name a script font explicitly, for example for CJK text inside a Latin deck.\n\n`@openpresentation/opf/composition` exports `resolveScriptFonts(document, { app, slideIndex })` (`app` is `"powerpoint"`, the default, or `"google-slides"`), and the package root exports `normalizeLanguageFamily(value)` (which reads a font scheme\'s `languageFamily`, `eastAsian` as `ea` and `complexScript` as `cs`). `resolveScriptFonts` returns the heading and body slots, the OOXML `lang` (a curated `ooxmlLang` culture tag such as `ja-JP` or `ms-MY`, or an authored region tag), the canonical `bcp47` tag, `script`, `direction`/`rtl`, and the per-script supplemental theme font. Renderers and exporters should use it rather than re-deriving slots. The model, the OOXML mapping and the open questions are in [`programs/font-fidelity-everywhere/script-font-model.md`](./programs/font-fidelity-everywhere/script-font-model.md). opf-render and opf-pptx implement it (FF-07, FF-19, FF-49).\n\n### Numbers in the language\'s own digits (LH-106, OPF 0.34)\n\nEvery number the engines generate from a numeric value is drawn in the numbering system of the language in effect: the slide\'s `language`, else the deck\'s. That covers a metric\'s numeric `value` and `delta`, chart data labels, value-axis ticks, percentages, the pie value list and the doughnut hole, table cells that hold numbers, step badges and agenda numerals, and number variables placed on a slide or in the header and footer. Text the author typed is never rewritten: a title that says "999" stays "999", and a string metric value is drawn as written.\n\nThe numbering system is the locale\'s own, as the Unicode CLDR data defines it: `ar-SA` and `ar-EG` draw Arabic-Indic digits (\u0669\u0669\u0669, \u0661,\u0660\u0660\u0660), `ar-AE`, `ar-MA`, `ar-DZ`, `ar-TN` and a bare `ar` draw Latin digits, `fa-IR` draws Persian digits (\u06F9\u06F9\u06F9, \u06F1\u066C\u06F0\u06F0\u06F0), `bn` draws Bengali digits, `hi-IN` and every `en-*` tag draw Latin digits. Digits, decimal and group separators, grouping (thousands, or the Indian lakh and crore in `hi-IN` and `en-IN`) and the percent sign all come from the same entry, so 999 and 1,000 are always drawn in the same system. To choose another, add the standard BCP 47 Unicode extension `-u-nu-<system>` to the tag:\n\n```json\n{ "language": "ar-SA-u-nu-latn", "slides": [{ "title": "\u0627\u0644\u0645\u0624\u0634\u0631\u0627\u062A", "metric": { "value": 1250, "label": "\u0627\u0644\u0639\u0645\u0644\u0627\u0621" } }] }\n```\n\nThis Saudi Arabic deck draws `1,250`; `ar-AE-u-nu-arab` draws `\u0661,\u0662\u0665\u0660` in an Emirati one. The extension is OPF\'s: PowerPoint\'s `lang` attribute is written without it (`ar-SA`), and the tag as written comes back from a PPTX round trip through the document\'s provenance.\n\n**OPF draws what PowerPoint draws.** A deck is seen in OPF\'s preview and in PowerPoint, so OPF draws a numbering system only where PowerPoint draws the same digits, with the same separators (vetoable decisions of 2026-11-12, from PowerPoint 16.0.20527):\n\n- OPF draws Latin, Arabic-Indic (`arab`), Persian (`arabext`), Devanagari (`deva`) and Bengali (`beng`) digits. Any other system (Thai, Myanmar, ...), the locale\'s own or one `-u-nu-` names, is drawn in Latin digits, and `opf/language-tag` warns about such an extension.\n- Arabic-Indic digits take the Latin comma, period and percent sign (`\u0661,\u0662\u0663\u0664.\u0665\u0660`, `\u0662\u0665%`), because PowerPoint draws its charts so; Persian digits take the Persian separators and percent sign (`\u06F1\u066C\u06F2\u06F3\u06F4\u066B\u06F5\u06F0`, `\u06F2\u06F5\u066A`). Every other locale uses its CLDR separators (`1.234,50` in German).\n- PowerPoint formats a native chart\'s values itself. The export prefixes every number format of a classic chart (column, bar, line, area, pie, doughnut, scatter, ...) on such a slide with PowerPoint\'s numeral shape (`[$-2000000]` Arabic-Indic, `[$-3000000]` Persian, `[$-4000000]` Devanagari, `[$-5000000]` Bengali), so PowerPoint draws the chart in the same digits; import removes the prefix again. The preview draws each such chart number left to right as one unit (digits, then the percent sign; a sign before the digits), as PowerPoint does in a right-to-left deck.\n- **Numbers that stay Latin in every language, because PowerPoint draws them, not OPF:** `{{slide.number}}` and `{{deck.slideCount}}` (the slide number exports as PowerPoint\'s live field, which PowerPoint draws in Latin digits); the markers of a numbered list (PowerPoint\'s auto-number: even its Hindi schemes take their digits from the paragraph\'s text, Devanagari beside Latin words); and every number of a chart PowerPoint draws with its second chart engine (waterfall, histogram, pareto, box and whisker, funnel, treemap), which draws Arabic-Indic digits with another decimal mark and a trailing minus sign. Step badges and agenda numerals export as text and keep the language\'s digits. Dates in headers and footers keep their fixed English month names and Latin digits, because PowerPoint\'s date field is written in English (United States).\n- **Known gap:** in PowerPoint, the language\'s digits in chart labels are drawn in PowerPoint\'s own font for that script, so they look larger or smaller than in the preview\'s bundled face.\n\nA number format the author wrote (`#,##0.00`, `0%`) decides whether a number groups and how many decimals it shows; its `,` and `.` are drawn as the locale\'s group and decimal separators, as Excel and PowerPoint read a format code, and its literal text stays as written.\n\nThe data is a table in `@openpresentation/opf` (`number-locale-data.ts`), read from the platform\'s `Intl` once by `scripts/build-number-locales.mjs` (with PowerPoint\'s Arabic-Indic separators as a stated override) and never at render time, so Node 22, 24 and 26, browsers and edge runtimes draw the same text whatever their ICU version. `formatNumber`, `formatPercentNumber`, `numberLocale`, `numberingSystemOf` and `plainLanguageTag` (exported by the package root and `@openpresentation/opf/composition`) are the one path the engines use. A deck whose generated digits are in a script its authored text does not use (an `ar-SA` deck titled "Q3" with the metric 1000) loads that script\'s font as well: `loadFonts({ scripts: \'auto\' })` and `fonts.ensure` consider the digits each slide\'s language generates.\n\n## Brand assets and layout hints\n\nThe 2026-09-30 spec coverage audit found that the deck logo, `organization.logo`, `speaker.photo`, `design.contentDirection`, `design.chartPrimary`, `design.listBullet` and `fontScheme.accent` validated, edited and round-tripped but changed nothing in any engine. This section states what they do now. Every rule below is implemented once, in `composeSlide()` and `resolveLogo()` of `@openpresentation/opf`, and consumed by the renderer and the exporter; the decisions marked **(vetoable)** are agent decisions the owner can overturn.\n\n### Layout templates and design\n\nAn OPF layout record (`opf-layout/v2`) is one ordered list of `regions`, declared once, in reading order, with a `direction` (`row` or `column`) and splits for two dimensions. A region has a `name`, a relative `size` and rules: accepted content kinds, role, flow, capacity and optional bleed. `layoutContent(record)` and `layoutStructure(record)` summarize those regions for hosts; `composeSlide()` reports their binding and boxes in `geometry.regions`. A slide may use `layout: "auto"` to bypass a record explicitly. [Layout templates](layout-templates.md) documents the binding and flow rules.\n\nThe effective `design` value of each key comes from the slide, then the deck, then the resolved theme, then the layout record, then the engine default. This includes `titleAlignment`, `contentAlignment`, `contentBox`, `contentDirection`, `chartPrimary`, `imageFit`, `listBullet` and `mirror`. `resolveDesignHints()` reports the supplying level, and `SlideComposition.design` holds the merged result. A layout\'s regions determine placement; `design.mirror` reverses its tracks, while the slide\'s own `composition` arranges the first primary flowing region. A top-level image block may still carry its own `placement` band. A layout sits on any slide background; it does not opt into a picture.\n\nThe `tag` (eyebrow) follows `titleAlignment` on every slide, and is start-aligned when none resolves, like the title, so a layout that centres its content does not centre the tag over a start-aligned title. The `subtitle` joins them whenever it sits in the title area (a cover, or a layout with no `subtitle` region of its own), so the heading group shares one alignment axis; a layout with a separate `subtitle` region keeps it on `contentAlignment`. Only the slide\'s own `design.contentAlignment` keeps the tag and that subtitle on content alignment, preserving the 2026-10-06 authoring decision.\n\n### Logos live on the organization (RR-71, OPF 0.18)\n\nA logo belongs to an organization. `Organization.logo` is one path or Asset for every shape, or up to four shapes:\n\n```json\n"organization": {\n "id": "acme", "name": "Acme",\n "logo": {\n "full": { "onLight": "./assets/acme-logo.svg", "onDark": "./assets/acme-logo-white.svg" },\n "icon": "./assets/acme-mark.svg"\n }\n}\n```\n\n`resolveLogo(presentation, slide, { shape, onDark, slideIndex, reference })` (`@openpresentation/opf/composition`) returns `{ source, path, shape, variant, reference, designPath? }` or `null`:\n\n```\n organization 1. options.reference var:organization.beta.logo.icon\n 2. slides[i].design.logo, then design.logo:\n false draws no logo; a reference picks the organization\n (and the shape, when it names one)\n 3. the primary organization role "primary", else the first\n shape the reference\'s shape, else options.shape (default full)\n missing shape -> full -> first of wordmark, stacked, icon\n variant onDark on a dark background, else onLight; a missing one uses\n the other; a plain asset is "default"\n path organization.logo, organization.1.logo.icon,\n organization.logo.full.onDark, ...\n```\n\nAn override that names an organization without a logo draws nothing: it never falls back to another organization. Hosts pass their own background luminance test as `composeSlide(..., { darkBackground })` (`resolveSlideContext` computes it); core never inspects colors.\n\nThe same logos are placed anywhere through slide-scoped built-in references (`var:organization.logo`, `var:organization.logo.icon`, `var:organization.beta.logo.wordmark`), which resolve for each slide\'s background: see [templates and variables](templates-and-variables.md#organization-logos).\n\n### Where the logo is drawn (vetoable)\n\n1. **Cover and section slides.** A slide with no body payload on a title-only template, after empty template regions collapse, or without a layout (the same rule that centers covers) draws the primary organization\'s `full` logo (or the `design.logo` override) at the top-left of the free area, inside the slide padding and below any header furniture. `composeSlide` returns it as `geometry.logo` (`{ box, shape, path, source, variant, reference, anchor: \'left\' }`): `x = area.left + padding`, `y` at the image-safe heading top, `height = 56` reference pixels at a 720-pixel short edge, `width = min(4 * height, free width)`. Headings start one gap below the box and the cover-centering rule centers the tag/title/subtitle group in the remaining span; the logo itself does not move. Consumers fit the image inside the box preserving its aspect ratio, anchored left and vertically centered (SVG `preserveAspectRatio="xMinYMid meet"`; PPTX computes the fitted size from the raster dimensions and places it at `box.x`). Nothing is drawn when no logo resolves or `design.logo` is `false`. **Content slides never get an automatic logo** (vetoable: it would move every content area).\n2. **Headers and footers.** A zone places a logo like any picture: `"image": "var:organization.logo.icon"`. `layoutFurniture` resolves the reference for the slide\'s background; the image part carries the asset in `image`, the organization path in `sourcePath` and the reference in `reference`. Without a logo the engine reports `unresolved-content` at `<zone>.image`. The zone\'s parts sit in one row (see [dynamic composition](dynamic-composition.md)).\n3. **Picture bullets.** See `listBullet` below: the `icon` shape.\n\n> **Decision, 2026-09-30 (agent decision, vetoable).** 84 of the 126 bundled example decks carry a logo, so 81 cover slides gain a logo and their heading group moves down. The placement (top-left, 56 px, full logo) and the content-slide exclusion are the reference-engine defaults; a layout-driven logo slot is a separate design.\n\n### `speaker.photo` is a built-in image variable (vetoable)\n\nNo reference engine draws a speaker photo by itself: the schema has no speaker slot on any slide and no slide-to-speaker link, and a speaker block on covers would be a separate design. The author places it explicitly with the built-in image variable (`"image": "var:speaker.photo"`, see [templates and variables](templates-and-variables.md#built-in-variables)); the field also round-trips through PPTX provenance.\n\n### `contentDirection`\n\nThe effective value follows the normal design precedence: slide, deck, theme, layout, engine default. On automatic slides `vertical` sets the root arrangement to `column` and `horizontal` to `row`, unless the slide explicitly sets `composition.mode`. Promoted regions keep their geometry and nested content groups keep their own composition.\n\nOn a v2 template, `contentDirection` changes every flowing region into a row or column without changing the template\'s regions. An atomic `flow: "none"` region remains atomic. Without the direction hint each region uses its declared flow. Layout records do not have `composition.mode`, `columns` or `weights`; their region list defines the grid.\n\nThe resolved direction also chooses how a lone list with icons is drawn (a list that can be LH-165\'s [icon cards](icons.md#icon-cards-lh-165)): where the root arrangement resolves to `column` (`vertical`, or the slide\'s own `composition.mode: "column"`, which wins), or the list\'s layout region is arranged as a column (the slide\'s own `composition.mode` in the first primary flowing region it arranges, else `contentDirection`), the list stays ruled rows with each entry\'s chip at the start of its row (the end in a right-to-left deck), at the size the rows have without icons; `row`, `grid`, `auto` and no direction draw the icon cards. A layout region\'s own `flow` is no direction for this choice, so a layout\'s lone list keeps its cards unless the slide sets `composition.mode: "column"` or `contentDirection` is `vertical`.\n\n### `titleAlignment` and `contentAlignment` in right-to-left decks\n\n> **Decision, 2026-10-01 (RR-05, supervisor decision, vetoable).** Alignment is logical. `start` is the start edge and `end` the end edge of each paragraph (the values were `left` and `right` before 0.34): in a deck whose language is written right to left, an Arabic or Hebrew paragraph with the default (or authored) `start` is drawn against the right edge, with its bullets, indents and table cells to match, while an English paragraph in the same deck keeps the left edge. `center` is unchanged and a left-to-right deck is unchanged. `item.alignment` reports the effective value (slide design, then deck design, then the start edge) in the engine\'s words, `left` for `start` and `right` for `end`; `placement.lines[i].alignment` and the exported `algn` carry the physical edge. A right-to-left deck that wants a paragraph at its end edge sets `end`. See [Layout direction](programs/font-fidelity-everywhere/script-font-model.md#layout-direction-rr-05).\n\n**Numbers in right-to-left text (LH-118).** A number with a sign, a currency or a percent sign (`+16%`, `-2.5%`, `$42`; core `numberRanges`) reads left to right inside right-to-left text: "+16%" in an Arabic metric drew as "16%+". The preview wraps each such number in a left-to-right isolate (U+2066 ... U+2069, core `isolateNumbers`), in metric values, deltas and units, table cells, body text and chart text. PowerPoint draws the isolate characters as boxes, so the PPTX export writes each such number as its own `en-US` run (as RR-05 does for a Latin phrase), and writes a paragraph of only such a number left to right (`rtl="0"`) at the physical alignment it had, because PowerPoint still drew "16%+" for an `en-US` run in a right-to-left paragraph of no letters (checked with PowerPoint\'s own slide export). Import reads the split runs and the left-to-right number-only paragraph back as they were authored. Bare digits (`2026`, `1,200`, `10:30`) are unchanged: they read the same in either direction.\n\n### `chartPrimary`\n\nThe resolved `design.chartPrimary` applies on automatic slides only. It changes the root arrangement when the slide has no promoted regions, no `composition.mode` of its own, and its root nodes contain at least one chart leaf and at least one node that is not a chart. The **first chart node is primary** and the other root nodes form one synthetic sub-grid:\n\n- `start` / `end`: the root is a two-track row with weights `[3, 2]` (chart first for `start`, last for `end`; `start` is the left in a left-to-right deck and the right in a right-to-left deck); the rest arrange in `auto` mode inside their track.\n- `top` / `bottom`: a two-track column with weights `[3, 2]` (chart first for `top`).\n- `none`, or any other value: no change, the existing automatic grid with equal weight.\n\nAutomatic composition builds the primary chart track and a direct content group for the other root nodes, preserving the 3:2 chart weight and source content order. A v2 template remains authoritative and does not apply this automatic hint. OPF 0.19 removes the v1 record-construction helper `chartPrimaryLayout`; authors use `chart-beside` or a custom v2 template for an authored grid.\n\nThe synthetic container has no OPF path, so it records no `groups`, `flows` or explanation entry; the root decision has `reason: \'chart-primary\'` and `selectedColumns` 2 (row) or 1 (column). Explicit root `columns` and `weights` are ignored while the automatic hint applies. A chart inside a nested group, a chart-only root, or a single root `chart` payload leaves the arrangement unchanged. A slide using a v2 template follows that template instead.\n\n### `listBullet` (vetoable)\n\n`character` (the default) draws the current glyph marker. `image` draws the organization\'s icon logo (`resolveLogo(..., { shape: \'icon\', onDark })`: the primary organization\'s, or the organization and shape `design.logo` names) as a picture bullet: every `items`/`bullets` item in `composeSlide` and every `listEntries[]` entry of its fit carry `bulletImage: { source, path }`. Marker geometry is unchanged, and each entry carries `bulletBox`, where the image draws: a square of side `marker.fontSize * PICTURE_BULLET_SCALE` (0.65, exported) whose bottom sits on the marker baseline (`marker.y`) with its left edge at `marker.x`. The scale is what desktop PowerPoint draws for an `a:buBlip` at `a:buSzPct 100000` (what the exporter writes), measured as a square 10, 15, 16, 20 and 31 px wide at font sizes of 16, 24, 25, 32 and 48 px (0.625 to 0.646; the heights run a pixel more from anti-aliasing) with its bottom on the text baseline, in Arial, Aptos, Georgia and Courier New alike, so it does not depend on the typeface; the text start and hanging indent are identical in both. The exporter sets no size, because PowerPoint sizes the bullet itself; consumers that draw it themselves (the preview) use `bulletBox`. Vetoable: the constant is a measurement, not a rule of the format. When `image` is set and no logo resolves, the glyph stays and the slide reports one `unresolved-content` diagnostic at `slides.N.design.listBullet` or `design.listBullet`, only when the slide has a list. The renderer draws an `<image>` per marker; the exporter writes native picture bullets (`a:buBlip`).\n\n`none` draws no marker and no hanging indent, for lists that are a label with its explanation (pillars, team members, questions with answers). Every entry\'s text and description start at the left edge of the list box, and each `listEntries[]` marker is `{ none: true, text: \'\', indent: 0 }` (its `x`, `y` and `style` still give the first baseline and font). A nested `level` still steps in by 1.1 em. A list that sets `numbering` keeps its numbers, as it does for `image`. The preview draws nothing for the marker, and the exporter writes `a:buNone` with no margin or indent; a re-import reads the list back through the line roles recorded in the slide\'s provenance (a PPTX without that record keeps one text shape per line).\n\n### `listStyle` (LH-08, vetoable)\n\n`stack` draws each entry\'s text with its description under it, the entries close together. `rows` draws ruled rows: a hairline\n(`ListFit.rules`, `LIST_RULE_WIDTH` = 1 reference pixel in the scheme\'s `neutrals.border`) between two first-level entries, `LIST_ROWS_GAP`\n(0.8 em) between rows, and no bullet; a numbered list keeps its numbers. When every entry has a description and sits at the first level,\nthe labels are bold and, when the widest fits `LIST_ROWS_LABEL_SHARE` (40%) of the list\'s width on one line, sit in a column beside\ntheir descriptions with their first baselines aligned (the label column at the right in a right-to-left list); otherwise each\ndescription sits under its label. The preview draws the hairlines as SVG lines and the PPTX export as native line shapes (`OPF list rule\n<path> N`), at the same geometry. Text sizes keep their roles: the description is 0.82 of the list size, as in a stacked list.\n\nWithout a `listStyle` anywhere, a list of two or more first-level entries that each pair a short label (3 words or fewer and at most 32\ncharacters, no full stop: `isLabelText`) with a description is drawn as rows, under the size guard (the guarded rule `list-rows`): a\nslide keeps the rows only when no block reads smaller than it does with the list stacked. A list of questions with answers is ruled the\nsame way (`pair-rows`, LH-133), each question in a column of 40% of the width, and a glossary\'s terms draw in the accent; a few\nnumbered takeaways and an agenda with descriptions draw numerals beside their rows (LH-134). See\n[Questions and terms](dynamic-composition.md#questions-and-terms-lh-133). Every other list is stacked. Effective value:\nthe slide\'s design, the deck\'s, the theme\'s, then the layout record\'s.\n\n### Eyebrows (LH-32, LH-50)\n\nThe slide `tag` is an eyebrow: `EYEBROW_TAG_SIZE` (22 reference px, 0.4 of the title\'s role size; it was 16), bold, in the primary color (the text color\nwhen the primary is under 4.5:1 on the backdrop), and, where its script has case (`eyebrowCaps`: every letter cased and capitals of the\nsame length), in capitals with `EYEBROW_TRACKING` (0.08 em) of letter spacing. The document keeps the text as written: core sets\n`textStyle.caps` and `textStyle.tracking` and measures the capitals with the spacing (`textWidthMeasurer`, `measureTextOutline`); the\npreview draws the capitals with `letter-spacing`, and the PPTX export writes the authored text with `cap="all"` and `spc`, so it stays\neditable and imports as written. Arabic, Hebrew, CJK and other scripts without case keep their letters and spacing (tracking would break\nthe joining of a cursive script).\n\nA short label next to a longer text is that text\'s eyebrow (LH-50): a root text block of one line, 2 to 32 characters, 3 words or fewer\nand no full stop (`isLabelText`), right before a plain text block that is no label and at least twice as long (`eyebrowLabel`). The two\nare one block of the body: the label is bound to no region and takes no cell; it is drawn as an eyebrow at `eyebrowSize` of the paragraph (`EYEBROW_SHARE`, 0.6 of its size, from `EYEBROW_MIN_SIZE` 20 to\n`EYEBROW_MAX_SIZE` 24 reference px, and always under the paragraph\'s size: one step of the type scale under a paragraph of 20 px or less, never\nunder the floor), `EYEBROW_GAP` (half a gap) over\nthe paragraph, at the paragraph\'s x, width and alignment, and is listed before it (`ComposedItem.eyebrow`). On a card the eyebrow carries\nits paragraph\'s `frameBox`, and engines draw that card once, under the eyebrow. Blocks with a caption, an `emphasis` of their own, or on\na slide that pins a block to a region, are composed as written; a labeled paragraph is never LH-06\'s band or pill. The rule is guarded\n(`eyebrow`): the paragraphs keep at least the size they have with the label as a block of its own.\n\nThe same label heads a list or a group (LH-152), at the root or inside a group, instead of taking an equal-width cell beside it half a\nslide away: a label right before a list (`items` or `bullets`) or a group is that list\'s or group\'s eyebrow, and a group\'s first child that\nis a label, followed by two or more blocks none of which is a label, is the eyebrow of the whole group. A list\'s eyebrow is drawn as a\nparagraph\'s is. A group\'s eyebrow takes a band at the top of the group, sized for the first paragraph or list the group holds, and is drawn\nover the span its blocks finally cover (their cards included), at the content alignment, before them in reading order. Two groups with\neyebrows stay side by side or stacked as peers. An explicit arrangement (a `composition` mode, weights or columns of the slide or\nof the group) keeps its blocks as authored, a group of labels alone heads nothing, a root label before a root list stays a block on a\nlayout with a `sequence` region (LH-07 draws step badges on its lists), and two labels in a row are no eyebrows.\n\n### `fontScheme.accent`\n\n`resolveFontFamilies()` returns `accent` only when the effective scheme defines an `accent` role (a family string or a `Font` object). The slide `tag` (eyebrow) and the quote body use `fonts.accent ?? <current family>` (body for the tag, heading for the quote body); nothing else changes. The renderer loads and embeds it, the exporter writes it on those runs (`a:latin`) while the theme fonts stay major/minor, and import keeps restoring `design.fontScheme` from provenance. None of the bundled examples sets an accent font.\n\n## What is *not* part of this chain\n\nBeyond the color references above, content payloads carry no design controls in v1 \u2014 `position`, `fontSize` overrides at payload level, and the like were deliberately kept out while the content model stabilizes (see [`content-item-design-overrides.md`](./content-item-design-overrides.md); styled table cells and rich-text runs carry the only per-content styling, and their color fields take the reference forms above). The design system, plus layout hints (`titleAlignment`, `contentBox`, `chartPrimary`, ...) and dynamic composition, is the styling surface of an OPF document.\n'
82
82
  },
83
83
  {
84
84
  "slug": "diagrams",
85
85
  "file": "docs/diagrams.md",
86
86
  "title": "Diagrams",
87
- "markdown": '# Diagrams\n\nA `diagram` is a diagram written as text. You write [Mermaid](https://mermaid.js.org), [Graphviz DOT](#graphviz-dot) or [PlantUML](#plantuml) source, and the engines draw it in the deck\'s own fonts and colors, so a flowchart, a sequence of messages or a mind map looks like the rest of the slide and not like a pasted screenshot. This guide covers when to use one, how to write it in JSON, YAML and Markdown, what it looks like, how it is sized, and how it exports. The field reference is [Content payloads](content-payloads.md#diagram); the schema definition is `$defs.Diagram` (`opf schema presentation \'/$defs/Diagram\'`).\n\n## When to use a diagram\n\nChoose the content kind by what the content is, not by how it should look.\n\n| The content is | Use |\n| --- | --- |\n| Steps, a decision flow, systems and how they connect, messages between parties, states and transitions, a hierarchy, an entity model | `diagram` |\n| Numbers plotted on axes or as shares of a whole, where the values should stay editable data | `chart` |\n| Dated or ordered milestones with progress (`done`, `current`, `planned`) | `timeline` (the payload, with its status design) |\n| Parallel entries with details, or a short sequence of one-line steps | a list (`items`) or layout `process` |\n\nA Mermaid `pie` or `timeline` diagram is a quick picture. A `chart` or `timeline` payload keeps the data editable and gets the engines\' chart and timeline design, with highlights and status words. Prefer the payload when it fits and the diagram when only a diagram can show the structure.\n\n## Writing one\n\nA string is shorthand for `{ "source": value }`. The object form adds `alt`, the text alternative, and `syntax`: `"mermaid"` (the default), `"dot"` for a [Graphviz DOT](#graphviz-dot) graph or `"plantuml"` for a [PlantUML](#plantuml) diagram. A diagram is a root payload, a block, or the content of a layout region that accepts it. It takes a `caption` like an image or a chart.\n\n```json\n{\n "title": "Every request is reviewed before it ships",\n "diagram": "flowchart LR\\n A[Request] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| D[Revise]\\n D --> A"\n}\n```\n\nThe slide this draws, in the engine\'s default design:\n\n![The slide drawn from the example: the title above a flowchart in which a request goes to an Approved? decision, yes leads to Build and no leads to Revise, which loops back to the request.](images/diagrams/review-loop.svg)\n\nWith an `alt` and a caption:\n\n```json\n{\n "title": "A rejected brief returns to its author",\n "diagram": {\n "source": "flowchart LR\\n A[Brief] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| A",\n "alt": "A brief goes to review. Approved work is built; rejected work returns to the brief."\n },\n "caption": "Figure 1. The review loop"\n}\n```\n\n![The slide drawn from the example: a brief goes to an Approved? decision, yes leads to Build and no returns to the brief, with the caption Figure 1. The review loop under the diagram.](images/diagrams/review-loop-caption.svg)\n\nAs YAML a block scalar keeps the source readable:\n\n```yaml\n- title: Every request is reviewed before it ships\n diagram:\n alt: A request is approved or revised, then built.\n source: |-\n flowchart LR\n A[Request] --> B{Approved?}\n B -->|yes| C[Build]\n B -->|no| D[Revise]\n D --> A\n```\n\nBeside text, give the slide `blocks`; the diagram takes its own cell:\n\n```json\n{\n "title": "The client talks to one API",\n "blocks": [\n { "bullets": ["The client creates a deck with one call", "The API validates it before it answers"] },\n { "diagram": "sequenceDiagram\\n Client->>API: POST /decks\\n API-->>Client: 201 Created" }\n ]\n}\n```\n\n![The slide drawn from the example: two bullets on the left and, on the right, a sequence diagram in which the client sends POST /decks to the API and the API answers 201 Created.](images/diagrams/beside-text.svg)\n\n### In Markdown\n\nA fenced block whose info word is `mermaid` is a diagram, one whose info word is `dot` is a [DOT diagram](#graphviz-dot) (`{ source, syntax: "dot" }`) and one whose info word is `plantuml` a [PlantUML diagram](#plantuml) (`{ source, syntax: "plantuml" }`). An optional `alt="..."` after the word is its text alternative. `toMarkdown` writes a diagram back the same way, so the round trip is lossless.\n\n````markdown\n# Every request is reviewed before it ships\n\n```mermaid alt="A request is approved or revised, then built."\nflowchart LR\n A[Request] --> B{Approved?}\n B -->|yes| C[Build]\n B -->|no| D[Revise]\n D --> A\n```\n````\n\nA source with a blank first or last line, or an `alt` that holds a backtick or a line break, cannot be written as a fence; the writer then uses an `opf-block`, which reads back exactly. See [Markdown and outlines](markdown.md). A runnable deck is [`examples/markdown/diagrams.opf.md`](../examples/markdown/diagrams.opf.md), and the JSON fixture [`examples/technical/diagrams.opf.json`](../examples/technical/diagrams.opf.json) has seven slides.\n\n## Supported Mermaid families\n\nOPF draws diagrams with [pele](https://pele.run), the shared layout/drawing library pinned as `pele@1.13.0` in this source. It parses Mermaid 12.1 syntax. OPF reads the supported DOT and PlantUML subsets itself and adapts them to the same engine; these are not separate Graphviz or PlantUML renderer installations. The first line of the source names the family. All the built-in families are supported; ZenUML is not.\n\n| Family | First line | Shows |\n| --- | --- | --- |\n| Flowchart | `flowchart LR` or `TB` | Steps, decisions and flow |\n| Sequence | `sequenceDiagram` | Messages between participants over time |\n| Class | `classDiagram` | Classes, members and relationships |\n| State | `stateDiagram-v2` | States and transitions |\n| Entity relationship | `erDiagram` | Entities, attributes and cardinalities |\n| Gantt | `gantt` | Tasks on a calendar |\n| Pie | `pie` | Shares of a whole |\n| Quadrant | `quadrantChart` | Points on two axes |\n| Mind map | `mindmap` | A hierarchy of ideas |\n| Timeline | `timeline` | Periods with events, in sections |\n| User journey | `journey` | Tasks with a satisfaction score |\n| XY chart | `xychart` | Bars and lines on axes |\n| Sankey | `sankey` | Flows between nodes |\n| Git graph | `gitGraph` | Commits, branches and merges |\n| C4 | `C4Context` and the other C4 headers | System context, containers, components |\n| Block | `block` | Blocks on a grid |\n| Architecture | `architecture-beta` | Services, groups and connections |\n| Kanban | `kanban` | Columns of cards |\n| Packet | `packet` | Bit fields of a protocol packet |\n| Radar | `radar-beta` | Several measures on radial axes |\n| Treemap | `treemap` | Nested rectangles sized by value |\n| Venn | `venn-beta` | Overlapping sets |\n| Ishikawa | `ishikawa-beta` | Causes of a problem (fishbone) |\n| Requirement | `requirementDiagram` | Requirements and what satisfies them |\n| Wardley map | `wardley-beta` | Components by visibility and evolution |\n| Tree view | `treeView-beta` | A folder-style hierarchy |\n| Event modeling | `eventmodeling` | Commands, events and views along a timeline |\n| Railroad | `railroad-beta` (also `railroad-ebnf-beta`, `railroad-abnf-beta`, `railroad-peg-beta`) | The syntax of a grammar |\n| Cynefin | `cynefin-beta` | Items placed in the Cynefin domains |\n| Use case | `usecase-beta` | Actors, use cases and system boundaries |\n| Swimlane | `swimlane-beta` | A flowchart in lanes |\n| Agent flow | `agentflow-beta` | The steps and tools of an agent workflow |\n\nThe six most useful, each as a complete source and the slide it draws in the default design:\n\n````text\nflowchart LR\n A[Idea] --> B{Worth testing?}\n B -->|yes| C[Prototype]\n B -->|no| D[Park it]\n````\n\n![A flowchart: an idea goes to a Worth testing? decision; yes leads to Prototype and no to Park it.](images/diagrams/family-flowchart.svg)\n\n````text\nsequenceDiagram\n Client->>API: POST /decks\n API-->>Client: 201 Created\n````\n\n![A sequence diagram: the client sends POST /decks to the API, and the API answers 201 Created.](images/diagrams/family-sequence.svg)\n\n````text\nmindmap\n root((Strategy))\n Growth\n Efficiency\n People\n````\n\n![A mind map: Strategy in a circle at the center with the branches Growth, Efficiency and People.](images/diagrams/family-mindmap.svg)\n\n````text\ntimeline\n title Regional rollout\n section Pilot\n 2026 Q1 : One operations team\n section Rollout\n 2026 Q3 : All regions\n````\n\n![A timeline titled Regional rollout: the Pilot section in 2026 Q1 with one operations team, and the Rollout section in 2026 Q3 with all regions.](images/diagrams/family-timeline.svg)\n\n````text\nstateDiagram-v2\n [*] --> Queued\n Queued --> Building\n Building --> Live: success\n Building --> Failed: error\n Failed --> Queued: retry\n````\n\n![A state diagram: Queued goes to Building, which goes to Live on success or Failed on error, and Failed returns to Queued on retry.](images/diagrams/family-state.svg)\n\n````text\njourney\n title Onboarding\n section Sign up\n Create an account: 5: New user\n Verify the email: 3: New user\n section First week\n Build a first deck: 4: New user\n````\n\n![A user journey titled Onboarding: creating an account scores 5, verifying the email 3 and building a first deck 4.](images/diagrams/family-journey.svg)\n\nFor the full syntax of each family, read the [Mermaid documentation](https://mermaid.js.org/intro/); pele follows it, but draws with its own layout (see [The engine](#the-engine)).\n\n## Graphviz DOT\n\nA [DOT](https://graphviz.org/doc/info/lang.html) graph (`graph` or `digraph`) is a diagram with `syntax: "dot"`. OPF reads the DOT language itself and gives the graph to pele\'s layered layout, the one that draws a Mermaid flowchart, so a DOT diagram is laid out in ranks as Graphviz\'s `dot` engine lays it out, sized, styled and exported exactly as a flowchart is. No Graphviz code ships or runs (Graphviz is EPL-2.0), and the drawing is pele\'s, so it does not match the pixels of a Graphviz rendering.\n\n```json\n{\n "title": "Every change passes the same pipeline",\n "diagram": {\n "syntax": "dot",\n "source": "digraph release {\\n rankdir=LR\\n node [shape=box, style=rounded]\\n subgraph cluster_ci {\\n label=\\"Continuous integration\\"\\n Commit -> Build -> Test\\n }\\n Review [shape=diamond, label=\\"Approved?\\"]\\n Test -> Review [label=\\"passes\\"]\\n Test -> Build [label=\\"fails\\", style=dashed]\\n Review -> Release [label=\\"yes\\"]\\n Release [shape=ellipse]\\n}"\n }\n}\n```\n\n![The slide drawn from the example: Commit, Build and Test in a group named Continuous integration, Test going to an Approved? diamond when it passes and back to Build, dashed, when it fails, and yes leading to a rounded Release.](images/diagrams/dot-pipeline.svg)\n\nIn Markdown, the `dot` fence:\n\n````markdown\n# A deck moves from draft to published\n\n```dot alt="A draft is submitted for review; review approves it or sends it back."\ndigraph states {\n rankdir=LR\n node [shape=circle]\n Draft -> Review [label="submit"]\n Review -> Draft [label="changes"]\n Review -> Published [label="approve"]\n Published [shape=doublecircle]\n}\n```\n````\n\n![The slide drawn from the example on a dark variant: Draft, Review and a double-circled Published, with submit, changes and approve on the edges.](images/diagrams/dot-states.svg)\n\nA runnable deck is [`examples/technical/dot-diagrams.opf.json`](../examples/technical/dot-diagrams.opf.json).\n\nWhat OPF draws from a DOT source:\n\n| DOT | Drawn as |\n| --- | --- |\n| `digraph` and `->`, `graph` and `--`, `strict` | Edges with an arrowhead in a digraph and without one in a graph; `strict` draws a repeated edge once |\n| `rankdir` (`TB`, `LR`, `BT`, `RL`) | The direction the ranks run (top to bottom by default) |\n| `label` on the graph | The diagram\'s title, drawn above it |\n| `subgraph cluster_*` (or `cluster=true`) and its `label` | A labeled group around its nodes, nested as written; a node is in the innermost cluster that mentions it. Other subgraphs only group statements (`rank=same` is not kept) |\n| `node [...]`, `edge [...]`, `graph [...]` | Defaults for the statements after them, scoped to their subgraph |\n| Node `label` | The node\'s text: `\\n`, `\\l` and `\\r` break lines, `\\N`, `\\G`, `\\E`, `\\T` and `\\H` are the node, graph, edge, tail and head names; a record\'s fields (`{a\\|b\\|<p> c}`) are its lines; an HTML-like label is read as text (`<br/>` breaks a line) |\n| Node `shape` | The shapes in the table below |\n| Node `style` | `rounded` rounds a box, `dashed` and `dotted` dash the outline, `bold` thickens it, `invis` leaves the node and its edges out |\n| Edge `label` (or `xlabel`) | The edge\'s label |\n| Edge `style` and `penwidth` | `dashed` and `dotted` are a dashed line, `bold` or a `penwidth` of 2 or more a thick one, `invis` an edge that only places its nodes |\n| `arrowhead`, `arrowtail`, `dir` | `none` is no marker, the `dot` and `odot` arrows a circle, `tee` and `box` a cross, every other arrow type an arrowhead; `dir=both` draws both ends (with the head\'s marker), `dir=none` neither, and `dir=back` draws the edge from its head to its tail, which the layout then ranks that way |\n| `minlen` | The number of ranks the edge spans (up to 8) |\n| Ports (`a:p:n`) | Read and not kept: the layout decides where an edge meets its node |\n\n| DOT shape | Drawn as | PowerPoint shape |\n| --- | --- | --- |\n| `box`, `rect`, `rectangle`, `square`, `Msquare`, `record` | A rounded box | Rounded rectangle |\n| `Mrecord`, `box` with `style=rounded` | A box with rounder corners | Rounded rectangle |\n| `ellipse` (the default), `oval`, `egg` | A stadium, which holds its label as an ellipse does | Rounded rectangle (fully rounded) |\n| `circle`, `Mcircle`, `doublecircle`, `point` | A circle, a double circle, a small filled circle | Ellipse |\n| `diamond`, `Mdiamond` | A diamond | Diamond |\n| `hexagon`, `octagon`, `doubleoctagon`, `tripleoctagon`, `septagon` | A hexagon | Hexagon |\n| `parallelogram`, `trapezium`, `invtrapezium` | A parallelogram, a trapezoid, an inverted trapezoid | Parallelogram, trapezoid, freeform |\n| `triangle`, `invtriangle` | A triangle, an inverted triangle | Triangle, freeform |\n| `cylinder`, `note`, `tab`, `folder` | A cylinder, a card with a cut corner, a folder | Freeform |\n| `box3d`, `component` | Stacked boxes, a framed box | Rounded rectangles and lines |\n| `plaintext`, `plain`, `none`, `underline` | Text without an outline | Text box |\n| Any other shape (`house`, `star`, `cds`, ...) | A rounded box | Rounded rectangle |\n\nThe deck decides colors, fonts and sizes, as it does for Mermaid: `color`, `fillcolor`, `fontcolor`, `fontname`, `fontsize`, `bgcolor`, `width`, `height`, `pos` and the other attributes of Graphviz\'s drawing are read and ignored, and so are `style=filled`, `constraint`, `weight`, `splines` and `rank`.\n\n**Layouts OPF does not draw are refused, not approximated.** A graph whose `layout` attribute names another Graphviz engine (`neato`, `fdp`, `sfdp`, `circo`, `twopi`, `osage`, `patchwork`) is not drawn: the slide reports a finding at the attribute\'s line and column ("OPF draws DOT graphs with a layered layout, as Graphviz\'s dot engine does; the neato layout is not drawn ...") and the engines draw the "Diagram unavailable" placeholder. Remove the attribute, or write `layout=dot`, to draw the graph in layers. An HTML-like label that holds a `<table>` is refused the same way; write the label as text, or as a record.\n\nIn a double-quoted string `\\"` is a quote and a backslash before a line break continues the line; every other backslash pair (`\\\\`, `\\n`, `\\l`, `\\N`) is a label escape, so `"c:\\\\"` is the text `c:\\`. Text arrives as written, backticks included.\n\nA DOT source holds one graph, at most 20,000 characters, 500 edges and 16 levels of nested subgraphs. A syntax error is a finding with its line and column in the DOT source; if pele rejects what OPF made of a source, the finding says so without a position (pele\'s would be in generated text).\n\n## PlantUML\n\nA [PlantUML](https://plantuml.com) diagram is a diagram with `syntax: "plantuml"`, written from its `@start` line to its `@end` line. OPF reads PlantUML itself and draws each kind as the Mermaid family of the same kind, so a PlantUML diagram is laid out by pele, sized, styled and exported exactly as that family is. No PlantUML code ships or runs (PlantUML is GPL), and the drawing is pele\'s, so it does not match the pixels of a PlantUML rendering.\n\n```json\n{\n "title": "The API answers every request with findings",\n "diagram": {\n "syntax": "plantuml",\n "source": "@startuml\\nactor Author\\nparticipant \\"Deck API\\" as API\\ndatabase Store\\nAuthor -> API : POST /decks\\nAPI -> Store : save\\nStore --> API : id\\nalt valid\\n API --> Author : 201 Created\\nelse invalid\\n API --> Author : 422 findings\\nend\\n@enduml"\n }\n}\n```\n\n![The slide drawn from the example: Author, Deck API and a Store database with POST /decks, save and id, then an alt frame where a valid deck answers 201 Created and an invalid one 422 findings.](images/diagrams/plantuml-sequence.svg)\n\nIn Markdown, the `plantuml` fence:\n\n````markdown\n# Every brief is reviewed before it is built\n\n```plantuml\n@startuml\nstart\n:Write the brief;\nif (Approved?) then (yes)\n :Build the deck;\nelse (no)\n :Revise it;\nendif\nstop\n@enduml\n```\n````\n\n![The slide drawn from the example: a start dot, Write the brief, an Approved? diamond, yes to Build the deck and no to Revise it, both ending at a stop.](images/diagrams/plantuml-activity.svg)\n\nA runnable deck with every kind is [`examples/technical/plantuml-diagrams.opf.json`](../examples/technical/plantuml-diagrams.opf.json).\n\nThe kinds OPF draws, and what it reads of each:\n\n| PlantUML diagram | Drawn as | What is read |\n| --- | --- | --- |\n| Sequence (`participant`, `A -> B : message`) | Sequence | `participant`, `actor`, `boundary`, `control`, `entity`, `database`, `collections` and `queue` with `as` names; messages `->`, `-->` (dashed), `->>`, `-\\` and `-/` (the last three are drawn with the open head), `->x`, `<-`, `<->`; `++` and `--` activations, `activate`, `deactivate`, `create`, `destroy`, `return`; `alt`/`else`, `opt`, `loop`, `par`, `break`, `critical` and `group`; notes (`left of`, `right of`, `over`, one line or a block); `ref over`; `== dividers ==` and `...delays...` as notes over every participant; `box`; `autonumber` (plain; numbers from 1); `title` |\n| Class (`class`, `interface`, `enum`) | Class | Classes, abstract classes, interfaces, enums, annotations and the other class keywords, with `as` names, generics and stereotypes; members in braces or as `Name : member`, `{static}` and `{abstract}`; `extends` and `implements`; relations `<|--`, `<|..`, `*--`, `o--`, `-->`, `..>`, `--`, `..` (both ways) with cardinalities and labels; notes on a class and a floating `note "text" as N` that no link refers to; packages and namespaces |\n| State (`[*]`, `state`) | State | States with `as` names and descriptions, transitions with events, composite states, `--` and `||` regions, `<<choice>>`, `<<fork>>` and `<<join>>`, notes left of or right of a state, `left to right direction` |\n| Activity, the current syntax (`start`, `:action;`, `stop`) | Flowchart | `start`, `stop`, `end`, `kill`, `detach`; actions over one or several lines (an SDL ending `|`, `<`, `>`, `/`, `]` or `}` picks the shape); `if`/`elseif`/`else`/`endif`, `switch`/`case`, `while`/`endwhile`, `repeat`/`repeat while`, `fork`/`fork again`/`end fork` (bars), `split`; arrow labels (`-> label;`); `partition` and `group` blocks and `|swimlanes|` as groups; notes beside the last action; `(A)` connectors |\n| Use case (`actor`, `(use case)`) | Use case | Actors (`actor`, `:Name:`), use cases (`usecase`, `(Name)`) with `as` names (including `(Use the application) as (Use)`), `rectangle` and `package` boundaries around use cases (one level; a nested one is drawn beside its parent; an actor written inside a boundary is drawn outside it, and a boundary with no use case is not drawn), associations with labels, `<<include>>` and `<<extend>>` on dotted links, generalization, notes left of, right of, top of or bottom of an element, `left to right direction` |\n| Component and deployment (`[Component]`, `node`, `database`) | Flowchart | `[Component]`, `component`, `() Interface`, `interface`, `database`, `node`, `cloud`, `artifact`, `folder`, `queue`, `actor` and the other element keywords as shapes; `package`, `node`, `folder`, `frame`, `cloud`, `database` and `rectangle` blocks as groups (named, with `as`, or unnamed: `cloud {`), which a link can name; links with their line (`--`, `..`, `==`, `-[hidden]-`), direction, ends and labels; notes left of, right of, top of or bottom of an element |\n| Mind map (`@startmindmap`) | Mind map | `*` depth (and `+` and `-` for the two sides), Markdown indentation, boxless `*_` nodes as square ones, multi-line `:text;` nodes |\n| Gantt (`@startgantt`) | Gantt | `Project starts`, tasks that `last` or `require` days or weeks, `starts` and `ends` on a date or at another task\'s start or end (with days before or after), `then`, milestones that `happen`, `is N% complete` (100% done, more than 0 active), `-- sections --`, closed weekdays and dates. OPF schedules the tasks in working days and writes their dates; without `Project starts`, the days are numbered from 1 |\n\nIn `participant Participant as Foo`, `Foo` is the name later lines use and `Participant` is what is drawn (PlantUML\'s own example); a quoted side is always what is drawn (`participant "Web App" as W`, `participant W as "Web App"`). The same holds for classes, states, use cases, actors, components and gantt tasks (`[Prototype design] as [D1]`).\n\nPlantUML\'s styling is ignored, as Mermaid\'s themes are: `skinparam`, `!theme`, `<style>`, colors, `hide` and `show`, `scale`, headers, footers, captions, legends, `mainframe` and `autoactivate` (no activation bars). A keyword is a statement only in its own shape: an element named `Header`, `Show`, `Title`, `Node` or `Group` keeps its messages and relations. Spacing lines (`...`, `|||`, `||45||`) are ignored, since the layout spaces the messages; `...text...` and `== text ==` are notes.\n\n**What OPF does not draw is refused, not approximated.** The other PlantUML diagrams (timing, object, network, ArchiMate, entity relationship, Salt, JSON, YAML, work breakdown structures and the other `@start` kinds), the legacy activity syntax (`(*) --> "First"`), messages from outside a sequence diagram (`[->`), circle ends (`->o`), a cross or half head on a double-headed message, `autonumber` with arguments, `newpage`, history states (`[H]`), `label` and `goto`, `hide @unlinked` and `hide <<stereotype>>`, notes on a link or floating notes that a link names (a lone floating class note is drawn), a note above or below a state, a gantt `pauses` or `is deleted`, a ** after a message, a second diagram in one source, and the preprocessor (`!include`, `!define`, `!function`, `$variables`) report a finding at their line ("OPF does not draw PlantUML timing diagrams; it draws sequence, class, state, ...") and the engines draw the "Diagram unavailable" placeholder. So does a line OPF cannot read in a diagram it draws.\n\n`return` answers the call of the latest activation (`++`, `activate`) and deactivates it; without one it replies to the last unanswered call. A `destroy` followed by messages of others is drawn with the last message to or from the destroyed participant, as pele requires. If pele rejects what OPF made of a source, the finding says so without a position (pele\'s would be in generated text).\n\nA PlantUML source holds one diagram, at most 20,000 characters (2,000 on a line), 500 messages, relations or arrows, and 16 levels of nested blocks.\n\n## How the deck styles a diagram\n\nThe deck decides colors and fonts, so a diagram follows the slide it sits on:\n\n- **Node fills** are tints of the first accent of the slide\'s color scheme, in the slide variant\'s order, mixed over the surface the diagram sits on. That surface is the card when the block has one (see `emphasis` and cards in [Layout templates](layout-templates.md)), otherwise the slide background.\n- **Outlines and connectors** mix toward the accent and the text color, with enough contrast to read as structure without competing with the labels.\n- **Data series** (pie slices, xychart series, timeline sections, mind map branches and the like) use the same chart series palette as the slide\'s charts: the color scheme\'s accents in the variant\'s order.\n- **Text** keeps 4.5:1 against its fill.\n- **Fonts.** Labels use the font scheme\'s body font, and code-like labels (class members, for example) its code font.\n- **Dark backgrounds, dark variants and color maps** adapt with no change to the source: `design.variant: "dark1"` on a slide redraws its diagram from the dark surface.\n\nThe same slide, with the same source, in four designs from the default catalog:\n\n```json\n{\n "title": "Every request is reviewed before it ships",\n "diagram": "flowchart LR\\n A[Request] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| D[Revise]\\n D --> A\\n C --> E[Test]\\n E --> F{Passes?}\\n F -->|yes| G[Release]\\n F -->|no| C"\n}\n```\n\n| `classic`, `forest-green`, `aptos` | `bold`, `deep-purple`, `montserrat` |\n| --- | --- |\n| ![The flowchart on a white slide with pale green nodes.](images/diagrams/style-classic.svg) | ![The flowchart on a white slide with pale purple nodes and the Montserrat font.](images/diagrams/style-bold.svg) |\n| **`minimal`, `burnt-orange`, `georgia`** | **`classic`, `steel-blue`, `open-sans`, slide `design.variant: "dark1"`** |\n| ![The flowchart on a dark brown slide with orange-brown nodes and a serif font.](images/diagrams/style-minimal.svg) | ![The flowchart on a black slide with dark nodes, light labels and the Open Sans font.](images/diagrams/style-dark.svg) |\n\nEvery image in this guide is the renderer\'s own SVG output for the source above it, drawn by `scripts/build-diagram-doc-images.mjs` (`pnpm check:diagram-doc-images` keeps them current).\n\nMermaid\'s own theming (`%%{init: ...}%%`, themes, `themeVariables`) and click callbacks are ignored. Authored `style`, `classDef` and C4 `UpdateElementStyle` colors are the exception: pele applies them and OPF\'s painter keeps them, so a shape with an authored color no longer follows the deck\'s colors, variant or contrast rules. Leave them out and let the deck decide; if one shape must stand out, prefer a different node shape or a label to a color.\n\n## Sizing\n\nCore lays a diagram out for its block with the deck\'s measured fonts, the same way it fits text:\n\n1. It tries the largest base size from 32 reference pixels down at which the drawing fits the block. A small diagram grows to the size of a list; a large one steps down.\n2. Node labels never go below the readability floor (`minFontSize`, 16 reference pixels by default). The smallest secondary label (an edge label, an axis tick, a score) never goes below 75% of it.\n3. A diagram is centered in its block. A region anchored to the bottom places it there.\n4. Pele lays the diagram out for the width it has, so a smaller size is a new layout, not a shrunken picture: a wide flowchart may turn to run downward.\n\nWhen the diagram does not fit even at the floor, a flowchart or a state diagram is first tried in the other main direction (`LR` and `TB` swap, `RL` and `BT` swap; a state diagram without a `direction` is top to bottom, so it tries `direction LR`). If the labels reach the floor there, the diagram is drawn that way and the slide reports an `arrangement-adapted` info finding ("The flowchart is drawn top to bottom because left to right does not fit at the readability floor"). This applies to a direction the author wrote too: the source keeps its text, only the drawing turns, and the preview and the PPTX export draw the same turned layout. A diagram that fits as written is never turned.\n\nWhen no direction holds the labels at the floor (or the diagram type has no direction), the diagram as written is drawn smaller to stay inside its block, and the slide reports a `text-overflow` finding at the diagram\'s path, naming the directions tried. Fix it in the content, not in `minFontSize`:\n\n- give the diagram a slide or a region of its own, or put it beside short text rather than under long text;\n- split it into two diagrams, or shorten the labels.\n\n`opf validate` reports both findings, `text-overflow` and `arrangement-adapted`, whether or not `@openpresentation/opf-render` is installed, because it composes every slide and lays each diagram out. With the renderer it measures with the fonts `opf convert` draws with (the report says `layout (measured)`); without it, with core\'s portable estimate (`layout (estimated)`, and a hint says how to install the renderer). The two can disagree for a diagram near the limit: a flowchart of ten one-word branches gets `arrangement-adapted` measured and `text-overflow` estimated (checked 2026-11-14, CLI 0.34.0). Treat an estimated result as provisional and run `opf validate` or `opf convert` with the renderer installed for the final answer.\n\n### Write for readable labels\n\nA diagram is the slide\'s main content, so write it to be read from the back of a room: few nodes, few hops, short labels. Measured with this repository\'s renderer (core 0.34.0, `opf convert` to SVG, a titled slide at 1280 x 720 with the diagram alone in the body; sizes are reference pixels, 32 is the most a label gets and 16 the floor, a body list is 28 to 32):\n\n| Flowchart (nodes, longest path in hops) | Labels of one or two words | Labels of three or four words |\n| --- | --- | --- |\n| 3 nodes in a row | 32 | 32 |\n| 4 in a row | 32 | 21 |\n| 5 in a row | 32 | 17 |\n| 6 in a row | 27 | 15 (under the floor, `text-overflow`) |\n| 8 in a row | 20 | 11 (`text-overflow`) |\n| 10 in a row | 16 | 9 (`text-overflow`) |\n| 7 nodes, one parent with three children, each with one child (written `TB` or `LR`) | 32 | not measured |\n| 10 nodes in a tree three levels deep | 18 to 25 (`LR` 25, `TB` 18) | not measured |\n\nWhat the numbers say, and so what to write:\n\n- **Keep to 3 to 6 nodes on a slide, and to one or two words a label.** That keeps labels at 27 pixels or more, close to the body text. At 8 nodes labels are 20 pixels and the diagram reads as small print beside the slide\'s title; at 10 nodes they are at the floor.\n- **A label of three or four words costs about as much as two more nodes.** Put the detail in the slide\'s text or notes, or in a second slide, and keep the node to the noun.\n- **Split a long flow over several slides** (one stage or one decision per slide, each with its own title that says what happens there) instead of writing one chain of 8 or more. Each part is then drawn at 32.\n- **Direction follows the shape, and the engine tries both.** A chain is drawn best left to right on a wide slide: five nodes in a row are 32 pixels left to right and 18 top to bottom, because the slide is shorter than it is wide. A parent with many children is the other way: one parent with five children is 20 pixels left to right and 32 top to bottom. Write `TB` for a fan-out or a hierarchy and `LR` for a sequence; do not turn a long chain top to bottom to make it fit, and do not rely on the engine\'s turn (`arrangement-adapted`) to save a diagram that has too many nodes.\n- **Do not shrink to fit.** Never lower `minFontSize` or draw a diagram in a small region so that a large one fits; fewer nodes and shorter labels is the fix, and a `text-overflow` finding on a diagram means the slide has too much in it.\n- **Give the diagram the slide.** A title and the diagram, or the diagram beside a few short lines, not a diagram under a paragraph.\n\n### Layouts that accept a diagram\n\nA layout region lists the kinds it `accepts` ([Layout templates](layout-templates.md#regions)); `diagram` is one of them. In the default catalog these regions take a diagram:\n\n| Layout | Region |\n| --- | --- |\n| `charts` | `chart` |\n| `chart` | `chart-beside` |\n| `media`, `image-beside`, `hero` | `image` |\n| `comparison`, `two-column` | `first` and `second` |\n| `three-column` | the three columns |\n| `process` | `steps` |\n| `timeline` | `timeline` |\n\nA block binds to a region by kind, role and reading order ([Binding content to regions](layout-templates.md#binding-content-to-regions)); a slide that pins a diagram to a region that does not accept it gets the warning `opf/region-kind` and the block is bound by kind instead.\n\n## Accessibility\n\n`alt` is the text alternative: say what the diagram shows, not that it is a diagram ("A brief goes to review; approved work is built, rejected work returns to the brief."). Without `alt`, engines derive one from the diagram type and its labels (for example "Flowchart: Request, Approved?, Build, Revise"), up to 400 characters. The preview draws the diagram as one `role="img"` named by that text, and the PPTX export writes it as the description of the picture (or of the group of shapes).\n\n## Exports\n\n| Output | What you get |\n| --- | --- |\n| SVG preview | The diagram as vector shapes and text in the slide\'s colors and fonts |\n| PNG | The preview rasterized |\n| PDF | Vector; the diagram\'s labels stay selectable text |\n| PPTX (the default, `diagrams: "shapes"`) | Native PowerPoint shapes, connectors and text in one group, drawn from the preview\'s own geometry, `alt` as the group\'s description. `fromPptx` brings an unchanged group back as a `diagram`, a DOT or PlantUML diagram with its own source. A diagram that cannot be written as shapes is the picture below. |\n| PPTX, `diagrams: "picture"` | A native SVG picture with a PNG fallback: crisp at any size, recolorable as a picture in PowerPoint, `alt` as the picture\'s description. `fromPptx` brings it back as a `diagram`. |\n\n### Native shapes in PowerPoint\n\nThe PPTX export writes each diagram as editable PowerPoint shapes that look like the preview (`diagrams: "shapes"`, the default). To get one SVG picture per diagram instead, as earlier releases did, opt out:\n\n```js\nconst bytes = await toPptx(deck, { diagrams: "picture" });\nawait convert(deck, "deck.pptx", { diagrams: "picture" });\n```\n\n```sh\nopf convert deck.opf.json deck.pptx --diagrams picture\n```\n\nThe shapes are built from pele\'s laid-out drawing, the same geometry the preview draws, never a second layout or PowerPoint\'s connector routing:\n\n- **Nodes** are shapes. An outline that is exactly a PowerPoint preset is that preset (`rect`, `roundRect`, `ellipse`, `diamond`, `hexagon`, `parallelogram`, `trapezoid`, `triangle`, checked against the [shape geometry](shapes.md)); any other outline (a cylinder, a flag, a stick figure, a pie slice) is a freeform of its exact path.\n- **Labels** are real text in the deck\'s fonts at the preview\'s size, weight, color and baseline, with no wrapping and no autofit. A node\'s label is the node\'s own text, so it moves with the node; other labels are text boxes.\n- **Edges** keep their exact path and arrowheads. A straight edge without arrowheads is a PowerPoint connector glued to the connection sites of the nodes it touches, so it follows a node you move. Every other edge is a freeform of its line and its arrowheads: PowerPoint opens a connector only with one of its preset routes (a connector of freeform geometry makes the file unreadable), and its largest line end is about a fifth shorter than pele\'s arrowhead, so a glued connector would not look like the preview.\n- **Fills and lines** keep their colors, opacity, gradients, widths, dashes, caps and joins.\n- Everything is one group named `OPF diagram N`, with the diagram\'s `alt` as its description.\n\nA diagram family is written as shapes only after PowerPoint\'s drawing of it has been compared with the preview, source by source. Every family below passed: in PowerPoint 365 for Windows, with an example source per family (the ones in this guide where it has one) and a harder one (more nodes, long labels, right to left where the family has a direction), each slide rendered through PowerPoint and compared with the preview pixel by pixel and by eye, in five designs: the engine default (a dark slide in Aptos), a light theme, a serif font scheme (Georgia), a deck in Segoe UI, and a Japanese deck in Yu Gothic for the families that take labels (flowchart, sequence, mind map, timeline, kanban). In every design the shapes, lines and fills match the preview to antialiasing and every label sits where the preview puts it; what differs is the glyphs where the preview draws a font with a stand-in (see below).\n\n| Family | Written as shapes | Family | Written as shapes |\n| --- | --- | --- | --- |\n| Flowchart | yes | Architecture | yes |\n| Sequence | yes | Kanban | yes |\n| Class | yes | Packet | yes |\n| State | yes | Radar | yes |\n| Entity relationship | yes | Treemap | yes |\n| Gantt | yes | Venn | yes |\n| Pie | yes | Ishikawa | yes |\n| Quadrant | yes | Requirement | yes |\n| Mind map | yes | Wardley map | yes |\n| Timeline | yes | Tree view | yes |\n| User journey | yes | Event modeling | yes |\n| XY chart | yes | Railroad | yes |\n| Sankey | yes | Cynefin | yes |\n| Git graph | yes | Use case | yes |\n| C4 | yes | Swimlane | yes |\n| Block | yes | Agent flow | yes |\n\nA DOT diagram is drawn as a flowchart, and a PlantUML diagram as its Mermaid family, so each is written as shapes as that family is. The list is core\'s `DIAGRAM_SHAPE_FAMILIES` (from `@openpresentation/opf/composition`). A diagram stays the picture, with the info finding `pptx/diagram-shapes-unavailable` naming its family and the reason, when:\n\n- its family is not in that list (a new pele diagram type, until it has been compared);\n- its drawing uses something PowerPoint has no native form for: a clip path, a mask, a filter, a pattern, an embedded image, text on a path, or right-to-left text (whose placement PowerPoint decides by its own bidirectional layout).\n\nWhat can differ from the preview is what differs for all of the deck\'s text: where the preview draws a font with a stand-in (Aptos, Segoe UI and Yu Gothic, for example, which OPF does not bundle), PowerPoint draws the real font, so the glyph shapes and weight differ a little, while every line starts, ends and sits where the preview puts it. For a diagram that must be the preview to the pixel, export with `diagrams: "picture"`.\n\n**Editing and import.** The shapes are ordinary PowerPoint shapes: restyle, move or retype them as you like. `fromPptx` reads an unchanged group back as the diagram, with its Mermaid, DOT or PlantUML source and the group\'s current description as `alt`. Once a member is moved, resized, retyped, added or removed, the group imports as its shapes and reports `invalid-diagram-provenance`: the edit is kept and the source is not reconstructed. To keep the source as the truth, edit it in OPF and export again. With `provenance: false` (`--provenance none`) the group carries no source and imports as its shapes.\n\nPowerPoint\'s own "Convert to Shape" on a picture diagram also gives shapes, but that is PowerPoint\'s conversion, not an OPF export, and it does not map back to the diagram. See the [compatibility matrix](compatibility-matrix.md).\n\n## Errors and limits\n\n- A source that cannot be parsed reports a finding with its position in the source, for example `The diagram cannot be drawn (line 2, column 9): Expecting ...`, and the engines draw a "Diagram unavailable" placeholder in the block instead. Fix the source at that line and column.\n- An empty source, a source over **20,000 characters** or a diagram with more than **500 edges** is refused the same way: a slide holds one readable drawing, not a document.\n- In Markdown, an unknown attribute on the fence is `markdown/diagram-attributes`, and an empty fence is `markdown/diagram-source`.\n\n## The engine\n\n[pele](https://pele.run) 1.13.0 (MIT, no runtime dependencies) is the engine; OPF\'s own DOT and PlantUML readers (`dotToMermaid` and `plantumlToMermaid`, from `@openpresentation/opf/composition`, which show the Mermaid a source becomes) hand it DOT graphs and PlantUML diagrams. It is synchronous and does not use the DOM, so the preview, the PDF and the PPTX export need no browser, and the drawing is deterministic for a given source and fonts. Core measures the text with the deck\'s fonts, so line breaks match the rest of the slide.\n\nNode, Bun and Deno load every diagram type with core and draw any diagram at once. A browser bundle or an edge Worker (Cloudflare Workers, Vercel Edge) loads only pele\'s core with OPF (about 12 KB gzipped) and each diagram type the first time a deck draws one (13 to 54 KB gzipped each), and OPF\'s PlantUML reader (about 10 KB gzipped) the first time a deck draws a PlantUML diagram, through the package\'s `#diagram-engine` import map; a Worker that never loads a diagram type does not carry their code. The renderer\'s browser fonts handle loads them in `ensure` (its `pending` lists them as `diagram:<type>`), so `<opf-deck>`, the player, browser export and the editor wait for them as they wait for fonts; `toPptx` loads them itself. A host that validates or draws with `validate`, `composeSlide` or `toSvg` directly calls `await ensureDiagrams(presentation)` (from `@openpresentation/opf` or `@openpresentation/opf/composition`) first; `diagramsPending(presentation)` lists what it would load. Shapes and icon sets load the same way, and one preload covers all three: see [Engines and icon sets that load on demand](how-opf-works.md#engines-and-icon-sets-that-load-on-demand). Until then a diagram draws as a "Loading diagram" placeholder and its source is not checked, which is not a finding.\n\nPele reads Mermaid 12.1 syntax but has its own layout and drawing, so a diagram does not match the pixels of mermaid.js, and an unusual construct may parse in one and not in the other. Write for the OPF drawing: check a diagram in the preview (`opf convert deck.opf.json slide-{n}.png`), not in Mermaid\'s live editor.\n\nPlantUML Gantt schedules refuse durations, offsets or task spans over 36,600 days and more than 366,000 calendar-day checks per diagram. These limits produce a located diagnostic where a source location is available; shorten the schedule or split it into separate diagrams. A calendar with every weekday closed, an invalid date, or a task ending before it starts is refused instead of normalized.\n\nPlantUML state transitions use one arrowhead. Write two separate transitions for both directions; a two-headed state arrow is a source-positioned syntax finding.\n'
87
+ "markdown": '# Diagrams\n\nA `diagram` is a diagram written as text. You write [Mermaid](https://mermaid.js.org), [Graphviz DOT](#graphviz-dot) or [PlantUML](#plantuml) source, and the engines draw it in the deck\'s own fonts and colors, so a flowchart, a sequence of messages or a mind map looks like the rest of the slide and not like a pasted screenshot. This guide covers when to use one, how to write it in JSON, YAML and Markdown, what it looks like, how it is sized, and how it exports. The field reference is [Content payloads](content-payloads.md#diagram); the schema definition is `$defs.Diagram` (`opf schema presentation \'/$defs/Diagram\'`).\n\n## When to use a diagram\n\nChoose the content kind by what the content is, not by how it should look.\n\n| The content is | Use |\n| --- | --- |\n| Steps, a decision flow, systems and how they connect, messages between parties, states and transitions, a hierarchy, an entity model | `diagram` |\n| Numbers plotted on axes or as shares of a whole, where the values should stay editable data | `chart` |\n| Dated or ordered milestones with progress (`done`, `current`, `planned`) | `timeline` (the payload, with its status design) |\n| Parallel entries with details, or a short sequence of one-line steps | a list (`items`) or layout `process` |\n| A single-root reporting tree of up to eight people (an assistant is an entry with `assistant: true`), or up to seven overlapping sets (their common overlap named by a last entry with `overlap: true`) | a list on layout `org-chart` or `venn` ([Trees and set overlap](smartart.md#trees-and-set-overlap-sh-21)) |\n\nA Mermaid `pie` or `timeline` diagram is a quick picture. A `chart` or `timeline` payload keeps the data editable and gets the engines\' chart and timeline design, with highlights and status words. Prefer the payload when it fits and the diagram when only a diagram can show the structure.\n\n## Writing one\n\nA string is shorthand for `{ "source": value }`. The object form adds `alt`, the text alternative, and `syntax`: `"mermaid"` (the default), `"dot"` for a [Graphviz DOT](#graphviz-dot) graph or `"plantuml"` for a [PlantUML](#plantuml) diagram. A diagram is a root payload, a block, or the content of a layout region that accepts it. It takes a `caption` like an image or a chart.\n\n```json\n{\n "title": "Every request is reviewed before it ships",\n "diagram": "flowchart LR\\n A[Request] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| D[Revise]\\n D --> A"\n}\n```\n\nThe slide this draws, in the engine\'s default design:\n\n![The slide drawn from the example: the title above a flowchart in which a request goes to an Approved? decision, yes leads to Build and no leads to Revise, which loops back to the request.](images/diagrams/review-loop.svg)\n\nWith an `alt` and a caption:\n\n```json\n{\n "title": "A rejected brief returns to its author",\n "diagram": {\n "source": "flowchart LR\\n A[Brief] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| A",\n "alt": "A brief goes to review. Approved work is built; rejected work returns to the brief."\n },\n "caption": "Figure 1. The review loop"\n}\n```\n\n![The slide drawn from the example: a brief goes to an Approved? decision, yes leads to Build and no returns to the brief, with the caption Figure 1. The review loop under the diagram.](images/diagrams/review-loop-caption.svg)\n\nAs YAML a block scalar keeps the source readable:\n\n```yaml\n- title: Every request is reviewed before it ships\n diagram:\n alt: A request is approved or revised, then built.\n source: |-\n flowchart LR\n A[Request] --> B{Approved?}\n B -->|yes| C[Build]\n B -->|no| D[Revise]\n D --> A\n```\n\nBeside text, give the slide `blocks`; the diagram takes its own cell:\n\n```json\n{\n "title": "The client talks to one API",\n "blocks": [\n { "bullets": ["The client creates a deck with one call", "The API validates it before it answers"] },\n { "diagram": "sequenceDiagram\\n Client->>API: POST /decks\\n API-->>Client: 201 Created" }\n ]\n}\n```\n\n![The slide drawn from the example: two bullets on the left and, on the right, a sequence diagram in which the client sends POST /decks to the API and the API answers 201 Created.](images/diagrams/beside-text.svg)\n\n### In Markdown\n\nA fenced block whose info word is `mermaid` is a diagram, one whose info word is `dot` is a [DOT diagram](#graphviz-dot) (`{ source, syntax: "dot" }`) and one whose info word is `plantuml` a [PlantUML diagram](#plantuml) (`{ source, syntax: "plantuml" }`). An optional `alt="..."` after the word is its text alternative. `toMarkdown` writes a diagram back the same way, so the round trip is lossless.\n\n````markdown\n# Every request is reviewed before it ships\n\n```mermaid alt="A request is approved or revised, then built."\nflowchart LR\n A[Request] --> B{Approved?}\n B -->|yes| C[Build]\n B -->|no| D[Revise]\n D --> A\n```\n````\n\nA source with a blank first or last line, or an `alt` that holds a backtick or a line break, cannot be written as a fence; the writer then uses an `opf-block`, which reads back exactly. See [Markdown and outlines](markdown.md). A runnable deck is [`examples/markdown/diagrams.opf.md`](../examples/markdown/diagrams.opf.md), and the JSON fixture [`examples/technical/diagrams.opf.json`](../examples/technical/diagrams.opf.json) has seven slides.\n\n## Supported Mermaid families\n\nOPF draws diagrams with [pele](https://pele.run), the shared layout/drawing library pinned as `pele@1.13.0` in this source. It parses Mermaid 12.1 syntax. OPF reads the supported DOT and PlantUML subsets itself and adapts them to the same engine; these are not separate Graphviz or PlantUML renderer installations. The first line of the source names the family. All the built-in families are supported; ZenUML is not.\n\n| Family | First line | Shows |\n| --- | --- | --- |\n| Flowchart | `flowchart LR` or `TB` | Steps, decisions and flow |\n| Sequence | `sequenceDiagram` | Messages between participants over time |\n| Class | `classDiagram` | Classes, members and relationships |\n| State | `stateDiagram-v2` | States and transitions |\n| Entity relationship | `erDiagram` | Entities, attributes and cardinalities |\n| Gantt | `gantt` | Tasks on a calendar |\n| Pie | `pie` | Shares of a whole |\n| Quadrant | `quadrantChart` | Points on two axes |\n| Mind map | `mindmap` | A hierarchy of ideas |\n| Timeline | `timeline` | Periods with events, in sections |\n| User journey | `journey` | Tasks with a satisfaction score |\n| XY chart | `xychart` | Bars and lines on axes |\n| Sankey | `sankey` | Flows between nodes |\n| Git graph | `gitGraph` | Commits, branches and merges |\n| C4 | `C4Context` and the other C4 headers | System context, containers, components |\n| Block | `block` | Blocks on a grid |\n| Architecture | `architecture-beta` | Services, groups and connections |\n| Kanban | `kanban` | Columns of cards |\n| Packet | `packet` | Bit fields of a protocol packet |\n| Radar | `radar-beta` | Several measures on radial axes |\n| Treemap | `treemap` | Nested rectangles sized by value |\n| Venn | `venn-beta` | Overlapping sets |\n| Ishikawa | `ishikawa-beta` | Causes of a problem (fishbone) |\n| Requirement | `requirementDiagram` | Requirements and what satisfies them |\n| Wardley map | `wardley-beta` | Components by visibility and evolution |\n| Tree view | `treeView-beta` | A folder-style hierarchy |\n| Event modeling | `eventmodeling` | Commands, events and views along a timeline |\n| Railroad | `railroad-beta` (also `railroad-ebnf-beta`, `railroad-abnf-beta`, `railroad-peg-beta`) | The syntax of a grammar |\n| Cynefin | `cynefin-beta` | Items placed in the Cynefin domains |\n| Use case | `usecase-beta` | Actors, use cases and system boundaries |\n| Swimlane | `swimlane-beta` | A flowchart in lanes |\n| Agent flow | `agentflow-beta` | The steps and tools of an agent workflow |\n\nThe six most useful, each as a complete source and the slide it draws in the default design:\n\n````text\nflowchart LR\n A[Idea] --> B{Worth testing?}\n B -->|yes| C[Prototype]\n B -->|no| D[Park it]\n````\n\n![A flowchart: an idea goes to a Worth testing? decision; yes leads to Prototype and no to Park it.](images/diagrams/family-flowchart.svg)\n\n````text\nsequenceDiagram\n Client->>API: POST /decks\n API-->>Client: 201 Created\n````\n\n![A sequence diagram: the client sends POST /decks to the API, and the API answers 201 Created.](images/diagrams/family-sequence.svg)\n\n````text\nmindmap\n root((Strategy))\n Growth\n Efficiency\n People\n````\n\n![A mind map: Strategy in a circle at the center with the branches Growth, Efficiency and People.](images/diagrams/family-mindmap.svg)\n\n````text\ntimeline\n title Regional rollout\n section Pilot\n 2026 Q1 : One operations team\n section Rollout\n 2026 Q3 : All regions\n````\n\n![A timeline titled Regional rollout: the Pilot section in 2026 Q1 with one operations team, and the Rollout section in 2026 Q3 with all regions.](images/diagrams/family-timeline.svg)\n\n````text\nstateDiagram-v2\n [*] --> Queued\n Queued --> Building\n Building --> Live: success\n Building --> Failed: error\n Failed --> Queued: retry\n````\n\n![A state diagram: Queued goes to Building, which goes to Live on success or Failed on error, and Failed returns to Queued on retry.](images/diagrams/family-state.svg)\n\n````text\njourney\n title Onboarding\n section Sign up\n Create an account: 5: New user\n Verify the email: 3: New user\n section First week\n Build a first deck: 4: New user\n````\n\n![A user journey titled Onboarding: creating an account scores 5, verifying the email 3 and building a first deck 4.](images/diagrams/family-journey.svg)\n\nFor the full syntax of each family, read the [Mermaid documentation](https://mermaid.js.org/intro/); pele follows it, but draws with its own layout (see [The engine](#the-engine)).\n\n## Graphviz DOT\n\nA [DOT](https://graphviz.org/doc/info/lang.html) graph (`graph` or `digraph`) is a diagram with `syntax: "dot"`. OPF reads the DOT language itself and gives the graph to pele\'s layered layout, the one that draws a Mermaid flowchart, so a DOT diagram is laid out in ranks as Graphviz\'s `dot` engine lays it out, sized, styled and exported exactly as a flowchart is. No Graphviz code ships or runs (Graphviz is EPL-2.0), and the drawing is pele\'s, so it does not match the pixels of a Graphviz rendering.\n\n```json\n{\n "title": "Every change passes the same pipeline",\n "diagram": {\n "syntax": "dot",\n "source": "digraph release {\\n rankdir=LR\\n node [shape=box, style=rounded]\\n subgraph cluster_ci {\\n label=\\"Continuous integration\\"\\n Commit -> Build -> Test\\n }\\n Review [shape=diamond, label=\\"Approved?\\"]\\n Test -> Review [label=\\"passes\\"]\\n Test -> Build [label=\\"fails\\", style=dashed]\\n Review -> Release [label=\\"yes\\"]\\n Release [shape=ellipse]\\n}"\n }\n}\n```\n\n![The slide drawn from the example: Commit, Build and Test in a group named Continuous integration, Test going to an Approved? diamond when it passes and back to Build, dashed, when it fails, and yes leading to a rounded Release.](images/diagrams/dot-pipeline.svg)\n\nIn Markdown, the `dot` fence:\n\n````markdown\n# A deck moves from draft to published\n\n```dot alt="A draft is submitted for review; review approves it or sends it back."\ndigraph states {\n rankdir=LR\n node [shape=circle]\n Draft -> Review [label="submit"]\n Review -> Draft [label="changes"]\n Review -> Published [label="approve"]\n Published [shape=doublecircle]\n}\n```\n````\n\n![The slide drawn from the example on a dark variant: Draft, Review and a double-circled Published, with submit, changes and approve on the edges.](images/diagrams/dot-states.svg)\n\nA runnable deck is [`examples/technical/dot-diagrams.opf.json`](../examples/technical/dot-diagrams.opf.json).\n\nWhat OPF draws from a DOT source:\n\n| DOT | Drawn as |\n| --- | --- |\n| `digraph` and `->`, `graph` and `--`, `strict` | Edges with an arrowhead in a digraph and without one in a graph; `strict` draws a repeated edge once |\n| `rankdir` (`TB`, `LR`, `BT`, `RL`) | The direction the ranks run (top to bottom by default) |\n| `label` on the graph | The diagram\'s title, drawn above it |\n| `subgraph cluster_*` (or `cluster=true`) and its `label` | A labeled group around its nodes, nested as written; a node is in the innermost cluster that mentions it. Other subgraphs only group statements (`rank=same` is not kept) |\n| `node [...]`, `edge [...]`, `graph [...]` | Defaults for the statements after them, scoped to their subgraph |\n| Node `label` | The node\'s text: `\\n`, `\\l` and `\\r` break lines, `\\N`, `\\G`, `\\E`, `\\T` and `\\H` are the node, graph, edge, tail and head names; a record\'s fields (`{a\\|b\\|<p> c}`) are its lines; an HTML-like label is read as text (`<br/>` breaks a line) |\n| Node `shape` | The shapes in the table below |\n| Node `style` | `rounded` rounds a box, `dashed` and `dotted` dash the outline, `bold` thickens it, `invis` leaves the node and its edges out |\n| Edge `label` (or `xlabel`) | The edge\'s label |\n| Edge `style` and `penwidth` | `dashed` and `dotted` are a dashed line, `bold` or a `penwidth` of 2 or more a thick one, `invis` an edge that only places its nodes |\n| `arrowhead`, `arrowtail`, `dir` | `none` is no marker, the `dot` and `odot` arrows a circle, `tee` and `box` a cross, every other arrow type an arrowhead; `dir=both` draws both ends (with the head\'s marker), `dir=none` neither, and `dir=back` draws the edge from its head to its tail, which the layout then ranks that way |\n| `minlen` | The number of ranks the edge spans (up to 8) |\n| Ports (`a:p:n`) | Read and not kept: the layout decides where an edge meets its node |\n\n| DOT shape | Drawn as | PowerPoint shape |\n| --- | --- | --- |\n| `box`, `rect`, `rectangle`, `square`, `Msquare`, `record` | A rounded box | Rounded rectangle |\n| `Mrecord`, `box` with `style=rounded` | A box with rounder corners | Rounded rectangle |\n| `ellipse` (the default), `oval`, `egg` | A stadium, which holds its label as an ellipse does | Rounded rectangle (fully rounded) |\n| `circle`, `Mcircle`, `doublecircle`, `point` | A circle, a double circle, a small filled circle | Ellipse |\n| `diamond`, `Mdiamond` | A diamond | Diamond |\n| `hexagon`, `octagon`, `doubleoctagon`, `tripleoctagon`, `septagon` | A hexagon | Hexagon |\n| `parallelogram`, `trapezium`, `invtrapezium` | A parallelogram, a trapezoid, an inverted trapezoid | Parallelogram, trapezoid, freeform |\n| `triangle`, `invtriangle` | A triangle, an inverted triangle | Triangle, freeform |\n| `cylinder`, `note`, `tab`, `folder` | A cylinder, a card with a cut corner, a folder | Freeform |\n| `box3d`, `component` | Stacked boxes, a framed box | Rounded rectangles and lines |\n| `plaintext`, `plain`, `none`, `underline` | Text without an outline | Text box |\n| Any other shape (`house`, `star`, `cds`, ...) | A rounded box | Rounded rectangle |\n\nThe deck decides colors, fonts and sizes, as it does for Mermaid: `color`, `fillcolor`, `fontcolor`, `fontname`, `fontsize`, `bgcolor`, `width`, `height`, `pos` and the other attributes of Graphviz\'s drawing are read and ignored, and so are `style=filled`, `constraint`, `weight`, `splines` and `rank`.\n\n**Layouts OPF does not draw are refused, not approximated.** A graph whose `layout` attribute names another Graphviz engine (`neato`, `fdp`, `sfdp`, `circo`, `twopi`, `osage`, `patchwork`) is not drawn: the slide reports a finding at the attribute\'s line and column ("OPF draws DOT graphs with a layered layout, as Graphviz\'s dot engine does; the neato layout is not drawn ...") and the engines draw the "Diagram unavailable" placeholder. Remove the attribute, or write `layout=dot`, to draw the graph in layers. An HTML-like label that holds a `<table>` is refused the same way; write the label as text, or as a record.\n\nIn a double-quoted string `\\"` is a quote and a backslash before a line break continues the line; every other backslash pair (`\\\\`, `\\n`, `\\l`, `\\N`) is a label escape, so `"c:\\\\"` is the text `c:\\`. Text arrives as written, backticks included.\n\nA DOT source holds one graph, at most 20,000 characters, 500 edges and 16 levels of nested subgraphs. A syntax error is a finding with its line and column in the DOT source; if pele rejects what OPF made of a source, the finding says so without a position (pele\'s would be in generated text).\n\n## PlantUML\n\nA [PlantUML](https://plantuml.com) diagram is a diagram with `syntax: "plantuml"`, written from its `@start` line to its `@end` line. OPF reads PlantUML itself and draws each kind as the Mermaid family of the same kind, so a PlantUML diagram is laid out by pele, sized, styled and exported exactly as that family is. No PlantUML code ships or runs (PlantUML is GPL), and the drawing is pele\'s, so it does not match the pixels of a PlantUML rendering.\n\n```json\n{\n "title": "The API answers every request with findings",\n "diagram": {\n "syntax": "plantuml",\n "source": "@startuml\\nactor Author\\nparticipant \\"Deck API\\" as API\\ndatabase Store\\nAuthor -> API : POST /decks\\nAPI -> Store : save\\nStore --> API : id\\nalt valid\\n API --> Author : 201 Created\\nelse invalid\\n API --> Author : 422 findings\\nend\\n@enduml"\n }\n}\n```\n\n![The slide drawn from the example: Author, Deck API and a Store database with POST /decks, save and id, then an alt frame where a valid deck answers 201 Created and an invalid one 422 findings.](images/diagrams/plantuml-sequence.svg)\n\nIn Markdown, the `plantuml` fence:\n\n````markdown\n# Every brief is reviewed before it is built\n\n```plantuml\n@startuml\nstart\n:Write the brief;\nif (Approved?) then (yes)\n :Build the deck;\nelse (no)\n :Revise it;\nendif\nstop\n@enduml\n```\n````\n\n![The slide drawn from the example: a start dot, Write the brief, an Approved? diamond, yes to Build the deck and no to Revise it, both ending at a stop.](images/diagrams/plantuml-activity.svg)\n\nA runnable deck with every kind is [`examples/technical/plantuml-diagrams.opf.json`](../examples/technical/plantuml-diagrams.opf.json).\n\nThe kinds OPF draws, and what it reads of each:\n\n| PlantUML diagram | Drawn as | What is read |\n| --- | --- | --- |\n| Sequence (`participant`, `A -> B : message`) | Sequence | `participant`, `actor`, `boundary`, `control`, `entity`, `database`, `collections` and `queue` with `as` names; messages `->`, `-->` (dashed), `->>`, `-\\` and `-/` (the last three are drawn with the open head), `->x`, `<-`, `<->`; `++` and `--` activations, `activate`, `deactivate`, `create`, `destroy`, `return`; `alt`/`else`, `opt`, `loop`, `par`, `break`, `critical` and `group`; notes (`left of`, `right of`, `over`, one line or a block); `ref over`; `== dividers ==` and `...delays...` as notes over every participant; `box`; `autonumber` (plain; numbers from 1); `title` |\n| Class (`class`, `interface`, `enum`) | Class | Classes, abstract classes, interfaces, enums, annotations and the other class keywords, with `as` names, generics and stereotypes; members in braces or as `Name : member`, `{static}` and `{abstract}`; `extends` and `implements`; relations `<|--`, `<|..`, `*--`, `o--`, `-->`, `..>`, `--`, `..` (both ways) with cardinalities and labels; notes on a class and a floating `note "text" as N` that no link refers to; packages and namespaces |\n| State (`[*]`, `state`) | State | States with `as` names and descriptions, transitions with events, composite states, `--` and `||` regions, `<<choice>>`, `<<fork>>` and `<<join>>`, notes left of or right of a state, `left to right direction` |\n| Activity, the current syntax (`start`, `:action;`, `stop`) | Flowchart | `start`, `stop`, `end`, `kill`, `detach`; actions over one or several lines (an SDL ending `|`, `<`, `>`, `/`, `]` or `}` picks the shape); `if`/`elseif`/`else`/`endif`, `switch`/`case`, `while`/`endwhile`, `repeat`/`repeat while`, `fork`/`fork again`/`end fork` (bars), `split`; arrow labels (`-> label;`); `partition` and `group` blocks and `|swimlanes|` as groups; notes beside the last action; `(A)` connectors |\n| Use case (`actor`, `(use case)`) | Use case | Actors (`actor`, `:Name:`), use cases (`usecase`, `(Name)`) with `as` names (including `(Use the application) as (Use)`), `rectangle` and `package` boundaries around use cases (one level; a nested one is drawn beside its parent; an actor written inside a boundary is drawn outside it, and a boundary with no use case is not drawn), associations with labels, `<<include>>` and `<<extend>>` on dotted links, generalization, notes left of, right of, top of or bottom of an element, `left to right direction` |\n| Component and deployment (`[Component]`, `node`, `database`) | Flowchart | `[Component]`, `component`, `() Interface`, `interface`, `database`, `node`, `cloud`, `artifact`, `folder`, `queue`, `actor` and the other element keywords as shapes; `package`, `node`, `folder`, `frame`, `cloud`, `database` and `rectangle` blocks as groups (named, with `as`, or unnamed: `cloud {`), which a link can name; links with their line (`--`, `..`, `==`, `-[hidden]-`), direction, ends and labels; notes left of, right of, top of or bottom of an element |\n| Mind map (`@startmindmap`) | Mind map | `*` depth (and `+` and `-` for the two sides), Markdown indentation, boxless `*_` nodes as square ones, multi-line `:text;` nodes |\n| Gantt (`@startgantt`) | Gantt | `Project starts`, tasks that `last` or `require` days or weeks, `starts` and `ends` on a date or at another task\'s start or end (with days before or after), `then`, milestones that `happen`, `is N% complete` (100% done, more than 0 active), `-- sections --`, closed weekdays and dates. OPF schedules the tasks in working days and writes their dates; without `Project starts`, the days are numbered from 1 |\n\nIn `participant Participant as Foo`, `Foo` is the name later lines use and `Participant` is what is drawn (PlantUML\'s own example); a quoted side is always what is drawn (`participant "Web App" as W`, `participant W as "Web App"`). The same holds for classes, states, use cases, actors, components and gantt tasks (`[Prototype design] as [D1]`).\n\nPlantUML\'s styling is ignored, as Mermaid\'s themes are: `skinparam`, `!theme`, `<style>`, colors, `hide` and `show`, `scale`, headers, footers, captions, legends, `mainframe` and `autoactivate` (no activation bars). A keyword is a statement only in its own shape: an element named `Header`, `Show`, `Title`, `Node` or `Group` keeps its messages and relations. Spacing lines (`...`, `|||`, `||45||`) are ignored, since the layout spaces the messages; `...text...` and `== text ==` are notes.\n\n**What OPF does not draw is refused, not approximated.** The other PlantUML diagrams (timing, object, network, ArchiMate, entity relationship, Salt, JSON, YAML, work breakdown structures and the other `@start` kinds), the legacy activity syntax (`(*) --> "First"`), messages from outside a sequence diagram (`[->`), circle ends (`->o`), a cross or half head on a double-headed message, `autonumber` with arguments, `newpage`, history states (`[H]`), `label` and `goto`, `hide @unlinked` and `hide <<stereotype>>`, notes on a link or floating notes that a link names (a lone floating class note is drawn), a note above or below a state, a gantt `pauses` or `is deleted`, a ** after a message, a second diagram in one source, and the preprocessor (`!include`, `!define`, `!function`, `$variables`) report a finding at their line ("OPF does not draw PlantUML timing diagrams; it draws sequence, class, state, ...") and the engines draw the "Diagram unavailable" placeholder. So does a line OPF cannot read in a diagram it draws.\n\n`return` answers the call of the latest activation (`++`, `activate`) and deactivates it; without one it replies to the last unanswered call. A `destroy` followed by messages of others is drawn with the last message to or from the destroyed participant, as pele requires. If pele rejects what OPF made of a source, the finding says so without a position (pele\'s would be in generated text).\n\nA PlantUML source holds one diagram, at most 20,000 characters (2,000 on a line), 500 messages, relations or arrows, and 16 levels of nested blocks.\n\n## How the deck styles a diagram\n\nThe deck decides colors and fonts, so a diagram follows the slide it sits on:\n\n- **Node fills** are tints of the first accent of the slide\'s color scheme, in the slide variant\'s order, mixed over the surface the diagram sits on. That surface is the card when the block has one (see `emphasis` and cards in [Layout templates](layout-templates.md)), otherwise the slide background.\n- **Outlines and connectors** mix toward the accent and the text color, with enough contrast to read as structure without competing with the labels.\n- **Data series** (pie slices, xychart series, timeline sections, mind map branches and the like) use the same chart series palette as the slide\'s charts: the color scheme\'s accents in the variant\'s order.\n- **Text** keeps 4.5:1 against its fill.\n- **Fonts.** Labels use the font scheme\'s body font, and code-like labels (class members, for example) its code font.\n- **Dark backgrounds, dark variants and color maps** adapt with no change to the source: `design.variant: "dark1"` on a slide redraws its diagram from the dark surface.\n\nThe same slide, with the same source, in four designs from the default catalog:\n\n```json\n{\n "title": "Every request is reviewed before it ships",\n "diagram": "flowchart LR\\n A[Request] --> B{Approved?}\\n B -->|yes| C[Build]\\n B -->|no| D[Revise]\\n D --> A\\n C --> E[Test]\\n E --> F{Passes?}\\n F -->|yes| G[Release]\\n F -->|no| C"\n}\n```\n\n| `classic`, `forest-green`, `aptos` | `bold`, `deep-purple`, `montserrat` |\n| --- | --- |\n| ![The flowchart on a white slide with pale green nodes.](images/diagrams/style-classic.svg) | ![The flowchart on a white slide with pale purple nodes and the Montserrat font.](images/diagrams/style-bold.svg) |\n| **`minimal`, `burnt-orange`, `georgia`** | **`classic`, `steel-blue`, `open-sans`, slide `design.variant: "dark1"`** |\n| ![The flowchart on a dark brown slide with orange-brown nodes and a serif font.](images/diagrams/style-minimal.svg) | ![The flowchart on a black slide with dark nodes, light labels and the Open Sans font.](images/diagrams/style-dark.svg) |\n\nEvery image in this guide is the renderer\'s own SVG output for the source above it, drawn by `scripts/build-diagram-doc-images.mjs` (`pnpm check:diagram-doc-images` keeps them current).\n\nMermaid\'s own theming (`%%{init: ...}%%`, themes, `themeVariables`) and click callbacks are ignored. Authored `style`, `classDef` and C4 `UpdateElementStyle` colors are the exception: pele applies them and OPF\'s painter keeps them, so a shape with an authored color no longer follows the deck\'s colors, variant or contrast rules. Leave them out and let the deck decide; if one shape must stand out, prefer a different node shape or a label to a color.\n\n## Sizing\n\nCore lays a diagram out for its block with the deck\'s measured fonts, the same way it fits text:\n\n1. It tries the largest base size from 32 reference pixels down at which the drawing fits the block. A small diagram grows to the size of a list; a large one steps down.\n2. Node labels never go below the readability floor (`minFontSize`, 16 reference pixels by default). The smallest secondary label (an edge label, an axis tick, a score) never goes below 75% of it.\n3. A diagram is centered in its block. A region anchored to the bottom places it there.\n4. Pele lays the diagram out for the width it has, so a smaller size is a new layout, not a shrunken picture: a wide flowchart may turn to run downward.\n\nWhen the diagram does not fit even at the floor, a flowchart or a state diagram is first tried in the other main direction (`LR` and `TB` swap, `RL` and `BT` swap; a state diagram without a `direction` is top to bottom, so it tries `direction LR`). If the labels reach the floor there, the diagram is drawn that way and the slide reports an `arrangement-adapted` info finding ("The flowchart is drawn top to bottom because left to right does not fit at the readability floor"). This applies to a direction the author wrote too: the source keeps its text, only the drawing turns, and the preview and the PPTX export draw the same turned layout. A diagram that fits as written is never turned.\n\nWhen no direction holds the labels at the floor (or the diagram type has no direction), the diagram as written is drawn smaller to stay inside its block, and the slide reports a `text-overflow` finding at the diagram\'s path, naming the directions tried. Fix it in the content, not in `minFontSize`:\n\n- give the diagram a slide or a region of its own, or put it beside short text rather than under long text;\n- split it into two diagrams, or shorten the labels.\n\n`opf validate` reports both findings, `text-overflow` and `arrangement-adapted`, whether or not `@openpresentation/opf-render` is installed, because it composes every slide and lays each diagram out. With the renderer it measures with the fonts `opf convert` draws with (the report says `layout (measured)`); without it, with core\'s portable estimate (`layout (estimated)`, and a hint says how to install the renderer). The two can disagree for a diagram near the limit: a flowchart of ten one-word branches gets `arrangement-adapted` measured and `text-overflow` estimated (checked 2026-11-14, CLI 0.34.0). Treat an estimated result as provisional and run `opf validate` or `opf convert` with the renderer installed for the final answer.\n\n### Write for readable labels\n\nA diagram is the slide\'s main content, so write it to be read from the back of a room: few nodes, few hops, short labels. Measured with this repository\'s renderer (core 0.34.0, `opf convert` to SVG, a titled slide at 1280 x 720 with the diagram alone in the body; sizes are reference pixels, 32 is the most a label gets and 16 the floor, a body list is 28 to 32):\n\n| Flowchart (nodes, longest path in hops) | Labels of one or two words | Labels of three or four words |\n| --- | --- | --- |\n| 3 nodes in a row | 32 | 32 |\n| 4 in a row | 32 | 21 |\n| 5 in a row | 32 | 17 |\n| 6 in a row | 27 | 15 (under the floor, `text-overflow`) |\n| 8 in a row | 20 | 11 (`text-overflow`) |\n| 10 in a row | 16 | 9 (`text-overflow`) |\n| 7 nodes, one parent with three children, each with one child (written `TB` or `LR`) | 32 | not measured |\n| 10 nodes in a tree three levels deep | 18 to 25 (`LR` 25, `TB` 18) | not measured |\n\nWhat the numbers say, and so what to write:\n\n- **Keep to 3 to 6 nodes on a slide, and to one or two words a label.** That keeps labels at 27 pixels or more, close to the body text. At 8 nodes labels are 20 pixels and the diagram reads as small print beside the slide\'s title; at 10 nodes they are at the floor.\n- **A label of three or four words costs about as much as two more nodes.** Put the detail in the slide\'s text or notes, or in a second slide, and keep the node to the noun.\n- **Split a long flow over several slides** (one stage or one decision per slide, each with its own title that says what happens there) instead of writing one chain of 8 or more. Each part is then drawn at 32.\n- **Direction follows the shape, and the engine tries both.** A chain is drawn best left to right on a wide slide: five nodes in a row are 32 pixels left to right and 18 top to bottom, because the slide is shorter than it is wide. A parent with many children is the other way: one parent with five children is 20 pixels left to right and 32 top to bottom. Write `TB` for a fan-out or a hierarchy and `LR` for a sequence; do not turn a long chain top to bottom to make it fit, and do not rely on the engine\'s turn (`arrangement-adapted`) to save a diagram that has too many nodes.\n- **Do not shrink to fit.** Never lower `minFontSize` or draw a diagram in a small region so that a large one fits; fewer nodes and shorter labels is the fix, and a `text-overflow` finding on a diagram means the slide has too much in it.\n- **Give the diagram the slide.** A title and the diagram, or the diagram beside a few short lines, not a diagram under a paragraph.\n\n### Layouts that accept a diagram\n\nA layout region lists the kinds it `accepts` ([Layout templates](layout-templates.md#regions)); `diagram` is one of them. In the default catalog these regions take a diagram:\n\n| Layout | Region |\n| --- | --- |\n| `charts` | `chart` |\n| `chart` | `chart-beside` |\n| `media`, `image-beside`, `hero` | `image` |\n| `comparison`, `two-column` | `first` and `second` |\n| `three-column` | the three columns |\n| `process` | `steps` |\n| `timeline` | `timeline` |\n\nA block binds to a region by kind, role and reading order ([Binding content to regions](layout-templates.md#binding-content-to-regions)); a slide that pins a diagram to a region that does not accept it gets the warning `opf/region-kind` and the block is bound by kind instead.\n\n## Accessibility\n\n`alt` is the text alternative: say what the diagram shows, not that it is a diagram ("A brief goes to review; approved work is built, rejected work returns to the brief."). Without `alt`, engines derive one from the diagram type and its labels (for example "Flowchart: Request, Approved?, Build, Revise"), up to 400 characters. The preview draws the diagram as one `role="img"` named by that text, and the PPTX export writes it as the description of the picture (or of the group of shapes).\n\n## Exports\n\n| Output | What you get |\n| --- | --- |\n| SVG preview | The diagram as vector shapes and text in the slide\'s colors and fonts |\n| PNG | The preview rasterized |\n| PDF | Vector; the diagram\'s labels stay selectable text |\n| PPTX (the default, `diagrams: "shapes"`) | Native PowerPoint shapes, connectors and text in one group, drawn from the preview\'s own geometry, `alt` as the group\'s description. `fromPptx` brings an unchanged group back as a `diagram`, a DOT or PlantUML diagram with its own source. A diagram that cannot be written as shapes is the picture below. |\n| PPTX, `diagrams: "picture"` | A native SVG picture with a PNG fallback: crisp at any size, recolorable as a picture in PowerPoint, `alt` as the picture\'s description. `fromPptx` brings it back as a `diagram`. |\n\n### Native shapes in PowerPoint\n\nThe PPTX export writes each diagram as editable PowerPoint shapes that look like the preview (`diagrams: "shapes"`, the default). To get one SVG picture per diagram instead, as earlier releases did, opt out:\n\n```js\nconst bytes = await toPptx(deck, { diagrams: "picture" });\nawait convert(deck, "deck.pptx", { diagrams: "picture" });\n```\n\n```sh\nopf convert deck.opf.json deck.pptx --diagrams picture\n```\n\nThe shapes are built from pele\'s laid-out drawing, the same geometry the preview draws, never a second layout or PowerPoint\'s connector routing:\n\n- **Nodes** are shapes. An outline that is exactly a PowerPoint preset is that preset (`rect`, `roundRect`, `ellipse`, `diamond`, `hexagon`, `parallelogram`, `trapezoid`, `triangle`, checked against the [shape geometry](shapes.md)); any other outline (a cylinder, a flag, a stick figure, a pie slice) is a freeform of its exact path.\n- **Labels** are real text in the deck\'s fonts at the preview\'s size, weight, color and baseline, with no wrapping and no autofit. A node\'s label is the node\'s own text, so it moves with the node; other labels are text boxes.\n- **Edges** keep their exact path and arrowheads. A straight edge without arrowheads is a PowerPoint connector glued to the connection sites of the nodes it touches, so it follows a node you move. Every other edge is a freeform of its line and its arrowheads: PowerPoint opens a connector only with one of its preset routes (a connector of freeform geometry makes the file unreadable), and its largest line end is about a fifth shorter than pele\'s arrowhead, so a glued connector would not look like the preview.\n- **Fills and lines** keep their colors, opacity, gradients, widths, dashes, caps and joins.\n- Everything is one group named `OPF diagram N`, with the diagram\'s `alt` as its description.\n\nA diagram family is written as shapes only after PowerPoint\'s drawing of it has been compared with the preview, source by source. Every family below passed: in PowerPoint 365 for Windows, with an example source per family (the ones in this guide where it has one) and a harder one (more nodes, long labels, right to left where the family has a direction), each slide rendered through PowerPoint and compared with the preview pixel by pixel and by eye, in five designs: the engine default (a dark slide in Aptos), a light theme, a serif font scheme (Georgia), a deck in Segoe UI, and a Japanese deck in Yu Gothic for the families that take labels (flowchart, sequence, mind map, timeline, kanban). In every design the shapes, lines and fills match the preview to antialiasing and every label sits where the preview puts it; what differs is the glyphs where the preview draws a font with a stand-in (see below).\n\n| Family | Written as shapes | Family | Written as shapes |\n| --- | --- | --- | --- |\n| Flowchart | yes | Architecture | yes |\n| Sequence | yes | Kanban | yes |\n| Class | yes | Packet | yes |\n| State | yes | Radar | yes |\n| Entity relationship | yes | Treemap | yes |\n| Gantt | yes | Venn | yes |\n| Pie | yes | Ishikawa | yes |\n| Quadrant | yes | Requirement | yes |\n| Mind map | yes | Wardley map | yes |\n| Timeline | yes | Tree view | yes |\n| User journey | yes | Event modeling | yes |\n| XY chart | yes | Railroad | yes |\n| Sankey | yes | Cynefin | yes |\n| Git graph | yes | Use case | yes |\n| C4 | yes | Swimlane | yes |\n| Block | yes | Agent flow | yes |\n\nA DOT diagram is drawn as a flowchart, and a PlantUML diagram as its Mermaid family, so each is written as shapes as that family is. The list is core\'s `DIAGRAM_SHAPE_FAMILIES` (from `@openpresentation/opf/composition`). A diagram stays the picture, with the info finding `pptx/diagram-shapes-unavailable` naming its family and the reason, when:\n\n- its family is not in that list (a new pele diagram type, until it has been compared);\n- its drawing uses something PowerPoint has no native form for: a clip path, a mask, a filter, a pattern, an embedded image, text on a path, or right-to-left text (whose placement PowerPoint decides by its own bidirectional layout).\n\nWhat can differ from the preview is what differs for all of the deck\'s text: where the preview draws a font with a stand-in (Aptos, Segoe UI and Yu Gothic, for example, which OPF does not bundle), PowerPoint draws the real font, so the glyph shapes and weight differ a little, while every line starts, ends and sits where the preview puts it. For a diagram that must be the preview to the pixel, export with `diagrams: "picture"`.\n\n**Editing and import.** The shapes are ordinary PowerPoint shapes: restyle, move or retype them as you like. `fromPptx` reads an unchanged group back as the diagram, with its Mermaid, DOT or PlantUML source and the group\'s current description as `alt`. Once a member is moved, resized, retyped, added or removed, the group imports as its shapes and reports `invalid-diagram-provenance`: the edit is kept and the source is not reconstructed. To keep the source as the truth, edit it in OPF and export again. With `provenance: false` (`--provenance none`) the group carries no source and imports as its shapes.\n\nPowerPoint\'s own "Convert to Shape" on a picture diagram also gives shapes, but that is PowerPoint\'s conversion, not an OPF export, and it does not map back to the diagram. See the [compatibility matrix](compatibility-matrix.md).\n\n## Errors and limits\n\n- A source that cannot be parsed reports a finding with its position in the source, for example `The diagram cannot be drawn (line 2, column 9): Expecting ...`, and the engines draw a "Diagram unavailable" placeholder in the block instead. Fix the source at that line and column.\n- An empty source, a source over **20,000 characters** or a diagram with more than **500 edges** is refused the same way: a slide holds one readable drawing, not a document.\n- In Markdown, an unknown attribute on the fence is `markdown/diagram-attributes`, and an empty fence is `markdown/diagram-source`.\n\n## The engine\n\n[pele](https://pele.run) 1.13.0 (MIT, no runtime dependencies) is the engine; OPF\'s own DOT and PlantUML readers (`dotToMermaid` and `plantumlToMermaid`, from `@openpresentation/opf/composition`, which show the Mermaid a source becomes) hand it DOT graphs and PlantUML diagrams. It is synchronous and does not use the DOM, so the preview, the PDF and the PPTX export need no browser, and the drawing is deterministic for a given source and fonts. Core measures the text with the deck\'s fonts, so line breaks match the rest of the slide.\n\nNode, Bun and Deno load every diagram type with core and draw any diagram at once. A browser bundle or an edge Worker (Cloudflare Workers, Vercel Edge) loads only pele\'s core with OPF (about 12 KB gzipped) and each diagram type the first time a deck draws one (13 to 54 KB gzipped each), and OPF\'s PlantUML reader (about 10 KB gzipped) the first time a deck draws a PlantUML diagram, through the package\'s `#diagram-engine` import map; a Worker that never loads a diagram type does not carry their code. The renderer\'s browser fonts handle loads them in `ensure` (its `pending` lists them as `diagram:<type>`), so `<opf-deck>`, the player, browser export and the editor wait for them as they wait for fonts; `toPptx` loads them itself. A host that validates or draws with `validate`, `composeSlide` or `toSvg` directly calls `await ensureDiagrams(presentation)` (from `@openpresentation/opf` or `@openpresentation/opf/composition`) first; `diagramsPending(presentation)` lists what it would load. Shapes and icon sets load the same way, and one preload covers all three: see [Engines and icon sets that load on demand](how-opf-works.md#engines-and-icon-sets-that-load-on-demand). Until then a diagram draws as a "Loading diagram" placeholder and its source is not checked, which is not a finding.\n\nPele reads Mermaid 12.1 syntax but has its own layout and drawing, so a diagram does not match the pixels of mermaid.js, and an unusual construct may parse in one and not in the other. Write for the OPF drawing: check a diagram in the preview (`opf convert deck.opf.json slide-{n}.png`), not in Mermaid\'s live editor.\n\nPlantUML Gantt schedules refuse durations, offsets or task spans over 36,600 days and more than 366,000 calendar-day checks per diagram. These limits produce a located diagnostic where a source location is available; shorten the schedule or split it into separate diagrams. A calendar with every weekday closed, an invalid date, or a task ending before it starts is refused instead of normalized.\n\nPlantUML state transitions use one arrowhead. Write two separate transitions for both directions; a two-headed state arrow is a source-positioned syntax finding.\n'
88
88
  },
89
89
  {
90
90
  "slug": "dynamic-composition",
91
91
  "file": "docs/dynamic-composition.md",
92
92
  "title": "Dynamic composition",
93
- "markdown": "# Dynamic composition\n\nOPF keeps authoring intent in JSON. Use `blocks` when content can reflow; use promoted regions when relative placement is meaningful. `composition` on a slide overrides fields in the resolved layout's `composition`. Existing documents remain valid.\n\nThe published Node 24 set is the registry's `latest` of each package (`node scripts/registry-plan.mjs`); a layout is one list of regions (FA-33, Gallery 5). Use the exact pins it prints; the [compatibility matrix](compatibility-matrix.md) separates package support from native Office and font gates. Older version references below identify when individual contracts were introduced.\n\n```json\n{\n \"name\": \"Decision brief\",\n \"slides\": [{\n \"title\": \"Make the main idea clear\",\n \"composition\": { \"mode\": \"row\", \"weights\": [2, 1], \"overflow\": \"error\" },\n \"blocks\": [\n { \"text\": \"The evidence and recommendation receive twice the width.\" },\n { \"text\": \"The supporting detail receives the remaining width.\" }\n ]\n }]\n}\n```\n\n`auto` evaluates candidate grids using text fit and cell proportions. `columns` limits its candidates. `grid` uses `columns` if given, otherwise a grid based on the canvas shape. `row` uses one row; `column` uses one column. Items retain source order. Weights size columns except in column mode, where they size rows. Missing weights are 1; unused weights have no effect. A partially filled final row retains its grid tracks.\n\nTwo or three blocks (no group, no caption) at the root of the body form a split. Its fill is the share of the body its blocks draw: the ink of text, lists, quotes, metrics and code (each line's width by its height at its starting size, so rewrapping changes nothing), a table at most its natural width by the height of its rows at that width, a timeline its cell's width by the height it needs, a picture shown whole and a video their frames, and a chart the largest 4:3 box of its cell.\n\n- **Row or column by fill (LH-71).** In `auto` mode with no `columns` or `weights`, a split tries one row and one column (stacked at the heights the blocks need) besides the grid the scores chose, and keeps the one that fills the most. A row that fills under 55% counts its code panels stretched, as it is drawn. A row must give every block at least 120 px of width, and a column must give every picture, chart and video at least 120 px of height. Neither may overflow more than the scored grid, nor set its blocks smaller (more font reduction) unless it removes an overflow. A fill within 2% of the body keeps the scored grid. Texts fill the same either way, so they stay in a row. A table that wraps in a row goes full width above its text. The explanation records such a container with `reason: \"split-fill\"`. An explicit `row`, `column` or `grid` is kept.\n- **Panels stretch, text centers (LH-52).** A split that fills under 55% of the body no longer reads as a strip along the top. In a row (any mode), a code panel takes its whole cell with its code in the middle. Text, lists, quotes, metrics, tables and timelines sit at the height they need in the middle of their cells (a card still fills its cell). A picture shown whole or a video sits in the middle of its cell, and a chart's box is centered. In a column, every measured block keeps the height it needs (a table no longer takes the spare height that pushed its neighbor to the foot of the body), and the stack sits in the middle of the body. No block changes size, and the arrangement and widths are unchanged.\n- **A picture alone on a card fills it (LH-74).** A picture that covers its frame (fit `cover`, or `auto` resolved to cover) on a card of its own, with no caption and no shape, corner radius, aspect ratio or line of its own, is the card: its box is the card's whole frame, its shape a rounded rectangle at the card radius (8 reference pixels), and `frameBox` is left out, so neither engine draws an inset, a card fill or a card stroke around it. A picture shown whole (`contain`) keeps its card and inset. A team's pictures (two or more people, each a picture and a name) are portraits or avatars (LH-132), never card-filling pictures.\n\n`gap` defaults to 1/30 and `padding` to 0.08, both fractions of the canvas's shorter edge. Large gaps are reduced when necessary to keep cells positive. `minFontSize` defaults to 16 reference pixels at a 720-pixel short edge. `maxFontSize` (LH-144, none by default) caps body text the same way from above: paragraphs, lists, quotes, metrics and timelines are never set larger, their growth included, and never under `minFontSize`; headings, tables, code and charts keep their sizes. `paginate` writes it on the pages after the first, so the pages of one slide share their sizes: each later page is first drawn as an unpaginated slide would be, then capped, for each kind of block it holds, at the larger of the first page's size and the smallest size any later page reaches on its own. A later page is never held under the first page's size or under what every later page reaches, so continuation pages that all grow (an arrangement beside a side title) keep their growth, and only a page that would read larger than its siblings is held to them (RR-105). The reference coordinate system uses 96 pixels per inch. Explicit inch dimensions override presets independently for each axis.\n\nComposed font sizes lie on PowerPoint's 0.01 pt grid (RR-16). PowerPoint stores a run size (`sz`) in hundredths of a point and a point is 4/3 reference pixels, so every size a fit accepts is a whole multiple of 1/75 px (`FONT_SIZE_GRID_PER_PX`), and the preview draws exactly the size the export writes. Fitting evaluates each trial size on the grid before breaking lines and placing text: trial sizes stay anchored to the unsnapped request (no drift) and round down (`snapFontSizeDown`), so a size that fit before snapping still fits; a readability floor rounds up (`snapFontSizeUp`), so `minFontSize` is never undercut; and a result that reports no overflow was measured at the size it carries. The rule covers plain, rich, list (marker, description and picture-bullet side), table, quote, code, metric, timeline, furniture and heading text, including each rich run and script. `wrapText` measures at exactly the size it is given.\n\nHeadings reserve space according to their wrapped text. Title and subtitle share the padded width of the free area, and a missing tag or subtitle leaves no gap.\n\nA content slide's title stays on one line when it can (LH-51). The title asks for 54 reference pixels and, before it wraps, steps down in three equal steps of a twelfth (49.5, 45, 40.5 px) to the largest step that sets it on one line, so a deck has at most four content title sizes. Only a title that needs a second line even at 40.5 px wraps, at 54 px and balanced, as before. A content slide is one with a body whose title sits in auto rows above it; covers, sections, the stacked records (`statement`, `quote`, `closing`) and a title beside the body in a sized row (`agenda-split`) keep 54 px. The step is chosen per slide: composition sees one slide, so one size for the whole deck would need each engine to resolve every slide's layout first.\n\nA content title of the form \"Topic: qualifier\" (its first colon followed by a space) that still wraps at 40.5 px is split at the colon when the slide has no subtitle and the topic fits one line (LH-76). The topic is the title, on one line at its step; the qualifier is drawn below it as the subtitle at 28 px, its first letter as authored. A rich-text title and a layout with a separate subtitle area are not split. This is a composition-time presentation: the document keeps the whole title. Both items carry the title's path and `titleSplit` (`part`, and the drawn part's `start` and `end` in the authored title). The PPTX export puts the topic in the Title placeholder and the qualifier in a text box below it, and tags both as one title group, so import restores the whole title.\n\nCover slides vertically center the combined tag/title/subtitle group in the free heading area. A cover is a slide with no body payload (no root content field, where a root `image` counts unless it carries its own `placement`, no `blocks` other than placed images, no promoted regions; empty payloads such as `blocks: []`, `text: \"\"`, empty lists and regions with nothing in them count as no body; whitespace-only text is still body) on a v2 template or with no layout record. Empty template regions collapse according to the record and its heading regions place the headings (a heading region's own `anchor` sets the group at the foot of its area, as the gallery `cover` and `section` do, LH-130). The rule reads the record, never its id. The free area is the slide minus the bands of placed images, header and footer furniture, and the usual padding; a picture background reserves nothing. A wrapped heading makes the group taller and the group recenters. A group that already fills the free area is not moved. Accepted line and outline origins move with the boxes. Explicit heading `alignment` positions ink inside the box and never changes the vertical position. A flowed image is body, so image slides keep the top-aligned content origin; a placed image is not. Content slides are not affected: headings stay at the top and the body follows them. This is a reference-engine default, not a schema field.\n\n## Adaptive layout templates (OPF 0.19)\n\nA layout record is one ordered list of regions, declared once in reading order, and describes the content each body region accepts. The 40 built-in layouts are named by intent, such as `cover`, `text`, `chart`, `list`, `metrics` and `image-beside`. `layout: \"auto\"` explicitly asks for automatic composition; omitting `layout` does the same. See [Layout templates](layout-templates.md) for the record shape, the built-ins, region binding and overflow rules.\n\n```json\n{\n \"name\": \"Evidence beside the recommendation\",\n \"slides\": [{\n \"layout\": \"two-column\",\n \"title\": \"Approve the next phase\",\n \"blocks\": [\n { \"region\": \"first\", \"text\": \"The pilot met its acceptance criteria.\" },\n { \"region\": \"second\", \"text\": \"Fund the next two sites.\" }\n ]\n }]\n}\n```\n\nA block's `region` pin is resolved before the layout binds unpinned content by kind, role and reading order. A region's `flow` arranges several blocks; `max` limits how many it accepts, and `overflowRegion` receives content no region accepts. If there is no overflow region, unplaced content receives a row below the grid. An empty area collapses into a neighbouring area unless its record says `empty: \"keep\"`. The geometry exposes the result in `geometry.regions`, including each region's box, bound paths, overflow, collapse and bleed. Pagination repeats the selected layout and carries a region pin forward for a block moved to a continuation slide.\n\n**Arrangement before a smaller size (LH-186, the guarded rule `layout-first`).** Composition grows short content to fill, changes the arrangement before it sets text smaller, and fits dense content that no arrangement holds down the type scale to the readability floor, never below it, flagging what still does not fit. A paragraph, list or table set more than one step of the type scale (LH-149's half steps: 16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 32 px) under its role size (28, 32 and 25 px; on a layout template held to `composition.maxFontSize`) tries the arrangements that keep it larger. A long list (more than LH-42's six entries) that neither its payload nor a region gave a `columns` count, the slide's only list, of plain entries (no descriptions, icons or step badges), is dealt into two or three columns, each at least `LIST_COLUMN_MEASURE` (36) characters wide at its size, at the count that sets it largest on the type scale, when that is at least one step larger than its one column and nothing overflows (ten entries of twelve words: 21 px in one column, 26 px in two); as LH-144's columns, the count is chosen without `composition.maxFontSize`, which then caps it, so a page of a paginated slide is arranged as the first. A list drawn as an arrangement (a pyramid, matrix, cycle or flow) adapts its own design and is never counted as shrunk. A layout template is composed as the automatic grid (below). An arrangement is kept only when it adds no finding, sets no block smaller and reads as well. Where no arrangement sets the text larger the slide is unchanged: a 14-entry list stays at 24 px in one column (two columns would set it at 23 px), a 160-word paragraph at 26 px (one long paragraph has no more room in columns: they set it at 26 px and 24 px), a 14-row table at 18 px. `fill: false` and a run size of the author's (`fontSize` on a text run) keep the fitted composition.\n\nWhen a template sets a body role at the readability floor, `composeSlide` composes the same blocks as the automatic grid and keeps that result when its smallest body size is larger (or as large with less overflow) and it neither overflows nor splits words more (LH-83, `recomposed` on the composition): the headings then sit above the body as on an automatic slide and the result has no `regions`. `recompose: false` keeps the layout's result. See [Recomposition at the readability floor](layout-templates.md#recomposition-at-the-readability-floor-lh-83).\n\nA body that fills under half of its height at its role sizes grows (LH-48): the only block of a slide steps up the type scale (each role up to its display size, `LONE_DISPLAY_SIZES`) to about 60% of the body and sits in its middle, and a body of several paragraphs and lists steps up together, at one size, and centers. `fill: false` keeps the role sizes. See [A body that fills too little](layout-templates.md#a-body-that-fills-too-little-lh-48). A short lone text and a `statement` draw their message at display size (LH-09). On a one-message slide (the body is one text, quote or metric, with no subtitle, and no title or a title of at most four words that is not a sentence; `oneMessageField`) the message grows past those caps as far as its length allows (LH-188, `MESSAGE_CEILINGS`): a statement of up to 30, 60 and 120 characters up to 115, 80 and 54 reference pixels (16%, 11% and 7.5% of the short edge), a quote's body up to 86, 72 and 56, and a figure of at most six characters up to 252 (`FIGURE_CEILING`). These are ceilings for the same growth by steps of the type scale, never fixed sizes and never lower than the cap before them: the message still keeps every word whole, its balanced lines and the 60% fill target, and takes no step that adds a line whose last line is a stub, under a third of the longest (`stubLine`: balancing does not even out text without word spaces, or a word too long to move). Characters are grapheme clusters, a run of white space counts once and a full-width (CJK) character twice (`messageCharacters`). Display text (LH-189), set at twice the body size (56 px) or more in Latin, Greek or Cyrillic text or ASCII figures (other scripts, emoji and mathematical letters are drawn by script faces and keep their spacing), tightens only where it pays: a title or subtitle (not over a measured background picture, where LH-158 places the group by its height), the message text, a one-message quote's body and a growing lone metric's value track by -1.5% when they fit on one line, at the usual 1.22 em pitch; a text of two lines takes a 1.0 em pitch and the tracking only when that lets it reach a larger size (`composeSlide` composes such a slide both ways and keeps the tighter one only when a text is larger there and none is smaller); three lines or more keep 1.22 em and no tracking (`linePitch`, `DISPLAY_TRACKING`). A label or attribution set in capitals tracks by +8%, as an eyebrow. Text in other roles keeps 1.22 em at any size. A slide with no body composes as a cover and grows its headings by steps of the type scale (LH-129), as a `cover` record does; a lone timeline tries two or three steps of the scale on its labels first.\n\nThe slide's own `composition.mode`, `columns` and `weights` arrange the first primary flowing region. `design.contentDirection` asks flowing regions to use a row or column; `design.mirror` reverses template tracks. Effective design keys resolve per key from slide, deck, theme, layout, then engine default. Promoted regions retain their 3\xD73 vocabulary and visual reading order. The layout template does not replace content groups inside a slide; groups still keep related blocks together.\n\n## Shared headers and footers\n\nPublished core 0.11.0 exposes `layoutFurniture(slide, options)` and `geometry.furniture`, separate from body `items`. Composition identifies the available-space policy as `grid-score-v9`. Raw callers pass the presentation as `options.presentation`, resolved dimensions/fonts and the same measurement provider used by preview. `slideIndex` identifies source paths; optional `slideNumber` is the one-based displayed number.\n\nThe core resolver honors whole local header/footer overrides, including `false` and empty objects. Each zone retains its image and all configured text fields in source-aware parts. Literal text and dates preserve whitespace and empty strings. A zone logo reference (`var:organization.logo.icon`) to an organization without a logo, missing socials, or `date: true` without a host-supplied current date, produces `unresolved-content`; the implementation never consults a clock or invents source text.\n\nGenerated values are variables inside a zone's `text` (FA-31): `{{organization.name}}`, `{{speaker.name}}, {{speaker.title}}` and the other deck-wide built-ins resolve with `resolveVariables` before composition, and the slide-scoped `{{slide.number}}` (the displayed number), `{{slide.section}}` (the slide's `section`, empty when it has none) and `{{deck.slideCount}}` (the displayed slide count: `options.slideCount`, else `presentation.slides.length`; whole-deck pagination iterates to the final page count) resolve in `layoutFurniture` for the slide it lays out. One `text` holds several values in the author's order, with `\\n` between lines (`\"{{organization.name}}\\n{{slide.section}}\"`, `\"Page {{slide.number}} of {{deck.slideCount}}\"`). An escaped `\\{{slide.number}}` draws as the literal token. Every zone `text` is one part with `field: 'text'` and `sourcePath` at the authored text. `dateFormat` is an LDML-style pattern (`yyyy`, `yy`, `MMMM`, `MMM`, `MM`, `M`, `dd`, `d`, `EEEE`, `EEE`, quoted literals) with fixed English month and weekday names. A string `date` with `dateFormat` must be an ISO `YYYY-MM-DD` date and renders as fixed, generated text tied to that source value; without `dateFormat` a date string stays literal and editable. `date: true` is the current date: hosts pass today's ISO date as `options.date` (composition, pagination, renderer and exporter), and the default pattern is `M/d/yyyy`. Text parts expose `fields`: one `{ type: 'slideNumber', start, end }` per substituted `{{slide.number}}` and one `{ type: 'date', start, end, format }` for a whole current date, as half-open UTF-16 ranges into the part's `text`, so exporters can write native live fields while `{{deck.slideCount}}`, `{{slide.section}}` and fixed dates stay fixed text. `formatFurnitureDate()` is exported for hosts. All configured fields in one zone sit side by side in one row, in the order image, text, socials, date (see the row geometry below). An organization logo is `image: \"var:organization.logo.icon\"` (or any shape and organization): `layoutFurniture` resolves it for the slide's background and the image part keeps the reference in `reference` (see [design resolution](design-resolution.md#brand-assets-and-layout-hints)). Hiding furniture on a title slide is the slide-level `design.header: false` / `design.footer: false` override.\n\nThe slide-scoped built-ins work in body text too. Engines compose and draw the slide `resolveSlideContext(deck, index, { slideNumber, slideCount })` returns as `context.slide` (`resolveSlideVariables(slide, { slideNumber, slideCount, presentation, darkBackground })` substitutes them in the slide's own strings and resolves its organization logo references for the background, leaving its own header and footer to `layoutFurniture`), with the same numbers in `context.options`, so body text is measured and drawn with the real value. `paginate` measures continuation pages with the substituted values but returns the slides with the tokens kept, never splitting a page inside a token, and runs its slide-count fixed point whenever `{{deck.slideCount}}` appears in the deck.\n\n`socials: true` (core 0.11.1 and later) generates one `socials` part from the primary organization's `organization.socials`. The part has one source line per platform, in key order, and a parallel `links` array (`platform`, `text`, `href`, `resolved`, `sourcePath`). `resolveSocialProfile(platform, value, owner)` formats each value without network access, through the engine's social-platform vocabulary (`SOCIAL_PLATFORMS`, [`engine-vocabularies.json`](../spec/reference/engine-vocabularies.json)). A handle loses its `handlePrefix` and is substituted into `companyUrlPattern`, then `profileUrlPattern`, then `baseUrl/{handle}`; the result is shown as that URL without `https://`. A URL value passes through unchanged except that `https://` is dropped from the display. A key outside the vocabulary (the schema rejects one) is shown raw with no link, which is the Socials engine fallback. No catalog is involved: the Socials keys are an engine vocabulary. A missing organization, or one with no non-empty socials, produces `unresolved-content`. Speaker socials, platform icons, brand colors and slide-size presets are not rendered.\n\n`furniture-flow-v2` lays the start, center and end zones on the content inset (`composition.padding`, the body's own left and right edge) as three columns with a 2% gutter, and an empty zone lends its column to its neighbours: a lone `start` footer spans the content width, a `start` and an `end` zone share the free centre, and a `center` zone stays centred. The validator warns (`opf/furniture-wraps`) when a zone's text wraps past two lines; move sources to a caption or the speaker notes. **Zones lay out in a row (RR-71, vetoable).** A zone's parts sit side by side in the order image, text, socials, date (in a right-to-left deck the row runs from the right, the image at the start edge), `FURNITURE_GAP` (12 reference pixels at a 720-pixel short edge) apart, the row flush with the zone's start edge, centered, or flush with its end edge, and each part vertically centered on the row's tallest part. `\n` still breaks lines inside a text or socials part. With other parts, a text part's box is as wide as its longest line; a zone with a lone text part keeps the whole zone width (it wraps there, as before). When the row is wider than the zone, its text parts share what the images and gaps leave: a part narrower than an equal share keeps its width and the others wrap at the share; beside other parts an image is at most `FURNITURE_IMAGE_SHARE` (40%) of the zone's width, and a word that would break inside itself at the readability floor (letters or digits of a space-separated script on both sides of a soft break) is a `text-overflow` diagnostic at the part's text path, never a silent break. The tallest row sets the natural band height; rows start at the band's top edge. **Distance from the edge (LH-38).** The header band starts, and the footer band ends, half a content margin (`composition.padding` times the short edge, halved: 28.8 px at the default on a 720 px short edge) from the top and the bottom edge, the same distance at both, so the furniture sits nearer the edge than the content and reads as chrome; sideways the zones stay on the content inset. Text uses at least the selected readability floor, with complete accepted source lines and optional measured outline placement. Header and footer bands reserve room before heading and body allocation. Irreducible text, conflicting bands or a heading displaced beyond the remaining space produce diagnostics; strict composition rejects them. An image part (`type: 'image'`) alone in its zone aligns like the zone's text: its `box` is as wide as the image's own proportions make it at the band height (a 36 px band at 1280 px wide), at most the zone, flush with the zone's start edge in the start zone, centered in the center zone and flush with its end edge in the end zone, at the same vertical position as before; consumers fit the image inside `box`. Core reads the proportions without fetching, from an embedded PNG, JPEG, GIF, WebP or SVG data URI or an `asset:` reference to one, decoding only a bounded prefix of the payload (64 KiB, 1 MiB for a JPEG whose frame header sits behind large metadata) and memoizing per source, so a multi-megabyte logo costs nothing per slide; a JPEG whose header is past 1 MiB, an SVG whose root tag is past 64 KiB, a path or a URL is unreadable is placed in a square box (vetoable), so a wide image behind a path or URL is drawn small and flush to its zone edge until it is embedded. No-furniture body geometry remains unchanged.\n\nPagination repeats these fields without putting them among body slices. An optional `page.repeatedMappings` records repeated heading/furniture and metadata paths while the existing `page.mappings` retains its body-fragment contract. Whole-deck pagination evaluates final output numbers, including preceding continuation pages, and rejects unresolved repeated content atomically. Renderer and editor reuse the accepted parts; literal text/date fields, including empty values, support direct canvas editing and undo. Generated labels remain tied to metadata.\n\nPublished PPTX (0.9.1 and later) draws the accepted editable text boxes and fitted images and records furniture provenance in tagged slide shapes. Reimport uses current native text and images; damaged or ambiguous provenance retains visible content with diagnostics. The fresh installed-package evidence includes deterministic export, current-content reimport controls and offline canvas editing/undo. Native PowerPoint acceptance, font compatibility and full visual review remain separate gates. Since PPTX 0.11.9 (RR-11), the first footer text, date and slide number that fit one accepted line become real PowerPoint `ftr`, `dt` and `sldNum` placeholders at exactly this geometry, with master/layout placeholders and `p:hf` flags (see [native header and footer](https://github.com/OpenPresentation/opf-pptx/blob/main/docs/native-header-footer.md)); header parts, organization, section, socials, images and multi-line text stay tagged shapes because PowerPoint has no object for them. No core geometry or schema changed. Bounds/readability checks do not certify whole-slide design quality: long labels can wrap heavily in portrait zones, and outline agreement does not establish native font identity.\n\n## Footnote areas and caption bands\n\nRR-34 (core after 0.11.4) adds two reserved regions that exist only for decks that use the fields. A slide whose runs carry `cite` or `footnote` markers gets `geometry.footnotes` (`footnote-area-v1`): a rule and the slide's notes in number order, directly above the footer band (or the bottom padding) with the content area's left edge and width, in the body family at the furniture size; the content area shrinks by exactly the area's height plus half the slide gap, and nothing above it moves. The area takes at most 35% of the span between the heading top and the footer band; a note that does not fit reports `text-overflow` at its source path (`references.N` or the run's path), which pagination treats like any other fit overflow. `slideCitations(slide, slideIndex, presentation)` is the numbering `composeSlide` uses; pass the same `presentation` and `slideIndex` to every consumer. An `image`, `chart`, `table` or `video` payload with a `caption` reserves a caption band inside its region (`item.caption`; `item.box` becomes the media box), below or above the media, at most 35% of the region; automatic grid selection scores the leaf on its media box. See [footnotes, citations and captions](footnotes-citations-captions.md).\n\n## Backgrounds and placed images\n\nCore 0.15 composes pictures in two ways (FA-22); [images](image-treatments.md) has the full vocabulary.\n\n- A picture background (the slide's `design.background`, then the deck's, then the theme's, when it is `{ type: \"image\", ... }` or an image-source string) is `geometry.backgroundImage`: the whole canvas as its frame, `fit` (`cover`, `contain`, `stretch`, `tile`), `focus`, `opacity`, `recolor` and the overlay box (whole picture or an edge band). It never moves content. `resolveSlideContext` passes the theme's background as `ComposeSlideOptions.themeBackground`.\n- Every image item carries `item.image`: the frame inside its region, `fit` (the block's own, else the effective `design.imageFit`, else `cover` in a layout and in an automatic picture track, and `contain` elsewhere on a slide composed with no layout), `focus`, the mask with its DrawingML preset and SVG outline, line, opacity, recolor and overlay. `fitImage(frame, fit, aspect, focus)` is the shared fit math (LH-84: with no authored `focus`, a portrait picture, taller than wide, cover-cropped into a wider frame defaults to focus y 0.3 so heads stay in frame, `defaultImageFocus`; any other crop is centered, an authored focus always wins, and `item.image.focus` is the focus drawn); core fills `item.image.picture` itself when it can read the picture's proportions (a data URI, or an `asset:` reference to one). A picture shown whole (`contain`) gets a frame of its own proportions at the region's anchor (top by default) when core can read them, so `item.image.box` is the picture and not the whole cell; a video's `item.box` is its 16:9 frame; in automatic composition a chart is at most 4:3 landscape in a cell, a radar at most square, and a chart that is the slide's only body at most 2:3 portrait, centered in the body it does not fill (RR-105: on a 9:16 slide a lone chart filled the top half of the body), and a single row of a portrait picture beside other blocks, or of two prose blocks whose demand differs by 2.5 times, gets weighted widths.\n\nTwo text notes moved out of a metric or chart grid can use those measured width shares too. A substantially longer note may take up to 70% of the row when that shortens it and adds the shorter at most one line. The notes stay side by side only when the row is no taller than stacking them. Their type size and source order remain intact; narrow canvases and authored direction keep their existing choices.\n\nA top-level image block with `placement: { edge, size, inset }` takes a band along that slide edge: `size` of the slide width (start, end) or height (top, bottom), default 0.5, edge to edge, or inside the slide padding with `inset`. Headings, footnotes and the body compose in the free area that remains, with the usual padding; header and footer bands keep their full-width placement. Bands are taken in block order and each spans the free area the earlier ones left; a second block on a used edge flows as content (the validator reports it). Placed items are listed after the headings and before the flowed body, and their placeholder slot is not reserved in the flow. A slide whose only body is placed images is composed like a cover. `start` and `end` follow the deck's direction: `start` is the left edge in a left-to-right deck and the right edge in a right-to-left deck.\n\n## One size guard for the layout-harvest rules\n\nEvery rule of the third layout-harvest wave that rearranges or resizes blocks is held to one guard in `composeSlide`: no rule sets\na block's fitted body size below what the slide gets without the wave's rules (each text, list and table, and each main part of a\nquote, code panel, metric or timeline), unless that leaves fewer findings (`text-overflow`, `small-cell`, `layout-unplaced`), and\nthen never below the readability floor. A rule never adds a finding, splits a word or sets a paragraph under the minimum measure.\nThe guarded rules are LH-89's nested gaps, LH-65's empty columns, LH-72's measure column, LH-78's quote lead size and card, LH-06's\nautomatic band or pill, LH-114's pull line, LH-121's timeline status words, LH-68's scorecard tiles, LH-86's long-text rows, LH-66's\nminimum measure, LH-67's lead plus stack, LH-70's paragraph columns, LH-10's reading measure in a layout's regions, LH-64's one start for\na row of cards of mixed kinds, LH-47's stretched short last row, LH-120's 40% share of a bar chart in a row of three, LH-112's start\nalignment and display size of a metric beside other blocks (with LH-15's band), LH-50's label drawn as the eyebrow of the text after it,\nLH-08's ruled rows for a list of short labels with descriptions (LH-171: on a slide where another list is ruled, a list whose labels are a short phrase of up to six words is ruled too, so sibling columns read alike; see [Design resolution](design-resolution.md#liststyle-lh-08-vetoable)),\nLH-133's questions as ruled rows (`pair-rows`, see [Questions and terms](#questions-and-terms-lh-133)), LH-07's step badges and flows\nof a `sequence` region (see [Step sequences](layout-templates.md#step-sequences-lh-07)), LH-134's numerals (`numerals`, see\n[Numerals, badges or rows](#numerals-badges-or-rows-lh-134)), LH-135's pricing tiers as one card each and LH-136's one-word pillar titles at display size over an accent rule (see [Layout templates](layout-templates.md)), LH-131's featured card\nof a pair or a set (`featured-card`, see [Emphasis surface](#emphasis-surface-lh-06)), LH-137's delta pill (`delta-pill`) and LH-137's\ncheck-mark tiles of a dark summary list (`check-tiles`), LH-14's icon chips (`icons`, `icon-chips`), LH-170's closing note on the band (`note-band`, see [Emphasis surface](#emphasis-surface-lh-06)) LH-169's\nfigure-led list as a row of figures (`figure-row`, see [Layout templates](layout-templates.md)), LH-63's bold run-in heading over a text (`run-in`, see [Content payloads](content-payloads.md)), LH-46's lead plus cards of a closing's details (`closing-lead`, see [Layout templates](layout-templates.md)), and LH-186's arrangement before a smaller size (`layout-first`: a long list in columns, a layout template as the automatic grid; see above). The decorative mark of a quote card (LH-78, `QuoteLayout.mark`) is not guarded: it is drawn in the card's own padding and moves nothing. The featured card, the pill, the tiles, the icon chips, the note band and the figure row only draw, so a slide that draws one of them is also composed under the guard without them and keeps the drawing only when no block reads smaller there, nothing more is found and a body role at the readability floor stays at it (the drawing never decides LH-83's recomposition); otherwise each is tried alone on top of the rules that slide kept. LH-40's figure on one line\n(`metric-figure`) is tried last, on top of the rules the guard kept, and kept when the slide reads as well with a split figure allowed\nthe next smaller type-scale step (a slide that composes no metric is not composed again for it). LH-165's icon cards, LH-162's text\ntiles and LH-69's placed tiles (`icon-cards`, `text-tiles`, `placed-tiles`) are tried before it the same way, on top of the rules the guard kept: they rearrange the whole body,\nso they are never part of the first composition, where a failure would take every rule that did not fire off the slide. A layout's\nlone list with icons also tries its cards across the whole body as the automatic grid (`recomposed.cards`), kept when its text reads at\nleast as large as the layout's.\nAn eyebrow is set at its own role size (0.6 of its paragraph's, from 20 to 24 px), like the tag, and is not a body size the guard compares. A pull line sets its quote at the lead size on purpose,\nso the guard holds that quote to the slide's smallest body size rather than to the larger size it had on a card (every other block still\nkeeps its own size); another arrangement of the slide (a track, LH-48's growth) that draws the quote on a card again is held to the\ncard's size. The display size is tried last, so it never displaces an arrangement that reads well without it, and a value at display\nsize is compared at its 76 px role size: what it has above that is headroom an arrangement may spend.\n\n- The slide is composed once with every rule. When none changed anything (most slides), that is the result.\n- When only rules that move blocks without changing the size any block asks for changed something (nested gaps, the measure, long-text\n rows, the measure column), and every block got the size it asked for with no finding, the result is kept as it is.\n- Otherwise the slide is also composed without the rules. That composition seeds LH-68's tiles (each metric role starts at its stacked\n size) and LH-06's band or pill (its text starts at the size the block had), and the result with the rules is kept when it reads as\n well. When it does not, each rule that changed something is added on its own, smallest change first, and kept while the slide still\n reads as well.\n- The slide then settles: a message set in the middle of the slide grows (LH-129), an under-filled body grows (LH-48), a layout may\n be recomposed as the automatic grid (LH-49, LH-83), and an automatic slide may give its picture or chart a track (LH-80, LH-49). Each\n of those arrangements is composed with the rules that read well in it and kept only when it reads as well as the guarded composition.\n- A slide that draws step badges (LH-07) or numerals (LH-134) is settled once more without them and keeps them only when every block\n reads as well, since a badge band changes how much of the body is filled and so whether LH-48 or LH-129 grows it. The automatic scrim of a picture\n background (LH-02) is computed last, over the slide that is kept, and changes no box or size.\n\nLH-52 and LH-71 only place blocks at the sizes they already have and are not guarded; LH-72's start alignment and sibling quotes of one\nrow sharing a size are always applied. The rules meet as follows:\n\n- Paragraph columns (LH-70) and a lead plus stack (LH-67) keep their own cells; LH-52 centers only the scored grid or LH-71's row, and\n LH-48 does not grow them.\n- A quote beside another block in a centered split (LH-52) takes its own card (LH-78), measured with the card's insets, in the middle of\n its cell. On the emphasis surface (LH-06) the surface is its card.\n- Long texts that LH-86 moved into one region keep their rows; paragraph columns and a lead plus stack do not rearrange them. A short\n last text after them is LH-06's foot band, bound to no region.\n- LH-06's band or pill keeps its own size; LH-48 grows the blocks above it. LH-114's pull line does the same.\n- LH-48 grows LH-86's long-text rows and LH-52's splits of paragraphs like any body of paragraphs: its fill is the height the text covers,\n not the cards around it. A lead plus stack (LH-67) does not grow, so its lead stays larger; a body at the floor is left to LH-83.\n- When LH-71 stacks a chart above a short takeaway and its plot becomes wider than 3:1, LH-49 gives the chart the filling track beside\n the text. A picture track (LH-80) keeps only the rules that read well beside it (a quote's lead size that would make it smaller is\n left out).\n- Charts that LH-49 recomposes share their value axis and plot height (LH-33, LH-93) in the recomposed grid.\n- A list in a `sequence` region keeps LH-07's badges and takes no automatic ruled rows (LH-08); its other lists, and a slide whose\n badges the guard refused, may still be ruled. An agenda whose entries all have descriptions draws LH-134's numbered rows instead of\n badges (see [Numerals, badges or rows](#numerals-badges-or-rows-lh-134)).\n- LH-133's questions as ruled rows take the region's blocks out of its grid into one column; six or more short questions keep the grid\n and only gain their accent rules, which sit in the gaps and change no size.\n- LH-129 grows a cover's or section's title and subtitle but not its tag: the tag is LH-32's eyebrow at its 22 px role size, which is\n also its display size.\n- LH-50's eyebrows apply on slides without layout regions and LH-07's steps only in layout regions, so a step never carries an eyebrow.\n LH-152's root label before a list stays a block on a layout with a `sequence` region for the same reason.\n\n## Questions and terms (LH-133)\n\nA question with its answer and a term with its definition are read from the content, never from a slide or layout id: a question is\nan entry (with a description, at the first level) whose text ends with a question mark of its script (`?`, the fullwidth `\uFF1F`, the\nArabic `\u061F`, the reversed `\u2E2E`, before any closing quote or bracket; `questionText`); a term is a short label (`isLabelText`) of at most\ntwo words (`TERM_WORDS`; `pairEntry`). Claude Design sets an FAQ and a glossary as two-column ruled rows:\n\n- **A list of questions.** A list of two or more first-level questions with answers is drawn as ruled rows (LH-08's rows, under the\n guarded rule `pair-rows`): each question bold in a column of `LIST_ROWS_LABEL_SHARE` (40%) of the list's width, wrapping in it, its\n answer beside it with their first baselines aligned. A question that needs more than `LIST_QUESTION_LINES` (3) lines in the column\n puts every answer under its question instead.\n- **One block per question.** A region whose two or more blocks are each a one-entry list holding a question with its answer (the\n usual way an FAQ is written) draws them one under another across the region instead of in its grid, each block a ruled row: the\n questions share one column of 40% of the width and the answers start at one edge, the answer at the list size (as the heading list it\n would otherwise be), and a hairline in the middle of the gap between two blocks. The import keeps each block (the export names each\n list, so two stacked lists are never merged into one).\n- **Six or more short questions** (`PAIR_GRID_MIN`; each question at most 48 and each answer at most 90 characters) keep the region's\n grid (3 \xD7 2 for six), each cell under an accent rule: `LIST_ACCENT_RULE_WIDTH` (3 reference px) in the accent, the tag's color on its\n backdrop, half a gap over its text and never nearer the text above it than its own. Questions whose rows the guard refused keep the\n grid with the same rules.\n- **A glossary.** The slide's lone list of two or more terms with definitions, most of them one word (\"ARR\", \"Churn\"; a list of\n features named in two words is not a glossary), draws its terms in the accent (`ListEntryLayout.accent`) in the column of the widest\n term, its definitions beside them as LH-08's rows.\n\n- **Ruled rows fill the body** (LH-48 for rows). A lone list drawn as ruled rows (LH-08's rows, questions, a glossary, takeaways\n beside numerals, an agenda's numbered rows) first grows in type-scale steps as any lone list does (toward about 60% of the body, never\n smaller than before), then takes the whole body: the leftover height is shared evenly between its rows, each gap at most\n `LIST_ROWS_SPREAD` (3) em, the hairlines in the middle of the gaps and numerals with their rows, and what is still left sits above and\n below them (`ListFitOptions.spread`). One-question blocks stacked as rows spread over the body the same way, from a gap under the\n headings to the foot of the content box. Claude Design spreads an agenda's or a FAQ's rows down the slide like this.\n\nRules and accents are drawing: the preview draws them as SVG lines and text fills, the PPTX export as native lines (`OPF list rule\n<path> N`) and run colors, and the import reads neither as content (a term's accent is the look the export records for its runs). In a\nright-to-left deck the question or term column is at the right and the answers to its left.\n\n## Numerals, badges or rows (LH-134)\n\nA numbered list draws its numbers one way, decided by its region and its content, never by a slide id:\n\n1. **A `steps` region** (a process): LH-07's badges, or a flow of chips.\n2. **A `numbered` region** (an agenda): when every entry of every list of the region has a description, numbered ruled rows: each\n number a numeral at the list size, bold in the accent and in two digits under 10 (\"01\"), in a column at the row's start, the label\n bold and the description in a second column (Claude Design's agenda). Otherwise LH-07's badges, for every list of the agenda.\n3. **Elsewhere**, a numbered list that is the slide's lone body block with 2 to `NUMERAL_TAKEAWAYS` (5) first-level entries is a few\n takeaways: display numerals beside ruled rows, the numeral `LIST_NUMERAL_SCALE` (2.5) times the list size when every takeaway has a\n supporting line (its digits from the takeaway's capitals to about its line's baseline) and `STEP_BADGE` (1.75) times when one has\n none, `LIST_NUMERAL_GAP` (1.5 em) before the text.\n4. **Every other numbered list** keeps its native numbers, ruled when LH-08 rules it.\n\nNumerals and badges are drawing, under LH-07's veto: an unnumbered agenda is numbered as drawing only and imports unnumbered, and an\nauthored `numbering` comes back from the tag of each numeral or badge (`ComposedStepBadge.list`). Both are guarded (`step-badges`,\n`numerals`), and a slide keeps them only when every block reads as well as without them; a list beside numerals grows (LH-48) as the\nplain list would, as long as it fits with them. A numeral is `ComposedStepBadge.numeral`, its line box: the preview draws its label\ncentered on its column in the tag's color, the PPTX export a text box at that box holding the numeral (no ellipse).\n\n## Metrics beside other blocks\n\n- **Display size (LH-112).** One or two metrics that share the body with one or two blocks of other kinds (a chart, table, paragraph,\n list, quote, picture or timeline) are drawn at display size: one metric's value starts at 120 reference pixels and grows in 4 px steps\n to 160 while its line height stays within 40% of the body's height and its one line within 90% of its cell's width; two start at 90\n and grow to 120 (`METRIC_DISPLAY_SIZES`, `METRIC_DISPLAY_HEIGHT`, `METRIC_DISPLAY_WIDTH`). A value that would wrap at its start keeps\n one line at the largest size down to its 76 px role size. Such a metric is start-aligned with its column (value, label, description,\n delta), unless the slide or the deck sets `contentAlignment`; a layout's or theme's centering is the default for short text, as LH-70\n reads it. A metric alone keeps its centered display (LH-101 below) and a grid of metrics alone, or a scorecard tile (LH-68), keeps its\n sizes.\n- **Lone metric (LH-101).** A lone metric grows by the type scale's ratio, up to nine steps, while it fills at most 80% of its cell\n (`LONE_METRIC_TARGET`), its value up to 232 px (`LONE_DISPLAY_SIZES.value`), as Claude Design sets a lone figure at about 230 px. On a\n one-message slide a figure of at most six characters grows up to 252 px (LH-188, `FIGURE_CEILING`), and a growing value's line is one em\n tall (LH-189).\n- **Band (LH-15).** A metric at display size in a cell at least three times as wide as it is tall (as the cell gives it, or as the\n metric stacks when the cell takes its natural height, `METRIC_BAND_RATIO`) is a band (`arrangement: \"band\"`): the value at the start\n edge, at most 60% of the width, and the label, description and delta in a column beside it (at least 200 px wide), the two centered on\n the band's height. Right to left, the value is at the right.\n- **KPI column beside a chart (LH-61).** A slide whose body is one or two metrics and one chart, and at most one table, with the metrics\n composed above the chart (a dashboard's KPI row over its charts) is composed again with the metrics (and the table) in a column of\n about a third of the width and the chart in a full-height track beside it (the chart track of LH-49, 67% then 60% of the content\n width; a layout slide is recomposed as the automatic grid, `recomposed.kpis`). It is kept when the plot is at least as tall and the\n slide reads as well; a table that would be smaller in the column keeps the layout's arrangement.\n- **A short table beside its note (LH-75).** A slide whose body is one table and one note (a plain text block, before or after the table)\n that sits one above the other, the table under half the body's height with its cells on one line and the note two lines or more, is\n composed again with the two side by side: the table first (or second, as authored; the start edge, mirrored right to left), taking 70%,\n then 65% or 60% of the width, the widest share at which the note's column keeps LH-66's 28-character measure, and the note on one plain\n card as tall as the row (`frameBox`), its text in the middle of the card, the row in the middle of the body. The type steps up with\n LH-48's steps (the table's rows with it). Initial placement keeps at most two whole-word cell lines and a row covering at most 60%\n of the body; actual growth may use three whole-word lines and up to 75% of the body, while preserving the note's reading measure. It is\n kept when no block is smaller, no word splits and no new finding appears; a layout slide is recomposed as the automatic\n grid (`recomposed.table`), and a layout that already sets the note beside the table (`table-beside`), a slide with a third block, an\n `emphasis`, regions, a `composition` mode, columns or weights of its own, and `recompose: false` keep their arrangement. A wide\n table whose words cannot fit its columns, or whose cells need more than two lines at their starting size, stays above it (LH-44).\n- **Compact grids (LH-05).** The rows of an automatic grid of paragraphs and lists (LH-43) used to spread over the body, so six one-line\n texts stood two thirds of a body apart. When the rows need under 45% of the body (or LH-48 grew them), they hug their text one gap apart\n and the grid sits in the middle of the body (`compact-grid`); rows that need more keep LH-43's spread. LH-48 then grows a hugging grid\n further than other bodies: up to eight steps of the type scale and past a list's display size (to 56 px), all cells at one size, while\n every text that was on one line stays on one line (the width of the cells bounds it: three columns of one-line texts stop at 43 px, two\n at 56 px) and the body covers at most 60%. The grid never ends smaller than the same body spread over the area; a growth that would end\n smaller lets texts wrap as they did, and one that still would is the spread body itself.\n- **Text tiles (LH-162).** 4 to 8 paragraphs of at most 90 characters that are the whole body of an automatic slide (blocks at its root)\n draw as tiles: one card each in the theme's card surface, in the grid of LH-165's icon cards (two to four a row, balanced, the short\n last row centered; see [Icons](icons.md#icon-cards-lh-165)), each text beside a small dot in the accent at the start of its first line\n and in the middle of its tile, on at most two lines. The texts start at the size they share and grow by steps of the type scale up to\n LH-05's 56 px while the tiles hold them without a split word and they cover at most 60% of the body; the grid is the one where they are\n largest, then on the fewest lines. Tiles (`text-tiles`) and icon cards (`icon-cards`) are tried on top of the rules the guard kept and\n kept only when no block reads smaller than without them, and than the settled slide without them (whose compact grid LH-48 may have\n grown further): with estimated text widths a compact grid of six texts reaches 43 px in three columns where tiles of two lines cannot,\n so it stays the compact grid.\n- **Placed tiles (LH-69).** A promoted region (a slide key such as `top:start`) whose one block is a plain text of at most four words\n that is no sentence (it does not end in `.`, `!`, `?` or their equivalents in other scripts) draws as a tile, as Claude Design draws\n \"Product\", \"Engineering\" and \"Operations\" over a list: a card in the theme's card surface filling the region, the text bold at its foot\n at the start edge. The tiles of a slide share one size: the text's size, then each step of the type scale up to LH-05's 56 px while every\n tile's text stays on at most three lines with its words whole and covers at most 60% of its card. No icon is drawn for a text that has\n none. The blocks beside the tiles grow with LH-48 as they would without them (the tiles' texts are left out of the body that grows), and\n the tiles (`placed-tiles`, tried with LH-165's icon cards) are kept only when no block reads smaller than on the settled slide without\n them, at its exact size: LH-149's half step is not given up for a tile. A short sentence (\"Teams want fewer exports.\") keeps the bold\n heading of LH-69, and a slide that draws cards (`design.contentBox`) keeps each region's text on its own card.\n- **Value color on dark (LH-57).** On a dark slide or card, a value whose accent falls under 4.5:1 against the surface is drawn in the\n light text color (`metricValueColor(color, background, text)`) instead of a lightened accent, so the number stays the strongest\n element. A unit on its value's line takes the value's color.\n\n## Media tracks and the reading measure\n\nAutomatic composition (no layout, no promoted regions, no `columns` or `weights` of the slide's own) gives a picture or a chart a track of its own and keeps paragraphs on a readable measure (layout harvest LH-80, LH-49, LH-66). The rules read block kinds, counts and measured sizes, never a slide id, and mirror in a right-to-left deck.\n\n- **Picture track (LH-80).** A slide's one picture block among other blocks takes a full-height track at the slide edge, as an automatic `placement` (`item.image.placement.automatic`): cover-cropped with the LH-84 portrait focus and bled to the edges. It sits at the start side when it is the first block, else at the end side (the top or bottom of a portrait canvas). The headings and the other blocks compose beside it in the slide's own `mode`. The track is 50, 45, 40 or 35% of the slide; a track whose crop would keep less than half of the picture's width or height is not tried, so a panorama stays whole in the flow. A track is a frame the engine chooses for the picture and crops it by design, so a picture with `fit: \"auto\"` (LH-104) takes it as one with no fit does and is cover-cropped in it. Of the tracks that read as well as the slide without one (below), the one with the largest smallest body size is taken, then the one with the larger body sizes in all, then the one that crops least (a portrait picture takes a narrow track), then the widest. A block's own `fit: \"contain\"` or `\"stretch\"`, a `design.imageFit` of either, a frame shape or `aspectRatio`, an authored `placement`, a second picture or a video keep the composition as before: set `fit: \"contain\"` to show a screenshot or a diagram whole. The track spans the title band only when the title fits one line beside it (after LH-51's steps); otherwise the tag, title and subtitle take the full width and the track starts at the body top, still bled to its side and the foot (LH-116). A track that would wrap a table cell the slide sets on one line is not kept while another track keeps every cell on one line; when none does, LH-75's allowance holds, a cell may wrap onto two lines with its words whole, so the table keeps its size beside the picture.\n- **Short last row (LH-47).** The cells of the scored grid's short last row share the full width (two pictures and a paragraph draw a row of pictures over the paragraph, not a 2 x 2 grid with an empty cell); a grid of pictures and videos only keeps one cell width.\n- **Chart track (LH-49).** A slide's one chart block among other blocks (no picture, no `design.chartPrimary`, which stays the author's, and no `design.contentDirection` across the track: `vertical` on a landscape slide keeps its column) whose plot is too short takes the filling track: the root's first column when it is the first block, else the last, 60, 55 or 50% of the content width (the first that reads as well) against a column of the other blocks in the slide's own `mode`, as `chartPrimary` splits it. A plot is too short under the larger of 120 reference pixels and 22% of the body's height, or when it is more than three times as wide as tall. `chartPlotBox(item, scale)` is the plot as the engines lay it out: the chart box less the chart layer's header row, the padding, the label rows and the value axis labels.\n- **Authored chartPrimary (RR-105).** A `top`, `bottom`, `start` or `end` chartPrimary is drawn as written: no block of the body becomes the automatic note band or pill, and a paragraph beside the chart sits in the middle of its track, level with it. A lone plain paragraph there that fills under half of its track grows as a lone block does: up to 43 px while it fills at most 60% of the track and keeps the minimum measure, and a short message (25 words or fewer) on to 56 px in at most 4 lines; a longer text keeps its size. `none` is the ordinary automatic body. Where the slide cannot draw it (its own `composition.mode`, promoted regions or a template's regions place the blocks), composition reports `arrangement-adapted` at the chartPrimary key instead of dropping it.\n- **Reads as well.** A track is kept only when the slide has no more overflow or small cells, no more words split, no more paragraphs under the minimum measure and none on a shorter measure than before, and no block's body size smaller: a new arrangement never costs the text its size. Only a slide that overflows without it may trade size, to leave fewer findings, and never below the readability floor. Otherwise the slide is composed as before (an authored `row` of four narrow blocks keeps its row). `geometry.track` (`kind`, physical `edge`, `size`, the block's `path`) says which track was taken.\n- **Reading measure (LH-66).** A paragraph of four lines or more in a cell narrower than 28 average characters of its fitted size (`MIN_MEASURE_CHARS`) has too short a measure. The `auto` grid adds 20 to a candidate's score for each such paragraph (`narrowMeasure` in the explanation's penalties), and a `grid` with no `columns` of its own takes fewer columns until its paragraphs keep the measure. The grid chosen with the measure is kept only when it reads as well as the grid without it (no block smaller, as above). Labels of a line or two and lists keep their grid.\n- **Bar chart share (LH-120).** In a row of three blocks, a horizontal bar chart (`bar`, `stacked-bar`, `100pct-stacked-bar`) takes 40% of the row and the other two 30% each, because its category labels sit beside its bars and take their width from it. It is a guarded rule (`bar-chart-share`): kept only when no block reads smaller. In the preview a category label wider than its gutter (30% of the chart, or up to 40% for its longest word) wraps onto two lines at a space, even where its row is shorter than two full lines (it reaches into the gap between bars), before it is ellipsized.\n\nA layout that leaves a chart's plot shorter than its minimum (a wide chart region drawn on purpose keeps its proportions) is composed as the automatic grid when that draws the plot taller and reads as well; `recomposed.chart` holds the shortest plot of both, in reference pixels (see [Layout templates](layout-templates.md#recomposition-at-the-readability-floor-lh-83)).\n\n## Rows shared across kinds (LH-115)\n\nTwo blocks that list the same keys in the same order share their rows (layout harvest LH-115, extending LH-18's shared row tracks across kinds). Each rule only moves marks within boxes composition already gave, or composes the slide once more under the size guard, so it never costs a block its size.\n\n- **Bars on a table's rows.** A horizontal bar chart beside a table whose first-column keys are the chart's categories in the same order draws each bar beside its key: the plot spans the table's body rows (from the first row's top to the last row's bottom) and each category is centered on the middle of its key cell's text (`item.chart.layer.rows`, core `alignBarRows`). Only when those rows fit in the chart's box below its header row and above its value labels; otherwise the chart keeps its own plot. The PPTX export writes the plot area over the same rows (an inner manual layout); PowerPoint spaces categories evenly over it, so on rows of unequal height a bar sits off its key by at most half the difference.\n- **A timeline under its column chart.** An automatic slide of a timeline and a column chart (no layout, no `mode`, `columns` or `weights` of the slide's own) whose events' `when` values are the chart's categories in the same order is composed again with the chart above and the timeline as one band under the plot: each event's marker and labels sit under its column, mirrored right to left with the columns. It is kept only when it reads as well as the slide without it; the timeline stays listed first when it was written first.\n- A list with one entry per bar category is not merged into the bar labels: as sublabels at the chart text size its entries would be smaller than the list (32 px against 16 to 20 px on the mixed corpus's m28), which the size guard forbids.\n\n## Grouping blocks before placing them\n\nComposition groups a slide's blocks before it places any cell (layout harvest LH-58, LH-82, LH-73, LH-46, LH-47). The\nrules read the blocks' kinds, counts and text lengths, never a layout or slide id, so they hold for any count, any content\nkind and right-to-left decks; a slide that pins a block to a region, or sets its own `composition.mode`, `columns` or\n`weights`, is composed as written. `repeatedPairs`, `majorityKind` and `groupBinding` (on `/composition`) expose them.\n\n- **Repeated pairs.** A sequence that repeats one pair of kinds, a figure (metric, chart, table, picture, video or code)\n and a paragraph in either order, or a long and a short paragraph (one at least twice the other's length, the long one\n on the same side of every pair), two pairs or more, composes as one cell per pair. A pair is one row of its two blocks\n when each half of its cell is at least 0.8 of the cell's height wide (a metric beside its note), else one column (the\n figure above its text), half a gap apart. Metric, text, metric, text is two cells, not four.\n- **Group by kind.** With no layout, interleaved blocks of two kinds with unequal counts (chart, text, chart, text,\n chart) are one column of a grid of the majority kind above a row of the others (up to three side by side), each at\n the height it needs. On a layout, a region's grid keeps the kinds it accepts and the other blocks join the region that\n accepts them, in one row under the grid that asks for at most 30% of the content box (see [Layout\n templates](layout-templates.md#grouping-before-placement-layout-harvest)).\n- **Extra blocks in fixed regions** join the grid at the sibling size instead of a slim full-width strip below it:\n pictures as a row, then a lead picture beside a mosaic, cover-cropped; the columns of `comparison` as N columns;\n `statement` as a lead over a row of cards (see [Layout templates](layout-templates.md#grouping-before-placement-layout-harvest)).\n- **Balanced grids.** A region's grid of 7 to 12 blocks has balanced rows (7 as 4 + 3, 9 as 3 x 3), and the cells of a\n short row stretch to the full width, except in a grid of pictures, whose cells keep one size and center.\n\nGrouping changes the order of the composed items to the order of the cells (a pair's two blocks together; the majority\ngrid before the others), which is the reading order the preview, the PPTX export and accessibility use.\n\n## Reading measure, alignment and leads\n\nThese rules (layout harvest LH-70, LH-72, LH-67, LH-78) read block kinds, counts and text lengths, never a layout or slide id,\nand apply in automatic composition and in a layout's regions alike; a right-to-left deck mirrors them. A slide's own\n`composition.mode`, `columns` or `weights`, and `design.contentDirection`, keep their arrangement.\n\n**Readable size wins over the ideal measure.** These rules are held to the size guard above: a result with them is kept only when\nno block's fitted body size is smaller, or when it reports fewer findings; otherwise each rule is tried on its own and the ones that\npass are kept. LH-72's start alignment and sibling quotes sharing one size are always applied.\n\n- **Paragraph columns.** Three to six sibling paragraphs of similar length (100 to 240 characters each, the longest less\n than twice the shortest) are parallel items, so they are set as a grid of columns 45 to 65 average characters wide, when that\n is as large as their own arrangement. The shapes have 2 to 4 full columns (3 as 2 + 1 or a row; 4 as 2 x 2, 3 + 1 or a row;\n 6 as 2 x 3 or 3 x 2); each takes the largest size of the type scale at which its narrowest column keeps 45 characters and its\n rows fit, and the largest wins. On a wide slide that is two columns at 21 or 24 px; three columns at a 45-character measure\n exist only at the floor, so three paragraphs usually keep their own arrangement. `explain` reports `paragraph-columns`.\n- **Centered layouts center only short text.** When the content alignment is `center` and comes from the layout record or\n the theme, a paragraph or list over two lines or 120 characters is start-aligned in a column at most 65 characters wide,\n centered in its cell, and its siblings follow it. An alignment the slide or the deck sets is the author's and is kept.\n- **Lead plus stack.** Of three to five sibling texts or quotes, a paragraph of at least 100 characters, at least 2.5 times\n the median length of the others and twice the next longest, leads: a cell 55% of the width at full height, a text starting\n at the lead size (32 px), beside a stack of the others at one size. A chart or picture with two compact siblings (metrics, or\n texts and quotes of at most 120 characters) leads at 58%. The lead sits at the start unless it is the last block. A\n `flow: grid` region keeps its grid. `explain` reports `lead-stack`.\n- **Quotes beside other blocks.** A quote beside a block of another kind, or one of three or more quotes, starts at the\n lead size and steps down until it takes at most four lines (never below the 28 px body size), on a card that hugs it, when\n that makes no quote smaller; otherwise it keeps its size, on a card when the card costs no size. A card the slide does not\n otherwise draw is left out when it would make the quote overflow. A lone quote, and one or two quotes alone on a slide, keep\n the 40 px display size. Sibling quotes in one row share one body size; a row of wider cells keeps its own.\n- **Quotes under data: the pull line (LH-114).** A quote of 140 characters or fewer that shares the slide's root `blocks` with\n a table, a list of three or more entries, or two or more other blocks is drawn across the body as its own row: an 80 x 6 px\n accent rule in the primary color at the start edge, the quote at the lead size (32 px, stepping down to 28 px to take at most two\n lines) in the regular weight, and one caption line \"\u2014 Name, Role\" (the source after an en dash) under it. It is the last row when\n the quote is the last block, and the first row under the headings when it is the first block of an automatic slide; the data takes\n the full width beside it, and in a layout the quote is bound to no region. The data and the pull line are one stack at the top of the\n body: the pull line sits one gap under the lowest content (a table's last row, a text's last line, a card's edge, a chart's box), or\n one gap above the highest, and the body is not centered (LH-52, LH-48), though LH-48 still grows the data. LH-06's band stays at the foot. A quote beside one compact block (a metric, a chart, a\n short text, a list of one or two entries) keeps its card, as does a quote in the middle, one of several quotes, a quote with a\n photo, a region pin, a caption or `emphasis: true`, a quote that needs more than two lines, and a slide with an arrangement of its\n own. The quote layout reports the rule as `quoteLayout.rule`; the preview draws it as a rectangle and the PPTX export as a tagged\n native rectangle (`OPF quote rule <group>`) that import consumes with the quote.\n\n## Check-mark tiles (LH-137)\n\nA slide set apart on a dark surface of its own (its `design` sets a variant or background, and the slide is dark; a deck that is dark throughout keeps its lists) whose whole body is one bulleted list of two to six entries of one level, with no descriptions and each 90 characters or fewer (`CHECK_TILE_MIN`, `CHECK_TILE_MAX`, `CHECK_TILE_MAX_CHARACTERS`; a summary of decisions or outcomes), draws each entry as a tile of a grid that fills the body, with a check mark badge at the entry's start (the right in a right-to-left deck) in place of its bullet, as Claude Design draws a closing list of decisions. The grid is one row for three or fewer, two columns for four, three for five or six; when an entry would take more than two lines there (`CHECK_TILE_MAX_LINES`), one column of wide tiles (three columns become two for five or six). The entries keep the list's size; when one does not fit its tile at it, the list stays as it was. A numbered list, a list with a caption, a card or an emphasis, a list of a `sequence` region and a deck with its own list marker (`design.listBullet`) keep their own drawing. Composition reports the tiles as a step sequence (`result.steps`, form `tiles`): `chips` (one per entry, its text the list column of the same index) and `badges` whose `check` is core `checkMarkPoints(cx, cy, diameter)`, a polygon both engines fill in the badge's numeral color (PPTX: an accent ellipse and a custom geometry, tagged as LH-07's badges are and consumed on import).\n\n## Emphasis surface (LH-06)\n\nA slide has at most one emphasis surface: a contrasting card or band that carries the slide's takeaway. `emphasis: true` on a block or a group (at any depth) puts it there; the first one in reading order takes the surface, any other is drawn without it and reported as the composition diagnostic `emphasis-ignored`. The surface is the block's or group's cell, drawn as a card; nothing on it takes a card of its own, and a group's children are arranged inside the card's inset.\n\nWithout an authored emphasis, two automatic rules read the slide's root `blocks` (with a layout or without):\n\n- a **foot band**: a last block that is plain text of 60 characters or fewer, after blocks that are all longer (any other kind, or text over 60 characters), is drawn as a full-width band at the foot of the body. A takeaway of up to 120 characters is a foot band too when the blocks right before it are two or more charts or tables (LH-06, widened); a note between two charts reads as the first chart's note and keeps the 60-character rule;\n- a **pill**: a last plain text of 30 characters or fewer after one long text (over 60 characters) is drawn as a pill one gap under that text's last line, hugging its one line at the start of the text's column (the right in a right-to-left deck); where that leaves no room it is drawn at the foot of the body;\n- a **closing note** (LH-170, the guarded rule `note-band`): a lone short note that closes the body is the foot band whatever its length in characters, when it sets in at most 3 lines (`EMPHASIS_NOTE_LINES`) across the band at its size. It is the one text a layout binds to its `verdict` region (the comparison's \"Recommendation: ...\", pinned or bound there), or the last block when every block before it is a figure, two or more in all: metrics, groups of metrics or LH-169's figure lists (a row of figures and what they mean, under them in a `metrics` layout's note region or beside them in a `two-column` layout, whose region then gives way). A featured pair or set (LH-131, below) keeps its card and the note stays text, as do a note with `emphasis: false` and a longer one. So does a note that is a peer of the texts above it, even in a `verdict` region: when two or more texts before it have its form (plain text with as many paragraphs) and its length is 0.6 to 1.6 times their median (`NOTE_PEER_RATIO`), or it opens as each of them does (the same first lowercase word in its first 6 words, as \"should\" in \"<Name> should ...\"; the same first word in a script without case), it is one of a set, and banding it would set one peer apart. The band's text is set at least at the size the note has on the slide without the band, after LH-48's growth there, and the band is kept only when no block then reads smaller than on that slide.\n\nThe body above composes in what remains and the band or pill text is the last item. Neither costs a block its size: `composeSlide` also composes the slide without it, starts the band or pill text at least at the size the block fitted at there, and keeps the band or pill only when it leaves fewer findings (`text-overflow`, `small-cell`, `layout-unplaced`), or as many and no body block smaller (a text or list, any visible part of a quote, code panel, metric or timeline, a table's smallest cell). A band or pill taller than 30% of the body is not drawn. `emphasis: false` keeps a block out of both rules, and a slide with an arrangement of its own (a `composition` mode other than `auto`, `weights` or `columns`) takes neither; a block with a region pin, a caption or any payload besides `text` never takes them.\n\nLH-131: without an authored emphasis or a band or pill, a **featured card** reads the slide's root blocks too (core `featuredCells`, from content only, never from an id). The cells are the root blocks that are groups (a group's label is its first block when that is a text, or its first metric's label) or metrics (their label), two to six of one kind:\n\n- a **pair**: two cells whose labels (four words and 40 characters or fewer) name opposite sides, before and after or a problem (a challenge) and its solution, in English, German, French, Spanish, Portuguese, Italian, Dutch, Polish, Russian, Turkish, Arabic, Hebrew, Korean, Japanese or Chinese (\"After\", \"Nachher\", \"Apr\xE8s\", \"\u0628\u0639\u062F\", \"\u5C0E\u5165\u5F8C\"; \"The solution\", \"Die L\xF6sung\", \"\u0627\u0644\u062D\u0644\"). The cell naming the second side is featured, wherever it stands;\n- a **set**: exactly one cell marks itself as the featured tier in its label, a short text or its metric's label or description (80 characters or fewer; a list's entries are not read): \"recommended\", \"most popular\", \"best value\" and their words in those languages (\"empfohlen\", \"m\xE1s popular\", \"\u304A\u3059\u3059\u3081\", \"\u63A8\u8350\", \"\u0627\u0644\u0623\u0643\u062B\u0631 \u0634\u064A\u0648\u0639\u0627\").\n\nThe featured cell is drawn on the emphasis surface (`source: 'featured'`), and every other cell of the pair or set on one plain card (each block of a group shares its group's card), so the set reads as cards with one marked, as Claude Design draws a solution, an \"after\" or a pricing tier. In a design with cards, a cell's card is inset 12 px (`CELL_CARD_INSET`, the smallest inset of a block's own card) so no block has less room than its own card gave it; otherwise the card takes payloadBox's inset, and the cell asks for that room. A pair of before and after whose cells both hold a metric and stand side by side draws an arrow from the first card to the featured one, in the middle of the room between them (`emphasis.arrow` `{box, direction}`, `PAIR_ARROW_WIDTH` by `PAIR_ARROW_HEIGHT`, 40 by 28 px, at least `PAIR_ARROW_MARGIN` of a gap from each card), drawn as LH-07's flow arrows are (an accent `rightArrow` or `leftArrow`; a `leftArrow` in a right-to-left deck, where the \"after\" card stands left); when the cards stand closer, the slide is composed again with each card that much narrower on its inner side and kept only when no block reads smaller. An authored `emphasis: true` anywhere on the slide always wins, `emphasis: false` on the featured block keeps the slide plain, and the guard keeps the featured card only when no block reads smaller.\n\nComposition reports the surface as `result.emphasis` `{ path, box, radius, shape: 'card' | 'band' | 'pill', source: 'authored' | 'foot-band' | 'pill' | 'featured', arrow? }` and marks every item on it `emphasis: true`. Its colors come from core `emphasisSurface(colorScheme, roles)`, which resolves a variant of the deck's own scheme through the layout-variant machinery (LH-01): on a light slide dark2, then dark1, then the accents; on a dark slide the accents in the slide's order, then light1; the first whose text reaches 4.5:1 on its fill and whose fill reaches 3:1 against the slide. Every text role on it under 4.5:1 takes the surface's text color. The preview and the PPTX export draw the surface under the first item on it and color those items with the surface's roles (PPTX: a tagged `OPF card <path>` frame with no line, recognized on import as decoration); `validate` measures their contrast against the surface.\n\nA slide whose whole body is one display message is drawn on the accent surface (LH-164; docs/design-resolution.md, \"A message-only slide\"). The surface is a color variant the slide context resolves before composition, so `composeSlide` moves nothing for it: it echoes `options.messageSurface` as `result.surface` `{ kind: 'statement-message' | 'display-message', variant }`, the reason an editor can show, as `pictureText` and `recomposed` are. LH-163: in a display message on a dark or accent surface, the author's bold words that the primary does not reach 4.5:1 on draw in a lighter tint of the primary that does.\n\n## Nested groups\n\n### Shared content cards\n\nShared content cards are published in core 0.10.0 and later, including the current core. For `design.contentBox: true`, each body leaf carries a `frameBox` at its outer allocation and a `box` padded inward by 12 reference pixels at a 720-pixel short edge, capped at one quarter of the frame's width or height. Scoring, accepted payload measurement, strict overflow and pagination all use that rounded interior. Headings remain unframed, nested groups keep their original padding, and explicit outer regions/track weights remain authoritative. Automatic candidates may change because their available content space changes.\n\nEvery composed item carries its resolved horizontal text `alignment` (`left`, `center` or `right`: the engine's words for the design values `start`, `center` and `end`, where `left` is the start edge and `right` the end edge, and `itemAlignment` converts a design value). The title, the tag (eyebrow) and a subtitle that sits in the title area (any slide whose layout has no `subtitle` region of its own) use `titleAlignment`; every other item, including a separate `subtitle` region, body text, lists, tables and metrics, uses `contentAlignment`. The value is the effective `design` key: the slide's design, then the deck's design (or the host's resolved deck option), then the theme's design, then the layout record's `design`. With no explicit alignment from those layers, metrics default to `center` and other items to `left` (LH-112: a metric beside one or two blocks of other kinds is start-aligned, unless the slide or deck sets `contentAlignment`); any resolved `contentAlignment` still overrides that fallback. A layout that sets `contentAlignment: center` therefore centers its content when no higher-priority layer sets the key. The title never inherits `contentAlignment`. On every slide, only a `contentAlignment` set on the slide's own design keeps the tag and the title-area subtitle apart (a deck or layout value does not), so a centered-content deck with start-aligned titles draws a start-aligned title, tag and subtitle over its centered content. Accepted outline placement and metric internals use the same value. The renderer and the PPTX exporter anchor preview and native text to `item.alignment`, so both engines place a layout's text the same way.\n\nRaw composition callers pass their resolved deck flag as `composeSlide(slide, {contentBox: effectiveDesign.contentBox, ...options})`; a slide's explicit `design.contentBox: false` overrides it. Coordinated renderer, editor and whole-presentation pagination resolve this option for their callers. Consumers draw at `frameBox` and use the accepted `box` and payload internals without another inset. Core 0.9.0 predates this behavior. Content cards do not make the incomplete chart/timeline density models complete or certify native raster fidelity.\n\nA block or promoted region can contain its own `blocks` and `composition`. The optional discriminator is `\"type\": \"group\"`. A group has at least one child and cannot mix children with leaf fields such as `text` or `image`.\n\n```json\n{\n \"composition\": { \"mode\": \"row\", \"weights\": [2, 1] },\n \"blocks\": [\n {\n \"composition\": { \"mode\": \"column\", \"padding\": 0.02 },\n \"blocks\": [{ \"text\": \"Recommendation\" }, { \"text\": \"Supporting evidence\" }]\n },\n { \"text\": \"Context\" }\n ]\n}\n```\n\nThe parent allocates a box to each group, then the group arranges its children inside that box. Group padding defaults to zero; a group's own `padding` and `gap` use its shorter edge. A group without a `gap` of its own sets its blocks the slide's gap apart (0.25 in at 16:9, LH-89), reduced as any gap is when the group is too small for it; before, it was 1/30 of the group's own shorter edge, so the blocks of a short nested row nearly touched. The slide's gap is kept only when no block of the slide reads smaller than with the former gap (unless it removes overflow). Only `minFontSize`, `maxFontSize` and `overflow` inherit. A strict ancestor cannot be weakened by a child's `overflow: \"warn\"`. Font sizes remain relative to the canvas, not the group. Groups can nest up to 32 levels; cycles and deeper nesting fail with an explicit error.\n\nAutomatic grid scoring inspects descendant text using each descendant's explicit arrangement or geometric automatic seed. After selecting the parent's grid, it optimizes each child's automatic grid. This deterministic, bounded search avoids exponential combinations; it does not claim a globally optimal packing.\n\n`result.items` contains every leaf with its full source path and effective composition. `result.groups` contains group paths, outer bounds, and content bounds. The editor's `setGroupComposition(path, value)` validates and records undo/redo just like slide composition edits.\n\n## Inspecting and repairing layout\n\n```js\nimport { composeSlide } from '@openpresentation/opf/composition';\nconst result = composeSlide(deck.slides[0], { width: 1280, height: 720, layout: resolvedLayout });\nconsole.log(result.items); // Source paths, content, geometry, and text estimates\nconsole.log(result.diagnostics); // Path-specific text-overflow and small-cell messages\n```\n\nThis pure function expects a validated slide. The caller resolves catalog records and passes the canvas size, `fontFamilies` and `textMeasurement`; `resolveSlideContext(deck, index, { fonts })` from the package root does the catalog resolution for one slide of a deck and returns those options, plus the slide to pass (`context.slide`, with the slide-scoped built-ins substituted). The rendering and export packages perform those steps at their boundaries. No network, DOM, system font, or AI dependency is required.\n\n### Explain automatic selection (core 0.8.0 and later)\n\nPass `explain: true` to return `result.explanation`. This opt-in API requires core 0.8.0; it is absent from core 0.7.0. Enabling explanations adds no measurement calls and does not change geometry, source content, reading order, weights or selected arrangements within the same engine version.\n\n```js\nconst result = composeSlide(slide, {...resolvedOptions, explain: true});\nfor (const decision of result.explanation.decisions) {\n console.log(decision.path, decision.reason, decision.selectedColumns);\n console.table(decision.candidates);\n}\nconsole.log(result.explanation.textMeasurement);\nconsole.log(result.explanation.unmeasuredPayloads);\n```\n\n`resolvedOptions` supplies the same dimensions, layout, fonts and optional width provider as the preview. Core 0.8.0 identifies its explanation as `grid-score-v2`; core 0.9.0 advances to `grid-score-v3` to include complete code metadata/body measurements. Current core reports `grid-score-v9`. These versions record containers in parent-before-child order. `lowest-score` reports the candidates actually tried; `configured-mode` respects resolved row/column/grid intent and returns no invented candidates. `promoted-regions` leaves region placement fixed and has no selected column count. `table-width` (LH-44) says the grid of `selectedColumns` (the lowest score, or a `grid` composition's own count) gave a table a cell narrower than its words (`TableLayout.minimumWidth` at the starting size), so the container instead placed the table at its natural width (`naturalWidth`, at most 65% of the area) beside a column of the other blocks, or across the whole width between a row of the blocks before it and a row of the blocks after it, whichever scored lower; its `candidates` are the grid's. `split-fill` (LH-71) says two or three automatic blocks took one row or one column (`selectedColumns`) instead of the scored grid because it fills more of the body; its `candidates` are the scored ones. An explicit `columns` or `weights` is never replaced. In one row of automatic blocks a table asks for its natural width (at most 65% of the row) as long as its neighbors keep their fit, and in a `row` composition it takes at least the width its words need. Empty slides have no decisions. Automatic search tries one through `min(slotCount, columns ?? 6)` columns, in ascending order; ties retain the first candidate. Reserved placeholders count as slots. The schema caps an explicit candidate limit at twelve columns.\n\nEach candidate has `columns`, `rows`, `score` and additive `penalties`:\n\n| Penalty | Rule |\n| --- | --- |\n| `cellProportions` | Sum of `abs(log(cellAspect / 1.6))` for descendant leaves |\n| `fontReduction` | Reduction from the role size (28 reference pixels for prose, 32 for lists, 25 for tables) for text-like leaves; current quote/code/metric/timeline layouts sum requested-minus-fitted sizes across their parts, divided by canvas scale |\n| `textOverflow` | 1,000 per overflowing text-like leaf or complete quote/code/metric/timeline payload, regardless of the number of internal failure reasons |\n| `tableOverflow` | 1,000 per table whose shared cell layout overflows: its rows do not fit at the floor (a row is never shorter than its text at the floor plus its insets; LH-44) or a word is wider than its column at the floor |\n| `smallCells` | 100 per leaf narrower than 100 or shorter than 60 reference pixels |\n| `emptySlots` | 2 per unused position in the candidate grid's final row |\n| `narrowMeasure` | 20 per paragraph of four lines or more in a cell narrower than 28 average characters of its fitted size (LH-66) |\n\nScores are preference costs, not quality percentages or guarantees. Floating-point summation can make the component total differ slightly from `score`. Parent scoring uses descendant explicit arrangements or geometric automatic seeds; child automatic grids are optimized only after selecting the parent. Candidate scores therefore describe the bounded search, not a full assessment of the final optimized subtree. Heading fit remains in ordinary diagnostics, outside body-grid scoring. A strict-fit rejection exposes the explanation on `OPFCompositionError` when requested.\n\n`textMeasurement` is `estimated` without a provider and `provided` with one. A provided width function does not establish font provenance, glyph coverage, shaping or native raster fidelity. Text, rich text, lists, quotes, table cells and code in core 0.9 participate in the fit model. Current core 0.11.0 also measures metric and timeline parts; its `unmeasuredPayloads` identifies images, video and charts whose complete internal layout is not assessed. Core 0.8 reports code as incomplete; core 0.9 measures its filename/language/body and insets. Media aspect ratios, chart labels and complete timeline visual density still require inspection. A zero score or empty diagnostics is not proof that those payloads fit.\n\nExplanations expose the search for inspection and do not silently paginate or rewrite a document. Published editor 0.8.0 provides guarded track resizing, block moves, creation/removal and explicit pagination with preview/undo. A general automatic repair loop, automatic weight allocation, complete payload-internal measurement, CLI explanations and a canvas **Auto arrange** preview/undo operation remain open work; the **Arrange** controls below are explicit human adjustments.\n\nWith `overflow: \"warn\"` (default), the result retains all text and returns diagnostics. SVG emits all lines and marks overflowing groups with `data-opf-overflow=\"true\"`; text may extend beyond its box or canvas. Consumers can collect diagnostics using `onDiagnostic`. No overflow is silent (LH-45): a quote, code, metric or timeline part that reaches past its cell (its card, when it has one) is a `text-overflow` diagnostic at the part's path, also when its own layout accepted it in a taller box (a metric laid out at its row's shared height). A quote, code or metric part that finds no usable space at all (its `invalid-part-box` diagnostic) is laid out at the readability floor in the room its cell leaves (`floorFallback`), so the preview and the PPTX export draw it, overflowing, instead of failing (LH-40). With `overflow: \"error\"`, the layout rejects content that does not fit. Shorten the affected content, give it more space, or explicitly split it into another slide. Use the explicit pagination transform below to produce additional editable slides.\n\nThe editor exposes `editor.composeSlide(index)` and `editor.setComposition(index, value)`. The latter validates the change, records JSON Patch history, and supports undo/redo.\n\n## Pagination\n\n```js\nimport { paginateSlide, paginate } from '@openpresentation/opf/pagination';\nconst { presentation, pages } = paginate(deck);\n// Review, save, render, or export `presentation`; pages maps output fragments to source paths.\nconst single = paginateSlide(deck.slides[0], { width: 1280, height: 720, minFontSize: 24 });\n```\n\nPagination is an authoring operation. It produces ordinary OPF slides; previews and PPTX export consume those exact pages. It preserves the input, body order, nested groups, promoted regions, rich-text formatting, and source text characters. Plain text and rich runs split at grapheme boundaries, preferring sentence/paragraph breaks and then word breaks. Lists split between items, tables between rows with column labels repeated, and code splits without rewriting its source. Indivisible payloads remain intact. Existing track weights continue to apply to positions on each resulting page.\n\nThe default readability target is 24 reference pixels. Core 0.8.0 returns slides that persist that floor in `composition.minFontSize`, including an already-fitting one-page result; existing higher minima and strict overflow policies remain intact. Quotes can raise their nominal body/footer sizes to the floor. Current core 0.11.0 enforces the selected floor in shared plain/rich/list/table fitting, including painted rich fragments, while retaining authored style metadata. Unsupported fits report overflow rather than silently capping output below the floor. The [readability-floor checkpoint](plans/readability-floor.md) records the earlier candidate and its bounded-search tradeoffs. Pagination relies on the shared engine's estimates; it is not a guarantee that every host font renders identically. Headings repeat unchanged, speaker notes remain on the first page, and continuation IDs avoid existing deck IDs. `pages[].mappings` records full source/output paths and half-open text or item ranges. Text offsets use UTF-16, so source strings can be reconstructed exactly. Quote bodies split at grapheme boundaries and repeat complete attribution/source fields on each page. An irreducible footer rejects the whole operation, including a quote with an empty body after earlier content.\n\nIf a heading, individual list item, table row, or other atomic payload cannot fit on an otherwise empty page, `OPFPaginationError` returns actionable diagnostics. There is no partial output. `maxSlides` defaults to 100, and a layout-evaluation limit bounds work on pathological input. Specialized chart and timeline internals still require visual inspection; their complete density models remain outstanding.\n\n**Continuation in the export (LH-90).** `continueOverfull(presentation, options)` is the one split the export makes without being asked. A slide whose body is two or more block units (`blockUnits(slide)`: every root block one payload, nothing else to move; a unit starts at each block of the first block's kind and takes the blocks after it, so eight timelines are eight units and a timeline keeps the note that follows it) and that the engines draw with `text-overflow` or `small-cell` at its own readability floor continues on further slides. It is `paginateSlide` with `wholeBlocks: true`: breaks fall only between units, never inside one; page selection first preserves the settled source sizes of comparable automatic body roles (same base font/style, semantic role and authored constraints), including the text actually drawn on arrangement nodes; only then does it minimize page count, with the units spread evenly when every page still fits (eight timelines that fit five to a page are four and four); every page keeps the headings, layout and design (pagination's convention), the speaker notes stay on the first, ids take `--2` suffixes, and a page is bound by the layout as the first is (a moved block gets no region pin, so each page can recompose at the floor). The pages use the slide's own floor without injecting a new minimum. Explicit rich-run sizes/styles, captions and authored minima/maxima stay distinct from the shared automatic-body target. Later pages carry an ordinary `composition.maxFontSize` cap derived from the first page's actual automatic body text, including arrangement labels; the returned OPF recomposes to those evaluated pages. An indivisible unit that cannot retain its required text size keeps the original slide and its fit findings instead of silently setting smaller text. A slide is kept as written when it fits, when a unit does not fit even alone, when its composition is strict (`overflow: \"error\"`, which the engines still refuse) or when `{{deck.slideCount}}` does not settle. The result lists every slide it changed (`continued`: source index, output indices, kind, block indices and units per page, page mappings). The Node export (`convert`, `opf convert`) runs it by default (`paginate: \"blocks\"`) before drawing, so the SVG, PNG, PDF and PPTX draw the same deck, and reports each slide as `render/slide-continued` or `pptx/slide-continued` and in the report field `continued` (one-based). `paginate: true` (`--paginate`) splits every overflowing slide instead; `paginate: false` (`--keep-slides`) draws every slide as written. `toSvg` and `toPptx` draw the deck they are given slide for slide; a host that wants the export's pages calls `continueOverfull` first.\n\n**Continuation in hosts that draw slide by slide (LH-99).** `continuationPages(result, slideCount)` maps a `continueOverfull` result back to the source: `pages[i]` lists the output indices that draw source slide `i` (one for a slide kept as written). The player, `<opf-deck>` and its server markup (`toHtml`) show a continued slide's pages as steps after it, each the export's own page; the editor edits the slide as written and shows the split as a preview (a stacked thumbnail with its page count, a page indicator with a read-only preview of each page on the canvas, and the pages as steps in its presenter). No host shifts a source index: slide numbers, links, selection, `goto(n)` and the editor's slide paths address source slides, and the pages are sub-steps of their slide. Each host can turn it off (`continuation: false`, or `continuation=\"off\"` on `<opf-deck>`). See the opf-render and opf-editor READMEs.\n\nThe editor's `editor.paginateSlide(index)` is one validated transaction with undo/redo. It returns `{change, pagination}`. Editor 0.5.0 commits a one-page readability-policy change too; repeating the operation after the policy is recorded returns `change: null`. The playground includes an overflowing draft and **Split overflow** action. The CLI writes a new file and refuses to overwrite an existing one:\n\n```sh\nopf paginate input.opf.json output.opf.json\n```\n\n## Right-to-left decks\n\nWhen the presentation `language` is written right to left (Arabic, Hebrew, Syriac, Thaana and the other right-to-left scripts) or the host passes `direction: 'rtl'`, `composeSlide` mirrors the composition and reports each paragraph's direction; `SlideComposition.direction` is `'rtl'`. The first column and the `start` region are drawn at the right, banded slide images, cover logos and header/footer zones swap sides, lists put their markers at the right, tables run right to left, and `TextFit.directions` gives the direction of the paragraph each line belongs to. Alignment is logical: the authored `start` is drawn at the right edge of a right-to-left paragraph (`physicalAlignment`). A left-to-right deck composes exactly as before. The rules and the PPTX mapping are in [Layout direction](programs/font-fidelity-everywhere/script-font-model.md#layout-direction-rr-05).\n\nOne rule says which words follow the direction. Layout words and layout coordinates are logical: `start` and `end` in alignments (`titleAlignment`, `contentAlignment`, a caption's `align`, a table cell's `style.align`), header and footer zones, promoted regions, image `placement.edge`, overlay bands (`overlay.edge`), `chartPrimary` and shape anchors, and an overlay shape's `x`, all run from the edge the deck starts on: `start` is the left edge in a left-to-right deck and the right edge in a right-to-left deck. Coordinates and sides that name pixels of a picture or parts of a plot are physical in every language: image focus and image callout coordinates (measured from the picture's top-left), a chart's `legend` and data label `position`, and the `left` and `right` sides of table cell borders and padding and of a shape's padding.\n\n## Fidelity boundary\n\nThe shared engine provides identical body and heading geometry to SVG and editable PPTX export. Text measurements default to deterministic estimates. For actual font advances, pass the same `fonts` handle to every step (see [pass `fonts`, otherwise the estimate](font-fidelity.md#pass-fonts-otherwise-the-estimate)). Complex scripts, fallback fonts, PowerPoint text rendering, rich text, charts, tables, and images still need visual verification. Dynamic composition is not a guarantee of pixel-identical PowerPoint output. Line breaking never splits a number from its unit or `%` (`26 %`, `$4.8 M`, `12 km`, `3 x`, `5 pm`, and the digits of one figure) or a ratio at its slash (`4.6 / 5`, `3/4`, LH-150; a metric value written so is one figure, LH-40) and never starts a line with a closing mark (`. , ; : ! ? ) ]`, a closing quotation mark, their CJK and Arabic forms) or ends one with an opening mark (LH-11, `src/line-break.ts`); the rule reads characters, so it holds for right-to-left and CJK text, and a unit outside its lexicon is bound with a no-break space (U+00A0), which the breaker already keeps whole. Where PowerPoint wraps the text itself (native titles and bodies, table cells) the export writes U+00A0 at the same places (`bindNoBreak`) and import writes the spaces back (`unbindNoBreak`), so PowerPoint breaks where preview does. List density includes rich runs, descriptions and nesting via `fitList`, with the same hanging indents used in preview and export. Only text-like payloads currently receive content-density estimates; small-cell diagnostics also cover non-text content.\n\nSVG embeds raster data URI images locally. Remote and file images require a host resolver that supplies a raster data URI; otherwise they appear as placeholders. `strictAssets` rejects unresolved images. The runtime never fetches them.\n\nSee [the complete example](../examples/technical/dynamic-composition.opf.json) and [local ecosystem verification](ecosystem-development.md).\n\n\n## Preview polish shared by preview and export (RR-07)\n\nThree accepted spec fields used to be drawn plain; core now owns the shared tables so the SVG preview and the PPTX export draw them identically. Consumers import them from `@openpresentation/opf`; none changes geometry, and an older core simply leaves the preview and the export plain, without a new diagnostic.\n\n- **Code syntax colours.** `tokenizeCode(source, language)` returns sorted, non-overlapping token ranges (`keyword`, `string`, `number`, `comment`, `function`, `type`, `property`) over the exact `code.source`; `codeLineRuns(tokens, start, end, source?)` clips them to one accepted source line, so concatenating the runs returns the line unchanged (a tab is always its own plain run). The scanner is deterministic and dependency-free (no network, clock or locale). `code.language` resolves through aliases (`ts`, `tsx`, `py`, `sh`, `yml`, `c++`, `terraform`, and so on) to `javascript`, `typescript`, `python`, `rust`, `go`, `bash`, `json`, `yaml`, `toml`, `ini`, `html`/`xml`, `css`, `sql`, `java`, `csharp`, `kotlin`, `swift`, `ruby`, `php`, `c`/`cpp`, `hcl` and `dockerfile` (`resolveCodeLanguage`, `CODE_HIGHLIGHT_LANGUAGES`); any other language, a missing one, or source over 200,000 characters stays plain. `codeSyntaxPaletteForScheme(colorScheme)` gives one colour per kind from the deck theme (keyword = primary, string = accent, number = secondary; comment, function, type and property are fixed slate, blue, cyan and pink, rotated away from a theme colour they would collide with), each lightened until it is at least 4.5:1 on the #111827 code panel. The renderer nests coloured tspans inside each accepted segment tspan; PPTX writes the same colours as native runs in the same one-text-box-per-line shapes, so editing and import are unchanged. The language is not inferred from `code.filename`. `code.highlight` (1-based source lines and inclusive ranges) adds a band behind marked lines and dims the rest: `codeHighlightLines` resolves it against the source, `codeLineNumbers` numbers each displayed line (a wrapped line repeats its number), `codeHighlightBands` returns the runs of displayed lines to draw behind, and `codeHighlightColors(colorScheme)` gives the band and the marked/dimmed palettes, all at least 4.5:1 on what they sit on. The SVG band is one `rect` per run behind the line text; PPTX writes one native rectangle per run (`OPF code N highlight M`) after the panel and before the line text boxes, so the one-text-box-per-line shapes and the code provenance tags are unchanged.\n- **Metric trend.** A `metric.trend` (`up`, `down`, `flat`) is drawn as one arrow; LH-53: the trend word is not drawn (it was an English word on every slide, a right-to-left one included) and stays the arrow's text alternative and the part's source. Core's metric layout places the arrow (`MetricLayout.trendBox`: square, 0.72 of its line's size, on the baseline, 0.3 of that size before the line) before the delta on one line (\"\u2191 +7 pts\"), or, with no delta, before the label, else the description, else on a line of its own; before means at the reading start, the right of a right-to-left metric. `metricTrendMark(layout, {background})` gives it its shape and color. The arrow is the DrawingML `upArrow`, `downArrow` or `rightArrow` preset at default adjustments (`metricTrendPoints` is the outline the preview draws), colored by the metric's `sentiment`: positive green, negative red, neutral a neutral color, kept at 4.5:1 or more against the slide background (`metricTrendColor`); the delta text takes the same color. `layoutMetric` passes `sentiment` through as `MetricLayout.sentiment` (omitted when the metric has none) and `metricTrendMark` reads it, so the arrow direction always follows `trend` and only the color follows `sentiment`. Absent, the sentiment is the conventional reading of the trend (up positive, down negative, flat neutral), which is the color drawn before `sentiment` existed. A `sentiment` without a `trend` draws no arrow and colors nothing. The arrow carries the alternative text \"Trend: up\" (`aria-label` in SVG, `descr` in PPTX); the arrow carries the direction, the color the verdict.\n- **Pattern fills.** `PATTERN_PRESETS` lists the 54 ECMA-376 ST_PresetPatternVal names and `patternBitmap(preset)` / `patternRuns(preset)` give each as an 8 x 8 one-bit tile, one pixel per 1/96 inch, anchored at the slide's top-left, foreground where a bit is set (`diagStripe` still resolves to `wdUpDiag`). ECMA-376 names the presets but does not define their pixels: the tiles are measured from desktop PowerPoint (Office 365, Windows, 2026-10-01) by exporting each preset as a full-slide background to a 1280 x 720 PNG and voting every pixel into its (x mod 8, y mod 8) cell with opf-render `scripts/derive-pattern-bitmaps.mjs`. Every tile was uniform across all repeats (confidence 1.00) at one image pixel per pattern pixel, so a pattern pixel is one 1/96 inch unit, and the phase is the slide's top-left corner. The tool also reports any tile that later differs. PPTX already wrote every preset as native `a:pattFill`.\n\n## Metric internals (published coordinated packages)\n\nPublished core 0.11.0 exports `layoutMetric(value, box, options)` from `@openpresentation/opf/composition` (the package root no longer exports engine names). It accepts a finite number, string, or `{value, unit?, label?, description?, delta?, trend?, sentiment?}`. Renderer 0.9.0, editor 0.8.0 and PPTX 0.9.1 consume its shared geometry for composition, atomic pagination, preview, editing and export. Core 0.9.0 predates this API. The [primitive checkpoint](plans/shared-metric-layout.md) and [source integration checkpoint](plans/shared-metric-integration.md) record its development; current pins and remaining native/font gates are in the [compatibility matrix](compatibility-matrix.md).\n\nPass the allocated reference-pixel `box`, resolved heading/body `fontFamilies`, `textMeasurement`, canvas `scale`, effective `minFontSize`, source `path` and optional `overflow: 'error'`. `metric-flow-v1` returns separate value/unit/label/description/delta/trend parts in that order. Numeric zero is visible; scalar values keep the scalar path. Every provided field retains its original string or number in `sources[].value`. Source ranges address `String(value)` using UTF-16 offsets; the original spelling of a numeric JSON token is not available. No locale formatting, trend icon, case conversion or separator is invented. Empty optional strings retain source mappings with `visible: false`; the required empty value keeps a targetable blank line.\n\nThe allocator tries an adjacent value/unit baseline when both fit one line and the unit uses at most 35% of the cell width; otherwise it stacks the fields. Metadata has an eight-reference-pixel gap, with twelve pixels after the primary row. Related fields stay together rather than being separated by a percentage of the cell height. The value starts at up to 76 reference pixels (28% of cell height); label/unit/delta start at 23, description at 20 and trend at 18 (the trend part is not drawn, LH-53; its arrow sits before its host line, which is measured that much narrower). LH-53: a unit beside its value is drawn at 60% of the value's size (`METRIC_UNIT_SHARE`) on its baseline when that still fits, so \"18 %\" reads as one figure. A candidate with more reduced metadata replaces an earlier one only when it scores a whole reference pixel better, so on a near tie the label keeps its size and the value gives way. `display` (LH-112) and `band` (LH-15) are the options composition passes a metric beside other blocks (above). Every requested size is raised to the chosen floor, scaled once. Natural metadata height gets space before reducing type. At most 48 arrangements are evaluated, each with at most 77 value-size trials; identical inputs and a deterministic measurement provider select the fitting candidate with least summed font reduction, preferring the first candidate on ties.\n\nEach part exposes requested/resolved styles and the same source-preserving line/segment representation used by code (`CodeTextFit`), measured with proportional heading/body fonts. CR/LF/CRLF, tabs, whitespace and grapheme boundaries remain exact. Consumers must reuse accepted line and segment positions, font sizes and styles rather than independently re-fit or normalize text. This API reports `provided` measurement when a provider is passed, without claiming that its glyph coverage or shaping is complete. Unsupported glyphs propagate the provider's error with the field path.\n\nLH-137: `deltaPill: true` (composition passes it under the guarded rule `delta-pill`) draws the delta and its trend arrow in a pill, as Claude Design draws a change: beside the value's line (after the value and an inline unit in reading order, its middle `METRIC_PILL_RISE`, 0.36, of the value's size above the value's baseline; the value and pill are one line placed by the alignment) when every field keeps the size it has without the pill, else above the value (its lead) when every field keeps it there, else in its place without a pill. A tile and a band keep their delta in place, and LH-83's automatic grid at the floor draws no pill (the room a pill frees there would decide between the layout and the grid). The pill is inset `METRIC_PILL_PAD_X` (0.55) and `METRIC_PILL_PAD_Y` (0.2) of the delta's size around its one line and arrow; `MetricLayout.deltaPill` `{box, radius, placement}` says where. Sibling metrics draw their pills one way: when one has its pill above, a sibling with its pill beside takes it above too where that keeps its sizes. Engines fill it with core `metricPillFill(backdrop, text)` (the backdrop moved toward the text color, as a table's banded row is, `surfaceAltColor`) under the delta and color the delta and arrow against that fill; the PPTX export writes a native rounded rectangle tagged into the metric's group (role `pill`), consumed on import with the trend arrow.\n\nLH-68: `tile: true` lays the metric out as a tile of its whole box, as a layout region with `metrics: \"tile\"` asks: the label first as an eyebrow, the value under it starting at `METRIC_TILE_VALUE_SHARE` (a quarter) of the box's height, between its 76 px role size and twice it, a stacked unit under the value, and the description, delta and trend at the foot of the box. Pass the start alignment with it. `minimumSizes` (by role, canvas pixels) is where each role starts at least and stops fitting; composition passes a tile the sizes its metric fitted at as a stack, so a tile never shrinks a role, and a slide whose tiles would still cost a size or a finding keeps its stacks.\n\nPass `align: 'left' | 'center' | 'right'` (default left) to the primitive. Its returned `alignment` and per-part `linePositions` give an absolute x origin and baseline for each `fit.sourceLines` entry, including blank lines. An inline value/unit pair moves together, with the gap following the actual value advance. Composition accepts host-resolved `contentAlignment`; an explicit slide `design.contentAlignment` overrides it. Renderer/export/pagination pass the effective design into the same operation. Alignment does not trigger a second font fit.\n\nCheck `overflow` before consuming parts. Irreducible text, invalid available space, parts outside the cell and overlapping occupied line boxes return field-specific diagnostics; strict mode throws `OPFCompositionError`. Invalid available boxes retain their dimensions and have no fit, unless `floorFallback` asks for a fit at the readability floor (LH-40). These are advance-based line rectangles, not glyph outlines: the controlled browser evidence separately records small glyph overhangs. The API is a bounded internal allocator, not the complete layout-repair/Auto arrange operation or a native export fidelity guarantee.\n\nCurrent `grid-score-v9` retains the metric scoring introduced by `grid-score-v4`: every metric part contributes font reduction, with one overflow penalty per failing metric leaf. `item.metricLayout` is measured against the rounded accepted cell; `item.text`/`item.textStyle` alias the value fit/style. Field diagnostics obey strict ancestor policies, while explicit modes/weights/regions remain authoritative. Metrics are excluded from the advance-model `unmeasuredPayloads` list. Explicit pagination retains metrics atomically with complete source types/metadata and rejects irreducible fields without returning partial output. The published train has installed-package acceptance, including metric provenance controls. That evidence does not establish native raster or font equivalence.\n\n## Code internals (core 0.9.0 and coordinated packages)\n\nCore 0.9.0 introduced `layoutCode(value, box, options)` for the schema's string shorthand or `{source, language?, filename?}` object. It returns measured filename/language/body parts with exact original text, requested/resolved styles, readability floors, available boxes and diagnostics. Its original integration targeted renderer/PPTX 0.7.0 and editor 0.6.0; the [release checkpoint](plans/shared-code-release.md) records that rollout. These contracts were included in the core 0.11.0, renderer 0.9.0, PPTX 0.9.1 and editor 0.8.0 train; current pins are what `node scripts/registry-plan.mjs` prints. Core 0.8.0 predates this API and retains the [recorded code-label, filename and whitespace defects](plans/layout-repair.md).\n\n`grid-score-v3` charges code font reductions across all metadata/body parts and one overflow penalty per failing leaf. It preserves explicit modes, weights, regions and source order. Accepted `item.codeLayout` is fitted to the same rounded cell exposed as `item.box`; `item.text` and `item.textStyle` alias the body, not the first metadata part. Strict ancestor settings apply to internal `.source`, `.filename` and `.language` diagnostics. Code no longer appears in `explanation.unmeasuredPayloads`, which concerns the core advance-based model only. It does not mean browser/native fidelity is verified.\n\nPagination slices the code body at grapheme boundaries, repeats filename/language and returns contiguous UTF-16 body ranges while preserving all source bytes and the evaluated readability floor. Irreducible metadata rejects all output, including when the body is empty or earlier content could have fitted. Consumers must preview/export the returned document. The [integration checkpoint](plans/shared-code-integration.md) separates source, installed browser, Windows PowerPoint and remaining release gates.\n\nEach fitted part retains every space and explicit CR/LF/CRLF break. `fit.lines` contains exact source slices, and `fit.sourceLines` records half-open UTF-16 `start`, `end` and `nextStart` offsets, the measured width and a `soft`, `hard` or `end` boundary. A hard break occupies `[end, nextStart)`; soft wrapping consumes no source character. Joining `part.text.slice(line.start, line.nextStart)` reconstructs the original part. Blank lines and a final empty line are retained, and long tokens split only at grapheme boundaries. Filename and language text are not case-converted. An absent/empty metadata pair creates a generated `code` label with no source range.\n\n`code-flow-v1` returns `bounds`, the panel the code needs at the allocated width (the insets around the metadata and the source lines, at most the cell); a composed slide draws the code panel at `bounds`, top-anchored, when the code is shorter than its cell. It uses 18-reference-pixel outer insets, an eight-pixel gap between filename and language, and a twelve-pixel gap before the body. Nominal metadata/body sizes are 14/22 reference pixels (WI-4: the body was 18), raised when necessary to respect the selected minimum, then scaled once. At most four metadata nominal/floor combinations are tried; each body fit tries at most 19 sizes regardless of canvas scale. The fitting combination with least font reduction wins. Irreducible metadata/body failures retain all text and diagnostic paths; invalid available boxes have no fit (a fit at the readability floor with `floorFallback`, LH-40). `overflow: 'error'` rejects rather than returning partial output.\n\nTabs remain literal characters in part text and displayed-line slices. Measurement advances to the next multiple of four measured spaces from that line's origin; `fit.tabSize` and `fit.tabWidth` expose the rule. Each source line's `segments` contains exact text/tab source ranges plus measured `x`/`width` values relative to its origin. Consumers must reuse those positions: an Edge probe showed that SVG treats a tab as one space despite CSS `tab-size: 4`. The published SVG renderer uses positioned spans and geometric precision; native export uses accepted tab stops. Width measurements and source preservation alone do not establish glyph-outline containment, shaping/bidi support or native fidelity. Installed workflow evidence records the separate actual browser and native checks with their exact font/runtime scope.\n\nPublished native export stores source boundaries in standard PowerPoint shape tags. Complete unique groups recover exact code/source metadata, with current native text taking precedence. Missing, damaged or ambiguous groups retain visible native shapes and report diagnostics. Reimport does not reconstruct native formatting, positioning, font theme or readability policy. Eight installed-export wide/portrait slides pass native edit/save/reopen and all 24 original/saved/edited imports on the recorded Windows PowerPoint build; this is not arbitrary PowerPoint round-trip or pixel equivalence. The editor preserves untouched CRLF/CR source around edits and keeps committed preview geometry separate from its active native textarea caret.\n\nThe JSON schema can accept strings that [XML 1.0 cannot represent](https://www.w3.org/TR/xml/#charsets). Published SVG/PPTX code output rejects forbidden controls, unpaired UTF-16 surrogates, U+FFFE and U+FFFF with `invalid-code-text`, the source field path and UTF-16 offset in the message. The input stays unchanged; the caller can correct that character explicitly. Tabs, CR/LF/CRLF and valid supplementary characters remain accepted for serialization. Schema support, format representability and glyph coverage are separate properties.\n\nThe controlled SVG harness requests `text-rendering=\"geometricPrecision\"` as well as explicit segment placement. Initial Linux Chromium CI rounded glyph advances under default hinting, unlike Windows Edge with the same font bytes. The [SVG specification](https://www.w3.org/TR/SVG/painting.html#TextRenderingProperty) defines geometric precision as a rendering hint, so consumers still need actual browser checks with their exact fonts and supported environments; the hint alone does not certify agreement. The harness retains a 0.1-reference-pixel tolerance and records observations before assertions.\n\n## Quote internals (core 0.8.0 and coordinated packages)\n\nCore 0.8.0 exports `layoutQuote(value, box, options)` from the `@openpresentation/opf/composition` entrypoint. Pass validated quote content (object or string shorthand), its allocated reference-pixel box, resolved `fontFamilies`, `textMeasurement`, `scale` (canvas short edge / 720), effective `minFontSize`, `overflow` policy and its source `path`.\n\nThe result contains `parts` for the body and any nonempty footer, exact display `text`, source mappings, requested and resolved text styles, and the available boxes/fits. Source ranges use half-open UTF-16 offsets in both the source field and display string; generated quotation marks and the footer separator have no source range. The original content is never modified. A supplied width provider is reported as `provided`; it does not certify shaping or font fidelity.\n\nCheck `overflow` and `diagnostics` before accepting the parts. Invalid available dimensions remain visible with `fit` absent (a fit at the readability floor with `floorFallback`, LH-40), and `overflow: 'error'` throws `OPFCompositionError`. Diagnostics distinguish invalid part space, parts outside their cell, text that exceeds its reserved space, and overlapping line rectangles. Those rectangles are conservative text-layout bounds, not measured glyph outlines. The readability floor is scaled once and can raise the nominal body (28) or footer (17) size; it is never silently capped below the selected floor.\n\n`quote-flow-v1` asks for a 40-pixel body (it fits down through 28 pixels to the readability floor; LH-78: `bodySize` sets another start, and `bodyLines` steps the start down until the body takes at most that many lines, never below 28 pixels) wrapped in the quotation marks of the deck language (`options.language`, a BCP-47 tag: \u201C\u2026\u201D for English, \u201E\u2026\u201C for German, \xAB\u2026\xBB for French and Spanish, \u300C\u2026\u300D for Japanese, ASCII only for a language the table `QUOTE_MARKS` does not list; every mark is one UTF-16 code unit, so the body's source range starts at offset 1). It keeps 18-reference-pixel outer insets and an 18-pixel body/footer gap while fonts scale with the canvas. A 40-pixel footer is a whitespace preference. The allocator expands it for long sources or compacts it for dense bodies, trying at most the nominal and minimum footer sizes and selecting the fitting pair with least total font reduction. If neither fits, it returns floor-size failure diagnostics. This is a bounded internal allocation step, not a complete layout-repair engine.\n\n`composeSlide` scores both parts and accepts geometry against the final rounded item box. Each quote item carries `quoteLayout`; its compatibility `text` field is the same fit object as the quote body, including generated quotation marks. Consumers needing original offsets must use the explicit `sources` mappings. The coordinated renderer and PPTX consume these parts without another measurement/style-resolution pass. Missing geometry rejects rendering/export rather than omitting content; a part with no usable space reaches them laid out at the readability floor (LH-40), so they draw it, overflowing, beside its diagnostic. This requires core 0.8.0 with renderer/PPTX 0.6.0; older core 0.7.0/renderer 0.5.1/PPTX 0.5.2 lack these changes. The complete published set, immutable verification refs and fresh registry evidence are recorded in [the release plan](plans/shared-quote-release.md).\n\nBrowser glyph bounds can extend slightly beyond advance-based part boxes into the reserved inset. Current loaded-font tests record those overhangs, verify glyph containment inside the full quote cell and check body/footer separation. Native PowerPoint fixtures separately verify text, sizes, cell containment, save/reopen and reimport. Neither test establishes universal pixel equivalence. Original requested-font provenance through host substitutions and non-quote payload internals remain open requirements.\n\n### Quote role and photo (FA-12)\n\n`QuoteContent` also takes `role` and `photo`. The footer text is the attribution, then `role` after a line break, then `source` after an en dash (` \u2013 `); each field keeps its own source mapping (`<path>.role`). Without a `role` the footer text is unchanged. A `photo` (an `Asset` value) adds `QuoteLayout.photo`: `{path, value, box, shape}`, where `shape` is the circle mask of `imageShape('circle', box)` (DrawingML `ellipse` and the same outline as an SVG path). The diameter is three times the footer font size and the gap beside it three quarters of that size, so the allocator picks the footer size (nominal or the readability floor) with the photo in the footer height and the footer text in the remaining width. The photo sits at the start edge of the inset area: the left, or the right when `options.direction` is `rtl`, where the footer text is its mirror. The text block is centered on the photo. A photo whose height cannot fit at the floor adds the `photo-fit` diagnostic reason (and `overflow`); a photo with no footer text still draws. Without a photo `layoutQuote` returns exactly what it returned before, with no `photo` key. The renderer and the PPTX exporter draw `photo` from the result and do not recompute it.\n\n## Timeline internals\n\n`layoutTimeline(value, box, options)` (`timeline-flow-v1`) places an optional name and description, then the events as a marker on a connector with each event's `when`, `what` and `description` as separate text parts. It has three arrangements, tried from the role sizes down to the readability floor (at most 100 candidates in all), and keeps the first that fits or the one with the fewest diagnostics:\n\n- `band` (LH-41): one horizontal connector, each event one spacing (`box.width / events`, less a gutter) wide, its `when` as an eyebrow above the marker and its `what` and description below. This is the horizontal arrangement whenever every `when` and `what` fits its spacing on one line.\n- `alternating`: labels alternate above and below the connector, each up to two spacings wide, for a `when` or `what` wider than one spacing (or a band whose labels would break inside a word).\n- `vertical`: a marker rail down the start edge with the labels beside it, tried first when an event's spacing is under 8 ems of the label size. Right-to-left decks put the rail on the right edge.\n\nA horizontal timeline centers its whole block (name, description and labels) in the box. `TimelineLayout.bounds` is what the drawn timeline covers (parts, markers and rings), so its height is the height the timeline needs; composition measures a timeline with it, label bands included, and stacks it like text (`MEASURED_FIELDS`).\n\n**Several timelines in one region (LH-41).** A template region whose blocks are all timelines draws them as a stack of bands, whatever its `flow` or the design's `contentDirection`: one column while the stack fits at the readability floor with every band at least 56 reference pixels tall, otherwise two columns (in reading order, each row as tall as its taller band, an odd last band spanning both) when that overflows less. The stack sits in the middle of the region (at the bottom in a region anchored there), the bands share the region as stacked text does (`shareHeights`) and every band is set at the size the most squeezed one fits at. A band of a stack never turns vertical (`horizontal`), sits at the top of its box and sets its name and description at its start edge. With four or more timelines the bands are compact (`compact`: name 20, `what` 18 and the rest 16 reference pixels; each `when` and `what` on one row below the marker when every pair fits; the description beside the name when every band's pair fits). A stack that does not fit at the floor reports `text-overflow` for the parts outside their band. A lone timeline in its region grows its type by up to 4 reference pixels when it still fits in the same arrangement (`sizeOffset`).\n\n### Event status (FA-11)\n\n`TimelineEvent.status` is `done`, `current` or `planned`. It is a progress state that the engines draw from the deck's own colors without judging it; schedule health (at risk, blocked) is deliberately not a status. Layout copies the status to `TimelineLayout.markers[i].status` and to each of that event's text parts (`TimelineTextPart.status`), and `timelineMarkerShapes(marker, colors)` and `timelineTextColor(part, colors)` turn it into the shapes and text color that both engines draw:\n\n| Status | Marker | Text |\n| --- | --- | --- |\n| absent | A filled circle in the primary color. | Normal text color. |\n| `done` | The same filled circle, so it looks like an event without a status. | Normal text color. |\n| `current` (\"we are here\") | The filled circle inside a ring: a circle 1.6 times the marker's radius with a primary-color outline over the slide background. | The label (`what`) is bold, in the normal text color. |\n| `planned` | A hollow-looking circle of the marker's radius: a primary-color outline filled with the slide background. | All of the event's text is the muted secondary text color. |\n\n- **Geometry.** A marker's `radius` is the radius of its ellipse, for every status. A `current` marker also has `ring.radius`, exactly 1.6 times `radius`, and a `current` or `planned` marker has the `strokeWidth` of its outline (2 reference pixels at 720, at most half the radius). The drawn and exported ellipses have exactly these radii, so every ellipse of a deck has the same size for the same radius (a done, planned and unset marker are the same size); an outline is centered on its ellipse's edge and reaches half a stroke beyond it, and the cell check and the vertical rail count that half stroke. A ring that leaves the cell is reported as a `event-space` diagnostic like any marker. In the vertical arrangement a deck with a `current` event moves the rail and the text out by the ring's extra width so the text keeps its usual distance from the marker. Events without a status produce exactly the geometry and no extra keys they did before.\n- **Hollow means background-filled.** The outline of a hollow marker and the ring are drawn over the slide background color (in the SVG as the fill, in PPTX as a solid fill of the same color) so the connector does not cross them.\n- **Colors.** `timelineTextColor` returns `mutedText` for a planned event, lightened or darkened until it reaches 4.5:1 against the slide background (`TIMELINE_TEXT_MIN_CONTRAST`), and the normal text color otherwise. Outlines and rings are kept at 3:1 (`TIMELINE_OUTLINE_MIN_CONTRAST`); the filled marker keeps the primary color exactly.\n- **Bold label.** The weight is part of the layout, not a drawing detail: the `what` part of a `current` event is requested at weight 700, so line breaks and heights were measured bold.\n- **Progress and status words (LH-121).** `TimelineLayout.progress` is the part of the connector from the first event to the\n `current` one (to the last `done` one when none is current; absent when no event is done or current); both engines draw it in the\n primary color over the border-colored connector. With `statusWords` (composition sets it under the size guard, where localized words are available)\n each event with a status gets a localized word under its label (`timelineStatusWordsFor`, English `TIMELINE_STATUS_WORDS`) at 16 reference\n pixels, in `TimelineLayout.statusLabels`: generated text with no `sources`, never in `parts`. `timelineTextColor` sets the current\n event's word in the primary color and the others muted, at 4.5:1. A timeline that would set its labels smaller to make room keeps\n them and draws no words; a deck without a supported translation keeps the status in its markers and progress.\n- **PPTX.** The marker is a native `ellipse` (solid primary fill for `done`, `current` and no status; background fill plus a primary line for `planned`), the ring is a second native `ellipse` (background fill plus a primary line), the bold label is a bold run, and planned text takes the muted color. The exporter records each event's status in the marker's `OPF_TIMELINE_V1` tag and the ring in a tag of its own, and the importer restores `status` from them; a deck whose marker or ring was edited away imports as ordinary text without status, like the rest of the timeline provenance. The progress line is a second native `line` (`OPF timeline <group> progress`) and each status word a text shape tagged `status`; import consumes both and reads the status from the markers. Status is also written in Markdown as a task-list prefix on the event line: `[x]` done, `[>]` current, `[ ]` planned.\n\n## Resizing in the preview\n\nChoose **Arrange** in the editor to reveal track dividers. Drag a divider to redistribute the space between adjacent columns (row/grid) or rows (column), including nested groups. Arrow keys make small changes; Shift makes larger changes. Escape discards a pointer draft. One drag creates one undo step, and no content is removed. Strict overflow rejects a resize that violates its fit constraints.\n\nResizing an automatic layout makes its chosen columns explicit as `mode: grid` with `columns`. This prevents the number of columns from changing under the pointer. The adjacent share clamps to 5\u201395%, with positive schema-valid weights. Other track proportions and unrelated document fields remain intact. Promoted regions retain their positions; their nested groups can still be resized. A v2 template\u2019s region grid is changed by editing the template\u2019s `columns` and `rows`. Flows with more than twelve tracks need grouping before the current resize controls can express all weights.\n\n`createCanvasEditor(container, {layoutEditing: true, ...options})` enables dividers initially. `canvas.setLayoutEditing(boolean)` toggles them, and `canvas.commit()` / `canvas.cancel()` also handle an active resize. `onDraft` receives the proposed document; the session stays unchanged until commit. Changes to the resized container cancel a stale draft; unrelated updates are retained.\n\nThe shared engine exposes `geometry.flows`: each flow has its container path, content box, resolved column/row tracks (offset and size), clamped gap, effective composition, item count, and reserved slot count. This is renderer geometry, not new OPF document fields.\n\nAgents can prepare the same guarded change without a DOM:\n\n```js\nimport {prepareTrackResize} from '@openpresentation/opf-editor/layout';\nimport {resolvePresentation} from '@openpresentation/opf-render/svg';\nconst geometry = resolvePresentation(editor.presentation, { fonts }).slides[0].geometry;\nconst flow = geometry.flows.find(flow => flow.path === 'slides.0');\nconst prepared = prepareTrackResize(editor.presentation, flow, 0, 0.65);\n// Boundary 0: give the first track 65% of the adjacent pair's combined space.\n// Preview prepared.presentation with the same renderer and fonts handle before applying.\neditor.applyPatch(prepared.patches, {rejectInvalid: true});\n```\n\nThe patch contains a `test` guard for the container before changing its composition. Failed tests do not mutate the document or its history. A test-only patch is read-only. Rendering is preflighted by the canvas; headless callers should likewise render a candidate to enforce font and overflow constraints.\n\nVerification: editor layout model tests, `/layout-tests.html` browser keyboard checks and trusted-pointer specimens, and `pnpm test:layout` for measured SVG/native PPTX coordinate parity. Shape-coordinate checks do not establish PowerPoint raster pixel parity.\n\n\n## Reordering and moving blocks\n\nIn **Arrange**, drag a numbered block handle to reorder siblings. The insertion marker shows the destination; the shared renderer reflows the slide after drop. Arrow keys on a handle move the whole block earlier or later. Click a handle for **Earlier**, **Later**, or an explicit destination and insertion position. The destination menu supports existing groups and block-based slides, including moving a child out of a group or moving a whole group to another slide. `canvas.openBlockMenu(path)` opens the same controls programmatically.\n\nA move preserves the entire block and its nested content, formatting, data, and references. Parent composition weights describe positions, so they stay in place. Moving to another container can change the block's inherited design and readability constraints; the canvas renders the candidate before committing it. Strict overflow or an unavailable required font rejects the move. A move cannot leave an empty block container or put a group inside its own descendants. Move the group or add another block first when the source has only one child.\n\n```js\nimport {prepareBlockMove, listBlockContainers} from '@openpresentation/opf-editor/layout';\nconst containers = listBlockContainers(editor.presentation);\nconst prepared = prepareBlockMove(editor.presentation,\n '/slides/0/blocks/0', '/slides/0/blocks/1', 1);\n// Insert the first block before child 1 of the second block's group.\n// Destination indexes refer to the document before removal.\n// prepared.path reports the moved block's address after any index shifts.\neditor.applyPatch(prepared.patches, {rejectInvalid: true});\n```\n\n`prepareBlockMove` returns `{presentation, patches, path, changed}`. It validates the complete result and emits guarded remove/add patches, so the editor or CLI can apply it atomically. No-op moves return `changed: false` and no patches. `listBlockContainers(presentation, {slideIndex})` optionally limits discovery to a single slide and excludes arbitrary extension data. Headless callers should render the candidate with their intended font provider before applying. The browser and installed-package block harnesses exercise nested moves, undo, stale menus, keyboard access, strict-fit rejection, and native drag reordering.\n\nCreation and deletion use the same layout engine: insertions can normalize implicit payloads into explicit blocks; deletions prune empty groups while retaining the slide. Existing track weights stay positional. See the [editor creation guide](live-editor.md#create-duplicate-and-delete-content) for the guarded APIs and canvas controls.\n\n### Localized timeline status words\n\nGenerated words are available for Arabic, Chinese (Simplified and Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian and Vietnamese. Regional variants share these vocabularies. `timelineStatusWordsFor(tag)` returns the words, or `undefined` for an unsupported language.\n\nThe words are engine vocabulary from `spec/reference/engine-vocabularies.json`, shared by SVG and native PPTX. They appear only when the guarded rule keeps the source labels at least as large. Unsupported generated translations omit the words while preserving the event statuses, markers, progress and authored event text. Put any precise local wording or schedule-health explanation in `what` or `description`. See [the French example](../examples/technical/localized-timeline.opf.json).\n\n### Proportional timeline periods\n\nSet a timeline event's positive numeric `duration` to draw consecutive periods at their relative lengths. All events use the same unit: `[{ \"when\": \"Week 1\", \"what\": \"Discover\", \"duration\": 1 }, { \"when\": \"Weeks 2\u20135\", \"what\": \"Build\", \"duration\": 4 }]` gives the second range four times the first. An omitted duration is one unit. `when` stays display text; OPF never guesses a duration from localized date labels. With no duration anywhere, the existing milestone layout is unchanged.\n\nThe shared composition geometry draws horizontal or vertical ranges in reading order. Labels use a balanced readable track with native leader lines to their actual ranges, so a short period never forces its text smaller; portrait timelines can use the height of the body. Both SVG and PPTX draw the same range rectangles; PPTX text and ranges remain native shapes. A period too short to draw visibly, or a timeline with too much label text, reports `opf/text-overflow` rather than changing its length or dropping words. Enlarge the timeline or split its events. Zero, negative, nonnumeric and nonfinite durations are invalid; ratios beyond finite layout precision are refused explicitly.\n\nPPTX import preserves the explicit numeric durations and reads edited labels from current native text. A native geometry or formatting edit reports timeline reflow; it does not infer new durations from dragged rectangles. Markdown uses a lossless embedded block when a timeline contains durations, preserving the values without an ambiguous date grammar. Conversions to text, lists or tables explicitly report that numeric periods are lost. See [the runnable example](../examples/technical/duration-timeline.opf.json).\n"
93
+ "markdown": "# Dynamic composition\n\nOPF keeps authoring intent in JSON. Use `blocks` when content can reflow; use promoted regions when relative placement is meaningful. `composition` on a slide overrides fields in the resolved layout's `composition`. Existing documents remain valid.\n\nThe published Node 24 set is the registry's `latest` of each package (`node scripts/registry-plan.mjs`); a layout is one list of regions (FA-33, Gallery 5). Use the exact pins it prints; the [compatibility matrix](compatibility-matrix.md) separates package support from native Office and font gates. Older version references below identify when individual contracts were introduced.\n\n```json\n{\n \"name\": \"Decision brief\",\n \"slides\": [{\n \"title\": \"Make the main idea clear\",\n \"composition\": { \"mode\": \"row\", \"weights\": [2, 1], \"overflow\": \"error\" },\n \"blocks\": [\n { \"text\": \"The evidence and recommendation receive twice the width.\" },\n { \"text\": \"The supporting detail receives the remaining width.\" }\n ]\n }]\n}\n```\n\n`auto` evaluates candidate grids using text fit and cell proportions. `columns` limits its candidates. `grid` uses `columns` if given, otherwise a grid based on the canvas shape. `row` uses one row; `column` uses one column. The arrangement the root resolves to (the slide's `mode`, else `design.contentDirection`) also chooses how a lone list with icons draws: `column` keeps its ruled rows with a chip at the start of each row, while `row`, `grid`, `auto` and no direction draw LH-165's icon cards side by side ([Icons](icons.md#icon-cards-lh-165)). Items retain source order. Weights size columns except in column mode, where they size rows. Missing weights are 1; unused weights have no effect. A partially filled final row retains its grid tracks.\n\nTwo or three blocks (no group, no caption) at the root of the body form a split. Its fill is the share of the body its blocks draw: the ink of text, lists, quotes, metrics and code (each line's width by its height at its starting size, so rewrapping changes nothing), a table at most its natural width by the height of its rows at that width, a timeline its cell's width by the height it needs, a picture shown whole and a video their frames, and a chart the largest 4:3 box of its cell.\n\n- **Row or column by fill (LH-71).** In `auto` mode with no `columns` or `weights`, a split tries one row and one column (stacked at the heights the blocks need) besides the grid the scores chose, and keeps the one that fills the most. A row that fills under 55% counts its code panels stretched, as it is drawn. A row must give every block at least 120 px of width, and a column must give every picture, chart and video at least 120 px of height. Neither may overflow more than the scored grid, nor set its blocks smaller (more font reduction) unless it removes an overflow. A fill within 2% of the body keeps the scored grid. Texts fill the same either way, so they stay in a row. A table that wraps in a row goes full width above its text. The explanation records such a container with `reason: \"split-fill\"`. An explicit `row`, `column` or `grid` is kept.\n- **Panels stretch, text centers (LH-52).** A split that fills under 55% of the body no longer reads as a strip along the top. In a row (any mode), a code panel takes its whole cell with its code in the middle. Text, lists, quotes, metrics, tables and timelines sit at the height they need in the middle of their cells (a card still fills its cell). A picture shown whole or a video sits in the middle of its cell, and a chart's box is centered. In a column, every measured block keeps the height it needs (a table no longer takes the spare height that pushed its neighbor to the foot of the body), and the stack sits in the middle of the body. No block changes size, and the arrangement and widths are unchanged.\n- **A picture alone on a card fills it (LH-74).** A picture that covers its frame (fit `cover`, or `auto` resolved to cover) on a card of its own, with no caption and no shape, corner radius, aspect ratio or line of its own, is the card: its box is the card's whole frame, its shape a rounded rectangle at the card radius (8 reference pixels), and `frameBox` is left out, so neither engine draws an inset, a card fill or a card stroke around it. A picture shown whole (`contain`) keeps its card and inset. A team's pictures (two or more people, each a picture and a name) are portraits or avatars (LH-132), never card-filling pictures.\n\n`gap` defaults to 1/30 and `padding` to 0.08, both fractions of the canvas's shorter edge. Large gaps are reduced when necessary to keep cells positive. `minFontSize` defaults to 16 reference pixels at a 720-pixel short edge. `maxFontSize` (LH-144, none by default) caps body text the same way from above: paragraphs, lists, quotes, metrics and timelines are never set larger, their growth included, and never under `minFontSize`; headings, tables, code and charts keep their sizes. `paginate` writes it on the pages after the first, so the pages of one slide share their sizes: each later page is first drawn as an unpaginated slide would be, then capped, for each kind of block it holds, at the larger of the first page's size and the smallest size any later page reaches on its own. A later page is never held under the first page's size or under what every later page reaches, so continuation pages that all grow (an arrangement beside a side title) keep their growth, and only a page that would read larger than its siblings is held to them (RR-105). The reference coordinate system uses 96 pixels per inch. Explicit inch dimensions override presets independently for each axis.\n\nComposed font sizes lie on PowerPoint's 0.01 pt grid (RR-16). PowerPoint stores a run size (`sz`) in hundredths of a point and a point is 4/3 reference pixels, so every size a fit accepts is a whole multiple of 1/75 px (`FONT_SIZE_GRID_PER_PX`), and the preview draws exactly the size the export writes. Fitting evaluates each trial size on the grid before breaking lines and placing text: trial sizes stay anchored to the unsnapped request (no drift) and round down (`snapFontSizeDown`), so a size that fit before snapping still fits; a readability floor rounds up (`snapFontSizeUp`), so `minFontSize` is never undercut; and a result that reports no overflow was measured at the size it carries. The rule covers plain, rich, list (marker, description and picture-bullet side), table, quote, code, metric, timeline, furniture and heading text, including each rich run and script. `wrapText` measures at exactly the size it is given.\n\nHeadings reserve space according to their wrapped text. Title and subtitle share the padded width of the free area, and a missing tag or subtitle leaves no gap.\n\nA content slide's title stays on one line when it can (LH-51). The title asks for 54 reference pixels and, before it wraps, steps down in three equal steps of a twelfth (49.5, 45, 40.5 px) to the largest step that sets it on one line, so a deck has at most four content title sizes. Only a title that needs a second line even at 40.5 px wraps, at 54 px and balanced, as before. A content slide is one with a body whose title sits in auto rows above it; covers, sections, the stacked records (`statement`, `quote`, `closing`) and a title beside the body in a sized row (`agenda-split`) keep 54 px. The step is chosen per slide: composition sees one slide, so one size for the whole deck would need each engine to resolve every slide's layout first.\n\nA content title of the form \"Topic: qualifier\" (its first colon followed by a space) that still wraps at 40.5 px is split at the colon when the slide has no subtitle and the topic fits one line (LH-76). The topic is the title, on one line at its step; the qualifier is drawn below it as the subtitle at 28 px, its first letter as authored. A rich-text title and a layout with a separate subtitle area are not split. This is a composition-time presentation: the document keeps the whole title. Both items carry the title's path and `titleSplit` (`part`, and the drawn part's `start` and `end` in the authored title). The PPTX export puts the topic in the Title placeholder and the qualifier in a text box below it, and tags both as one title group, so import restores the whole title.\n\nCover slides vertically center the combined tag/title/subtitle group in the free heading area. A cover is a slide with no body payload (no root content field, where a root `image` counts unless it carries its own `placement`, no `blocks` other than placed images, no promoted regions; empty payloads such as `blocks: []`, `text: \"\"`, empty lists and regions with nothing in them count as no body; whitespace-only text is still body) on a v2 template or with no layout record. Empty template regions collapse according to the record and its heading regions place the headings (a heading region's own `anchor` sets the group at the foot of its area, as the gallery `cover` and `section` do, LH-130). The rule reads the record, never its id. The free area is the slide minus the bands of placed images, header and footer furniture, and the usual padding; a picture background reserves nothing. A wrapped heading makes the group taller and the group recenters. A group that already fills the free area is not moved. Accepted line and outline origins move with the boxes. Explicit heading `alignment` positions ink inside the box and never changes the vertical position. A flowed image is body, so image slides keep the top-aligned content origin; a placed image is not. Content slides are not affected: headings stay at the top and the body follows them. This is a reference-engine default, not a schema field.\n\n## Adaptive layout templates (OPF 0.19)\n\nA layout record is one ordered list of regions, declared once in reading order, and describes the content each body region accepts. The 40 built-in layouts are named by intent, such as `cover`, `text`, `chart`, `list`, `metrics` and `image-beside`. `layout: \"auto\"` explicitly asks for automatic composition; omitting `layout` does the same. See [Layout templates](layout-templates.md) for the record shape, the built-ins, region binding and overflow rules.\n\n```json\n{\n \"name\": \"Evidence beside the recommendation\",\n \"slides\": [{\n \"layout\": \"two-column\",\n \"title\": \"Approve the next phase\",\n \"blocks\": [\n { \"region\": \"first\", \"text\": \"The pilot met its acceptance criteria.\" },\n { \"region\": \"second\", \"text\": \"Fund the next two sites.\" }\n ]\n }]\n}\n```\n\nA block's `region` pin is resolved before the layout binds unpinned content by kind, role and reading order. A region's `flow` arranges several blocks; `max` limits how many it accepts, and `overflowRegion` receives content no region accepts. If there is no overflow region, unplaced content receives a row below the grid. An empty area collapses into a neighbouring area unless its record says `empty: \"keep\"`. The geometry exposes the result in `geometry.regions`, including each region's box, bound paths, overflow, collapse and bleed. Pagination repeats the selected layout and carries a region pin forward for a block moved to a continuation slide.\n\n**Arrangement before a smaller size (LH-186, the guarded rule `layout-first`).** Composition grows short content to fill, changes the arrangement before it sets text smaller, and fits dense content that no arrangement holds down the type scale to the readability floor, never below it, flagging what still does not fit. A paragraph, list or table set more than one step of the type scale (LH-149's half steps: 16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 32 px) under its role size (28, 32 and 25 px; on a layout template held to `composition.maxFontSize`) tries the arrangements that keep it larger. A long list (more than LH-42's six entries) that neither its payload nor a region gave a `columns` count, the slide's only list, of plain entries (no descriptions, icons or step badges), is dealt into two or three columns, each at least `LIST_COLUMN_MEASURE` (36) characters wide at its size, at the count that sets it largest on the type scale, when that is at least one step larger than its one column and nothing overflows (ten entries of twelve words: 21 px in one column, 26 px in two); as LH-144's columns, the count is chosen without `composition.maxFontSize`, which then caps it, so a page of a paginated slide is arranged as the first. A list drawn as an arrangement (a pyramid, matrix, cycle or flow) adapts its own design and is never counted as shrunk. A layout template is composed as the automatic grid (below). An arrangement is kept only when it adds no finding, sets no block smaller and reads as well. Where no arrangement sets the text larger the slide is unchanged: a 14-entry list stays at 24 px in one column (two columns would set it at 23 px), a 160-word paragraph at 26 px (one long paragraph has no more room in columns: they set it at 26 px and 24 px), a 14-row table at 18 px. `fill: false` and a run size of the author's (`fontSize` on a text run) keep the fitted composition.\n\nWhen a template sets a body role at the readability floor, `composeSlide` composes the same blocks as the automatic grid and keeps that result when its smallest body size is larger (or as large with less overflow) and it neither overflows nor splits words more (LH-83, `recomposed` on the composition): the headings then sit above the body as on an automatic slide and the result has no `regions`. `recompose: false` keeps the layout's result. See [Recomposition at the readability floor](layout-templates.md#recomposition-at-the-readability-floor-lh-83).\n\nA body that fills under half of its height at its role sizes grows (LH-48): the only block of a slide steps up the type scale (each role up to its display size, `LONE_DISPLAY_SIZES`) to about 60% of the body and sits in its middle, and a body of several paragraphs and lists steps up together, at one size, and centers. `fill: false` keeps the role sizes. See [A body that fills too little](layout-templates.md#a-body-that-fills-too-little-lh-48). A short lone text and a `statement` draw their message at display size (LH-09). On a one-message slide (the body is one text, quote or metric, with no subtitle, and no title or a title of at most four words that is not a sentence; `oneMessageField`) the message grows past those caps as far as its length allows (LH-188, `MESSAGE_CEILINGS`): a statement of up to 30, 60 and 120 characters up to 115, 80 and 54 reference pixels (16%, 11% and 7.5% of the short edge), a quote's body up to 86, 72 and 56, and a figure of at most six characters up to 252 (`FIGURE_CEILING`). These are ceilings for the same growth by steps of the type scale, never fixed sizes and never lower than the cap before them: the message still keeps every word whole, its balanced lines and the 60% fill target, and takes no step that adds a line whose last line is a stub, under a third of the longest (`stubLine`: balancing does not even out text without word spaces, or a word too long to move). Characters are grapheme clusters, a run of white space counts once and a full-width (CJK) character twice (`messageCharacters`). Display text (LH-189), set at twice the body size (56 px) or more in Latin, Greek or Cyrillic text or ASCII figures (other scripts, emoji and mathematical letters are drawn by script faces and keep their spacing), tightens only where it pays: a title or subtitle (not over a measured background picture, where LH-158 places the group by its height), the message text, a one-message quote's body and a growing lone metric's value track by -1.5% when they fit on one line, at the usual 1.22 em pitch; a text of two lines takes a 1.0 em pitch and the tracking only when that lets it reach a larger size (`composeSlide` composes such a slide both ways and keeps the tighter one only when a text is larger there and none is smaller); three lines or more keep 1.22 em and no tracking (`linePitch`, `DISPLAY_TRACKING`). A label or attribution set in capitals tracks by +8%, as an eyebrow. Text in other roles keeps 1.22 em at any size. A slide with no body composes as a cover and grows its headings by steps of the type scale (LH-129), as a `cover` record does; a lone timeline tries two or three steps of the scale on its labels first.\n\nThe slide's own `composition.mode`, `columns` and `weights` arrange the first primary flowing region. `design.contentDirection` asks flowing regions to use a row or column; `design.mirror` reverses template tracks. Effective design keys resolve per key from slide, deck, theme, layout, then engine default. Promoted regions retain their 3\xD73 vocabulary and visual reading order. The layout template does not replace content groups inside a slide; groups still keep related blocks together.\n\n## Shared headers and footers\n\nPublished core 0.11.0 exposes `layoutFurniture(slide, options)` and `geometry.furniture`, separate from body `items`. Composition identifies the available-space policy as `grid-score-v9`. Raw callers pass the presentation as `options.presentation`, resolved dimensions/fonts and the same measurement provider used by preview. `slideIndex` identifies source paths; optional `slideNumber` is the one-based displayed number.\n\nThe core resolver honors whole local header/footer overrides, including `false` and empty objects. Each zone retains its image and all configured text fields in source-aware parts. Literal text and dates preserve whitespace and empty strings. A zone logo reference (`var:organization.logo.icon`) to an organization without a logo, missing socials, or `date: true` without a host-supplied current date, produces `unresolved-content`; the implementation never consults a clock or invents source text.\n\nGenerated values are variables inside a zone's `text` (FA-31): `{{organization.name}}`, `{{speaker.name}}, {{speaker.title}}` and the other deck-wide built-ins resolve with `resolveVariables` before composition, and the slide-scoped `{{slide.number}}` (the displayed number), `{{slide.section}}` (the slide's `section`, empty when it has none) and `{{deck.slideCount}}` (the displayed slide count: `options.slideCount`, else `presentation.slides.length`; whole-deck pagination iterates to the final page count) resolve in `layoutFurniture` for the slide it lays out. One `text` holds several values in the author's order, with `\\n` between lines (`\"{{organization.name}}\\n{{slide.section}}\"`, `\"Page {{slide.number}} of {{deck.slideCount}}\"`). An escaped `\\{{slide.number}}` draws as the literal token. Every zone `text` is one part with `field: 'text'` and `sourcePath` at the authored text. `dateFormat` is an LDML-style pattern (`yyyy`, `yy`, `MMMM`, `MMM`, `MM`, `M`, `dd`, `d`, `EEEE`, `EEE`, quoted literals) with fixed English month and weekday names. A string `date` with `dateFormat` must be an ISO `YYYY-MM-DD` date and renders as fixed, generated text tied to that source value; without `dateFormat` a date string stays literal and editable. `date: true` is the current date: hosts pass today's ISO date as `options.date` (composition, pagination, renderer and exporter), and the default pattern is `M/d/yyyy`. Text parts expose `fields`: one `{ type: 'slideNumber', start, end }` per substituted `{{slide.number}}` and one `{ type: 'date', start, end, format }` for a whole current date, as half-open UTF-16 ranges into the part's `text`, so exporters can write native live fields while `{{deck.slideCount}}`, `{{slide.section}}` and fixed dates stay fixed text. `formatFurnitureDate()` is exported for hosts. All configured fields in one zone sit side by side in one row, in the order image, text, socials, date (see the row geometry below). An organization logo is `image: \"var:organization.logo.icon\"` (or any shape and organization): `layoutFurniture` resolves it for the slide's background and the image part keeps the reference in `reference` (see [design resolution](design-resolution.md#brand-assets-and-layout-hints)). Hiding furniture on a title slide is the slide-level `design.header: false` / `design.footer: false` override.\n\nThe slide-scoped built-ins work in body text too. Engines compose and draw the slide `resolveSlideContext(deck, index, { slideNumber, slideCount })` returns as `context.slide` (`resolveSlideVariables(slide, { slideNumber, slideCount, presentation, darkBackground })` substitutes them in the slide's own strings and resolves its organization logo references for the background, leaving its own header and footer to `layoutFurniture`), with the same numbers in `context.options`, so body text is measured and drawn with the real value. `paginate` measures continuation pages with the substituted values but returns the slides with the tokens kept, never splitting a page inside a token, and runs its slide-count fixed point whenever `{{deck.slideCount}}` appears in the deck.\n\n`socials: true` (core 0.11.1 and later) generates one `socials` part from the primary organization's `organization.socials`. The part has one source line per platform, in key order, and a parallel `links` array (`platform`, `text`, `href`, `resolved`, `sourcePath`). `resolveSocialProfile(platform, value, owner)` formats each value without network access, through the engine's social-platform vocabulary (`SOCIAL_PLATFORMS`, [`engine-vocabularies.json`](../spec/reference/engine-vocabularies.json)). A handle loses its `handlePrefix` and is substituted into `companyUrlPattern`, then `profileUrlPattern`, then `baseUrl/{handle}`; the result is shown as that URL without `https://`. A URL value passes through unchanged except that `https://` is dropped from the display. A key outside the vocabulary (the schema rejects one) is shown raw with no link, which is the Socials engine fallback. No catalog is involved: the Socials keys are an engine vocabulary. A missing organization, or one with no non-empty socials, produces `unresolved-content`. Speaker socials, platform icons, brand colors and slide-size presets are not rendered.\n\n`furniture-flow-v2` lays the start, center and end zones on the content inset (`composition.padding`, the body's own left and right edge) as three columns with a 2% gutter, and an empty zone lends its column to its neighbours: a lone `start` footer spans the content width, a `start` and an `end` zone share the free centre, and a `center` zone stays centred. The validator warns (`opf/furniture-wraps`) when a zone's text wraps past two lines; move sources to a caption or the speaker notes. **Zones lay out in a row (RR-71, vetoable).** A zone's parts sit side by side in the order image, text, socials, date (in a right-to-left deck the row runs from the right, the image at the start edge), `FURNITURE_GAP` (12 reference pixels at a 720-pixel short edge) apart, the row flush with the zone's start edge, centered, or flush with its end edge, and each part vertically centered on the row's tallest part. `\n` still breaks lines inside a text or socials part. With other parts, a text part's box is as wide as its longest line; a zone with a lone text part keeps the whole zone width (it wraps there, as before). When the row is wider than the zone, its text parts share what the images and gaps leave: a part narrower than an equal share keeps its width and the others wrap at the share; beside other parts an image is at most `FURNITURE_IMAGE_SHARE` (40%) of the zone's width, and a word that would break inside itself at the readability floor (letters or digits of a space-separated script on both sides of a soft break) is a `text-overflow` diagnostic at the part's text path, never a silent break. The tallest row sets the natural band height; rows start at the band's top edge. **Distance from the edge (LH-38).** The header band starts, and the footer band ends, half a content margin (`composition.padding` times the short edge, halved: 28.8 px at the default on a 720 px short edge) from the top and the bottom edge, the same distance at both, so the furniture sits nearer the edge than the content and reads as chrome; sideways the zones stay on the content inset. Text uses at least the selected readability floor, with complete accepted source lines and optional measured outline placement. Header and footer bands reserve room before heading and body allocation. Irreducible text, conflicting bands or a heading displaced beyond the remaining space produce diagnostics; strict composition rejects them. An image part (`type: 'image'`) alone in its zone aligns like the zone's text: its `box` is as wide as the image's own proportions make it at the band height (a 36 px band at 1280 px wide), at most the zone, flush with the zone's start edge in the start zone, centered in the center zone and flush with its end edge in the end zone, at the same vertical position as before; consumers fit the image inside `box`. Core reads the proportions without fetching, from an embedded PNG, JPEG, GIF, WebP or SVG data URI or an `asset:` reference to one, decoding only a bounded prefix of the payload (64 KiB, 1 MiB for a JPEG whose frame header sits behind large metadata) and memoizing per source, so a multi-megabyte logo costs nothing per slide; a JPEG whose header is past 1 MiB, an SVG whose root tag is past 64 KiB, a path or a URL is unreadable is placed in a square box (vetoable), so a wide image behind a path or URL is drawn small and flush to its zone edge until it is embedded. No-furniture body geometry remains unchanged.\n\nPagination repeats these fields without putting them among body slices. An optional `page.repeatedMappings` records repeated heading/furniture and metadata paths while the existing `page.mappings` retains its body-fragment contract. Whole-deck pagination evaluates final output numbers, including preceding continuation pages, and rejects unresolved repeated content atomically. Renderer and editor reuse the accepted parts; literal text/date fields, including empty values, support direct canvas editing and undo. Generated labels remain tied to metadata.\n\nPublished PPTX (0.9.1 and later) draws the accepted editable text boxes and fitted images and records furniture provenance in tagged slide shapes. Reimport uses current native text and images; damaged or ambiguous provenance retains visible content with diagnostics. The fresh installed-package evidence includes deterministic export, current-content reimport controls and offline canvas editing/undo. Native PowerPoint acceptance, font compatibility and full visual review remain separate gates. Since PPTX 0.11.9 (RR-11), the first footer text, date and slide number that fit one accepted line become real PowerPoint `ftr`, `dt` and `sldNum` placeholders at exactly this geometry, with master/layout placeholders and `p:hf` flags (see [native header and footer](https://github.com/OpenPresentation/opf-pptx/blob/main/docs/native-header-footer.md)); header parts, organization, section, socials, images and multi-line text stay tagged shapes because PowerPoint has no object for them. No core geometry or schema changed. Bounds/readability checks do not certify whole-slide design quality: long labels can wrap heavily in portrait zones, and outline agreement does not establish native font identity.\n\n## Footnote areas and caption bands\n\nRR-34 (core after 0.11.4) adds two reserved regions that exist only for decks that use the fields. A slide whose runs carry `cite` or `footnote` markers gets `geometry.footnotes` (`footnote-area-v1`): a rule and the slide's notes in number order, directly above the footer band (or the bottom padding) with the content area's left edge and width, in the body family at the furniture size; the content area shrinks by exactly the area's height plus half the slide gap, and nothing above it moves. The area takes at most 35% of the span between the heading top and the footer band; a note that does not fit reports `text-overflow` at its source path (`references.N` or the run's path), which pagination treats like any other fit overflow. `slideCitations(slide, slideIndex, presentation)` is the numbering `composeSlide` uses; pass the same `presentation` and `slideIndex` to every consumer. An `image`, `chart`, `table` or `video` payload with a `caption` reserves a caption band inside its region (`item.caption`; `item.box` becomes the media box), below or above the media, at most 35% of the region; automatic grid selection scores the leaf on its media box. See [footnotes, citations and captions](footnotes-citations-captions.md).\n\n## Backgrounds and placed images\n\nCore 0.15 composes pictures in two ways (FA-22); [images](image-treatments.md) has the full vocabulary.\n\n- A picture background (the slide's `design.background`, then the deck's, then the theme's, when it is `{ type: \"image\", ... }` or an image-source string) is `geometry.backgroundImage`: the whole canvas as its frame, `fit` (`cover`, `contain`, `stretch`, `tile`), `focus`, `opacity`, `recolor` and the overlay box (whole picture or an edge band). It never moves content. `resolveSlideContext` passes the theme's background as `ComposeSlideOptions.themeBackground`.\n- Every image item carries `item.image`: the frame inside its region, `fit` (the block's own, else the effective `design.imageFit`, else `cover` in a layout and in an automatic picture track, and `contain` elsewhere on a slide composed with no layout), `focus`, the mask with its DrawingML preset and SVG outline, line, opacity, recolor and overlay. `fitImage(frame, fit, aspect, focus)` is the shared fit math (LH-84: with no authored `focus`, a portrait picture, taller than wide, cover-cropped into a wider frame defaults to focus y 0.3 so heads stay in frame, `defaultImageFocus`; any other crop is centered, an authored focus always wins, and `item.image.focus` is the focus drawn); core fills `item.image.picture` itself when it can read the picture's proportions (a data URI, or an `asset:` reference to one). A picture shown whole (`contain`) gets a frame of its own proportions at the region's anchor (top by default) when core can read them, so `item.image.box` is the picture and not the whole cell; a video's `item.box` is its 16:9 frame; in automatic composition a chart is at most 4:3 landscape in a cell, a radar at most square, and a chart that is the slide's only body at most 2:3 portrait, centered in the body it does not fill (RR-105: on a 9:16 slide a lone chart filled the top half of the body), and a single row of a portrait picture beside other blocks, or of two prose blocks whose demand differs by 2.5 times, gets weighted widths.\n\nTwo text notes moved out of a metric or chart grid can use those measured width shares too. A substantially longer note may take up to 70% of the row when that shortens it and adds the shorter at most one line. The notes stay side by side only when the row is no taller than stacking them. Their type size and source order remain intact; narrow canvases and authored direction keep their existing choices.\n\nA top-level image block with `placement: { edge, size, inset }` takes a band along that slide edge: `size` of the slide width (start, end) or height (top, bottom), default 0.5, edge to edge, or inside the slide padding with `inset`. Headings, footnotes and the body compose in the free area that remains, with the usual padding; header and footer bands keep their full-width placement. Bands are taken in block order and each spans the free area the earlier ones left; a second block on a used edge flows as content (the validator reports it). Placed items are listed after the headings and before the flowed body, and their placeholder slot is not reserved in the flow. A slide whose only body is placed images is composed like a cover. `start` and `end` follow the deck's direction: `start` is the left edge in a left-to-right deck and the right edge in a right-to-left deck.\n\n## One size guard for the layout-harvest rules\n\nEvery rule of the third layout-harvest wave that rearranges or resizes blocks is held to one guard in `composeSlide`: no rule sets\na block's fitted body size below what the slide gets without the wave's rules (each text, list and table, and each main part of a\nquote, code panel, metric or timeline), unless that leaves fewer findings (`text-overflow`, `small-cell`, `layout-unplaced`), and\nthen never below the readability floor. A rule never adds a finding, splits a word or sets a paragraph under the minimum measure.\nThe guarded rules are LH-89's nested gaps, LH-65's empty columns, LH-72's measure column, LH-78's quote lead size and card, LH-06's\nautomatic band or pill, LH-114's pull line, LH-121's timeline status words, LH-68's scorecard tiles, LH-86's long-text rows, LH-66's\nminimum measure, LH-67's lead plus stack, LH-70's paragraph columns, LH-10's reading measure in a layout's regions, LH-64's one start for\na row of cards of mixed kinds, LH-47's stretched short last row, LH-120's 40% share of a bar chart in a row of three, LH-112's start\nalignment and display size of a metric beside other blocks (with LH-15's band), LH-50's label drawn as the eyebrow of the text after it,\nLH-08's ruled rows for a list of short labels with descriptions (LH-171: on a slide where another list is ruled, a list whose labels are a short phrase of up to six words is ruled too, so sibling columns read alike; see [Design resolution](design-resolution.md#liststyle-lh-08-vetoable)),\nLH-133's questions as ruled rows (`pair-rows`, see [Questions and terms](#questions-and-terms-lh-133)), LH-07's step badges and flows\nof a `sequence` region (see [Step sequences](layout-templates.md#step-sequences-lh-07)), LH-134's numerals (`numerals`, see\n[Numerals, badges or rows](#numerals-badges-or-rows-lh-134)), LH-135's pricing tiers as one card each and LH-136's one-word pillar titles at display size over an accent rule (see [Layout templates](layout-templates.md)), LH-131's featured card\nof a pair or a set (`featured-card`, see [Emphasis surface](#emphasis-surface-lh-06)), LH-137's delta pill (`delta-pill`) and LH-137's\ncheck-mark tiles of a dark summary list (`check-tiles`), LH-14's icon chips (`icons`, `icon-chips`), LH-170's closing note on the band (`note-band`, see [Emphasis surface](#emphasis-surface-lh-06)) LH-169's\nfigure-led list as a row of figures (`figure-row`, see [Layout templates](layout-templates.md)), LH-63's bold run-in heading over a text (`run-in`, see [Content payloads](content-payloads.md)), LH-46's lead plus cards of a closing's details (`closing-lead`, see [Layout templates](layout-templates.md)), and LH-186's arrangement before a smaller size (`layout-first`: a long list in columns, a layout template as the automatic grid; see above). The decorative mark of a quote card (LH-78, `QuoteLayout.mark`) is not guarded: it is drawn in the card's own padding and moves nothing. The featured card, the pill, the tiles, the icon chips, the note band and the figure row only draw, so a slide that draws one of them is also composed under the guard without them and keeps the drawing only when no block reads smaller there, nothing more is found and a body role at the readability floor stays at it (the drawing never decides LH-83's recomposition); otherwise each is tried alone on top of the rules that slide kept. LH-40's figure on one line\n(`metric-figure`) is tried last, on top of the rules the guard kept, and kept when the slide reads as well with a split figure allowed\nthe next smaller type-scale step (a slide that composes no metric is not composed again for it). LH-165's icon cards, LH-162's text\ntiles and LH-69's placed tiles (`icon-cards`, `text-tiles`, `placed-tiles`) are tried before it the same way, on top of the rules the guard kept: they rearrange the whole body,\nso they are never part of the first composition, where a failure would take every rule that did not fire off the slide. A layout's\nlone list with icons also tries its cards across the whole body as the automatic grid (`recomposed.cards`), kept when its text reads at\nleast as large as the layout's.\nAn eyebrow is set at its own role size (0.6 of its paragraph's, from 20 to 24 px), like the tag, and is not a body size the guard compares. A pull line sets its quote at the lead size on purpose,\nso the guard holds that quote to the slide's smallest body size rather than to the larger size it had on a card (every other block still\nkeeps its own size); another arrangement of the slide (a track, LH-48's growth) that draws the quote on a card again is held to the\ncard's size. The display size is tried last, so it never displaces an arrangement that reads well without it, and a value at display\nsize is compared at its 76 px role size: what it has above that is headroom an arrangement may spend.\n\n- The slide is composed once with every rule. When none changed anything (most slides), that is the result.\n- When only rules that move blocks without changing the size any block asks for changed something (nested gaps, the measure, long-text\n rows, the measure column), and every block got the size it asked for with no finding, the result is kept as it is.\n- Otherwise the slide is also composed without the rules. That composition seeds LH-68's tiles (each metric role starts at its stacked\n size) and LH-06's band or pill (its text starts at the size the block had), and the result with the rules is kept when it reads as\n well. When it does not, each rule that changed something is added on its own, smallest change first, and kept while the slide still\n reads as well.\n- The slide then settles: a message set in the middle of the slide grows (LH-129), an under-filled body grows (LH-48), a layout may\n be recomposed as the automatic grid (LH-49, LH-83), and an automatic slide may give its picture or chart a track (LH-80, LH-49). Each\n of those arrangements is composed with the rules that read well in it and kept only when it reads as well as the guarded composition.\n- A slide that draws step badges (LH-07) or numerals (LH-134) is settled once more without them and keeps them only when every block\n reads as well, since a badge band changes how much of the body is filled and so whether LH-48 or LH-129 grows it. The automatic scrim of a picture\n background (LH-02) is computed last, over the slide that is kept, and changes no box or size.\n\nLH-52 and LH-71 only place blocks at the sizes they already have and are not guarded; LH-72's start alignment and sibling quotes of one\nrow sharing a size are always applied. The rules meet as follows:\n\n- Paragraph columns (LH-70) and a lead plus stack (LH-67) keep their own cells; LH-52 centers only the scored grid or LH-71's row, and\n LH-48 does not grow them.\n- A quote beside another block in a centered split (LH-52) takes its own card (LH-78), measured with the card's insets, in the middle of\n its cell. On the emphasis surface (LH-06) the surface is its card.\n- Long texts that LH-86 moved into one region keep their rows; paragraph columns and a lead plus stack do not rearrange them. A short\n last text after them is LH-06's foot band, bound to no region.\n- LH-06's band or pill keeps its own size; LH-48 grows the blocks above it. LH-114's pull line does the same.\n- LH-48 grows LH-86's long-text rows and LH-52's splits of paragraphs like any body of paragraphs: its fill is the height the text covers,\n not the cards around it. A lead plus stack (LH-67) does not grow, so its lead stays larger; a body at the floor is left to LH-83.\n- When LH-71 stacks a chart above a short takeaway and its plot becomes wider than 3:1, LH-49 gives the chart the filling track beside\n the text. A picture track (LH-80) keeps only the rules that read well beside it (a quote's lead size that would make it smaller is\n left out).\n- Charts that LH-49 recomposes share their value axis and plot height (LH-33, LH-93) in the recomposed grid.\n- A list in a `sequence` region keeps LH-07's badges and takes no automatic ruled rows (LH-08); its other lists, and a slide whose\n badges the guard refused, may still be ruled. An agenda whose entries all have descriptions draws LH-134's numbered rows instead of\n badges (see [Numerals, badges or rows](#numerals-badges-or-rows-lh-134)).\n- LH-133's questions as ruled rows take the region's blocks out of its grid into one column; six or more short questions keep the grid\n and only gain their accent rules, which sit in the gaps and change no size.\n- LH-129 grows a cover's or section's title and subtitle but not its tag: the tag is LH-32's eyebrow at its 22 px role size, which is\n also its display size.\n- LH-50's eyebrows apply on slides without layout regions and LH-07's steps only in layout regions, so a step never carries an eyebrow.\n LH-152's root label before a list stays a block on a layout with a `sequence` region for the same reason.\n\n## Questions and terms (LH-133)\n\nA question with its answer and a term with its definition are read from the content, never from a slide or layout id: a question is\nan entry (with a description, at the first level) whose text ends with a question mark of its script (`?`, the fullwidth `\uFF1F`, the\nArabic `\u061F`, the reversed `\u2E2E`, before any closing quote or bracket; `questionText`); a term is a short label (`isLabelText`) of at most\ntwo words (`TERM_WORDS`; `pairEntry`). Claude Design sets an FAQ and a glossary as two-column ruled rows:\n\n- **A list of questions.** A list of two or more first-level questions with answers is drawn as ruled rows (LH-08's rows, under the\n guarded rule `pair-rows`): each question bold in a column of `LIST_ROWS_LABEL_SHARE` (40%) of the list's width, wrapping in it, its\n answer beside it with their first baselines aligned. A question that needs more than `LIST_QUESTION_LINES` (3) lines in the column\n puts every answer under its question instead.\n- **One block per question.** A region whose two or more blocks are each a one-entry list holding a question with its answer (the\n usual way an FAQ is written) draws them one under another across the region instead of in its grid, each block a ruled row: the\n questions share one column of 40% of the width and the answers start at one edge, the answer at the list size (as the heading list it\n would otherwise be), and a hairline in the middle of the gap between two blocks. The import keeps each block (the export names each\n list, so two stacked lists are never merged into one).\n- **Six or more short questions** (`PAIR_GRID_MIN`; each question at most 48 and each answer at most 90 characters) keep the region's\n grid (3 \xD7 2 for six), each cell under an accent rule: `LIST_ACCENT_RULE_WIDTH` (3 reference px) in the accent, the tag's color on its\n backdrop, half a gap over its text and never nearer the text above it than its own. Questions whose rows the guard refused keep the\n grid with the same rules.\n- **A glossary.** The slide's lone list of two or more terms with definitions, most of them one word (\"ARR\", \"Churn\"; a list of\n features named in two words is not a glossary), draws its terms in the accent (`ListEntryLayout.accent`) in the column of the widest\n term, its definitions beside them as LH-08's rows.\n\n- **Ruled rows fill the body** (LH-48 for rows). A lone list drawn as ruled rows (LH-08's rows, questions, a glossary, takeaways\n beside numerals, an agenda's numbered rows) first grows in type-scale steps as any lone list does (toward about 60% of the body, never\n smaller than before), then takes the whole body: the leftover height is shared evenly between its rows, each gap at most\n `LIST_ROWS_SPREAD` (3) em, the hairlines in the middle of the gaps and numerals with their rows, and what is still left sits above and\n below them (`ListFitOptions.spread`). One-question blocks stacked as rows spread over the body the same way, from a gap under the\n headings to the foot of the content box. Claude Design spreads an agenda's or a FAQ's rows down the slide like this.\n\nRules and accents are drawing: the preview draws them as SVG lines and text fills, the PPTX export as native lines (`OPF list rule\n<path> N`) and run colors, and the import reads neither as content (a term's accent is the look the export records for its runs). In a\nright-to-left deck the question or term column is at the right and the answers to its left.\n\n## Numerals, badges or rows (LH-134)\n\nA numbered list draws its numbers one way, decided by its region and its content, never by a slide id:\n\n1. **A `steps` region** (a process): LH-07's badges, or a flow of chips.\n2. **A `numbered` region** (an agenda): when every entry of every list of the region has a description, numbered ruled rows: each\n number a numeral at the list size, bold in the accent and in two digits under 10 (\"01\"), in a column at the row's start, the label\n bold and the description in a second column (Claude Design's agenda). Otherwise LH-07's badges, for every list of the agenda.\n3. **Elsewhere**, a numbered list that is the slide's lone body block with 2 to `NUMERAL_TAKEAWAYS` (5) first-level entries is a few\n takeaways: display numerals beside ruled rows, the numeral `LIST_NUMERAL_SCALE` (2.5) times the list size when every takeaway has a\n supporting line (its digits from the takeaway's capitals to about its line's baseline) and `STEP_BADGE` (1.75) times when one has\n none, `LIST_NUMERAL_GAP` (1.5 em) before the text.\n4. **Every other numbered list** keeps its native numbers, ruled when LH-08 rules it.\n\nNumerals and badges are drawing, under LH-07's veto: an unnumbered agenda is numbered as drawing only and imports unnumbered, and an\nauthored `numbering` comes back from the tag of each numeral or badge (`ComposedStepBadge.list`). Both are guarded (`step-badges`,\n`numerals`), and a slide keeps them only when every block reads as well as without them; a list beside numerals grows (LH-48) as the\nplain list would, as long as it fits with them. A numeral is `ComposedStepBadge.numeral`, its line box: the preview draws its label\ncentered on its column in the tag's color, the PPTX export a text box at that box holding the numeral (no ellipse).\n\n## Metrics beside other blocks\n\n- **Display size (LH-112).** One or two metrics that share the body with one or two blocks of other kinds (a chart, table, paragraph,\n list, quote, picture or timeline) are drawn at display size: one metric's value starts at 120 reference pixels and grows in 4 px steps\n to 160 while its line height stays within 40% of the body's height and its one line within 90% of its cell's width; two start at 90\n and grow to 120 (`METRIC_DISPLAY_SIZES`, `METRIC_DISPLAY_HEIGHT`, `METRIC_DISPLAY_WIDTH`). A value that would wrap at its start keeps\n one line at the largest size down to its 76 px role size. Such a metric is start-aligned with its column (value, label, description,\n delta), unless the slide or the deck sets `contentAlignment`; a layout's or theme's centering is the default for short text, as LH-70\n reads it. A metric alone keeps its centered display (LH-101 below) and a grid of metrics alone, or a scorecard tile (LH-68), keeps its\n sizes.\n- **Lone metric (LH-101).** A lone metric grows by the type scale's ratio, up to nine steps, while it fills at most 80% of its cell\n (`LONE_METRIC_TARGET`), its value up to 232 px (`LONE_DISPLAY_SIZES.value`), as Claude Design sets a lone figure at about 230 px. On a\n one-message slide a figure of at most six characters grows up to 252 px (LH-188, `FIGURE_CEILING`), and a growing value's line is one em\n tall (LH-189).\n- **Band (LH-15).** A metric at display size in a cell at least three times as wide as it is tall (as the cell gives it, or as the\n metric stacks when the cell takes its natural height, `METRIC_BAND_RATIO`) is a band (`arrangement: \"band\"`): the value at the start\n edge, at most 60% of the width, and the label, description and delta in a column beside it (at least 200 px wide), the two centered on\n the band's height. Right to left, the value is at the right.\n- **KPI column beside a chart (LH-61).** A slide whose body is one or two metrics and one chart, and at most one table, with the metrics\n composed above the chart (a dashboard's KPI row over its charts) is composed again with the metrics (and the table) in a column of\n about a third of the width and the chart in a full-height track beside it (the chart track of LH-49, 67% then 60% of the content\n width; a layout slide is recomposed as the automatic grid, `recomposed.kpis`). It is kept when the plot is at least as tall and the\n slide reads as well; a table that would be smaller in the column keeps the layout's arrangement.\n- **A short table beside its note (LH-75).** A slide whose body is one table and one note (a plain text block, before or after the table)\n that sits one above the other, the table under half the body's height with its cells on one line and the note two lines or more, is\n composed again with the two side by side: the table first (or second, as authored; the start edge, mirrored right to left), taking 70%,\n then 65% or 60% of the width, the widest share at which the note's column keeps LH-66's 28-character measure, and the note on one plain\n card as tall as the row (`frameBox`), its text in the middle of the card, the row in the middle of the body. The type steps up with\n LH-48's steps (the table's rows with it). Initial placement keeps at most two whole-word cell lines and a row covering at most 60%\n of the body; actual growth may use three whole-word lines and up to 75% of the body, while preserving the note's reading measure. It is\n kept when no block is smaller, no word splits and no new finding appears; a layout slide is recomposed as the automatic\n grid (`recomposed.table`), and a layout that already sets the note beside the table (`table-beside`), a slide with a third block, an\n `emphasis`, regions, a `composition` mode, columns or weights of its own, and `recompose: false` keep their arrangement. A wide\n table whose words cannot fit its columns, or whose cells need more than two lines at their starting size, stays above it (LH-44).\n- **Compact grids (LH-05).** The rows of an automatic grid of paragraphs and lists (LH-43) used to spread over the body, so six one-line\n texts stood two thirds of a body apart. When the rows need under 45% of the body (or LH-48 grew them), they hug their text one gap apart\n and the grid sits in the middle of the body (`compact-grid`); rows that need more keep LH-43's spread. LH-48 then grows a hugging grid\n further than other bodies: up to eight steps of the type scale and past a list's display size (to 56 px), all cells at one size, while\n every text that was on one line stays on one line (the width of the cells bounds it: three columns of one-line texts stop at 43 px, two\n at 56 px) and the body covers at most 60%. The grid never ends smaller than the same body spread over the area; a growth that would end\n smaller lets texts wrap as they did, and one that still would is the spread body itself.\n- **Text tiles (LH-162).** 4 to 8 paragraphs of at most 90 characters that are the whole body of an automatic slide (blocks at its root)\n draw as tiles: one card each in the theme's card surface, in the grid of LH-165's icon cards (two to four a row, balanced, the short\n last row centered; see [Icons](icons.md#icon-cards-lh-165)), each text beside a small dot in the accent at the start of its first line\n and in the middle of its tile, on at most two lines. The texts start at the size they share and grow by steps of the type scale up to\n LH-05's 56 px while the tiles hold them without a split word and they cover at most 60% of the body; the grid is the one where they are\n largest, then on the fewest lines. Tiles (`text-tiles`) and icon cards (`icon-cards`) are tried on top of the rules the guard kept and\n kept only when no block reads smaller than without them, and than the settled slide without them (whose compact grid LH-48 may have\n grown further): with estimated text widths a compact grid of six texts reaches 43 px in three columns where tiles of two lines cannot,\n so it stays the compact grid.\n- **Placed tiles (LH-69).** A promoted region (a slide key such as `top:start`) holds a content payload, an object: a tile is `\"top:start\": { \"text\": \"Product\" }`, never the bare string `\"top:start\": \"Product\"` (validation reports that with the `{ \"text\": ... }` fix). A region key lists rows, then a colon, then columns, each half in reading order and without gaps: `top+middle:start+center`, `middle+bottom:end`; `bottom+middle:...`, `top+bottom:...` and `start:top` are not keys, and validation names the one meant. A region whose one block is a plain text of at most four words\n that is no sentence (it does not end in `.`, `!`, `?` or their equivalents in other scripts) draws as a tile, as Claude Design draws\n \"Product\", \"Engineering\" and \"Operations\" over a list: a card in the theme's card surface filling the region, the text bold at its foot\n at the start edge. The tiles of a slide share one size: the text's size, then each step of the type scale up to LH-05's 56 px while every\n tile's text stays on at most three lines with its words whole and covers at most 60% of its card. No icon is drawn for a text that has\n none. The blocks beside the tiles grow with LH-48 as they would without them (the tiles' texts are left out of the body that grows), and\n the tiles (`placed-tiles`, tried with LH-165's icon cards) are kept only when no block reads smaller than on the settled slide without\n them, at its exact size: LH-149's half step is not given up for a tile. A short sentence (\"Teams want fewer exports.\") keeps the bold\n heading of LH-69, and a slide that draws cards (`design.contentBox`) keeps each region's text on its own card.\n- **Value color on dark (LH-57).** On a dark slide or card, a value whose accent falls under 4.5:1 against the surface is drawn in the\n light text color (`metricValueColor(color, background, text)`) instead of a lightened accent, so the number stays the strongest\n element. A unit on its value's line takes the value's color.\n\n## Media tracks and the reading measure\n\nAutomatic composition (no layout, no promoted regions, no `columns` or `weights` of the slide's own) gives a picture or a chart a track of its own and keeps paragraphs on a readable measure (layout harvest LH-80, LH-49, LH-66). The rules read block kinds, counts and measured sizes, never a slide id, and mirror in a right-to-left deck.\n\n- **Picture track (LH-80).** A slide's one picture block among other blocks takes a full-height track at the slide edge, as an automatic `placement` (`item.image.placement.automatic`): cover-cropped with the LH-84 portrait focus and bled to the edges. It sits at the start side when it is the first block, else at the end side (the top or bottom of a portrait canvas). The headings and the other blocks compose beside it in the slide's own `mode`. The track is 50, 45, 40 or 35% of the slide; a track whose crop would keep less than half of the picture's width or height is not tried, so a panorama stays whole in the flow. A track is a frame the engine chooses for the picture and crops it by design, so a picture with `fit: \"auto\"` (LH-104) takes it as one with no fit does and is cover-cropped in it. Of the tracks that read as well as the slide without one (below), the one with the largest smallest body size is taken, then the one with the larger body sizes in all, then the one that crops least (a portrait picture takes a narrow track), then the widest. A block's own `fit: \"contain\"` or `\"stretch\"`, a `design.imageFit` of either, a frame shape or `aspectRatio`, an authored `placement`, a second picture or a video keep the composition as before: set `fit: \"contain\"` to show a screenshot or a diagram whole. The track spans the title band only when the title fits one line beside it (after LH-51's steps); otherwise the tag, title and subtitle take the full width and the track starts at the body top, still bled to its side and the foot (LH-116). A track that would wrap a table cell the slide sets on one line is not kept while another track keeps every cell on one line; when none does, LH-75's allowance holds, a cell may wrap onto two lines with its words whole, so the table keeps its size beside the picture.\n- **Short last row (LH-47).** The cells of the scored grid's short last row share the full width (two pictures and a paragraph draw a row of pictures over the paragraph, not a 2 x 2 grid with an empty cell); a grid of pictures and videos only keeps one cell width.\n- **Chart track (LH-49).** A slide's one chart block among other blocks (no picture, no `design.chartPrimary`, which stays the author's, and no `design.contentDirection` across the track: `vertical` on a landscape slide keeps its column) whose plot is too short takes the filling track: the root's first column when it is the first block, else the last, 60, 55 or 50% of the content width (the first that reads as well) against a column of the other blocks in the slide's own `mode`, as `chartPrimary` splits it. A plot is too short under the larger of 120 reference pixels and 22% of the body's height, or when it is more than three times as wide as tall. `chartPlotBox(item, scale)` is the plot as the engines lay it out: the chart box less the chart layer's header row, the padding, the label rows and the value axis labels.\n- **Authored chartPrimary (RR-105).** A `top`, `bottom`, `start` or `end` chartPrimary is drawn as written: no block of the body becomes the automatic note band or pill, and a paragraph beside the chart sits in the middle of its track, level with it. A lone plain paragraph there that fills under half of its track grows as a lone block does: up to 43 px while it fills at most 60% of the track and keeps the minimum measure, and a short message (25 words or fewer) on to 56 px in at most 4 lines; a longer text keeps its size. `none` is the ordinary automatic body. Where the slide cannot draw it (its own `composition.mode`, promoted regions or a template's regions place the blocks), composition reports `arrangement-adapted` at the chartPrimary key instead of dropping it.\n- **Reads as well.** A track is kept only when the slide has no more overflow or small cells, no more words split, no more paragraphs under the minimum measure and none on a shorter measure than before, and no block's body size smaller: a new arrangement never costs the text its size. Only a slide that overflows without it may trade size, to leave fewer findings, and never below the readability floor. Otherwise the slide is composed as before (an authored `row` of four narrow blocks keeps its row). `geometry.track` (`kind`, physical `edge`, `size`, the block's `path`) says which track was taken.\n- **Reading measure (LH-66).** A paragraph of four lines or more in a cell narrower than 28 average characters of its fitted size (`MIN_MEASURE_CHARS`) has too short a measure. The `auto` grid adds 20 to a candidate's score for each such paragraph (`narrowMeasure` in the explanation's penalties), and a `grid` with no `columns` of its own takes fewer columns until its paragraphs keep the measure. The grid chosen with the measure is kept only when it reads as well as the grid without it (no block smaller, as above). Labels of a line or two and lists keep their grid.\n- **Bar chart share (LH-120).** In a row of three blocks, a horizontal bar chart (`bar`, `stacked-bar`, `100pct-stacked-bar`) takes 40% of the row and the other two 30% each, because its category labels sit beside its bars and take their width from it. It is a guarded rule (`bar-chart-share`): kept only when no block reads smaller. In the preview a category label wider than its gutter (30% of the chart, or up to 40% for its longest word) wraps onto two lines at a space, even where its row is shorter than two full lines (it reaches into the gap between bars), before it is ellipsized.\n\nA layout that leaves a chart's plot shorter than its minimum (a wide chart region drawn on purpose keeps its proportions) is composed as the automatic grid when that draws the plot taller and reads as well; `recomposed.chart` holds the shortest plot of both, in reference pixels (see [Layout templates](layout-templates.md#recomposition-at-the-readability-floor-lh-83)).\n\n## Rows shared across kinds (LH-115)\n\nTwo blocks that list the same keys in the same order share their rows (layout harvest LH-115, extending LH-18's shared row tracks across kinds). Each rule only moves marks within boxes composition already gave, or composes the slide once more under the size guard, so it never costs a block its size.\n\n- **Bars on a table's rows.** A horizontal bar chart beside a table whose first-column keys are the chart's categories in the same order draws each bar beside its key: the plot spans the table's body rows (from the first row's top to the last row's bottom) and each category is centered on the middle of its key cell's text (`item.chart.layer.rows`, core `alignBarRows`). Only when those rows fit in the chart's box below its header row and above its value labels; otherwise the chart keeps its own plot. The PPTX export writes the plot area over the same rows (an inner manual layout); PowerPoint spaces categories evenly over it, so on rows of unequal height a bar sits off its key by at most half the difference.\n- **A timeline under its column chart.** An automatic slide of a timeline and a column chart (no layout, no `mode`, `columns` or `weights` of the slide's own) whose events' `when` values are the chart's categories in the same order is composed again with the chart above and the timeline as one band under the plot: each event's marker and labels sit under its column, mirrored right to left with the columns. It is kept only when it reads as well as the slide without it; the timeline stays listed first when it was written first.\n- A list with one entry per bar category is not merged into the bar labels: as sublabels at the chart text size its entries would be smaller than the list (32 px against 16 to 20 px on the mixed corpus's m28), which the size guard forbids.\n\n## Grouping blocks before placing them\n\nComposition groups a slide's blocks before it places any cell (layout harvest LH-58, LH-82, LH-73, LH-46, LH-47). The\nrules read the blocks' kinds, counts and text lengths, never a layout or slide id, so they hold for any count, any content\nkind and right-to-left decks; a slide that pins a block to a region, or sets its own `composition.mode`, `columns` or\n`weights`, is composed as written. `repeatedPairs`, `majorityKind` and `groupBinding` (on `/composition`) expose them.\n\n- **Repeated pairs.** A sequence that repeats one pair of kinds, a figure (metric, chart, table, picture, video or code)\n and a paragraph in either order, or a long and a short paragraph (one at least twice the other's length, the long one\n on the same side of every pair), two pairs or more, composes as one cell per pair. A pair is one row of its two blocks\n when each half of its cell is at least 0.8 of the cell's height wide (a metric beside its note), else one column (the\n figure above its text), half a gap apart. Metric, text, metric, text is two cells, not four.\n- **Group by kind.** With no layout, interleaved blocks of two kinds with unequal counts (chart, text, chart, text,\n chart) are one column of a grid of the majority kind above a row of the others (up to three side by side), each at\n the height it needs. On a layout, a region's grid keeps the kinds it accepts and the other blocks join the region that\n accepts them, in one row under the grid that asks for at most 30% of the content box (see [Layout\n templates](layout-templates.md#grouping-before-placement-layout-harvest)).\n- **Extra blocks in fixed regions** join the grid at the sibling size instead of a slim full-width strip below it:\n pictures as a row, then a lead picture beside a mosaic, cover-cropped; the columns of `comparison` as N columns;\n `statement` as a lead over a row of cards (see [Layout templates](layout-templates.md#grouping-before-placement-layout-harvest)).\n- **Balanced grids.** A region's grid of 7 to 12 blocks has balanced rows (7 as 4 + 3, 9 as 3 x 3), and the cells of a\n short row stretch to the full width, except in a grid of pictures, whose cells keep one size and center.\n\nGrouping changes the order of the composed items to the order of the cells (a pair's two blocks together; the majority\ngrid before the others), which is the reading order the preview, the PPTX export and accessibility use.\n\n## Reading measure, alignment and leads\n\nThese rules (layout harvest LH-70, LH-72, LH-67, LH-78) read block kinds, counts and text lengths, never a layout or slide id,\nand apply in automatic composition and in a layout's regions alike; a right-to-left deck mirrors them. A slide's own\n`composition.mode`, `columns` or `weights`, and `design.contentDirection`, keep their arrangement.\n\n**Readable size wins over the ideal measure.** These rules are held to the size guard above: a result with them is kept only when\nno block's fitted body size is smaller, or when it reports fewer findings; otherwise each rule is tried on its own and the ones that\npass are kept. LH-72's start alignment and sibling quotes sharing one size are always applied.\n\n- **Paragraph columns.** Three to six sibling paragraphs of similar length (100 to 240 characters each, the longest less\n than twice the shortest) are parallel items, so they are set as a grid of columns 45 to 65 average characters wide, when that\n is as large as their own arrangement. The shapes have 2 to 4 full columns (3 as 2 + 1 or a row; 4 as 2 x 2, 3 + 1 or a row;\n 6 as 2 x 3 or 3 x 2); each takes the largest size of the type scale at which its narrowest column keeps 45 characters and its\n rows fit, and the largest wins. On a wide slide that is two columns at 21 or 24 px; three columns at a 45-character measure\n exist only at the floor, so three paragraphs usually keep their own arrangement. `explain` reports `paragraph-columns`.\n- **Centered layouts center only short text.** When the content alignment is `center` and comes from the layout record or\n the theme, a paragraph or list over two lines or 120 characters is start-aligned in a column at most 65 characters wide,\n centered in its cell, and its siblings follow it. An alignment the slide or the deck sets is the author's and is kept.\n- **Lead plus stack.** Of three to five sibling texts or quotes, a paragraph of at least 100 characters, at least 2.5 times\n the median length of the others and twice the next longest, leads: a cell 55% of the width at full height, a text starting\n at the lead size (32 px), beside a stack of the others at one size. A chart or picture with two compact siblings (metrics, or\n texts and quotes of at most 120 characters) leads at 58%. The lead sits at the start unless it is the last block. A\n `flow: grid` region keeps its grid. `explain` reports `lead-stack`.\n- **Quotes beside other blocks.** A quote beside a block of another kind, or one of three or more quotes, starts at the\n lead size and steps down until it takes at most four lines (never below the 28 px body size), on a card that hugs it, when\n that makes no quote smaller; otherwise it keeps its size, on a card when the card costs no size. A card the slide does not\n otherwise draw is left out when it would make the quote overflow. A lone quote, and one or two quotes alone on a slide, keep\n the 40 px display size. Sibling quotes in one row share one body size; a row of wider cells keeps its own.\n- **Quotes under data: the pull line (LH-114).** A quote of 140 characters or fewer that shares the slide's root `blocks` with\n a table, a list of three or more entries, or two or more other blocks is drawn across the body as its own row: an 80 x 6 px\n accent rule in the primary color at the start edge, the quote at the lead size (32 px, stepping down to 28 px to take at most two\n lines) in the regular weight, and one caption line \"\u2014 Name, Role\" (the source after an en dash) under it. It is the last row when\n the quote is the last block, and the first row under the headings when it is the first block of an automatic slide; the data takes\n the full width beside it, and in a layout the quote is bound to no region. The data and the pull line are one stack at the top of the\n body: the pull line sits one gap under the lowest content (a table's last row, a text's last line, a card's edge, a chart's box), or\n one gap above the highest, and the body is not centered (LH-52, LH-48), though LH-48 still grows the data. LH-06's band stays at the foot. A quote beside one compact block (a metric, a chart, a\n short text, a list of one or two entries) keeps its card, as does a quote in the middle, one of several quotes, a quote with a\n photo, a region pin, a caption or `emphasis: true`, a quote that needs more than two lines, and a slide with an arrangement of its\n own. The quote layout reports the rule as `quoteLayout.rule`; the preview draws it as a rectangle and the PPTX export as a tagged\n native rectangle (`OPF quote rule <group>`) that import consumes with the quote.\n\n## Check-mark tiles (LH-137)\n\nA slide set apart on a dark surface of its own (its `design` sets a variant or background, and the slide is dark; a deck that is dark throughout keeps its lists) whose whole body is one bulleted list of two to six entries of one level, with no descriptions and each 90 characters or fewer (`CHECK_TILE_MIN`, `CHECK_TILE_MAX`, `CHECK_TILE_MAX_CHARACTERS`; a summary of decisions or outcomes), draws each entry as a tile of a grid that fills the body, with a check mark badge at the entry's start (the right in a right-to-left deck) in place of its bullet, as Claude Design draws a closing list of decisions. The grid is one row for three or fewer, two columns for four, three for five or six; when an entry would take more than two lines there (`CHECK_TILE_MAX_LINES`), one column of wide tiles (three columns become two for five or six). The entries keep the list's size; when one does not fit its tile at it, the list stays as it was. A numbered list, a list with a caption, a card or an emphasis, a list of a `sequence` region and a deck with its own list marker (`design.listBullet`) keep their own drawing. Composition reports the tiles as a step sequence (`result.steps`, form `tiles`): `chips` (one per entry, its text the list column of the same index) and `badges` whose `check` is core `checkMarkPoints(cx, cy, diameter)`, a polygon both engines fill in the badge's numeral color (PPTX: an accent ellipse and a custom geometry, tagged as LH-07's badges are and consumed on import).\n\n## Emphasis surface (LH-06)\n\nA slide has at most one emphasis surface: a contrasting card or band that carries the slide's takeaway. `emphasis: true` on a block or a group (at any depth) puts it there; the first one in reading order takes the surface, any other is drawn without it and reported as the composition diagnostic `emphasis-ignored`. The surface is the block's or group's cell, drawn as a card; nothing on it takes a card of its own, and a group's children are arranged inside the card's inset.\n\nWithout an authored emphasis, two automatic rules read the slide's root `blocks` (with a layout or without):\n\n- a **foot band**: a last block that is plain text of 60 characters or fewer, after blocks that are all longer (any other kind, or text over 60 characters), is drawn as a full-width band at the foot of the body. A takeaway of up to 120 characters is a foot band too when the blocks right before it are two or more charts or tables (LH-06, widened); a note between two charts reads as the first chart's note and keeps the 60-character rule;\n- a **pill**: a last plain text of 30 characters or fewer after one long text (over 60 characters) is drawn as a pill one gap under that text's last line, hugging its one line at the start of the text's column (the right in a right-to-left deck); where that leaves no room it is drawn at the foot of the body;\n- a **closing note** (LH-170, the guarded rule `note-band`): a lone short note that closes the body is the foot band whatever its length in characters, when it sets in at most 3 lines (`EMPHASIS_NOTE_LINES`) across the band at its size. It is the one text a layout binds to its `verdict` region (the comparison's \"Recommendation: ...\", pinned or bound there), or the last block when every block before it is a figure, two or more in all: metrics, groups of metrics or LH-169's figure lists (a row of figures and what they mean, under them in a `metrics` layout's note region or beside them in a `two-column` layout, whose region then gives way). A featured pair or set (LH-131, below) keeps its card and the note stays text, as do a note with `emphasis: false` and a longer one. So does a note that is a peer of the texts above it, even in a `verdict` region: when two or more texts before it have its form (plain text with as many paragraphs) and its length is 0.6 to 1.6 times their median (`NOTE_PEER_RATIO`), or it opens as each of them does (the same first lowercase word in its first 6 words, as \"should\" in \"<Name> should ...\"; the same first word in a script without case), it is one of a set, and banding it would set one peer apart. The band's text is set at least at the size the note has on the slide without the band, after LH-48's growth there, and the band is kept only when no block then reads smaller than on that slide.\n\nThe body above composes in what remains and the band or pill text is the last item. Neither costs a block its size: `composeSlide` also composes the slide without it, starts the band or pill text at least at the size the block fitted at there, and keeps the band or pill only when it leaves fewer findings (`text-overflow`, `small-cell`, `layout-unplaced`), or as many and no body block smaller (a text or list, any visible part of a quote, code panel, metric or timeline, a table's smallest cell). A band or pill taller than 30% of the body is not drawn. `emphasis: false` keeps a block out of both rules, and a slide with an arrangement of its own (a `composition` mode other than `auto`, `weights` or `columns`) takes neither; a block with a region pin, a caption or any payload besides `text` never takes them.\n\nLH-131: without an authored emphasis or a band or pill, a **featured card** reads the slide's root blocks too (core `featuredCells`, from content only, never from an id). The cells are the root blocks that are groups (a group's label is its first block when that is a text, or its first metric's label) or metrics (their label), two to six of one kind:\n\n- a **pair**: two cells whose labels (four words and 40 characters or fewer) name opposite sides, before and after or a problem (a challenge) and its solution, in English, German, French, Spanish, Portuguese, Italian, Dutch, Polish, Russian, Turkish, Arabic, Hebrew, Korean, Japanese or Chinese (\"After\", \"Nachher\", \"Apr\xE8s\", \"\u0628\u0639\u062F\", \"\u5C0E\u5165\u5F8C\"; \"The solution\", \"Die L\xF6sung\", \"\u0627\u0644\u062D\u0644\"). The cell naming the second side is featured, wherever it stands;\n- a **set**: exactly one cell marks itself as the featured tier in its label, a short text or its metric's label or description (80 characters or fewer; a list's entries are not read): \"recommended\", \"most popular\", \"best value\" and their words in those languages (\"empfohlen\", \"m\xE1s popular\", \"\u304A\u3059\u3059\u3081\", \"\u63A8\u8350\", \"\u0627\u0644\u0623\u0643\u062B\u0631 \u0634\u064A\u0648\u0639\u0627\").\n\nThe featured cell is drawn on the emphasis surface (`source: 'featured'`), and every other cell of the pair or set on one plain card (each block of a group shares its group's card), so the set reads as cards with one marked, as Claude Design draws a solution, an \"after\" or a pricing tier. In a design with cards, a cell's card is inset 12 px (`CELL_CARD_INSET`, the smallest inset of a block's own card) so no block has less room than its own card gave it; otherwise the card takes payloadBox's inset, and the cell asks for that room. A pair of before and after whose cells both hold a metric and stand side by side draws an arrow from the first card to the featured one, in the middle of the room between them (`emphasis.arrow` `{box, direction}`, `PAIR_ARROW_WIDTH` by `PAIR_ARROW_HEIGHT`, 40 by 28 px, at least `PAIR_ARROW_MARGIN` of a gap from each card), drawn as LH-07's flow arrows are (an accent `rightArrow` or `leftArrow`; a `leftArrow` in a right-to-left deck, where the \"after\" card stands left); when the cards stand closer, the slide is composed again with each card that much narrower on its inner side and kept only when no block reads smaller. An authored `emphasis: true` anywhere on the slide always wins, `emphasis: false` on the featured block keeps the slide plain, and the guard keeps the featured card only when no block reads smaller.\n\nComposition reports the surface as `result.emphasis` `{ path, box, radius, shape: 'card' | 'band' | 'pill', source: 'authored' | 'foot-band' | 'pill' | 'featured', arrow? }` and marks every item on it `emphasis: true`. Its colors come from core `emphasisSurface(colorScheme, roles)`, which resolves a variant of the deck's own scheme through the layout-variant machinery (LH-01): on a light slide dark2, then dark1, then the accents; on a dark slide the accents in the slide's order, then light1; the first whose text reaches 4.5:1 on its fill and whose fill reaches 3:1 against the slide. Every text role on it under 4.5:1 takes the surface's text color. The preview and the PPTX export draw the surface under the first item on it and color those items with the surface's roles (PPTX: a tagged `OPF card <path>` frame with no line, recognized on import as decoration); `validate` measures their contrast against the surface.\n\nA slide whose whole body is one display message is drawn on the accent surface (LH-164; docs/design-resolution.md, \"A message-only slide\"). The surface is a color variant the slide context resolves before composition, so `composeSlide` moves nothing for it: it echoes `options.messageSurface` as `result.surface` `{ kind: 'statement-message' | 'display-message', variant }`, the reason an editor can show, as `pictureText` and `recomposed` are. LH-163: in a display message on a dark or accent surface, the author's bold words that the primary does not reach 4.5:1 on draw in a lighter tint of the primary that does.\n\n## Nested groups\n\n### Shared content cards\n\nShared content cards are published in core 0.10.0 and later, including the current core. For `design.contentBox: true`, each body leaf carries a `frameBox` at its outer allocation and a `box` padded inward by 12 reference pixels at a 720-pixel short edge, capped at one quarter of the frame's width or height. Scoring, accepted payload measurement, strict overflow and pagination all use that rounded interior. Headings remain unframed, nested groups keep their original padding, and explicit outer regions/track weights remain authoritative. Automatic candidates may change because their available content space changes.\n\nEvery composed item carries its resolved horizontal text `alignment` (`left`, `center` or `right`: the engine's words for the design values `start`, `center` and `end`, where `left` is the start edge and `right` the end edge, and `itemAlignment` converts a design value). The title, the tag (eyebrow) and a subtitle that sits in the title area (any slide whose layout has no `subtitle` region of its own) use `titleAlignment`; every other item, including a separate `subtitle` region, body text, lists, tables and metrics, uses `contentAlignment`. The value is the effective `design` key: the slide's design, then the deck's design (or the host's resolved deck option), then the theme's design, then the layout record's `design`. With no explicit alignment from those layers, metrics default to `center` and other items to `left` (LH-112: a metric beside one or two blocks of other kinds is start-aligned, unless the slide or deck sets `contentAlignment`); any resolved `contentAlignment` still overrides that fallback. A layout that sets `contentAlignment: center` therefore centers its content when no higher-priority layer sets the key. The title never inherits `contentAlignment`. On every slide, only a `contentAlignment` set on the slide's own design keeps the tag and the title-area subtitle apart (a deck or layout value does not), so a centered-content deck with start-aligned titles draws a start-aligned title, tag and subtitle over its centered content. Accepted outline placement and metric internals use the same value. The renderer and the PPTX exporter anchor preview and native text to `item.alignment`, so both engines place a layout's text the same way.\n\nRaw composition callers pass their resolved deck flag as `composeSlide(slide, {contentBox: effectiveDesign.contentBox, ...options})`; a slide's explicit `design.contentBox: false` overrides it. Coordinated renderer, editor and whole-presentation pagination resolve this option for their callers. Consumers draw at `frameBox` and use the accepted `box` and payload internals without another inset. Core 0.9.0 predates this behavior. Content cards do not make the incomplete chart/timeline density models complete or certify native raster fidelity.\n\nA block or promoted region can contain its own `blocks` and `composition`. The optional discriminator is `\"type\": \"group\"`. A group has at least one child and cannot mix children with leaf fields such as `text` or `image`.\n\n```json\n{\n \"composition\": { \"mode\": \"row\", \"weights\": [2, 1] },\n \"blocks\": [\n {\n \"composition\": { \"mode\": \"column\", \"padding\": 0.02 },\n \"blocks\": [{ \"text\": \"Recommendation\" }, { \"text\": \"Supporting evidence\" }]\n },\n { \"text\": \"Context\" }\n ]\n}\n```\n\nThe parent allocates a box to each group, then the group arranges its children inside that box. Group padding defaults to zero; a group's own `padding` and `gap` use its shorter edge. A group without a `gap` of its own sets its blocks the slide's gap apart (0.25 in at 16:9, LH-89), reduced as any gap is when the group is too small for it; before, it was 1/30 of the group's own shorter edge, so the blocks of a short nested row nearly touched. The slide's gap is kept only when no block of the slide reads smaller than with the former gap (unless it removes overflow). Only `minFontSize`, `maxFontSize` and `overflow` inherit. A strict ancestor cannot be weakened by a child's `overflow: \"warn\"`. Font sizes remain relative to the canvas, not the group. Groups can nest up to 32 levels; cycles and deeper nesting fail with an explicit error.\n\nAutomatic grid scoring inspects descendant text using each descendant's explicit arrangement or geometric automatic seed. After selecting the parent's grid, it optimizes each child's automatic grid. This deterministic, bounded search avoids exponential combinations; it does not claim a globally optimal packing.\n\n`result.items` contains every leaf with its full source path and effective composition. `result.groups` contains group paths, outer bounds, and content bounds. The editor's `setGroupComposition(path, value)` validates and records undo/redo just like slide composition edits.\n\n## Inspecting and repairing layout\n\n```js\nimport { composeSlide } from '@openpresentation/opf/composition';\nconst result = composeSlide(deck.slides[0], { width: 1280, height: 720, layout: resolvedLayout });\nconsole.log(result.items); // Source paths, content, geometry, and text estimates\nconsole.log(result.diagnostics); // Path-specific text-overflow and small-cell messages\n```\n\nThis pure function expects a validated slide. The caller resolves catalog records and passes the canvas size, `fontFamilies` and `textMeasurement`; `resolveSlideContext(deck, index, { fonts })` from the package root does the catalog resolution for one slide of a deck and returns those options, plus the slide to pass (`context.slide`, with the slide-scoped built-ins substituted). The rendering and export packages perform those steps at their boundaries. No network, DOM, system font, or AI dependency is required.\n\n### Explain automatic selection (core 0.8.0 and later)\n\nPass `explain: true` to return `result.explanation`. This opt-in API requires core 0.8.0; it is absent from core 0.7.0. Enabling explanations adds no measurement calls and does not change geometry, source content, reading order, weights or selected arrangements within the same engine version.\n\n```js\nconst result = composeSlide(slide, {...resolvedOptions, explain: true});\nfor (const decision of result.explanation.decisions) {\n console.log(decision.path, decision.reason, decision.selectedColumns);\n console.table(decision.candidates);\n}\nconsole.log(result.explanation.textMeasurement);\nconsole.log(result.explanation.unmeasuredPayloads);\n```\n\n`resolvedOptions` supplies the same dimensions, layout, fonts and optional width provider as the preview. Core 0.8.0 identifies its explanation as `grid-score-v2`; core 0.9.0 advances to `grid-score-v3` to include complete code metadata/body measurements. Current core reports `grid-score-v9`. These versions record containers in parent-before-child order. `lowest-score` reports the candidates actually tried; `configured-mode` respects resolved row/column/grid intent and returns no invented candidates. `promoted-regions` leaves region placement fixed and has no selected column count. `table-width` (LH-44) says the grid of `selectedColumns` (the lowest score, or a `grid` composition's own count) gave a table a cell narrower than its words (`TableLayout.minimumWidth` at the starting size), so the container instead placed the table at its natural width (`naturalWidth`, at most 65% of the area) beside a column of the other blocks, or across the whole width between a row of the blocks before it and a row of the blocks after it, whichever scored lower; its `candidates` are the grid's. `split-fill` (LH-71) says two or three automatic blocks took one row or one column (`selectedColumns`) instead of the scored grid because it fills more of the body; its `candidates` are the scored ones. An explicit `columns` or `weights` is never replaced. In one row of automatic blocks a table asks for its natural width (at most 65% of the row) as long as its neighbors keep their fit, and in a `row` composition it takes at least the width its words need. Empty slides have no decisions. Automatic search tries one through `min(slotCount, columns ?? 6)` columns, in ascending order; ties retain the first candidate. Reserved placeholders count as slots. The schema caps an explicit candidate limit at twelve columns.\n\nEach candidate has `columns`, `rows`, `score` and additive `penalties`:\n\n| Penalty | Rule |\n| --- | --- |\n| `cellProportions` | Sum of `abs(log(cellAspect / 1.6))` for descendant leaves |\n| `fontReduction` | Reduction from the role size (28 reference pixels for prose, 32 for lists, 25 for tables) for text-like leaves; current quote/code/metric/timeline layouts sum requested-minus-fitted sizes across their parts, divided by canvas scale |\n| `textOverflow` | 1,000 per overflowing text-like leaf or complete quote/code/metric/timeline payload, regardless of the number of internal failure reasons |\n| `tableOverflow` | 1,000 per table whose shared cell layout overflows: its rows do not fit at the floor (a row is never shorter than its text at the floor plus its insets; LH-44) or a word is wider than its column at the floor |\n| `smallCells` | 100 per leaf narrower than 100 or shorter than 60 reference pixels |\n| `emptySlots` | 2 per unused position in the candidate grid's final row |\n| `narrowMeasure` | 20 per paragraph of four lines or more in a cell narrower than 28 average characters of its fitted size (LH-66) |\n\nScores are preference costs, not quality percentages or guarantees. Floating-point summation can make the component total differ slightly from `score`. Parent scoring uses descendant explicit arrangements or geometric automatic seeds; child automatic grids are optimized only after selecting the parent. Candidate scores therefore describe the bounded search, not a full assessment of the final optimized subtree. Heading fit remains in ordinary diagnostics, outside body-grid scoring. A strict-fit rejection exposes the explanation on `OPFCompositionError` when requested.\n\n`textMeasurement` is `estimated` without a provider and `provided` with one. A provided width function does not establish font provenance, glyph coverage, shaping or native raster fidelity. Text, rich text, lists, quotes, table cells and code in core 0.9 participate in the fit model. Current core 0.11.0 also measures metric and timeline parts; its `unmeasuredPayloads` identifies images, video and charts whose complete internal layout is not assessed. Core 0.8 reports code as incomplete; core 0.9 measures its filename/language/body and insets. Media aspect ratios, chart labels and complete timeline visual density still require inspection. A zero score or empty diagnostics is not proof that those payloads fit.\n\nExplanations expose the search for inspection and do not silently paginate or rewrite a document. Published editor 0.8.0 provides guarded track resizing, block moves, creation/removal and explicit pagination with preview/undo. A general automatic repair loop, automatic weight allocation, complete payload-internal measurement, CLI explanations and a canvas **Auto arrange** preview/undo operation remain open work; the **Arrange** controls below are explicit human adjustments.\n\nWith `overflow: \"warn\"` (default), the result retains all text and returns diagnostics. SVG emits all lines and marks overflowing groups with `data-opf-overflow=\"true\"`; text may extend beyond its box or canvas. Consumers can collect diagnostics using `onDiagnostic`. No overflow is silent (LH-45): a quote, code, metric or timeline part that reaches past its cell (its card, when it has one) is a `text-overflow` diagnostic at the part's path, also when its own layout accepted it in a taller box (a metric laid out at its row's shared height). A quote, code or metric part that finds no usable space at all (its `invalid-part-box` diagnostic) is laid out at the readability floor in the room its cell leaves (`floorFallback`), so the preview and the PPTX export draw it, overflowing, instead of failing (LH-40). With `overflow: \"error\"`, the layout rejects content that does not fit. Shorten the affected content, give it more space, or explicitly split it into another slide. Use the explicit pagination transform below to produce additional editable slides.\n\nThe editor exposes `editor.composeSlide(index)` and `editor.setComposition(index, value)`. The latter validates the change, records JSON Patch history, and supports undo/redo.\n\n## Pagination\n\n```js\nimport { paginateSlide, paginate } from '@openpresentation/opf/pagination';\nconst { presentation, pages } = paginate(deck);\n// Review, save, render, or export `presentation`; pages maps output fragments to source paths.\nconst single = paginateSlide(deck.slides[0], { width: 1280, height: 720, minFontSize: 24 });\n```\n\nPagination is an authoring operation. It produces ordinary OPF slides; previews and PPTX export consume those exact pages. It preserves the input, body order, nested groups, promoted regions, rich-text formatting, and source text characters. Plain text and rich runs split at grapheme boundaries, preferring sentence/paragraph breaks and then word breaks. Lists split between items, tables between rows with column labels repeated, and code splits without rewriting its source. Indivisible payloads remain intact. Existing track weights continue to apply to positions on each resulting page.\n\nThe default readability target is 24 reference pixels. Core 0.8.0 returns slides that persist that floor in `composition.minFontSize`, including an already-fitting one-page result; existing higher minima and strict overflow policies remain intact. Quotes can raise their nominal body/footer sizes to the floor. Current core 0.11.0 enforces the selected floor in shared plain/rich/list/table fitting, including painted rich fragments, while retaining authored style metadata. Unsupported fits report overflow rather than silently capping output below the floor. The [readability-floor checkpoint](plans/readability-floor.md) records the earlier candidate and its bounded-search tradeoffs. Pagination relies on the shared engine's estimates; it is not a guarantee that every host font renders identically. Headings repeat unchanged, speaker notes remain on the first page, and continuation IDs avoid existing deck IDs. `pages[].mappings` records full source/output paths and half-open text or item ranges. Text offsets use UTF-16, so source strings can be reconstructed exactly. Quote bodies split at grapheme boundaries and repeat complete attribution/source fields on each page. An irreducible footer rejects the whole operation, including a quote with an empty body after earlier content.\n\nIf a heading, individual list item, table row, or other atomic payload cannot fit on an otherwise empty page, `OPFPaginationError` returns actionable diagnostics. There is no partial output. `maxSlides` defaults to 100, and a layout-evaluation limit bounds work on pathological input. Specialized chart and timeline internals still require visual inspection; their complete density models remain outstanding.\n\n**Continuation in the export (LH-90).** `continueOverfull(presentation, options)` is the one split the export makes without being asked. A slide whose body is two or more block units (`blockUnits(slide)`: every root block one payload, nothing else to move; a unit starts at each block of the first block's kind and takes the blocks after it, so eight timelines are eight units and a timeline keeps the note that follows it) and that the engines draw with `text-overflow` or `small-cell` at its own readability floor continues on further slides. It is `paginateSlide` with `wholeBlocks: true`: breaks fall only between units, never inside one; page selection first preserves the settled source sizes of comparable automatic body roles (same base font/style, semantic role and authored constraints), including the text actually drawn on arrangement nodes; only then does it minimize page count, with the units spread evenly when every page still fits (eight timelines that fit five to a page are four and four); every page keeps the headings, layout and design (pagination's convention), the speaker notes stay on the first, ids take `--2` suffixes, and a page is bound by the layout as the first is (a moved block gets no region pin, so each page can recompose at the floor). The pages use the slide's own floor without injecting a new minimum. Explicit rich-run sizes/styles, captions and authored minima/maxima stay distinct from the shared automatic-body target. Later pages carry an ordinary `composition.maxFontSize` cap derived from the first page's actual automatic body text, including arrangement labels; the returned OPF recomposes to those evaluated pages. An indivisible unit that cannot retain its required text size keeps the original slide and its fit findings instead of silently setting smaller text. A slide is kept as written when it fits, when a unit does not fit even alone, when its composition is strict (`overflow: \"error\"`, which the engines still refuse) or when `{{deck.slideCount}}` does not settle. The result lists every slide it changed (`continued`: source index, output indices, kind, block indices and units per page, page mappings). The Node export (`convert`, `opf convert`) runs it by default (`paginate: \"blocks\"`) before drawing, so the SVG, PNG, PDF and PPTX draw the same deck, and reports each slide as `render/slide-continued` or `pptx/slide-continued` and in the report field `continued` (one-based). `paginate: true` (`--paginate`) splits every overflowing slide instead; `paginate: false` (`--keep-slides`) draws every slide as written. `toSvg` and `toPptx` draw the deck they are given slide for slide; a host that wants the export's pages calls `continueOverfull` first.\n\n**Continuation in hosts that draw slide by slide (LH-99).** `continuationPages(result, slideCount)` maps a `continueOverfull` result back to the source: `pages[i]` lists the output indices that draw source slide `i` (one for a slide kept as written). The player, `<opf-deck>` and its server markup (`toHtml`) show a continued slide's pages as steps after it, each the export's own page; the editor edits the slide as written and shows the split as a preview (a stacked thumbnail with its page count, a page indicator with a read-only preview of each page on the canvas, and the pages as steps in its presenter). No host shifts a source index: slide numbers, links, selection, `goto(n)` and the editor's slide paths address source slides, and the pages are sub-steps of their slide. Each host can turn it off (`continuation: false`, or `continuation=\"off\"` on `<opf-deck>`). See the opf-render and opf-editor READMEs.\n\nThe editor's `editor.paginateSlide(index)` is one validated transaction with undo/redo. It returns `{change, pagination}`. Editor 0.5.0 commits a one-page readability-policy change too; repeating the operation after the policy is recorded returns `change: null`. The playground includes an overflowing draft and **Split overflow** action. The CLI writes a new file and refuses to overwrite an existing one:\n\n```sh\nopf paginate input.opf.json output.opf.json\n```\n\n## Right-to-left decks\n\nWhen the presentation `language` is written right to left (Arabic, Hebrew, Syriac, Thaana and the other right-to-left scripts) or the host passes `direction: 'rtl'`, `composeSlide` mirrors the composition and reports each paragraph's direction; `SlideComposition.direction` is `'rtl'`. The first column and the `start` region are drawn at the right, banded slide images, cover logos and header/footer zones swap sides, lists put their markers at the right, tables run right to left, and `TextFit.directions` gives the direction of the paragraph each line belongs to. Alignment is logical: the authored `start` is drawn at the right edge of a right-to-left paragraph (`physicalAlignment`). A left-to-right deck composes exactly as before. The rules and the PPTX mapping are in [Layout direction](programs/font-fidelity-everywhere/script-font-model.md#layout-direction-rr-05).\n\nOne rule says which words follow the direction. Layout words and layout coordinates are logical: `start` and `end` in alignments (`titleAlignment`, `contentAlignment`, a caption's `align`, a table cell's `style.align`), header and footer zones, promoted regions, image `placement.edge`, overlay bands (`overlay.edge`), `chartPrimary` and shape anchors, and an overlay shape's `x`, all run from the edge the deck starts on: `start` is the left edge in a left-to-right deck and the right edge in a right-to-left deck. Coordinates and sides that name pixels of a picture or parts of a plot are physical in every language: image focus and image callout coordinates (measured from the picture's top-left), a chart's `legend` and data label `position`, and the `left` and `right` sides of table cell borders and padding and of a shape's padding.\n\n## Fidelity boundary\n\nThe shared engine provides identical body and heading geometry to SVG and editable PPTX export. Text measurements default to deterministic estimates. For actual font advances, pass the same `fonts` handle to every step (see [pass `fonts`, otherwise the estimate](font-fidelity.md#pass-fonts-otherwise-the-estimate)). Complex scripts, fallback fonts, PowerPoint text rendering, rich text, charts, tables, and images still need visual verification. Dynamic composition is not a guarantee of pixel-identical PowerPoint output. Line breaking never splits a number from its unit or `%` (`26 %`, `$4.8 M`, `12 km`, `3 x`, `5 pm`, and the digits of one figure) or a ratio at its slash (`4.6 / 5`, `3/4`, LH-150; a metric value written so is one figure, LH-40) and never starts a line with a closing mark (`. , ; : ! ? ) ]`, a closing quotation mark, their CJK and Arabic forms) or ends one with an opening mark (LH-11, `src/line-break.ts`); the rule reads characters, so it holds for right-to-left and CJK text, and a unit outside its lexicon is bound with a no-break space (U+00A0), which the breaker already keeps whole. Where PowerPoint wraps the text itself (native titles and bodies, table cells) the export writes U+00A0 at the same places (`bindNoBreak`) and import writes the spaces back (`unbindNoBreak`), so PowerPoint breaks where preview does. List density includes rich runs, descriptions and nesting via `fitList`, with the same hanging indents used in preview and export. Only text-like payloads currently receive content-density estimates; small-cell diagnostics also cover non-text content.\n\nSVG embeds raster data URI images locally. Remote and file images require a host resolver that supplies a raster data URI; otherwise they appear as placeholders. `strictAssets` rejects unresolved images. The runtime never fetches them.\n\nSee [the complete example](../examples/technical/dynamic-composition.opf.json) and [local ecosystem verification](ecosystem-development.md).\n\n\n## Preview polish shared by preview and export (RR-07)\n\nThree accepted spec fields used to be drawn plain; core now owns the shared tables so the SVG preview and the PPTX export draw them identically. Consumers import them from `@openpresentation/opf`; none changes geometry, and an older core simply leaves the preview and the export plain, without a new diagnostic.\n\n- **Code syntax colours.** `tokenizeCode(source, language)` returns sorted, non-overlapping token ranges (`keyword`, `string`, `number`, `comment`, `function`, `type`, `property`) over the exact `code.source`; `codeLineRuns(tokens, start, end, source?)` clips them to one accepted source line, so concatenating the runs returns the line unchanged (a tab is always its own plain run). The scanner is deterministic and dependency-free (no network, clock or locale). `code.language` resolves through aliases (`ts`, `tsx`, `py`, `sh`, `yml`, `c++`, `terraform`, and so on) to `javascript`, `typescript`, `python`, `rust`, `go`, `bash`, `json`, `yaml`, `toml`, `ini`, `html`/`xml`, `css`, `sql`, `java`, `csharp`, `kotlin`, `swift`, `ruby`, `php`, `c`/`cpp`, `hcl` and `dockerfile` (`resolveCodeLanguage`, `CODE_HIGHLIGHT_LANGUAGES`); any other language, a missing one, or source over 200,000 characters stays plain. `codeSyntaxPaletteForScheme(colorScheme)` gives one colour per kind from the deck theme (keyword = primary, string = accent, number = secondary; comment, function, type and property are fixed slate, blue, cyan and pink, rotated away from a theme colour they would collide with), each lightened until it is at least 4.5:1 on the #111827 code panel. The renderer nests coloured tspans inside each accepted segment tspan; PPTX writes the same colours as native runs in the same one-text-box-per-line shapes, so editing and import are unchanged. The language is not inferred from `code.filename`. `code.highlight` (1-based source lines and inclusive ranges) adds a band behind marked lines and dims the rest: `codeHighlightLines` resolves it against the source, `codeLineNumbers` numbers each displayed line (a wrapped line repeats its number), `codeHighlightBands` returns the runs of displayed lines to draw behind, and `codeHighlightColors(colorScheme)` gives the band and the marked/dimmed palettes, all at least 4.5:1 on what they sit on. The SVG band is one `rect` per run behind the line text; PPTX writes one native rectangle per run (`OPF code N highlight M`) after the panel and before the line text boxes, so the one-text-box-per-line shapes and the code provenance tags are unchanged.\n- **Metric trend.** A `metric.trend` (`up`, `down`, `flat`) is drawn as one arrow; LH-53: the trend word is not drawn (it was an English word on every slide, a right-to-left one included) and stays the arrow's text alternative and the part's source. Core's metric layout places the arrow (`MetricLayout.trendBox`: square, 0.72 of its line's size, on the baseline, 0.3 of that size before the line) before the delta on one line (\"\u2191 +7 pts\"), or, with no delta, before the label, else the description, else on a line of its own; before means at the reading start, the right of a right-to-left metric. `metricTrendMark(layout, {background})` gives it its shape and color. The arrow is the DrawingML `upArrow`, `downArrow` or `rightArrow` preset at default adjustments (`metricTrendPoints` is the outline the preview draws), colored by the metric's `sentiment`: positive green, negative red, neutral a neutral color, kept at 4.5:1 or more against the slide background (`metricTrendColor`); the delta text takes the same color. `layoutMetric` passes `sentiment` through as `MetricLayout.sentiment` (omitted when the metric has none) and `metricTrendMark` reads it, so the arrow direction always follows `trend` and only the color follows `sentiment`. Absent, the sentiment is the conventional reading of the trend (up positive, down negative, flat neutral), which is the color drawn before `sentiment` existed. A `sentiment` without a `trend` draws no arrow and colors nothing. The arrow carries the alternative text \"Trend: up\" (`aria-label` in SVG, `descr` in PPTX); the arrow carries the direction, the color the verdict.\n- **Pattern fills.** `PATTERN_PRESETS` lists the 54 ECMA-376 ST_PresetPatternVal names and `patternBitmap(preset)` / `patternRuns(preset)` give each as an 8 x 8 one-bit tile, one pixel per 1/96 inch, anchored at the slide's top-left, foreground where a bit is set (`diagStripe` still resolves to `wdUpDiag`). ECMA-376 names the presets but does not define their pixels: the tiles are measured from desktop PowerPoint (Office 365, Windows, 2026-10-01) by exporting each preset as a full-slide background to a 1280 x 720 PNG and voting every pixel into its (x mod 8, y mod 8) cell with opf-render `scripts/derive-pattern-bitmaps.mjs`. Every tile was uniform across all repeats (confidence 1.00) at one image pixel per pattern pixel, so a pattern pixel is one 1/96 inch unit, and the phase is the slide's top-left corner. The tool also reports any tile that later differs. PPTX already wrote every preset as native `a:pattFill`.\n\n## Metric internals (published coordinated packages)\n\nPublished core 0.11.0 exports `layoutMetric(value, box, options)` from `@openpresentation/opf/composition` (the package root no longer exports engine names). It accepts a finite number, string, or `{value, unit?, label?, description?, delta?, trend?, sentiment?}`. Renderer 0.9.0, editor 0.8.0 and PPTX 0.9.1 consume its shared geometry for composition, atomic pagination, preview, editing and export. Core 0.9.0 predates this API. The [primitive checkpoint](plans/shared-metric-layout.md) and [source integration checkpoint](plans/shared-metric-integration.md) record its development; current pins and remaining native/font gates are in the [compatibility matrix](compatibility-matrix.md).\n\nPass the allocated reference-pixel `box`, resolved heading/body `fontFamilies`, `textMeasurement`, canvas `scale`, effective `minFontSize`, source `path` and optional `overflow: 'error'`. `metric-flow-v1` returns separate value/unit/label/description/delta/trend parts in that order. Numeric zero is visible; scalar values keep the scalar path. Every provided field retains its original string or number in `sources[].value`. Source ranges address `String(value)` using UTF-16 offsets; the original spelling of a numeric JSON token is not available. No locale formatting, trend icon, case conversion or separator is invented. Empty optional strings retain source mappings with `visible: false`; the required empty value keeps a targetable blank line.\n\nThe allocator tries an adjacent value/unit baseline when both fit one line and the unit uses at most 35% of the cell width; otherwise it stacks the fields. Metadata has an eight-reference-pixel gap, with twelve pixels after the primary row. Related fields stay together rather than being separated by a percentage of the cell height. The value starts at up to 76 reference pixels (28% of cell height); label/unit/delta start at 23, description at 20 and trend at 18 (the trend part is not drawn, LH-53; its arrow sits before its host line, which is measured that much narrower). LH-53: a unit beside its value is drawn at 60% of the value's size (`METRIC_UNIT_SHARE`) on its baseline when that still fits, so \"18 %\" reads as one figure. A candidate with more reduced metadata replaces an earlier one only when it scores a whole reference pixel better, so on a near tie the label keeps its size and the value gives way. `display` (LH-112) and `band` (LH-15) are the options composition passes a metric beside other blocks (above). Every requested size is raised to the chosen floor, scaled once. Natural metadata height gets space before reducing type. At most 48 arrangements are evaluated, each with at most 77 value-size trials; identical inputs and a deterministic measurement provider select the fitting candidate with least summed font reduction, preferring the first candidate on ties.\n\nEach part exposes requested/resolved styles and the same source-preserving line/segment representation used by code (`CodeTextFit`), measured with proportional heading/body fonts. CR/LF/CRLF, tabs, whitespace and grapheme boundaries remain exact. Consumers must reuse accepted line and segment positions, font sizes and styles rather than independently re-fit or normalize text. This API reports `provided` measurement when a provider is passed, without claiming that its glyph coverage or shaping is complete. Unsupported glyphs propagate the provider's error with the field path.\n\nLH-137: `deltaPill: true` (composition passes it under the guarded rule `delta-pill`) draws the delta and its trend arrow in a pill, as Claude Design draws a change: beside the value's line (after the value and an inline unit in reading order, its middle `METRIC_PILL_RISE`, 0.36, of the value's size above the value's baseline; the value and pill are one line placed by the alignment) when every field keeps the size it has without the pill, else above the value (its lead) when every field keeps it there, else in its place without a pill. A tile and a band keep their delta in place, and LH-83's automatic grid at the floor draws no pill (the room a pill frees there would decide between the layout and the grid). The pill is inset `METRIC_PILL_PAD_X` (0.55) and `METRIC_PILL_PAD_Y` (0.2) of the delta's size around its one line and arrow; `MetricLayout.deltaPill` `{box, radius, placement}` says where. Sibling metrics draw their pills one way: when one has its pill above, a sibling with its pill beside takes it above too where that keeps its sizes. Engines fill it with core `metricPillFill(backdrop, text)` (the backdrop moved toward the text color, as a table's banded row is, `surfaceAltColor`) under the delta and color the delta and arrow against that fill; the PPTX export writes a native rounded rectangle tagged into the metric's group (role `pill`), consumed on import with the trend arrow.\n\nLH-68: `tile: true` lays the metric out as a tile of its whole box, as a layout region with `metrics: \"tile\"` asks: the label first as an eyebrow, the value under it starting at `METRIC_TILE_VALUE_SHARE` (a quarter) of the box's height, between its 76 px role size and twice it, a stacked unit under the value, and the description, delta and trend at the foot of the box. Pass the start alignment with it. `minimumSizes` (by role, canvas pixels) is where each role starts at least and stops fitting; composition passes a tile the sizes its metric fitted at as a stack, so a tile never shrinks a role, and a slide whose tiles would still cost a size or a finding keeps its stacks.\n\nPass `align: 'left' | 'center' | 'right'` (default left) to the primitive. Its returned `alignment` and per-part `linePositions` give an absolute x origin and baseline for each `fit.sourceLines` entry, including blank lines. An inline value/unit pair moves together, with the gap following the actual value advance. Composition accepts host-resolved `contentAlignment`; an explicit slide `design.contentAlignment` overrides it. Renderer/export/pagination pass the effective design into the same operation. Alignment does not trigger a second font fit.\n\nCheck `overflow` before consuming parts. Irreducible text, invalid available space, parts outside the cell and overlapping occupied line boxes return field-specific diagnostics; strict mode throws `OPFCompositionError`. Invalid available boxes retain their dimensions and have no fit, unless `floorFallback` asks for a fit at the readability floor (LH-40). These are advance-based line rectangles, not glyph outlines: the controlled browser evidence separately records small glyph overhangs. The API is a bounded internal allocator, not the complete layout-repair/Auto arrange operation or a native export fidelity guarantee.\n\nCurrent `grid-score-v9` retains the metric scoring introduced by `grid-score-v4`: every metric part contributes font reduction, with one overflow penalty per failing metric leaf. `item.metricLayout` is measured against the rounded accepted cell; `item.text`/`item.textStyle` alias the value fit/style. Field diagnostics obey strict ancestor policies, while explicit modes/weights/regions remain authoritative. Metrics are excluded from the advance-model `unmeasuredPayloads` list. Explicit pagination retains metrics atomically with complete source types/metadata and rejects irreducible fields without returning partial output. The published train has installed-package acceptance, including metric provenance controls. That evidence does not establish native raster or font equivalence.\n\n## Code internals (core 0.9.0 and coordinated packages)\n\nCore 0.9.0 introduced `layoutCode(value, box, options)` for the schema's string shorthand or `{source, language?, filename?}` object. It returns measured filename/language/body parts with exact original text, requested/resolved styles, readability floors, available boxes and diagnostics. Its original integration targeted renderer/PPTX 0.7.0 and editor 0.6.0; the [release checkpoint](plans/shared-code-release.md) records that rollout. These contracts were included in the core 0.11.0, renderer 0.9.0, PPTX 0.9.1 and editor 0.8.0 train; current pins are what `node scripts/registry-plan.mjs` prints. Core 0.8.0 predates this API and retains the [recorded code-label, filename and whitespace defects](plans/layout-repair.md).\n\n`grid-score-v3` charges code font reductions across all metadata/body parts and one overflow penalty per failing leaf. It preserves explicit modes, weights, regions and source order. Accepted `item.codeLayout` is fitted to the same rounded cell exposed as `item.box`; `item.text` and `item.textStyle` alias the body, not the first metadata part. Strict ancestor settings apply to internal `.source`, `.filename` and `.language` diagnostics. Code no longer appears in `explanation.unmeasuredPayloads`, which concerns the core advance-based model only. It does not mean browser/native fidelity is verified.\n\nPagination slices the code body at grapheme boundaries, repeats filename/language and returns contiguous UTF-16 body ranges while preserving all source bytes and the evaluated readability floor. Irreducible metadata rejects all output, including when the body is empty or earlier content could have fitted. Consumers must preview/export the returned document. The [integration checkpoint](plans/shared-code-integration.md) separates source, installed browser, Windows PowerPoint and remaining release gates.\n\nEach fitted part retains every space and explicit CR/LF/CRLF break. `fit.lines` contains exact source slices, and `fit.sourceLines` records half-open UTF-16 `start`, `end` and `nextStart` offsets, the measured width and a `soft`, `hard` or `end` boundary. A hard break occupies `[end, nextStart)`; soft wrapping consumes no source character. Joining `part.text.slice(line.start, line.nextStart)` reconstructs the original part. Blank lines and a final empty line are retained, and long tokens split only at grapheme boundaries. Filename and language text are not case-converted. An absent/empty metadata pair creates a generated `code` label with no source range.\n\n`code-flow-v1` returns `bounds`, the panel the code needs at the allocated width (the insets around the metadata and the source lines, at most the cell); a composed slide draws the code panel at `bounds`, top-anchored, when the code is shorter than its cell. It uses 18-reference-pixel outer insets, an eight-pixel gap between filename and language, and a twelve-pixel gap before the body. Nominal metadata/body sizes are 14/22 reference pixels (WI-4: the body was 18), raised when necessary to respect the selected minimum, then scaled once. At most four metadata nominal/floor combinations are tried; each body fit tries at most 19 sizes regardless of canvas scale. The fitting combination with least font reduction wins. Irreducible metadata/body failures retain all text and diagnostic paths; invalid available boxes have no fit (a fit at the readability floor with `floorFallback`, LH-40). `overflow: 'error'` rejects rather than returning partial output.\n\nTabs remain literal characters in part text and displayed-line slices. Measurement advances to the next multiple of four measured spaces from that line's origin; `fit.tabSize` and `fit.tabWidth` expose the rule. Each source line's `segments` contains exact text/tab source ranges plus measured `x`/`width` values relative to its origin. Consumers must reuse those positions: an Edge probe showed that SVG treats a tab as one space despite CSS `tab-size: 4`. The published SVG renderer uses positioned spans and geometric precision; native export uses accepted tab stops. Width measurements and source preservation alone do not establish glyph-outline containment, shaping/bidi support or native fidelity. Installed workflow evidence records the separate actual browser and native checks with their exact font/runtime scope.\n\nPublished native export stores source boundaries in standard PowerPoint shape tags. Complete unique groups recover exact code/source metadata, with current native text taking precedence. Missing, damaged or ambiguous groups retain visible native shapes and report diagnostics. Reimport does not reconstruct native formatting, positioning, font theme or readability policy. Eight installed-export wide/portrait slides pass native edit/save/reopen and all 24 original/saved/edited imports on the recorded Windows PowerPoint build; this is not arbitrary PowerPoint round-trip or pixel equivalence. The editor preserves untouched CRLF/CR source around edits and keeps committed preview geometry separate from its active native textarea caret.\n\nThe JSON schema can accept strings that [XML 1.0 cannot represent](https://www.w3.org/TR/xml/#charsets). Published SVG/PPTX code output rejects forbidden controls, unpaired UTF-16 surrogates, U+FFFE and U+FFFF with `invalid-code-text`, the source field path and UTF-16 offset in the message. The input stays unchanged; the caller can correct that character explicitly. Tabs, CR/LF/CRLF and valid supplementary characters remain accepted for serialization. Schema support, format representability and glyph coverage are separate properties.\n\nThe controlled SVG harness requests `text-rendering=\"geometricPrecision\"` as well as explicit segment placement. Initial Linux Chromium CI rounded glyph advances under default hinting, unlike Windows Edge with the same font bytes. The [SVG specification](https://www.w3.org/TR/SVG/painting.html#TextRenderingProperty) defines geometric precision as a rendering hint, so consumers still need actual browser checks with their exact fonts and supported environments; the hint alone does not certify agreement. The harness retains a 0.1-reference-pixel tolerance and records observations before assertions.\n\n## Quote internals (core 0.8.0 and coordinated packages)\n\nCore 0.8.0 exports `layoutQuote(value, box, options)` from the `@openpresentation/opf/composition` entrypoint. Pass validated quote content (object or string shorthand), its allocated reference-pixel box, resolved `fontFamilies`, `textMeasurement`, `scale` (canvas short edge / 720), effective `minFontSize`, `overflow` policy and its source `path`.\n\nThe result contains `parts` for the body and any nonempty footer, exact display `text`, source mappings, requested and resolved text styles, and the available boxes/fits. Source ranges use half-open UTF-16 offsets in both the source field and display string; generated quotation marks and the footer separator have no source range. The original content is never modified. A supplied width provider is reported as `provided`; it does not certify shaping or font fidelity.\n\nCheck `overflow` and `diagnostics` before accepting the parts. Invalid available dimensions remain visible with `fit` absent (a fit at the readability floor with `floorFallback`, LH-40), and `overflow: 'error'` throws `OPFCompositionError`. Diagnostics distinguish invalid part space, parts outside their cell, text that exceeds its reserved space, and overlapping line rectangles. Those rectangles are conservative text-layout bounds, not measured glyph outlines. The readability floor is scaled once and can raise the nominal body (28) or footer (17) size; it is never silently capped below the selected floor.\n\n`quote-flow-v1` asks for a 40-pixel body (it fits down through 28 pixels to the readability floor; LH-78: `bodySize` sets another start, and `bodyLines` steps the start down until the body takes at most that many lines, never below 28 pixels) wrapped in the quotation marks of the deck language (`options.language`, a BCP-47 tag: \u201C\u2026\u201D for English, \u201E\u2026\u201C for German, \xAB\u2026\xBB for French and Spanish, \u300C\u2026\u300D for Japanese, ASCII only for a language the table `QUOTE_MARKS` does not list; every mark is one UTF-16 code unit, so the body's source range starts at offset 1). It keeps 18-reference-pixel outer insets and an 18-pixel body/footer gap while fonts scale with the canvas. A 40-pixel footer is a whitespace preference. The allocator expands it for long sources or compacts it for dense bodies, trying at most the nominal and minimum footer sizes and selecting the fitting pair with least total font reduction. If neither fits, it returns floor-size failure diagnostics. This is a bounded internal allocation step, not a complete layout-repair engine.\n\n`composeSlide` scores both parts and accepts geometry against the final rounded item box. Each quote item carries `quoteLayout`; its compatibility `text` field is the same fit object as the quote body, including generated quotation marks. Consumers needing original offsets must use the explicit `sources` mappings. The coordinated renderer and PPTX consume these parts without another measurement/style-resolution pass. Missing geometry rejects rendering/export rather than omitting content; a part with no usable space reaches them laid out at the readability floor (LH-40), so they draw it, overflowing, beside its diagnostic. This requires core 0.8.0 with renderer/PPTX 0.6.0; older core 0.7.0/renderer 0.5.1/PPTX 0.5.2 lack these changes. The complete published set, immutable verification refs and fresh registry evidence are recorded in [the release plan](plans/shared-quote-release.md).\n\nBrowser glyph bounds can extend slightly beyond advance-based part boxes into the reserved inset. Current loaded-font tests record those overhangs, verify glyph containment inside the full quote cell and check body/footer separation. Native PowerPoint fixtures separately verify text, sizes, cell containment, save/reopen and reimport. Neither test establishes universal pixel equivalence. Original requested-font provenance through host substitutions and non-quote payload internals remain open requirements.\n\n### Quote role and photo (FA-12)\n\n`QuoteContent` also takes `role` and `photo`. The footer text is the attribution, then `role` after a line break, then `source` after an en dash (` \u2013 `); each field keeps its own source mapping (`<path>.role`). Without a `role` the footer text is unchanged. A `photo` (an `Asset` value) adds `QuoteLayout.photo`: `{path, value, box, shape}`, where `shape` is the circle mask of `imageShape('circle', box)` (DrawingML `ellipse` and the same outline as an SVG path). The diameter is three times the footer font size and the gap beside it three quarters of that size, so the allocator picks the footer size (nominal or the readability floor) with the photo in the footer height and the footer text in the remaining width. The photo sits at the start edge of the inset area: the left, or the right when `options.direction` is `rtl`, where the footer text is its mirror. The text block is centered on the photo. A photo whose height cannot fit at the floor adds the `photo-fit` diagnostic reason (and `overflow`); a photo with no footer text still draws. Without a photo `layoutQuote` returns exactly what it returned before, with no `photo` key. The renderer and the PPTX exporter draw `photo` from the result and do not recompute it.\n\n## Timeline internals\n\n`layoutTimeline(value, box, options)` (`timeline-flow-v1`) places an optional name and description, then the events as a marker on a connector with each event's `when`, `what` and `description` as separate text parts. It has three arrangements, tried from the role sizes down to the readability floor (at most 100 candidates in all), and keeps the first that fits or the one with the fewest diagnostics:\n\n- `band` (LH-41): one horizontal connector, each event one spacing (`box.width / events`, less a gutter) wide, its `when` as an eyebrow above the marker and its `what` and description below. This is the horizontal arrangement whenever every `when` and `what` fits its spacing on one line.\n- `alternating`: labels alternate above and below the connector, each up to two spacings wide, for a `when` or `what` wider than one spacing (or a band whose labels would break inside a word).\n- `vertical`: a marker rail down the start edge with the labels beside it, tried first when an event's spacing is under 8 ems of the label size. Right-to-left decks put the rail on the right edge.\n\nA horizontal timeline centers its whole block (name, description and labels) in the box. `TimelineLayout.bounds` is what the drawn timeline covers (parts, markers and rings), so its height is the height the timeline needs; composition measures a timeline with it, label bands included, and stacks it like text (`MEASURED_FIELDS`).\n\n**Several timelines in one region (LH-41).** A template region whose blocks are all timelines draws them as a stack of bands, whatever its `flow` or the design's `contentDirection`: one column while the stack fits at the readability floor with every band at least 56 reference pixels tall, otherwise two columns (in reading order, each row as tall as its taller band, an odd last band spanning both) when that overflows less. The stack sits in the middle of the region (at the bottom in a region anchored there), the bands share the region as stacked text does (`shareHeights`) and every band is set at the size the most squeezed one fits at. A band of a stack never turns vertical (`horizontal`), sits at the top of its box and sets its name and description at its start edge. With four or more timelines the bands are compact (`compact`: name 20, `what` 18 and the rest 16 reference pixels; each `when` and `what` on one row below the marker when every pair fits; the description beside the name when every band's pair fits). A stack that does not fit at the floor reports `text-overflow` for the parts outside their band. A lone timeline in its region grows its type by up to 4 reference pixels when it still fits in the same arrangement (`sizeOffset`).\n\n### Event status (FA-11)\n\n`TimelineEvent.status` is `done`, `current` or `planned`. It is a progress state that the engines draw from the deck's own colors without judging it; schedule health (at risk, blocked) is deliberately not a status. Layout copies the status to `TimelineLayout.markers[i].status` and to each of that event's text parts (`TimelineTextPart.status`), and `timelineMarkerShapes(marker, colors)` and `timelineTextColor(part, colors)` turn it into the shapes and text color that both engines draw:\n\n| Status | Marker | Text |\n| --- | --- | --- |\n| absent | A filled circle in the primary color. | Normal text color. |\n| `done` | The same filled circle, so it looks like an event without a status. | Normal text color. |\n| `current` (\"we are here\") | The filled circle inside a ring: a circle 1.6 times the marker's radius with a primary-color outline over the slide background. | The label (`what`) is bold, in the normal text color. |\n| `planned` | A hollow-looking circle of the marker's radius: a primary-color outline filled with the slide background. | All of the event's text is the muted secondary text color. |\n\n- **Geometry.** A marker's `radius` is the radius of its ellipse, for every status. A `current` marker also has `ring.radius`, exactly 1.6 times `radius`, and a `current` or `planned` marker has the `strokeWidth` of its outline (2 reference pixels at 720, at most half the radius). The drawn and exported ellipses have exactly these radii, so every ellipse of a deck has the same size for the same radius (a done, planned and unset marker are the same size); an outline is centered on its ellipse's edge and reaches half a stroke beyond it, and the cell check and the vertical rail count that half stroke. A ring that leaves the cell is reported as a `event-space` diagnostic like any marker. In the vertical arrangement a deck with a `current` event moves the rail and the text out by the ring's extra width so the text keeps its usual distance from the marker. Events without a status produce exactly the geometry and no extra keys they did before.\n- **Hollow means background-filled.** The outline of a hollow marker and the ring are drawn over the slide background color (in the SVG as the fill, in PPTX as a solid fill of the same color) so the connector does not cross them.\n- **Colors.** `timelineTextColor` returns `mutedText` for a planned event, lightened or darkened until it reaches 4.5:1 against the slide background (`TIMELINE_TEXT_MIN_CONTRAST`), and the normal text color otherwise. Outlines and rings are kept at 3:1 (`TIMELINE_OUTLINE_MIN_CONTRAST`); the filled marker keeps the primary color exactly.\n- **Bold label.** The weight is part of the layout, not a drawing detail: the `what` part of a `current` event is requested at weight 700, so line breaks and heights were measured bold.\n- **Progress and status words (LH-121).** `TimelineLayout.progress` is the part of the connector from the first event to the\n `current` one (to the last `done` one when none is current; absent when no event is done or current); both engines draw it in the\n primary color over the border-colored connector. With `statusWords` (composition sets it under the size guard, where localized words are available)\n each event with a status gets a localized word under its label (`timelineStatusWordsFor`, English `TIMELINE_STATUS_WORDS`) at 16 reference\n pixels, in `TimelineLayout.statusLabels`: generated text with no `sources`, never in `parts`. `timelineTextColor` sets the current\n event's word in the primary color and the others muted, at 4.5:1. A timeline that would set its labels smaller to make room keeps\n them and draws no words; a deck without a supported translation keeps the status in its markers and progress.\n- **PPTX.** The marker is a native `ellipse` (solid primary fill for `done`, `current` and no status; background fill plus a primary line for `planned`), the ring is a second native `ellipse` (background fill plus a primary line), the bold label is a bold run, and planned text takes the muted color. The exporter records each event's status in the marker's `OPF_TIMELINE_V1` tag and the ring in a tag of its own, and the importer restores `status` from them; a deck whose marker or ring was edited away imports as ordinary text without status, like the rest of the timeline provenance. The progress line is a second native `line` (`OPF timeline <group> progress`) and each status word a text shape tagged `status`; import consumes both and reads the status from the markers. Status is also written in Markdown as a task-list prefix on the event line: `[x]` done, `[>]` current, `[ ]` planned.\n\n## Resizing in the preview\n\nChoose **Arrange** in the editor to reveal track dividers. Drag a divider to redistribute the space between adjacent columns (row/grid) or rows (column), including nested groups. Arrow keys make small changes; Shift makes larger changes. Escape discards a pointer draft. One drag creates one undo step, and no content is removed. Strict overflow rejects a resize that violates its fit constraints.\n\nResizing an automatic layout makes its chosen columns explicit as `mode: grid` with `columns`. This prevents the number of columns from changing under the pointer. The adjacent share clamps to 5\u201395%, with positive schema-valid weights. Other track proportions and unrelated document fields remain intact. Promoted regions retain their positions; their nested groups can still be resized. A v2 template\u2019s region grid is changed by editing the template\u2019s `columns` and `rows`. Flows with more than twelve tracks need grouping before the current resize controls can express all weights.\n\n`createCanvasEditor(container, {layoutEditing: true, ...options})` enables dividers initially. `canvas.setLayoutEditing(boolean)` toggles them, and `canvas.commit()` / `canvas.cancel()` also handle an active resize. `onDraft` receives the proposed document; the session stays unchanged until commit. Changes to the resized container cancel a stale draft; unrelated updates are retained.\n\nThe shared engine exposes `geometry.flows`: each flow has its container path, content box, resolved column/row tracks (offset and size), clamped gap, effective composition, item count, and reserved slot count. This is renderer geometry, not new OPF document fields.\n\nAgents can prepare the same guarded change without a DOM:\n\n```js\nimport {prepareTrackResize} from '@openpresentation/opf-editor/layout';\nimport {resolvePresentation} from '@openpresentation/opf-render/svg';\nconst geometry = resolvePresentation(editor.presentation, { fonts }).slides[0].geometry;\nconst flow = geometry.flows.find(flow => flow.path === 'slides.0');\nconst prepared = prepareTrackResize(editor.presentation, flow, 0, 0.65);\n// Boundary 0: give the first track 65% of the adjacent pair's combined space.\n// Preview prepared.presentation with the same renderer and fonts handle before applying.\neditor.applyPatch(prepared.patches, {rejectInvalid: true});\n```\n\nThe patch contains a `test` guard for the container before changing its composition. Failed tests do not mutate the document or its history. A test-only patch is read-only. Rendering is preflighted by the canvas; headless callers should likewise render a candidate to enforce font and overflow constraints.\n\nVerification: editor layout model tests, `/layout-tests.html` browser keyboard checks and trusted-pointer specimens, and `pnpm test:layout` for measured SVG/native PPTX coordinate parity. Shape-coordinate checks do not establish PowerPoint raster pixel parity.\n\n\n## Reordering and moving blocks\n\nIn **Arrange**, drag a numbered block handle to reorder siblings. The insertion marker shows the destination; the shared renderer reflows the slide after drop. Arrow keys on a handle move the whole block earlier or later. Click a handle for **Earlier**, **Later**, or an explicit destination and insertion position. The destination menu supports existing groups and block-based slides, including moving a child out of a group or moving a whole group to another slide. `canvas.openBlockMenu(path)` opens the same controls programmatically.\n\nA move preserves the entire block and its nested content, formatting, data, and references. Parent composition weights describe positions, so they stay in place. Moving to another container can change the block's inherited design and readability constraints; the canvas renders the candidate before committing it. Strict overflow or an unavailable required font rejects the move. A move cannot leave an empty block container or put a group inside its own descendants. Move the group or add another block first when the source has only one child.\n\n```js\nimport {prepareBlockMove, listBlockContainers} from '@openpresentation/opf-editor/layout';\nconst containers = listBlockContainers(editor.presentation);\nconst prepared = prepareBlockMove(editor.presentation,\n '/slides/0/blocks/0', '/slides/0/blocks/1', 1);\n// Insert the first block before child 1 of the second block's group.\n// Destination indexes refer to the document before removal.\n// prepared.path reports the moved block's address after any index shifts.\neditor.applyPatch(prepared.patches, {rejectInvalid: true});\n```\n\n`prepareBlockMove` returns `{presentation, patches, path, changed}`. It validates the complete result and emits guarded remove/add patches, so the editor or CLI can apply it atomically. No-op moves return `changed: false` and no patches. `listBlockContainers(presentation, {slideIndex})` optionally limits discovery to a single slide and excludes arbitrary extension data. Headless callers should render the candidate with their intended font provider before applying. The browser and installed-package block harnesses exercise nested moves, undo, stale menus, keyboard access, strict-fit rejection, and native drag reordering.\n\nCreation and deletion use the same layout engine: insertions can normalize implicit payloads into explicit blocks; deletions prune empty groups while retaining the slide. Existing track weights stay positional. See the [editor creation guide](live-editor.md#create-duplicate-and-delete-content) for the guarded APIs and canvas controls.\n\n### Localized timeline status words\n\nGenerated words are available for Arabic, Chinese (Simplified and Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian and Vietnamese. Regional variants share these vocabularies. `timelineStatusWordsFor(tag)` returns the words, or `undefined` for an unsupported language.\n\nThe words are engine vocabulary from `spec/reference/engine-vocabularies.json`, shared by SVG and native PPTX. They appear only when the guarded rule keeps the source labels at least as large. Unsupported generated translations omit the words while preserving the event statuses, markers, progress and authored event text. Put any precise local wording or schedule-health explanation in `what` or `description`. See [the French example](../examples/technical/localized-timeline.opf.json).\n\n### Proportional timeline periods\n\nSet a timeline event's positive numeric `duration` to draw consecutive periods at their relative lengths. All events use the same unit: `[{ \"when\": \"Week 1\", \"what\": \"Discover\", \"duration\": 1 }, { \"when\": \"Weeks 2\u20135\", \"what\": \"Build\", \"duration\": 4 }]` gives the second range four times the first. An omitted duration is one unit. `when` stays display text; OPF never guesses a duration from localized date labels. With no duration anywhere, the existing milestone layout is unchanged.\n\nThe shared composition geometry draws horizontal or vertical ranges in reading order. Labels use a balanced readable track with native leader lines to their actual ranges, so a short period never forces its text smaller; portrait timelines can use the height of the body. Both SVG and PPTX draw the same range rectangles; PPTX text and ranges remain native shapes. A period too short to draw visibly, or a timeline with too much label text, reports `opf/text-overflow` rather than changing its length or dropping words. Enlarge the timeline or split its events. Zero, negative, nonnumeric and nonfinite durations are invalid; ratios beyond finite layout precision are refused explicitly.\n\nPPTX import preserves the explicit numeric durations and reads edited labels from current native text. A native geometry or formatting edit reports timeline reflow; it does not infer new durations from dragged rectangles. Markdown uses a lossless embedded block when a timeline contains durations, preserving the values without an ambiguous date grammar. Conversions to text, lists or tables explicitly report that numeric periods are lost. See [the runnable example](../examples/technical/duration-timeline.opf.json).\n"
94
94
  },
95
95
  {
96
96
  "slug": "ecosystem-development",
@@ -138,7 +138,7 @@ var docsData = Object.freeze([
138
138
  "slug": "format-card",
139
139
  "file": "docs/format-card.md",
140
140
  "title": "OPF format card",
141
- "markdown": '# OPF format card\n\nA self-contained authoring reference for agents and humans writing `*.opf.json` documents, sized for pasting into a model\'s context. The canonical contract is the JSON Schema (`https://openpresentation.org/schema/opf/v1`, in [`spec/schemas/opf.schema.json`](../spec/schemas/opf.schema.json)); this card compresses it. Validate with `validate` from `@openpresentation/opf` or `opf validate <file>` ([validate](validate.md)); treat the deck as done only when `opf validate <file> --fail-on warning` passes, since an unknown layout id is only a warning. `v1` in the schema id is the pre-1.0 line, which changes across 0.x releases ([schema versioning](schema-versioning.md)).\n\n## Document shape\n\nA presentation is one JSON object; only `slides` is required.\n\n```json\n{ "name": "Minimal Deck", "slides": [{ "title": "Minimal Deck" }] }\n```\n\nOptional top-level fields, grouped:\n\n- Identity: `name`, `description`, `filename`, `author`, `organization`, `speaker`, `tags`.\n- Intent (used by AI generation): `audience`, `purpose`, `tone`, `language`, `narrative`, `takeaway`, `duration`.\n- Appearance: `design` (`theme`, `colorScheme`, `fontScheme`, `dimensions`, `background`, `variant` (from core 0.23.0: `"dark1"` or `{ background, accents }`, a map over the one color scheme), `logo` override, `watermark`, `header`, `footer`, alignment hints), `variables`; logos themselves live on `organization`.\n- Resources: `assets` (registry referenced as `asset:<id>`), `datasets` (shared data tables that charts and tables name with `dataset`), `icons` (deck-local SVG icons named by `icon`), `references` (the sources text runs `cite`), `catalogs` (the records the document embeds, grouped by catalog: `default`, `custom` and named groups with a `source`).\n- Templates: `template: true` marks an incomplete deck whose `variables` are filled later.\n- Machine state: `extensions` (preserved, never rendered).\n\n## Slides and content\n\nA slide carries `title` / `subtitle` / `tag` / `notes` / `section` / `beat` / `layout` / `id` / `language` (when it differs from the deck\'s) / `hidden` / `extensions` plus content in one of three shapes \u2014 pick the loosest that says what you mean:\n\n1. **Root payload** \u2014 content-kind fields directly on the slide. The kind is inferred from the field: `text`, `items` (list), `bullets`, `image`, `video`, `chart`, `table`, `code`, `metric`, `quote`, `timeline`, `diagram` (Mermaid, Graphviz DOT or PlantUML source). Several kinds at the root are shorthand for `blocks`.\n2. **`blocks`** \u2014 an ordered array of payloads when placement should stay engine-inferred. A block is a leaf payload or a **group**: `{ "type": "group", "blocks": [...], "composition": { ... } }`. Groups nest (hard cap 32; stay \u2264 3 in practice) and cannot mix `blocks` with leaf fields.\n3. **Promoted regions** \u2014 a 3\xD73 grid when position matters. Rows `top|middle|bottom`, columns `start|center|end`, spans with `+`, intersections with `:` \u2014 `"start"`, `"center+end"`, `"top:start"`, `"middle+bottom:center+end"`. Keys must not overlap; regions cannot mix with a root payload.\n\nDirection: layout words are logical. `start` and `end` (region columns, `titleAlignment` and `contentAlignment`, a caption\'s or table cell\'s `align`, header and footer zones, image `placement.edge`, `overlay.edge`, `chartPrimary`, shape anchors, an overlay shape\'s `x`) follow the deck\'s direction: `start` is the left edge in a left-to-right deck and the right edge in a right-to-left deck. Coordinates and sides that name pixels of a picture or parts of a plot are physical in every language: image `focus` and `callouts`, chart `legend` and `dataLabels.position`, and the `left` and `right` sides of cell `borders` and `padding` and of a shape\'s `padding`.\n\n`composition` (on a slide or group) arranges children: `{ "mode": "auto|grid|row|column", "columns": 1-12, "weights": [..], "gap": 0-0.1, "padding": 0-0.2, "minFontSize": 8-32, "maxFontSize": 8-200, "overflow": "warn|error" }`. Weights are relative track sizes; gap/padding are fractions of the canvas short edge; the font sizes are reference pixels at a 720-pixel short edge. Engines own the placement of content: a block has no x/y.\n\nOnly what is drawn over the composed slide is positioned. A slide\'s `shapes` holds overlay shapes and connectors: `{ "shape": "ellipse", "x": -0.06, "y": -0.1, "width": 0.22, "height": 0.39 }` (signed fractions of the slide, never percents or pixels, up to 8 slides wide or tall; a shape may hang over an edge, and one with nothing on the slide is the warning `opf/shape-off-slide`) or `{ "shape": "wedgeRectCallout", "text": "New", "at": { "block": "<id>", "edge": "top" } }` (it follows the block; sized by `width`/`height` as fractions of the block or `widthPx`/`heightPx` in reference pixels). An image object takes `callouts`, text panels placed by fractions of the picture.\n\nPayload notes: chart (never the Chart.js `categories`/`series`/`labels`/`datasets` shape; the first column holds the labels, each further column is one series) is `{ "type": "<chart-type id>", "data": { "columns": [...], "rows": [...] } }` or `{ "data": { "dataset": "<id>" } }`, with optional `legend`, `dataLabels`, `axisTitles`, `colors`, `highlight` and explicit `referenceLines` (`[{ "value": 0.25, "label": "Target 25%" }]` on a column, bar, line, line-with-markers, area or combo chart, not (yet) a stacked one; another type is the error `opf/chart-reference-unsupported-type`; a title never creates one); table rows may hold scalars, `TextRun[]`, or styled cells `{ "value", "style": { "fill", "color", "align", "borders", ... }, "colSpan", "rowSpan" }`; `metric`/`quote`/`code` accept string shorthand; list nesting uses `level` on items, not nested payloads.\n\n## Rich text and color references\n\n`text`, list items, bullets, and table cells accept `TextRun[]`: strings or `{ "text", "bold", "italic", "underline", "strikethrough", "color", "fontSize", "fontFamily", "code", "language", "link", "superscript", "subscript", "cite", "footnote" }`. `fontSize` is in points (12 points is 16 reference pixels), the one size in OPF that is not in reference pixels; an unknown key in a run is an error.\n\nEvery content color field (`TextRun.color`, table cell `style.fill` / `style.color`, cell border `color`) accepts four forms:\n\n- Literal hex: `"#0F172A"`, `"#B42318CC"`.\n- A color-scheme name, resolved through the effective scheme: slots `accent1`\u2013`accent6`, `dark1`, `dark2`, `light1`, `light2`, `hyperlink`, `followedHyperlink`, or roles `primary`, `secondary`, `accent`, `background`, `surface`, `surfaceAlt`, `text`, `textSecondary`.\n- A color made lighter or darker: `{ "color": "accent1", "lighten": 0.4 }` or `{ "color": "#1E40AF", "darken": 0.25 }`.\n- A variable reference `var:<id>` into the top-level map: `"variables": { "risk": "#B42318" }` (or `{ "type": "color", "value": "#B42318", "description": "..." }`).\n\nPrefer names and variables over hex \u2014 they survive re-theming. Unknown `var:` ids warn, never error. The styled cell and border color fields enforce these forms at the schema level; run colors tolerate any string (unrecognized values warn and renderers fall back to the theme), so imported decks keep validating.\n\n## Ids and extensions\n\n`id` is optional on slides and on any content payload (including groups), unique document-wide. Use ids when something outside the document must address content across edits \u2014 patch edits, comments, review state. `extensions` objects at document, slide, and payload scope carry machine state; engines ignore and preserve them.\n\n## Catalog references\n\nReusable records live in catalogs; a reference is a bare id or `name:id`: `narrative`, `tone`, `purpose`, `audience`, `design.theme`, `design.colorScheme`, `design.fontScheme`, `Slide.layout`. `catalogs` holds the records a document embeds, grouped by catalog: `default` (with its `source`), `custom` (the document\'s own) and named groups (`"acme": { "source": "pkg:@acme/opf-catalog", ... }`, referenced as `acme:hero`). Resolution: `custom` \u2192 embedded `default` \u2192 the catalog the host registered for its source; nothing is fetched. Object form overrides a record per key: `{ "id": "cool-horizon", "accent1": "#0F4C81" }`. A reference that resolves nowhere warns (`opf/unresolved-reference`), never errors. `opf embed <in> <out>` embeds every record a document uses so it renders with no catalog registered. `language` (a BCP-47 tag), `Chart.type` and the socials keys are engine vocabularies, not references.\n\n## Design in three lines\n\n`design.theme` bundles scheme + fonts + background + dimensions; `design.colorScheme` / `fontScheme` override it; `slides[].design` overrides per slide; resolution is per field, most specific wins. Backgrounds accept slot names (`"light1"`) or hex. `false` suppresses inherited `watermark` / `header` / `footer`. A header or footer zone (`start` / `center` / `end`) takes `image`, `text`, `socials`, `date`, laid out side by side in that order; generated values are variables in `text`: `"{{slide.number}} / {{deck.slideCount}}"`, `"{{slide.section}}"`, `"{{organization.name}}"` (the slide-scoped `{{slide.number}}`, `{{slide.section}}`, `{{deck.slideCount}}` also work in body text). Logos live on `organization.logo` (one path, or `full` / `stacked` / `icon` / `wordmark`, each a path or `{ onLight, onDark }`); place one with `"image": "var:organization.logo.icon"`; covers draw the full logo, and `design.logo` is only an override reference or `false`.\n\n## Prefer / never\n\nPrefer: string shorthands; bare ids for default-catalog records; inference over explicit `type`; regions only when position matters; groups only when `blocks` ordering is not enough; names/`var:` over hex in color fields; `items` for lists and `bullets` only for plain talking points (never both in one block or region; see [content payloads](content-payloads.md#items-versus-bullets)).\n\nNever: loose chart or table fields directly on a slide; region keys mixed with a root payload; overlapping region keys; `blocks` mixed with leaf fields on one payload; duplicate ids; x/y or pixel geometry on a block (only overlay `shapes` and image `callouts` are positioned, by fractions); a percent or a pixel where a fraction belongs (`"x": 20`).\n\n## Two canonical slides\n\n```json\n{\n "id": "headline",\n "title": "Adoption Doubled",\n "start": { "id": "kpi", "metric": { "value": "2.1x", "label": "Adoption", "trend": "up" } },\n "center+end": { "chart": { "type": "line", "data": { "columns": ["Month", "Teams"], "rows": [["Jan", 12], ["Feb", 18]] } } }\n}\n```\n\n```json\n{\n "id": "risks",\n "title": "What Could Go Wrong",\n "composition": { "mode": "column" },\n "blocks": [\n { "items": [["Two regions at ", { "text": "85% utilization", "color": "var:risk", "bold": true }]] },\n { "quote": { "text": "Exceptions became visible before they became escalations.", "attribution": "VP Operations" } }\n ],\n "extensions": { "authoring": { "locked": true } }\n}\n```\n'
141
+ "markdown": '# OPF format card\n\nA self-contained authoring reference for agents and humans writing `*.opf.json` documents, sized for pasting into a model\'s context. The canonical contract is the JSON Schema (`https://openpresentation.org/schema/opf/v1`, in [`spec/schemas/opf.schema.json`](../spec/schemas/opf.schema.json)); this card compresses it. Validate with `validate` from `@openpresentation/opf` or `opf validate <file>` ([validate](validate.md)); treat the deck as done only when `opf validate <file> --fail-on warning` passes, since an unknown layout id is only a warning. `v1` in the schema id is the pre-1.0 line, which changes across 0.x releases ([schema versioning](schema-versioning.md)).\n\n## Document shape\n\nA presentation is one JSON object; only `slides` is required.\n\n```json\n{ "name": "Minimal Deck", "slides": [{ "title": "Minimal Deck" }] }\n```\n\nOptional top-level fields, grouped:\n\n- Identity: `name`, `description`, `filename`, `author`, `organization`, `speaker`, `tags`. An `organization` (an object, or an array for hosts and partners) and a `speaker` each need both an `id` and a `name`: `"organization": { "id": "acme", "name": "Acme Corp" }`. The `id` (letters, digits, `-`, `_`, unique) is how `speaker.organizationId` and `{{organization.<id>.name}}` find the entry, and how the editor and the PPTX round trip tell entries apart; the footer\'s `{{organization.name}}` reads the primary one.\n- Intent (used by AI generation): `audience`, `purpose`, `tone`, `language`, `narrative`, `takeaway`, `duration`.\n- Appearance: `design` (`theme`, `colorScheme`, `fontScheme`, `dimensions`, `background`, `variant` (from core 0.23.0: `"dark1"` or `{ background, accents }`, a map over the one color scheme), `logo` override, `watermark`, `header`, `footer`, alignment hints), `variables`; logos themselves live on `organization`.\n- Resources: `assets` (registry referenced as `asset:<id>`), `datasets` (shared data tables that charts and tables name with `dataset`), `icons` (deck-local SVG icons named by `icon`), `references` (the sources text runs `cite`), `catalogs` (the records the document embeds, grouped by catalog: `default`, `custom` and named groups with a `source`).\n- Templates: `template: true` marks an incomplete deck whose `variables` are filled later.\n- Machine state: `extensions` (preserved, never rendered).\n\n## Slides and content\n\nA slide carries `title` / `subtitle` / `tag` / `notes` / `section` / `beat` / `layout` / `id` / `language` (when it differs from the deck\'s) / `hidden` / `extensions` plus content in one of three shapes \u2014 pick the loosest that says what you mean:\n\n1. **Root payload** \u2014 content-kind fields directly on the slide. The kind is inferred from the field: `text`, `items` (list), `bullets`, `image`, `video`, `chart`, `table`, `code`, `metric`, `quote`, `timeline`, `diagram` (Mermaid, Graphviz DOT or PlantUML source). Several kinds at the root are shorthand for `blocks`.\n2. **`blocks`** \u2014 an ordered array of payloads when placement should stay engine-inferred. A block is a leaf payload or a **group**: `{ "type": "group", "blocks": [...], "composition": { ... } }`. Groups nest (hard cap 32; stay \u2264 3 in practice) and cannot mix `blocks` with leaf fields.\n3. **Promoted regions** \u2014 a 3\xD73 grid when position matters. Rows `top|middle|bottom`, columns `start|center|end`, spans with `+`, intersections with `:` \u2014 `"start"`, `"center+end"`, `"top:start"`, `"middle+bottom:center+end"`. Keys must not overlap; regions cannot mix with a root payload.\n\nDirection: layout words are logical. `start` and `end` (region columns, `titleAlignment` and `contentAlignment`, a caption\'s or table cell\'s `align`, header and footer zones, image `placement.edge`, `overlay.edge`, `chartPrimary`, shape anchors, an overlay shape\'s `x`) follow the deck\'s direction: `start` is the left edge in a left-to-right deck and the right edge in a right-to-left deck. Coordinates and sides that name pixels of a picture or parts of a plot are physical in every language: image `focus` and `callouts`, chart `legend` and `dataLabels.position`, and the `left` and `right` sides of cell `borders` and `padding` and of a shape\'s `padding`.\n\n`composition` (on a slide or group) arranges children: `{ "mode": "auto|grid|row|column", "columns": 1-12, "weights": [..], "gap": 0-0.1, "padding": 0-0.2, "minFontSize": 8-32, "maxFontSize": 8-200, "overflow": "warn|error" }`. Weights are relative track sizes; gap/padding are fractions of the canvas short edge; the font sizes are reference pixels at a 720-pixel short edge. Engines own the placement of content: a block has no x/y.\n\nOnly what is drawn over the composed slide is positioned. A slide\'s `shapes` holds overlay shapes and connectors: `{ "shape": "ellipse", "x": -0.06, "y": -0.1, "width": 0.22, "height": 0.39 }` (signed fractions of the slide, never percents or pixels, up to 8 slides wide or tall; a shape may hang over an edge, and one with nothing on the slide is the warning `opf/shape-off-slide`) or `{ "shape": "wedgeRectCallout", "text": "New", "at": { "block": "<id>", "edge": "top" } }` (it follows the block; sized by `width`/`height` as fractions of the block or `widthPx`/`heightPx` in reference pixels). An image object takes `callouts`, text panels placed by fractions of the picture.\n\nPayload notes: chart (never the Chart.js `categories`/`series`/`labels`/`datasets` shape; the first column holds the labels, each further column is one series) is `{ "type": "<chart-type id>", "data": { "columns": [...], "rows": [...] } }` or `{ "data": { "dataset": "<id>" } }`, with optional `legend`, `dataLabels`, `axisTitles`, `colors`, `highlight` and explicit `referenceLines` (`[{ "value": 0.25, "label": "Target 25%" }]` on a column, bar, line, line-with-markers, area or combo chart, not (yet) a stacked one; another type is the error `opf/chart-reference-unsupported-type`; a title never creates one); table rows may hold scalars, `TextRun[]`, or styled cells `{ "value", "style": { "fill", "color", "align", "borders", ... }, "colSpan", "rowSpan" }`; `metric`/`quote`/`code` accept string shorthand; list nesting uses `level` on items, not nested payloads.\n\n## Rich text and color references\n\n`text`, list items, bullets, and table cells accept `TextRun[]`: strings or `{ "text", "bold", "italic", "underline", "strikethrough", "color", "fontSize", "fontFamily", "code", "language", "link", "superscript", "subscript", "cite", "footnote" }`. `fontSize` is in points (12 points is 16 reference pixels), the one size in OPF that is not in reference pixels; an unknown key in a run is an error.\n\nEvery content color field (`TextRun.color`, table cell `style.fill` / `style.color`, cell border `color`) accepts four forms:\n\n- Literal hex: `"#0F172A"`, `"#B42318CC"`.\n- A color-scheme name, resolved through the effective scheme: slots `accent1`\u2013`accent6`, `dark1`, `dark2`, `light1`, `light2`, `hyperlink`, `followedHyperlink`, or roles `primary`, `secondary`, `accent`, `background`, `surface`, `surfaceAlt`, `text`, `textSecondary`.\n- A color made lighter or darker: `{ "color": "accent1", "lighten": 0.4 }` or `{ "color": "#1E40AF", "darken": 0.25 }`.\n- A variable reference `var:<id>` into the top-level map: `"variables": { "risk": "#B42318" }` (or `{ "type": "color", "value": "#B42318", "description": "..." }`).\n\nPrefer names and variables over hex \u2014 they survive re-theming. Unknown `var:` ids warn, never error. The styled cell and border color fields enforce these forms at the schema level; run colors tolerate any string (unrecognized values warn and renderers fall back to the theme), so imported decks keep validating.\n\n## Ids and extensions\n\n`id` is optional on slides and on any content payload (including groups), unique document-wide. Use ids when something outside the document must address content across edits \u2014 patch edits, comments, review state. `extensions` objects at document, slide, and payload scope carry machine state; engines ignore and preserve them.\n\n## Catalog references\n\nReusable records live in catalogs; a reference is a bare id or `name:id`: `narrative`, `tone`, `purpose`, `audience`, `design.theme`, `design.colorScheme`, `design.fontScheme`, `Slide.layout`. `catalogs` holds the records a document embeds, grouped by catalog: `default` (with its `source`), `custom` (the document\'s own) and named groups (`"acme": { "source": "pkg:@acme/opf-catalog", ... }`, referenced as `acme:hero`). Resolution: `custom` \u2192 embedded `default` \u2192 the catalog the host registered for its source; nothing is fetched. Object form overrides a record per key: `{ "id": "cool-horizon", "accent1": "#0F4C81" }`. A reference that resolves nowhere warns (`opf/unresolved-reference`), never errors. `opf embed <in> <out>` embeds every record a document uses so it renders with no catalog registered. `language` (a BCP-47 tag), `Chart.type` and the socials keys are engine vocabularies, not references.\n\n## Design in three lines\n\n`design.theme` bundles scheme + fonts + background + dimensions; `design.colorScheme` / `fontScheme` override it; `slides[].design` overrides per slide; resolution is per field, most specific wins. Backgrounds accept slot names (`"light1"`) or hex. `false` suppresses inherited `watermark` / `header` / `footer`. A header or footer zone (`start` / `center` / `end`) takes `image`, `text`, `socials`, `date`, laid out side by side in that order; generated values are variables in `text`: `"{{slide.number}} / {{deck.slideCount}}"`, `"{{slide.section}}"`, `"{{organization.name}}"` (the slide-scoped `{{slide.number}}`, `{{slide.section}}`, `{{deck.slideCount}}` also work in body text). Logos live on `organization.logo` (one path, or `full` / `stacked` / `icon` / `wordmark`, each a path or `{ onLight, onDark }`); place one with `"image": "var:organization.logo.icon"`; covers draw the full logo, and `design.logo` is only an override reference or `false`.\n\n## Prefer / never\n\nPrefer: string shorthands; bare ids for default-catalog records; inference over explicit `type`; regions only when position matters; groups only when `blocks` ordering is not enough; names/`var:` over hex in color fields; `items` for lists and `bullets` only for plain talking points (never both in one block or region; see [content payloads](content-payloads.md#items-versus-bullets)).\n\nNever: loose chart or table fields directly on a slide; region keys mixed with a root payload; overlapping region keys; `blocks` mixed with leaf fields on one payload; duplicate ids; x/y or pixel geometry on a block (only overlay `shapes` and image `callouts` are positioned, by fractions); a percent or a pixel where a fraction belongs (`"x": 20`).\n\n## Two canonical slides\n\n```json\n{\n "id": "headline",\n "title": "Adoption Doubled",\n "start": { "id": "kpi", "metric": { "value": "2.1x", "label": "Adoption", "trend": "up" } },\n "center+end": { "chart": { "type": "line", "data": { "columns": ["Month", "Teams"], "rows": [["Jan", 12], ["Feb", 18]] } } }\n}\n```\n\n```json\n{\n "id": "risks",\n "title": "What Could Go Wrong",\n "composition": { "mode": "column" },\n "blocks": [\n { "items": [["Two regions at ", { "text": "85% utilization", "color": "var:risk", "bold": true }]] },\n { "quote": { "text": "Exceptions became visible before they became escalations.", "attribution": "VP Operations" } }\n ],\n "extensions": { "authoring": { "locked": true } }\n}\n```\n'
142
142
  },
143
143
  {
144
144
  "slug": "handoff-2026-09-08",
@@ -216,7 +216,7 @@ var docsData = Object.freeze([
216
216
  "slug": "icons",
217
217
  "file": "docs/icons.md",
218
218
  "title": "Icons",
219
- "markdown": '# Icons\n\nAn `icon` puts a small drawing on a chip beside a list entry, above a metric or at the top of a group, as Claude Design draws a feature\nlist or a "what we will cover" card (LH-14). Icons are decoration: they never cost text its size, and they are drawn only where the\nauthor gave one. OPF never invents an icon.\n\n```json\n{\n "title": "What is new in the 5.0 release",\n "items": [\n { "text": "Offline mode", "description": "Keep working without a connection.", "icon": "lucide:wifi-off" },\n { "text": "Shared workspaces", "description": "One place for a team\'s files.", "icon": "lucide:users" }\n ]\n}\n```\n\n## Where an icon goes\n\n| Field | Drawn |\n| --- | --- |\n| `items[].icon` (a `ListItem` object) | On a chip in the marker column, in place of the bullet, centered on the entry\'s first line. Every entry of the list keeps the column, so the texts start at one edge; an entry without an icon keeps its bullet there, centered in the column (LH-174), unless `design.listBullet` is `none`. First-level entries of an unnumbered list only; in a nested list (RR-105) the first-level entries draw their chips and a nested entry keeps its bullet, under its entry\'s text, with a nested list\'s 1.1 em hanging indent. A ruled list (`listStyle: "rows"`) sets the chips at the start of its labels. A short list that is the whole body draws as icon cards (below), numbered or not. |\n| `metric.icon` | On a chip above the metric, at its alignment (centered, or at the start of a start-aligned metric). |\n| `icon` on a group (a block with `blocks`) | On a chip at the top start edge of the group, above its heading (its eyebrow), inside a group drawn on a card. A person drawn as a portrait card (LH-132) draws no chip; the icon is reported `icon-dropped`. |\n\nA list with icons is never drawn with step badges, numerals or check-mark tiles: its chips take the marker column those draw in.\n`bullets` entries and nested entries take no icon.\n\n### Icon cards (LH-165)\n\nA slide whose whole body is one list of 2 to 8 first-level entries, each with an `icon` that resolves, a label of at most 48\ncharacters and 7 words and at most a description of 160 characters, draws the list as a grid of equal cards that take the body\'s\nheight (or its layout region\'s), as Claude Design draws a set of features or an agenda:\n\n- **Grid.** Two to four cards a row, every row full but the last, which is at most one card short and centered under the others\n (`cardGridColumns`: 4 cards as 2 x 2 or one row, 6 as 3 x 2 or 2 x 3, 8 as 4 x 2, 3 x 3 + 2 or 2 x 4). The cards keep the list\'s\n order, row by row from the start edge (the right in a right-to-left deck).\n- **Card.** The theme\'s card surface and border (the card neutral, as LH-137\'s check-mark tiles), the chip at the top start, the label\n bold, the description under it at 0.82 of the label\'s size (as a ruled row\'s). The chip stands above the label, beside the label and\n its description, or beside the label with the description under both across the card, whichever lets the text be largest (then on\n the fewest lines). The chips on cards are solid in the primary with the glyph in the color that reads on it, on light and dark slides.\n- **Numbers.** A numbered list, or an agenda\'s list (a `numbered` region such as `agenda-split`\'s items), keeps its numbers as\n numerals in the accent at the top end of each card ("01", "02"); a numbered list\'s numerals carry the list number, so a PPTX import\n gives the list its `numbering` back.\n- **Size.** The text starts at the size the list has and grows by steps of the type scale, up to LH-05\'s 56 px (one size on every\n card, the description always 0.82 of the label), while every card holds its text without a split word and either the tallest card\'s\n text takes at most 80% of its card or the text covers at most 60% of the body (LH-48\'s fill), so a row of cards fills its cards. A\n label never takes more lines than it has at the starting size, except that a label of three words or more may take two (a two-word\n label stays on one line). Icon cards never set text smaller: they are tried on top of the rules the guard kept and kept only when no\n block reads smaller than without them, and the settled slide without them (which LH-48 may grow) is compared too. When no grid holds\n the list at its size, it stays the list it was.\n- **Across the body.** A layout\'s lone list with icons (an agenda\'s list in its half of an `agenda-split` slide) also tries its cards\n across the whole body under the heading, the slide composed as the automatic grid (LH-83\'s recomposition, `recomposed.cards`). That\n arrangement is kept when its text is at least as large as the layout\'s (with or without cards; LH-149\'s half steps count at the step\n under them), and the agenda keeps its numbers. Narrative n05 draws its four cards as a 2 x 2 grid under the title at the size the\n agenda had (37 px).\n\nA set of 2 to 8 groups that is the whole body, each with an `icon` and one short label paragraph, optionally followed by one\ndescription paragraph, draws the same cards; the label is bold in the card instead of the group\'s eyebrow, at the description\'s size.\nA description that would wrap into a column under the minimum measure keeps the groups as they are.\n\nShort paragraphs without icons draw as tiles (LH-162, see [Dynamic composition](dynamic-composition.md)).\n\n## What an icon names\n\n`icon` is one string, in one of three forms:\n\n- **`<set>:<name>`**, an icon of a set: `lucide:truck`, `tabler:rocket`. The gallery (`@openpresentation/gallery`) bundles\n [Lucide](https://lucide.dev) (ISC, `lucide-static` 1.70.0, about 2,000 icons, the default set) and\n [Tabler outline](https://tabler.io/icons) (MIT, `@tabler/icons` 3.50.0, about 5,200 icons). The MCP\'s `search_icons` tool\n finds names by keyword; never guess one.\n- **a bare name**, an icon of the deck\'s own `icons` map: an author\'s or an LLM\'s SVG, written once and named anywhere in the deck.\n- **an SVG source**: `asset:<id>`, `./icon.svg`, an HTTPS URL or a `data:image/svg+xml` URI, as pictures accept. A file is read by\n the host (the CLI and the Node file API read it from the asset directory); nothing is fetched by core.\n\n```json\n{\n "icons": {\n "brand-mark": "<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"4\\"><path d=\\"M24 6 40 15v18L24 42 8 33V15z\\"/><path d=\\"M16 24l6 6 11-12\\"/></svg>",\n "partner": "asset:partner-badge"\n },\n "slides": [{ "title": "Our commitments", "items": [{ "text": "Certified partners", "icon": "brand-mark" }] }]\n}\n```\n\n## SVG intake\n\nAn icon\'s SVG is read, never run. A script, an event handler, `foreignObject`, a raster image, or an `href`, `url()` or `@import`\nthat is not a fragment makes it `opf/icon-invalid`, as does text that is not well-formed XML, has a DOCTYPE or has no size. Then:\n\n- **One paint** (one color, or `currentColor`, at full opacity) in shapes core can read (`path`, `circle`, `ellipse`, `rect`,\n `line`, `polyline`, `polygon`, in groups with transforms): a **monochrome glyph**. Its shapes become path commands in a 0 0 24 24\n viewBox (its own viewBox is scaled to fit, centered) and are drawn in the accent: recolorable, and native in PowerPoint.\n- **Anything else** (several colors, gradients, text, opacity): a **picture** with its own colors, drawn without a chip in the chip\'s\n square.\n\n## Colors\n\nThe chip is a light tint of the primary (its luminance times 20% plus 80%, PowerPoint\'s "Lighter 80%") with the glyph in the primary;\non a dark slide or the emphasis surface the inverse, a primary chip with the glyph in the scheme color that reads best on it. A glyph\nunder 3:1 against its chip takes the text color. Core computes the colors (`iconColors`); both engines draw core\'s.\n\n## Size and the size guard\n\nA chip is a line of its text high (`ICON_CHIP_COMPACT`, 1.22 em) or, where the slide has room, 1.75 em (`ICON_CHIP`, a step badge\'s\nsize); the glyph is 55% of the chip. Both are guarded rules of composition (`icons`, `icon-chips`) and drawing rules: a slide keeps\nthe full chips, else the compact ones, only when every block reads as large as it does without them. When neither fits, the slide is\ndrawn without its icons and each one gets `opf/icon-dropped`; the text is always drawn. An icon on something icons do not mark (a\nnested or numbered entry) gets the same finding.\n\n## Engines\n\n- **Preview** (opf-render): the chip a circle, the glyph SVG paths (filled, or stroked with round caps and joins at the set\'s width\n scaled to the chip), a picture an `<image>`.\n- **PowerPoint** (opf-pptx): the chip an ellipse and each glyph part a native custom geometry (`a:custGeom`, editable points), filled\n or stroked with the theme\'s accent (`a:schemeClr val="accent1"`, with the chip\'s `lumMod`/`lumOff`), so a theme change recolors\n them. A picture is an SVG picture with its PNG fallback. Every shape carries an `OPF_ICON_V1` tag; import consumes the tagged shapes\n and gives each `icon` back to its entry, metric or group. The deck\'s `icons` map travels in the document provenance.\n\n## Loading\n\nCore is catalog-free. A host registers icon sets with its catalogs, as a catalog\'s `iconSets`: each set its record, or a function that\nloads it. `ensureIcons(deck, { catalogs })` calls a loader with the icons the deck draws (`{ icons: ["truck", ...] }`), and a loader\nmay resolve with only those, as a record whose `names` lists every icon of the set (and whose `errors` may say, by name, why an icon\nasked for could not be read); a loader that ignores the request resolves with the whole record. `gallery` itself names no icon set.\n\nThe gallery\'s sets are code only. Their data is plain static files in the gallery package, under `dist/icons/` (exported as\n`@openpresentation/gallery/icons/*`), written by its build from `catalog/icon-sets/`:\n\n| File | What it holds | Size (gzip) |\n| --- | --- | --- |\n| `lucide.json`, `tabler.json` | The index: the set\'s name, license, copyright, license text, version, viewBox, style and every icon name | 33 KB (10 KB), 82 KB (21 KB) |\n| `lucide/<name>.json`, `tabler/<name>.json` | One icon\'s path data | about 150 bytes (at most 1.4 KB) |\n| `lucide.icons.json`, `tabler.icons.json` | The whole set: the index and every icon\'s path data | 364 KB (99 KB), 1,009 KB (236 KB) |\n| `lucide.tags.json`, `tabler.tags.json` | Every icon\'s search keywords, read only by a search | 353 KB (59 KB), 628 KB (113 KB) |\n\n`galleryIconSets(load)` of `@openpresentation/gallery/icon-sets` registers the two sets over those files: drawing a deck reads each\nset\'s index once and one file per icon the deck names, so three icons cost three small files, and no bundler can pull a set in. A\nbatch of more than 40 icons of one set (an icon browser\'s page) reads the whole-set file instead, and so does a batch whose per-icon\nfile is missing (a 404, or the page a single-page host answers with): a host may serve only the six set-level files. `load(path)`\nreads a file by its path under `dist/icons/`; leave it out where the package is installed.\n\n### What each host does\n\n| Host | What to write |\n| --- | --- |\n| Node, Bun or Deno (core\'s `convert`, `open`, `validate`, the CLI, the stdio MCP server, a script) | Nothing: core\'s Node defaults register `galleryIconSets()`, which reads the installed package. A script that registers its own catalogs writes `[gallery, galleryIconSets()]`. |\n| A bundled Node server (esbuild, webpack, Next.js, ESM or CommonJS) | Nothing, when it is deployed with `@openpresentation/gallery` installed (its `node_modules`): the files are found next to the module, else as the package installed for the working directory. Keep `@openpresentation/opf-render` and `@openpresentation/opf-pptx` external, as any native dependency. A deploy that ships only traced files (Next.js standalone, a serverless function) must include `node_modules/@openpresentation/gallery/dist/icons/**` in the trace, or copy that folder next to the bundle as `icons/`. Without either, a set icon is `opf/icon-unknown` naming the folders it looked in and these remedies. |\n| A server that wants a set inside its bundle | Import the whole-set file and pass it by id: `galleryIconSets({ lucide })` with `import lucide from "@openpresentation/gallery/icons/lucide.icons.json" with { type: "json" }`. Only the sets passed are registered, and nothing is read at run time (Lucide adds 364 KB to the bundle, Tabler 1 MB). |\n| A browser page | `galleryIconSets(fetchIcons("/opf-icons/"))`, and its build copies the icon files to `/opf-icons/` (below). A relative URL resolves against the page. |\n| A Worker (Cloudflare and the like) | `galleryIconSets(fetchIcons(new URL("/opf-icons/", request.url), env.ASSETS))` with the files in its static assets: `fetchIcons` takes a fetch function or an object with a `fetch` method (the `env.ASSETS` binding, called as `env.ASSETS.fetch(url)`), and the base must be absolute (there is no page). Or bundle a set, as above. `@openpresentation/mcp`\'s `defaultSources()` registers no icon set in a Worker (there are no files to read), as the lean server does; pass `sources.iconSets` to give it one. |\n| The MCP viewer (`show_deck`, `open_editor`) | Nothing in the page: it cannot fetch, so it reads each set icon a deck names from its server through the app-only tool `read_icons` (at most 100 icons a call; each set\'s index, with its license and copyright, once). The server needs icon sets: `opf-mcp` and the `.mcpb` read the installed files; a Worker passes `sources.iconSets` as in the row above, else the viewer draws the slide without the icon and says it could not be loaded. See [the OPF viewer](mcp.md#the-opf-viewer-show_deck). |\n| The headless editor | `await loadIconSets(editor)`: it loads the icons the deck draws, so `composeSlide` draws them. After `setIcon`, `await change.ready` before the next `composeSlide` (the editor starts loading the one icon as part of the edit). The canvas, the workspace and the Studio wait for icons by themselves. |\n\n```js\nimport { gallery } from "@openpresentation/gallery";\nimport { fetchIcons, galleryIconSets } from "@openpresentation/gallery/icon-sets";\n\nconst node = [gallery, galleryIconSets()]; // Node, Bun and Deno: the installed files (core\'s defaults already do this)\nconst page = [gallery, galleryIconSets(fetchIcons("/opf-icons/"))]; // a browser page\nconst worker = (request, env) => [gallery, galleryIconSets(fetchIcons(new URL("/opf-icons/", request.url), env.ASSETS))];\nawait ensureIcons(deck, { catalogs: page });\n```\n\nCopying the files for a page or a Worker (from the folder that has `node_modules/@openpresentation/gallery`):\n\n```sh\n# Everything (7,238 files, 3.6 MB): the fewest bytes per deck, one small request per icon.\nnode -e "require(\'fs\').cpSync(\'node_modules/@openpresentation/gallery/dist/icons\', \'public/opf-icons\', { recursive: true })"\n# Or only the six set-level files (2.5 MB, 538 KB gzip): a deck reads each set it names whole, once.\nnode -e "const fs = require(\'fs\'); fs.mkdirSync(\'public/opf-icons\', { recursive: true }); for (const f of fs.readdirSync(\'node_modules/@openpresentation/gallery/dist/icons\')) if (f.endsWith(\'.json\')) fs.copyFileSync(\'node_modules/@openpresentation/gallery/dist/icons/\' + f, \'public/opf-icons/\' + f)"\n```\n\nAn icon that cannot be loaded never blocks drawing. Its load is settled: the slide draws without it, `opf/icon-unknown` says which\nicon could not be loaded and why ("The icon lucide:truck could not be loaded: https://example.com/opf-icons/lucide.json answered\n404."), and nothing asks for it again, so a preview never waits on it in a loop. `ensureIcons(deck, { catalogs, retry: true })` asks\nagain (a host\'s "try again" after the files or the connection are back). What `ensureIcons` loads is shared by every copy of core in\na process, so a server that bundles core and keeps the engines external draws what its own copy loaded.\n\nBefore synchronous code reads a deck, a host awaits `ensureIcons(deck, { catalogs })`: opf-pptx\'s `toPptx` and the renderer\'s browser\nfonts handle (`ensure`) do with the catalogs they are given; core\'s Node file API, the CLI and the MCP load the icons a deck names before\nthey check or draw it. A Node script that calls `toSvg` directly calls `ensureIcons` first; diagrams and shapes load the same way, and one\npreload covers all three (see [Engines and icon sets that load on demand](how-opf-works.md#engines-and-icon-sets-that-load-on-demand)).\n`validate` alone checks only the set ids and the sets the document embeds until the sets are loaded. `opf validate` reads the SVG files a deck\'s icons name from the folder `opf convert` reads them from (the deck\'s folder or `--asset-dir`, RR-105), so both report the same `opf/icon-dropped` findings. Search (the MCP\'s `search_icons`,\nthe editor\'s `searchIcons` and icon picker) reads the names and the keywords, and the picker reads the path data of the icons on the page\nit shows.\n\n`embedIcons(deck, { catalogs })` copies the set icons a deck uses (only those, with the set\'s license and copyright) into\n`catalogs.default.iconSets`, so the deck draws them with no registered catalog. An icon set is a catalog kind\n(`spec/schemas/icon-set.schema.json`); the gallery\'s records are generated from the pinned npm packages by\n`packages/gallery/scripts/build-icon-sets.mjs`, and their licenses are in the package\'s `THIRD-PARTY-NOTICES.md`.\n\n## Editing icons\n\nThe editor (`@openpresentation/opf-editor`) sets, changes and removes an `icon` on a list entry, a metric and a group, each as one undoable patch: `setIcon`, `removeIcon` and `setSvgIcon` of `@openpresentation/opf-editor/icon-options`, and an icon picker in the Content panel (`@openpresentation/opf-editor/icon-picker`). The picker searches the sets the host registered (the editor bundles none), lists the deck\'s own icons, and takes a pasted SVG, which it stores in the deck\'s `icons` under a name and references by that name; an SVG that cannot be an icon is refused with the `opf/icon-invalid` message. Removing the last use of a deck icon also removes it from `icons`. A set icon is read on demand: `setIcon` starts loading it and returns `ready`, which a headless host awaits before `composeSlide` (the canvas waits by itself); `await loadIconSets(editor)` loads every icon the deck draws. When a set cannot be read the picker says why instead of "no matches".\n\n## Findings\n\n| Rule | When |\n| --- | --- |\n| `opf/icon-unknown` | The set or the name is not found (the finding suggests the nearest names), or the icon could not be loaded (the finding says why). |\n| `opf/icon-invalid` | The SVG cannot be an icon (see SVG intake). |\n| `opf/icon-dropped` | The icon is not drawn: no room without setting text smaller, or nothing it can mark. |\n'
219
+ "markdown": '# Icons\n\nAn `icon` puts a small drawing on a chip beside a list entry, above a metric or at the top of a group, as Claude Design draws a feature\nlist or a "what we will cover" card (LH-14). Icons are decoration: they never cost text its size, and they are drawn only where the\nauthor gave one. OPF never invents an icon.\n\n```json\n{\n "title": "What is new in the 5.0 release",\n "items": [\n { "text": "Offline mode", "description": "Keep working without a connection.", "icon": "lucide:wifi-off" },\n { "text": "Shared workspaces", "description": "One place for a team\'s files.", "icon": "lucide:users" }\n ]\n}\n```\n\n## Where an icon goes\n\n| Field | Drawn |\n| --- | --- |\n| `items[].icon` (a `ListItem` object) | On a chip in the marker column, in place of the bullet, centered on the entry\'s first line. Every entry of the list keeps the column, so the texts start at one edge; an entry without an icon keeps its bullet there, centered in the column (LH-174), unless `design.listBullet` is `none`. First-level entries of an unnumbered list only; in a nested list (RR-105) the first-level entries draw their chips and a nested entry keeps its bullet, under its entry\'s text, with a nested list\'s 1.1 em hanging indent. A ruled list (`listStyle: "rows"`) sets the chips at the start of its labels. A short list that is the whole body draws as icon cards (below), numbered or not. |\n| `metric.icon` | On a chip above the metric, at its alignment (centered, or at the start of a start-aligned metric). |\n| `icon` on a group (a block with `blocks`) | On a chip at the top start edge of the group, above its heading (its eyebrow), inside a group drawn on a card. A person drawn as a portrait card (LH-132) draws no chip; the icon is reported `icon-dropped`. |\n\nA list with icons is never drawn with step badges, numerals or check-mark tiles: its chips take the marker column those draw in.\n`bullets` entries and nested entries take no icon.\n\n### Icon cards (LH-165)\n\nA slide whose whole body is one list of 2 to 8 first-level entries, each with an `icon` that resolves, a label of at most 48\ncharacters and 7 words and at most a description of 160 characters, draws the list as a grid of equal cards that take the body\'s\nheight (or its layout region\'s), as Claude Design draws a set of features or an agenda:\n\n- **Grid.** Two to four cards a row, every row full but the last, which is at most one card short and centered under the others\n (`cardGridColumns`: 4 cards as 2 x 2 or one row, 6 as 3 x 2 or 2 x 3, 8 as 4 x 2, 3 x 3 + 2 or 2 x 4). The cards keep the list\'s\n order, row by row from the start edge (the right in a right-to-left deck).\n- **Card.** The theme\'s card surface and border (the card neutral, as LH-137\'s check-mark tiles), the chip at the top start, the label\n bold, the description under it at 0.82 of the label\'s size (as a ruled row\'s). The chip stands above the label, beside the label and\n its description, or beside the label with the description under both across the card, whichever lets the text be largest (then on\n the fewest lines). The chips on cards are solid in the primary with the glyph in the color that reads on it, on light and dark slides.\n- **Numbers.** A numbered list, or an agenda\'s list (a `numbered` region such as `agenda-split`\'s items), keeps its numbers as\n numerals in the accent at the top end of each card ("01", "02"); a numbered list\'s numerals carry the list number, so a PPTX import\n gives the list its `numbering` back.\n- **Size.** The text starts at the size the list has and grows by steps of the type scale, up to LH-05\'s 56 px (one size on every\n card, the description always 0.82 of the label), while every card holds its text without a split word and either the tallest card\'s\n text takes at most 80% of its card or the text covers at most 60% of the body (LH-48\'s fill), so a row of cards fills its cards. A\n label never takes more lines than it has at the starting size, except that a label of three words or more may take two (a two-word\n label stays on one line). Icon cards never set text smaller: they are tried on top of the rules the guard kept and kept only when no\n block reads smaller than without them, and the settled slide without them (which LH-48 may grow) is compared too. When no grid holds\n the list at its size, it stays the list it was.\n- **Direction.** The slide\'s direction chooses between the cards and the list: where the arrangement composition resolves for the\n list is a column (`composition.mode: "column"`, or `design.contentDirection: "vertical"` where the slide sets no mode; on a layout\n slide, the arrangement of the list\'s region: the slide\'s own mode where it arranges that region, else `contentDirection`\'s), the list stays ruled rows (label and description side by side\n when the labels are short), each entry\'s chip at the start of its row (the end in a right-to-left deck), at the size the rows have\n without icons. A row, a grid (a grid of cards is a grid) and no direction draw the cards. A layout region\'s own `flow` is no\n direction here, so a layout\'s lone list keeps its cards unless the slide or the design sets a column. Groups drawn as icon cards are not part of\n this choice.\n- **Across the body.** A layout\'s lone list with icons (an agenda\'s list in its half of an `agenda-split` slide) also tries its cards\n across the whole body under the heading, the slide composed as the automatic grid (LH-83\'s recomposition, `recomposed.cards`). That\n arrangement is kept when its text is at least as large as the layout\'s (with or without cards; LH-149\'s half steps count at the step\n under them), and the agenda keeps its numbers. Narrative n05 draws its four cards as a 2 x 2 grid under the title at the size the\n agenda had (37 px).\n\nA set of 2 to 8 groups that is the whole body, each with an `icon` and one short label paragraph, optionally followed by one\ndescription paragraph, draws the same cards; the label is bold in the card instead of the group\'s eyebrow, at the description\'s size.\nA description that would wrap into a column under the minimum measure keeps the groups as they are.\n\nShort paragraphs without icons draw as tiles (LH-162, see [Dynamic composition](dynamic-composition.md)).\n\n## What an icon names\n\n`icon` is one string, in one of three forms:\n\n- **`<set>:<name>`**, an icon of a set: `lucide:truck`, `tabler:rocket`. The gallery (`@openpresentation/gallery`) bundles\n [Lucide](https://lucide.dev) (ISC, `lucide-static` 1.72.0, about 2,000 icons, the default set) and\n [Tabler outline](https://tabler.io/icons) (MIT, `@tabler/icons` 3.51.0, about 5,200 icons). The MCP\'s `search_icons` tool\n finds names by keyword (and by a former name: see below); never guess one.\n **Renamed icons.** A set renames icons between versions. OPF has one name for each icon, so an old name does not draw; the set lists its former names (`renamed`, from the aliases the pinned `lucide-static` ships; Tabler\'s package ships none), so `opf/icon-unknown` for one says it was renamed and gives the new name with a fix, and `search_icons` finds the icon by it.\n- **a bare name**, an icon of the deck\'s own `icons` map: an author\'s or an LLM\'s SVG, written once and named anywhere in the deck.\n- **an SVG source**: `asset:<id>`, `./icon.svg`, an HTTPS URL or a `data:image/svg+xml` URI, as pictures accept. A file is read by\n the host (the CLI and the Node file API read it from the asset directory); nothing is fetched by core.\n\n```json\n{\n "icons": {\n "brand-mark": "<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"4\\"><path d=\\"M24 6 40 15v18L24 42 8 33V15z\\"/><path d=\\"M16 24l6 6 11-12\\"/></svg>",\n "partner": "asset:partner-badge"\n },\n "slides": [{ "title": "Our commitments", "items": [{ "text": "Certified partners", "icon": "brand-mark" }] }]\n}\n```\n\n## SVG intake\n\nAn icon\'s SVG is read, never run. A script, an event handler, `foreignObject`, a raster image, or an `href`, `url()` or `@import`\nthat is not a fragment makes it `opf/icon-invalid`, as does text that is not well-formed XML, has a DOCTYPE or has no size. Then:\n\n- **One paint** (one color, or `currentColor`, at full opacity) in shapes core can read (`path`, `circle`, `ellipse`, `rect`,\n `line`, `polyline`, `polygon`, in groups with transforms): a **monochrome glyph**. Its shapes become path commands in a 0 0 24 24\n viewBox (its own viewBox is scaled to fit, centered) and are drawn in the accent: recolorable, and native in PowerPoint.\n- **Anything else** (several colors, gradients, text, opacity): a **picture** with its own colors, drawn without a chip in the chip\'s\n square.\n\n## Colors\n\nThe chip is a light tint of the primary (its luminance times 20% plus 80%, PowerPoint\'s "Lighter 80%") with the glyph in the primary;\non a dark slide or the emphasis surface the inverse, a primary chip with the glyph in the scheme color that reads best on it. A glyph\nunder 3:1 against its chip takes the text color. Core computes the colors (`iconColors`); both engines draw core\'s.\n\n## Size and the size guard\n\nA chip is a line of its text high (`ICON_CHIP_COMPACT`, 1.22 em) or, where the slide has room, 1.75 em (`ICON_CHIP`, a step badge\'s\nsize); the glyph is 55% of the chip. Both are guarded rules of composition (`icons`, `icon-chips`) and drawing rules: a slide keeps\nthe full chips, else the compact ones, only when every block reads as large as it does without them. A lone list grows to fill the\nbody as the same list without icons would (its chips do not count against the body it fills, as a badge list\'s badges do not), as\nlong as it still fits with them. When neither fits, the slide is\ndrawn without its icons and each one gets `opf/icon-dropped`; the text is always drawn. The\nfinding names what bounds the block (its share of `composition.weights`, its region, or the slide), so the author knows what to give\nmore room. An icon on something icons do not mark (a nested or numbered entry) gets the same finding. Icons in promoted regions\n(`start`, `center+end`, ...) are drawn and reported as any block\'s.\n\n## Engines\n\n- **Preview** (opf-render): the chip a circle, the glyph SVG paths (filled, or stroked with round caps and joins at the set\'s width\n scaled to the chip), a picture an `<image>`.\n- **PowerPoint** (opf-pptx): the chip an ellipse and each glyph part a native custom geometry (`a:custGeom`, editable points), filled\n or stroked with the theme\'s accent (`a:schemeClr val="accent1"`, with the chip\'s `lumMod`/`lumOff`), so a theme change recolors\n them. A picture is an SVG picture with its PNG fallback. Every shape carries an `OPF_ICON_V1` tag; import consumes the tagged shapes\n and gives each `icon` back to its entry, metric or group. The deck\'s `icons` map travels in the document provenance.\n\n## Loading\n\nCore is catalog-free. A host registers icon sets with its catalogs, as a catalog\'s `iconSets`: each set its record, or a function that\nloads it. `ensureIcons(deck, { catalogs })` calls a loader with the icons the deck draws (`{ icons: ["truck", ...] }`), and a loader\nmay resolve with only those, as a record whose `names` lists every icon of the set (and whose `errors` may say, by name, why an icon\nasked for could not be read); a loader that ignores the request resolves with the whole record. `gallery` itself names no icon set.\n\nThe gallery\'s sets are code only. Their data is plain static files in the gallery package, under `dist/icons/` (exported as\n`@openpresentation/gallery/icons/*`), written by its build from `catalog/icon-sets/`:\n\n| File | What it holds | Size (gzip) |\n| --- | --- | --- |\n| `lucide.json`, `tabler.json` | The index: the set\'s name, license, copyright, license text, version, viewBox, style and every icon name | 33 KB (10 KB), 82 KB (21 KB) |\n| `lucide/<name>.json`, `tabler/<name>.json` | One icon\'s path data | about 150 bytes (at most 1.4 KB) |\n| `lucide.icons.json`, `tabler.icons.json` | The whole set: the index and every icon\'s path data | 364 KB (99 KB), 1,009 KB (236 KB) |\n| `lucide.tags.json`, `tabler.tags.json` | Every icon\'s search keywords, read only by a search | 353 KB (59 KB), 628 KB (113 KB) |\n\n`galleryIconSets(load)` of `@openpresentation/gallery/icon-sets` registers the two sets over those files: drawing a deck reads each\nset\'s index once and one file per icon the deck names, so three icons cost three small files, and no bundler can pull a set in. A\nbatch of more than 40 icons of one set (an icon browser\'s page) reads the whole-set file instead, and so does a batch whose per-icon\nfile is missing (a 404, or the page a single-page host answers with): a host may serve only the six set-level files. `load(path)`\nreads a file by its path under `dist/icons/`; leave it out where the package is installed.\n\n### What each host does\n\n| Host | What to write |\n| --- | --- |\n| Node, Bun or Deno (core\'s `convert`, `open`, `validate`, the CLI, the stdio MCP server, a script) | Nothing: core\'s Node defaults register `galleryIconSets()`, which reads the installed package. A script that registers its own catalogs writes `[gallery, galleryIconSets()]`. |\n| A bundled Node server (esbuild, webpack, Next.js, ESM or CommonJS) | Nothing, when it is deployed with `@openpresentation/gallery` installed (its `node_modules`): the files are found next to the module, else as the package installed for the working directory. Keep `@openpresentation/opf-render` and `@openpresentation/opf-pptx` external, as any native dependency. A deploy that ships only traced files (Next.js standalone, a serverless function) must include `node_modules/@openpresentation/gallery/dist/icons/**` in the trace, or copy that folder next to the bundle as `icons/`. Without either, a set icon is `opf/icon-unknown` naming the folders it looked in and these remedies. |\n| A server that wants a set inside its bundle | Import the whole-set file and pass it by id: `galleryIconSets({ lucide })` with `import lucide from "@openpresentation/gallery/icons/lucide.icons.json" with { type: "json" }`. Only the sets passed are registered, and nothing is read at run time (Lucide adds 364 KB to the bundle, Tabler 1 MB). |\n| A browser page | `galleryIconSets(fetchIcons("/opf-icons/"))`, and its build copies the icon files to `/opf-icons/` (below). A relative URL resolves against the page. |\n| A Worker (Cloudflare and the like) | `galleryIconSets(fetchIcons(new URL("/opf-icons/", request.url), env.ASSETS))` with the files in its static assets: `fetchIcons` takes a fetch function or an object with a `fetch` method (the `env.ASSETS` binding, called as `env.ASSETS.fetch(url)`), and the base must be absolute (there is no page). Or bundle a set, as above. `@openpresentation/mcp`\'s `defaultSources()` registers no icon set in a Worker (there are no files to read), as the lean server does; pass `sources.iconSets` to give it one. |\n| The MCP viewer (`show_deck`, `open_editor`) | Nothing in the page: it cannot fetch, so it reads each set icon a deck names from its server through the app-only tool `read_icons` (at most 100 icons a call; each set\'s index, with its license and copyright, once). The server needs icon sets: `opf-mcp` and the `.mcpb` read the installed files; a Worker passes `sources.iconSets` as in the row above, else the viewer draws the slide without the icon and says it could not be loaded. See [the OPF viewer](mcp.md#the-opf-viewer-show_deck). |\n| The headless editor | `await loadIconSets(editor)`: it loads the icons the deck draws, so `composeSlide` draws them. After `setIcon`, `await change.ready` before the next `composeSlide` (the editor starts loading the one icon as part of the edit). The canvas, the workspace and the Studio wait for icons by themselves. |\n\n```js\nimport { gallery } from "@openpresentation/gallery";\nimport { fetchIcons, galleryIconSets } from "@openpresentation/gallery/icon-sets";\n\nconst node = [gallery, galleryIconSets()]; // Node, Bun and Deno: the installed files (core\'s defaults already do this)\nconst page = [gallery, galleryIconSets(fetchIcons("/opf-icons/"))]; // a browser page\nconst worker = (request, env) => [gallery, galleryIconSets(fetchIcons(new URL("/opf-icons/", request.url), env.ASSETS))];\nawait ensureIcons(deck, { catalogs: page });\n```\n\nCopying the files for a page or a Worker (from the folder that has `node_modules/@openpresentation/gallery`):\n\n```sh\n# Everything (7,238 files, 3.6 MB): the fewest bytes per deck, one small request per icon.\nnode -e "require(\'fs\').cpSync(\'node_modules/@openpresentation/gallery/dist/icons\', \'public/opf-icons\', { recursive: true })"\n# Or only the six set-level files (2.5 MB, 538 KB gzip): a deck reads each set it names whole, once.\nnode -e "const fs = require(\'fs\'); fs.mkdirSync(\'public/opf-icons\', { recursive: true }); for (const f of fs.readdirSync(\'node_modules/@openpresentation/gallery/dist/icons\')) if (f.endsWith(\'.json\')) fs.copyFileSync(\'node_modules/@openpresentation/gallery/dist/icons/\' + f, \'public/opf-icons/\' + f)"\n```\n\nAn icon that cannot be loaded never blocks drawing. Its load is settled: the slide draws without it, `opf/icon-unknown` says which\nicon could not be loaded and why ("The icon lucide:truck could not be loaded: https://example.com/opf-icons/lucide.json answered\n404."), and nothing asks for it again, so a preview never waits on it in a loop. `ensureIcons(deck, { catalogs, retry: true })` asks\nagain (a host\'s "try again" after the files or the connection are back). What `ensureIcons` loads is shared by every copy of core in\na process, so a server that bundles core and keeps the engines external draws what its own copy loaded.\n\nBefore synchronous code reads a deck, a host awaits `ensureIcons(deck, { catalogs })`: opf-pptx\'s `toPptx` and the renderer\'s browser\nfonts handle (`ensure`) do with the catalogs they are given; core\'s Node file API, the CLI and the MCP load the icons a deck names before\nthey check or draw it. A Node script that calls `toSvg` directly calls `ensureIcons` first; diagrams and shapes load the same way, and one\npreload covers all three (see [Engines and icon sets that load on demand](how-opf-works.md#engines-and-icon-sets-that-load-on-demand)).\n`validate` alone checks only the set ids and the sets the document embeds until the sets are loaded. `opf validate` reads the SVG files a deck\'s icons name from the folder `opf convert` reads them from (the deck\'s folder or `--asset-dir`, RR-105), so both report the same `opf/icon-dropped` findings. Search (the MCP\'s `search_icons`,\nthe editor\'s `searchIcons` and icon picker) reads the names and the keywords, and the picker reads the path data of the icons on the page\nit shows.\n\n`embedIcons(deck, { catalogs })` copies the set icons a deck uses (only those, with the set\'s license and copyright) into\n`catalogs.default.iconSets`, so the deck draws them with no registered catalog. An icon set is a catalog kind\n(`spec/schemas/icon-set.schema.json`); the gallery\'s records are generated from the pinned npm packages by\n`packages/gallery/scripts/build-icon-sets.mjs`, and their licenses are in the package\'s `THIRD-PARTY-NOTICES.md`.\n\n## Editing icons\n\nThe editor (`@openpresentation/opf-editor`) sets, changes and removes an `icon` on a list entry, a metric and a group, each as one undoable patch: `setIcon`, `removeIcon` and `setSvgIcon` of `@openpresentation/opf-editor/icon-options`, and an icon picker in the Content panel (`@openpresentation/opf-editor/icon-picker`). The picker searches the sets the host registered (the editor bundles none), lists the deck\'s own icons, and takes a pasted SVG, which it stores in the deck\'s `icons` under a name and references by that name; an SVG that cannot be an icon is refused with the `opf/icon-invalid` message. Removing the last use of a deck icon also removes it from `icons`. A set icon is read on demand: `setIcon` starts loading it and returns `ready`, which a headless host awaits before `composeSlide` (the canvas waits by itself); `await loadIconSets(editor)` loads every icon the deck draws. When a set cannot be read the picker says why instead of "no matches".\n\n## Findings\n\n| Rule | When |\n| --- | --- |\n| `opf/icon-unknown` | The set or the name is not found (the finding suggests the nearest names, or says the icon was renamed and gives the new name), or the icon could not be loaded (the finding says why). |\n| `opf/icon-invalid` | The SVG cannot be an icon (see SVG intake). |\n| `opf/icon-dropped` | The icon is not drawn: no room without setting text smaller, or nothing it can mark. |\n'
220
220
  },
221
221
  {
222
222
  "slug": "image-treatments",
@@ -228,7 +228,7 @@ var docsData = Object.freeze([
228
228
  "slug": "layout-templates",
229
229
  "file": "docs/layout-templates.md",
230
230
  "title": "Layout templates",
231
- "markdown": '# Layout templates\n\nA layout is **one ordered list of regions, declared once, in reading order.** Each region says how much of the slide it\ntakes (`size`), which content it accepts and how several blocks share it. The list has a `direction`: `row` puts the\nregions side by side, left to right; `column` stacks them top to bottom. For two dimensions, an entry of the list can be\na **split**: a nested list that runs the other way. That is the whole format. There is no grid of cell names to keep in\nstep with a table of sizes and a table of rules.\n\nA layout record (`https://openpresentation.org/schema/opf-layout/v2`) is an ordinary JSON object. The built-in layouts\nand a deck\'s own layouts are records of this one schema; a custom layout is embedded under `catalogs.custom.layouts` (or\na named catalog group) and referenced by id like any other. This page is the reference for what core implements.\n\n> The 40 built-in templates come from the matching `@openpresentation/gallery` package. Core and Gallery 5 use the region\n> lists documented below; Gallery 4 and earlier used a grid of area names (`areas`). Use coordinated core and Gallery\n> versions. V1 layout records, including `placeholders` and placeholder groups, remain unsupported; there are no aliases or\n> migration API.\n\n## A record\n\nA story on the left and the evidence beside it, a third of the width:\n\n```json\n{\n "$schema": "https://openpresentation.org/schema/opf-layout/v2",\n "id": "story-and-evidence",\n "name": "Story and evidence",\n "direction": "row",\n "anchor": "middle",\n "regions": [\n { "name": "main", "size": 2, "accepts": ["text"] },\n { "name": "aside", "size": 1, "accepts": ["metric"] }\n ]\n}\n```\n\nRead it left to right, because the record\'s `direction` is `row`: `main` first, then `aside`, and `main` is twice as wide.\n`anchor: "middle"` is written once and applies to both regions. A block targets a region by name (`"region": "aside"`),\nand a slide\'s blocks otherwise bind to regions by kind, role and the order of the list.\n\nA layout with a title and a row of two regions, the most common shape of the built-ins, nests one split:\n\n```json\n{\n "name": "Two column",\n "regions": [\n { "name": "title" },\n { "direction": "row", "regions": [\n { "name": "first", "accepts": ["text", "list"] },\n { "name": "second", "accepts": ["text", "list"] }\n ] }\n ]\n}\n```\n\nThe record\'s `direction` is omitted, so it is `column`: the title on top, then one entry, a split whose own `direction` is\n`row`. A split has no name; it is a place to put regions the other way. Splits nest up to three levels, so a record can\ndescribe any layout made of full-width and full-height cuts (a guillotine partition), which is every built-in layout.\n\n`hero` nests the other way, with sizes: a row of a text column (the title, the lead and the supporting content) and a\npicture two thirds as wide, bled to the slide\'s edges. A heading region may sit inside a split.\n\n```json\n{\n "name": "Hero",\n "direction": "row",\n "regions": [\n { "direction": "column", "size": 3, "regions": [\n { "name": "title" },\n { "name": "lead", "size": "auto", "accepts": ["text", "quote", "metric"], "flow": "none" },\n { "name": "support", "accepts": ["text", "list", "metric", "group"], "role": "supporting", "flow": "grid" }\n ] },\n { "name": "media", "size": 2, "accepts": ["image", "video"], "role": "media", "flow": "none", "bleed": true }\n ]\n}\n```\n\n| Field | Meaning |\n| --- | --- |\n| `direction` | `row` (side by side, left to right in reading order) or `column` (stacked, top to bottom). Default `column`. |\n| `regions` | 1 to 12 entries in reading order, each a region or a split. |\n| `anchor` | Vertical position of the content of every body region under the record (or split) that does not set its own. Inherited by body regions only, never by `title` or `subtitle`. Exception: on a column record whose entries are all `auto`, it places the whole stack (see Choosing an anchor). |\n| `overflowRegion` | Where content no region accepts goes. Omitted: the first `primary` region whose flow is not `none`. |\n| `design` | The layout\'s design defaults (below). |\n| `composition` | Only `gap`, `padding`, `minFontSize` and `overflow`, with their 0.18 meaning. |\n\nAn entry of `regions` is one of three things:\n\n- a **region**: `{ "name": "...", "size"?, ...rules }`, the rules below;\n- a **heading region**: `{ "name": "title" }` or `{ "name": "subtitle" }`, which take only a `size`, an `anchor` and (the\n `title`) a `rule` (see [Display headings](#display-headings-lh-130));\n- a **split**: `{ "direction": "row" | "column", "regions": [...], "size"?, "anchor"? }`, a nested list.\n\n`size` is a number above 0 and up to 100 (default 1). Siblings share their parent\'s length in proportion, separated by the\ngap, so `2` and `1` are two thirds and one third. `"auto"` is the height the content needs, up to the space the headings and\nthe numeric rows\' content leave (see Tracks), and an `auto` region with no content takes no space; it is allowed only on an entry of a `column` (a `row` has no height\nto ask for), and elsewhere it is the validate finding `opf/layout-template`.\n\n`title` and `subtitle` are reserved heading regions: `title` holds the tag, title and subtitle stacked, and a `subtitle`\nregion takes the subtitle out of it (a `subtitle` needs a `title`). Their `size` defaults to `auto` inside a `column` and to\n1 inside a `row`, so a cover that puts the title beside a picture is `{ "direction": "row", "regions": [{ "name": "title" },\n{ "name": "media", ... }] }`. A layout with no `title` region gets an implicit `auto` row on top for a slide that has\nheadings. Region names are unique across the whole record and may not be `tag`, `auto` or a promoted-region word (`start`,\n`center`, `end`, `top`, `middle`, `bottom`).\n\n### Regions\n\n| Field | Values | Default |\n| --- | --- | --- |\n| `name` | lowercase kebab-case, unique in the record; a block\'s `region` names it | required |\n| `size` | a number above 0 and up to 100, or `auto` (columns only) | 1 |\n| `accepts` | `text`, `list`, `image`, `video`, `chart`, `table`, `code`, `metric`, `quote`, `timeline`, `diagram`, `group` | every body kind and `group` |\n| `role` | `primary`, `secondary`, `media`, `supporting` | `primary` |\n| `flow` | `none`, `grid`, `column`, `auto` | `auto` |\n| `max` | 1 to 12 (`none` requires 1) | 1 for `none`, else 6 |\n| `bleed` | boolean: outer edges on the content box reach the slide edge; never a card | `false` |\n| `listColumns` | `"auto"` (a list of more than 6 entries that does not fit its cell flows into up to three columns before it shrinks) or `1` | `1` |\n| `metrics` | `stack` (value, unit, label and the rest as one block at the anchor) or `tile` (LH-68: each metric fills its cell, label first as an eyebrow, the value asking for a quarter of the cell\'s height between 76 and 152 px, description, delta and trend at the cell\'s foot, start-aligned; the gallery `scorecard` uses it) | `stack` |\n| `sequence` | `steps` or `numbered` (LH-07: the region lists the steps of a sequence, drawn under numbered badges joined by a connector, see [Step sequences](#step-sequences-lh-07); the gallery `process` uses `steps`, `agenda` and `agenda-split` use `numbered`) | none |\n| `arrangement` | `pyramid`, `matrix`, `cycle`, `chevrons`, `flow`, `vertical-flow`, `org-chart`, `hierarchy` or `venn` (SH-09, SH-18: the region\'s lone list of one level draws as PowerPoint\'s Basic Pyramid, Basic Matrix or Basic Cycle geometry, exported as live SmartArt where PowerPoint draws it as the preview does, or as OPF\'s own design of the arrangement where PowerPoint\'s does not hold the entries; a matrix of other than four entries draws cards; see [Pyramids, matrices and live SmartArt](smartart.md); the gallery `pyramid`, `matrix` and `cycle` use them; SH-17: `chevrons` draws the list as PowerPoint\'s Basic Chevron Process, `flow` as its Basic Process (boxes with arrows) and `vertical-flow` as its Vertical Process, or OPF\'s own rows or columns of them, used by the gallery layouts of the same names; SH-21: `org-chart` and `hierarchy` preserve a single-root tree through list-entry `level`, and `venn` holds one to seven flat set labels; malformed trees or labels that do not fit keep the complete list with a finding) | none |\n| `pyramidDirection` | `up` (default: narrow tip at the top) or `down` (widest first, tip at the bottom), only with `arrangement: pyramid`. The `inverted-pyramid` gallery layout uses `down`. Entries retain their authored top-to-bottom order; downward pyramids export as editable native shapes until a live SmartArt domain is measured. | `up` |\n| `anchor` | `top`, `middle`, `bottom` | inherited from the nearest split or the record, else `top` |\n| `empty` | `collapse`, `keep` | `collapse` |\n\n### Choosing an anchor\n\nA block\'s `region` selects a named region; that region\'s `anchor` controls vertical placement inside it. Region names such\nas `main` and `aside` have no special positioning behavior. Declare the names in the layout\'s region list. Write `anchor`\nonce on the record (or on a split) when every region under it shares it: body regions inherit it, a region\'s own `anchor`\nwins, and the heading regions never inherit it (they set their own, see [Display headings](#display-headings-lh-130)).\n\nUse middle anchoring for a compact statement, quotation, headline metric or short explanation beside a visual. Keep\nsubstantial text, lists, charts and tables top-aligned so readers can compare common starting positions. A region\'s\nanchor never moves the title: it stays in its own heading region. Anchoring does not enlarge short text to fill unused space.\n\n#### Display headings (LH-130)\n\nA heading region takes its own `anchor`, which places the heading group (tag, title and subtitle) in a sized area: `middle`\n(the default) centers it, `bottom` sets it at the foot of the area and `top` at its top. An `auto` area is as tall as the\ngroup, so its anchor changes nothing. The `title` region also takes `rule: true`: a slide whose headings are its message\n(no primary or secondary region holds a block and nothing sits below the grid) and that has a title but no tag draws a short\naccent rule, 80 by 5 px at a 720 px short edge, half a gap above the title at its start edge (the right in a right-to-left\ntitle). A tag is the group\'s eyebrow and takes the rule\'s place. Both engines fill it in the tag\'s color: the primary, or the\ntext color where the primary is under 4.5:1 on the slide (`SlideComposition.titleRule`; the PPTX export writes a native\nrectangle tagged `OPF_TITLE_RULE_V1`, which import consumes as the layout\'s drawing). The gallery `cover` and `section` use\nboth, with `titleAlignment` and `contentAlignment` `start`, so a display title sits low at the start edge as Claude\nDesign sets it, with the section\'s tag ("Part 1") as its eyebrow.\n\nOver a picture background the group goes where the measured picture is calm under its text (LH-158, see\n[text on a picture](image-treatments.md#text-on-a-picture)); in a run that measured nothing, a `bottom` group is centered as\nbefore LH-130, keeping its start alignment, rule and eyebrow. Plain and variant backgrounds keep the low anchor.\n\nLH-155: the gallery `closing` takes the same treatment as a stacked record: its all-`auto` column has `anchor: "bottom"`, so the stack (the title\nunder the accent rule, then the contact lines) stands at the foot of the content box at the start edge, as Claude Design sets a closing. The\nrule rides on the title (`rule: true`) and is a guarded rule (`title-rule`): where the stack has no room to spare, so that the rule\nwould set the contact lines smaller, the slide has no rule. Over a picture background the low stack is placed by the same scores as a\nheading group (LH-158), as one group (title and contact lines) at the top, middle or foot of the content box, keeping its alignment and\nwith no panel; `textPlacement` picks its anchor. In a run that measured nothing the stack is centered, as it was before.\n\nSuch a title grows to display size by steps of the type scale (LH-129, up to 75 px). A title that fits one line at its role\nsize may take a second line on the way (LH-130) when the two lines read as one balanced block: the shorter at least half the\nlonger, and no line but the last ending in a one-letter word or an article. A title that already wraps keeps the breaks its\nrole size balanced (LH-148). Nothing is set smaller than without the growth.\n\n#### Placing the whole group\n\nA single-message slide (a statement, a closing, a quotation) reads best when the title and what belongs to it sit together\nin the middle of the slide. A column has no numeric row to hold the leftover height when **every entry of the record\'s\n`regions` list is sized `auto`** (`title`, `subtitle` and the body regions alike), so the record\'s `anchor` then places\nthe whole stack, headings included, in the content box\'s leftover height: `middle` centres it, `bottom` sits it at the foot,\n`top` (the default) starts it at the top. Empty optional regions collapse and take no space, so a title-only slide centres\nthe title alone.\n\n```json\n{ "id": "closing", "direction": "column", "anchor": "middle",\n "regions": [ { "name": "title" }, { "name": "details", "size": "auto", "accepts": ["text", "list", "image"], "flow": "auto" } ] }\n```\n\nThe rule applies only to the record\'s own `anchor` on a column record with all-`auto` entries (an `auto` split counts as an\n`auto` entry). A record with any numeric entry, a row record, and a split\'s own `anchor` keep the behaviour above, so no\nexisting record changes until it opts in. `LayoutTemplate.stack` reports the resolved anchor.\n\nThe measured-content implementation supports text/list leaves and uncaptioned quote/metric leaves. A quote keeps\nits body, attribution and photo together. A metric keeps its value and metadata together without reducing the\nnominal font size merely because its placement box becomes shorter. Grid and horizontal rows share an origin\nbased on their tallest measured content, so differing description lengths do not stagger headline numbers.\nContent that does not fit retains its allocation and overflow diagnostics. Nested groups, captioned quotes/metrics,\ncharts, tables and explicit slide composition overrides keep their existing allocation behavior; an anchor is not\na promise to measure arbitrary content.\n\nOn a slide that draws content cards (`design.contentBox`), a row of cards is one row of a region\'s grid, or the lone blocks\nof regions side by side (two-column, three-column). The anchor sets how the row stands:\n\n- `middle` or `bottom`: a card fills its cell (starting half a gap down, clear of the heading) and the anchor places its\n content inside it, while a card carries a picture, a metric or a heading line (a labeled list item). A row of body text\n only (paragraphs and plain lists) does not (LH-64): when the tallest text fills under 45% of a filled card, the cards hug\n it with one height and the row centers in the region, since short text at the foot of a tall card reads as an empty card;\n rows that all hug stack one gap apart. When the texts are longer and their heights more than 1.5x apart, the cards still\n fill but every text starts at the card\'s top, so a short text does not sit alone at a foot beside long ones.\n- `top`: cards of measured blocks (text, lists, quotes, metrics) hug the tallest of their row, from the top, with one height\n per row (LH-04); a row with a picture, chart, table or group keeps cells the size of the region\'s share.\n\nLong texts are drawn as full-width rows (LH-86). Side by side, two or three paragraphs of at least 80 characters read as narrow\ncolumns of long lines, or as a short one in a wide card beside a long one in a narrow card when an empty region collapsed into it.\nOn a slide that draws cards, when the filled regions of a layout lie in one row and hold only such paragraphs (two or three, in\nseveral regions or in one region\'s grid), every paragraph moves to the first region of that row in reading order. The other\nregions are left empty and collapse into it, and that region stacks them one card per row across the row. The slide must have no\n`contentDirection` and no composition of its own, and must have nothing beyond a region\'s room or below the grid.\n\nA stacked column of such cards (these rows, or more long paragraphs one region stacks) shares the region\'s height. The text is\nset at the largest size of the type scale at which every row fits, each card as tall as its text plus the insets of a card that\ntall. The gap between the cards closes to half a gap when that sets the text larger. The cards share the leftover height in\nproportion to their needs, and each card\'s text sits in the middle of its card. When the texts would fill under 45% of that\nheight (a few short paragraphs), the cards hug their text instead and the stack sits in the middle of the region, as LH-64\'s rows do.\nThe rows are kept only when their smallest body size is at least the one the regions side by side give, or they overflow less;\notherwise the layout\'s regions stand.\n\nPictures shown whole and videos follow the anchor too (WI-3). A picture with `fit: "contain"` (a layout\'s `imageFit`, or the\nblock\'s own, or `auto` that resolves to contain: LH-104, the `image` layout\'s default) takes a frame of its own proportions, as wide as its cell allows and centered across, and sits at the region\'s\nanchor down the cell, so a landscape picture beside text starts on the text\'s first line instead of floating in the middle of\na tall cell. A video draws in a 16:9 frame, the largest that fits its cell, placed the same way. A frame the block shapes with\n`aspectRatio` or a circle stays centered, and `cover` and `stretch` fill the cell. `image-beside` and `logos` write\n`anchor: "middle"` on their media regions to keep their centered look.\n\n### Validation\n\nThe schema checks types, enums and ranges; an embedded record that fails it is `opf/catalog-record`. `validate` adds:\n\n| Rule | Severity | Raised for |\n| --- | --- | --- |\n| `opf/layout-template` | error | A `regions` list that is not 1 to 12 entries; an entry that is neither a region nor a split; a bad `direction` or `size`; `auto` outside a column; splits nested more than three levels (the record\'s own list is level 1); regions that compile to a grid over 12 x 12. |\n| `opf/layout-region` | error | A name used twice; a reserved region name; a heading region with content rules; a `subtitle` without a `title`; a region that accepts no kind; `flow: none` with `max` other than 1; an `overflowRegion` that is not a body region. |\n\n`composeSlide` refuses such a record (`OPFLayoutTemplateError`). `layoutTemplate(record)` parses, checks and compiles a record\nand `layoutTemplateIssues(record)` lists the problems, both on `@openpresentation/opf/composition`.\n\n### How a record becomes a grid\n\nEvery region list is a guillotine partition: each split cuts its cell across, all the way. So the engine compiles the tree\ninto the grid it has always composed with, and composition, the renderer, the PPTX export and the editor read that grid:\n\n1. Each split divides its cell among its entries in proportion to their `size`; `auto` entries take the height their\n content needs.\n2. The cuts of all splits along one axis are collected into the grid\'s tracks (rows and columns), and a region fills the\n rectangle of tracks it covers.\n3. `layoutTemplate(record)` returns that grid (`rows` as numbers or `auto`, `columns`, a cell grid of names, the areas with\n their spans) and the regions in reading order with every default and inherited `anchor` applied.\n\nNested sizes are relative to the entry\'s own parent, so a split of `{ "size": 2 }` beside a region of `{ "size": 1 }` is\ntwice as large, whatever its children\'s sizes. Because the grid is shared, the gaps between regions are the grid\'s gaps: a\nrow of two regions inside a column puts one gap between the two columns, as the cell grid does. The 40 built-in layouts\ncompile to exactly the grids they had in Gallery 4, so nothing they draw moved.\n\n## Binding content to regions\n\nSlide content stays flat. `bindRegions(slide, record)` (pure, on `/composition`) binds the slide\'s root nodes to regions,\nin source order; placed images (`placement`) take their band and never occupy a region, and a content group is one node of\nkind `group`.\n\n1. **Pins.** A block with `region: "<name>"` goes to that region when it exists, accepts the block\'s kind and has room.\n Otherwise the pin is ignored (`opf/region-unknown`, `opf/region-kind`, `opf/region-full`, warnings) and the block\n joins step 2.\n2. **Everything else.** Of the regions that accept the block and have room, the lowest role rank wins (pictures:\n media, primary, secondary, supporting; every other kind: primary, secondary, supporting, media), then the first in\n reading order (the order of the `regions` list, depth first). Then source order is kept across regions where the\n layout allows it (LH-122): a block drawn on the wrong side of another bound block moves to the equally ranked region\n that accepts it, has room and leaves it out of order with the fewest blocks, being drawn before a block it follows\n counting more than being drawn after one it precedes. The `timeline` layout has a `lead` region (text, auto height)\n between the title and the timeline and `notes` after it, so a text authored before the timeline is its lead and one\n after it (or between two timelines) a note.\n3. **No candidate.** The block goes to the overflow region whatever its `accepts` while it has room, and beyond `max`\n it is drawn there anyway with `opf/layout-unplaced` (`paginate` moves it to a continuation slide). A layout with no\n overflow region draws it in an implicit row below the grid.\n\n### Grouping before placement (layout harvest)\n\n`composeSlide` then groups the bound blocks before it places a cell (`groupBinding`, on `/composition`). The rules read\nblock kinds, counts and text lengths, never a layout or slide id, and work for any count and in right-to-left decks. A\nslide that pins any block with `region` keeps the binding above as written.\n\n1. **Repeated pairs (LH-58).** A block sequence that repeats one pair of kinds is one cell per pair: a figure (`metric`,\n `chart`, `table`, `image`, `video`, `code`) and a paragraph, in either order, or a long and a short paragraph (one at\n least twice the other\'s length, the long one on the same side of every pair), two pairs or more. The pairs go to the\n region the figure binds to, which may hold up to 6 of them (or its `max`, when larger); the other regions are empty\n and collapse. Inside its cell a pair is one row (each half at least 0.8 of the cell\'s height wide) or one column\n (the figure above its text), half a gap apart; every pair of a grid has one cell size, so the pairs match. On a slide\n that draws cards each block keeps its own card.\n2. **Group by kind (LH-82, LH-73).** A flowing region whose blocks are mostly (more than half, at least 2) of a kind it\n accepts keeps only those. The blocks it took only as the overflow region (within its room) go to another region that\n accepts them, beyond that region\'s `max`, or else to the implicit row below the grid; they are not\n `opf/layout-unplaced`. Up to 4 such blocks sit side by side in one row under the grid (or stacked, when that is\n shorter), and the row asks for at most 30% of the content box, down to its height at the minimum font size, so the\n grid keeps about 60 to 65% of the body. On `metrics`, 3 metrics and 2 notes are a row of metrics over a row of two\n notes; on `chart`, 3 charts and 2 notes the same.\n3. **Extra blocks join a region (LH-46).** A block no region had room for, on a layout with no overflow region, joins\n the region that accepts it instead of the row below the grid: a `flow: none` region takes up to 6 blocks (accepted,\n no finding: the region then flows as `auto`); a flowing region takes up to 12, drawn beyond its `max` with\n `opf/layout-unplaced` as an overflow region draws them (so `paginate` can still move them).\n - `flow: none` regions of one role side by side (the `first` and `second` columns of `comparison` or `two-column`)\n become one region of N cells: the first takes their blocks and any block bound between them in source order (the\n `verdict`), and the others collapse into it. Four texts on `comparison` are a 2 x 2 grid in reading order.\n - A lone fixed region arranges pictures as a **mosaic** and text, quotes and metrics as a **lead plus cards**. A\n mosaic is 2 or 3 pictures in a row, and 4 to 6 a lead picture at full height beside the others in two rows (the\n lead as wide as two of their columns); a region taller than wide stacks 2 and sets a lead picture across the top of\n 3 to 6. Mosaic pictures are cropped to fill (`cover`) unless the block, slide, deck or theme sets `imageFit` (the\n layout\'s own `contain` gives way). A lead plus cards is the first block across the region (a short one at the lead\n size) over the others in the balanced grid below, each row at the height it needs, placed by the region\'s anchor.\n - The closing\'s `details` region already flows, so its blocks join nothing; it takes the same lead plus cards (the\n guarded rule `closing-lead`). A layout whose one body region is a flowing `supporting` region, holding 3 to 6 plain\n texts that its `auto` flow would stack (a text too long for a cell of the balanced grid) and that read as neither\n paragraph columns (LH-70) nor a lead plus stack (LH-67), and whose other texts fill whole rows of the balanced grid (2, 3 or 4 of them, never a short last row), sets the first text, its call to action, across the region\n over the others in the balanced grid, as Claude Design draws a closing\'s details under its call to action. It is\n kept only when no text reads smaller and nothing more is found (the size guard).\n - The join is kept unless it overflows more than leaving the extra blocks below the grid (counting `text-overflow` and\n `small-cell`): measured blocks such as tables or timelines that need more room than the joined cells give stay below\n the grid with `opf/layout-unplaced`, where they read whole (three tables in `table-beside`\'s narrow region broke their\n words).\n\nAn empty region collapses into a neighbour that shares the full length of one of its edges (start side, end side, below,\nabove; a body region before a heading region). A column of the grid that holds nothing but empty regions (and heading or\nbelow-the-grid areas that span other columns too) gives way first (LH-65) when at least two columns with content remain, or\nwhen its empty region has no neighbor to collapse into (a `hero`\'s media column beside its stack of rows): it takes no width\nand no gap, and the columns left share the width by their own sizes, so two blocks in `three-column` draw 1:1 instead of one\ncolumn beside a neighbor that took the third column\'s width too. The empty region reports `collapsed` and a zero-wide cell where\nits column was. The column, and a nested group\'s new default gap (LH-89), are kept only when no block reads smaller than with\nthe columns and gaps of before (unless that removes overflow). Headings are centered vertically in their region unless every\nrow it spans is `auto`, so a `cover` or a title-only slide centers its title. A slide with promoted regions (`start`, `top:start`, ...)\ncomposes them as in 0.18.\n\nIn the Markdown dialect, `<!-- block: region=metrics -->` pins a block; a promoted-region key keeps its 0.18 meaning.\n\n## Flow\n\n| `flow` | Blocks are arranged |\n| --- | --- |\n| `none` | One block fills the region. |\n| `grid` | By count: 1 fills; 2, 3 in a row; 4 as 2 x 2; 5 as 3 + 2; 6 as 3 x 2; 7 to 12 in balanced rows of at most four (7 as 4 + 3, 8 as 4 + 4, 9 as 3 x 3, 10 as 4 + 3 + 3; LH-47: no row is more than one cell short of another). Rows and columns swap in a portrait region (7 as 3 + 2 + 2). The cells of a short row stretch to the full width; in a grid of only pictures and videos they keep the full rows\' size, one aspect, and are centered. |\n| `column` | Stacked at the heights the blocks need, one gap apart, and placed by the region\'s `anchor`. Charts, pictures, videos and diagrams take what the measured blocks (text, lists, quotes, metrics, code, timelines, tables) leave; a table (LH-44) needs its rows at the starting size, gives up height down to its rows at the floor and takes a share of any spare height. Blocks that do not fit share the region: each gives up the same fraction of what it can give up above its height at the minimum font size. A group\'s blocks in one column stack the same way. |\n| `auto` | `grid` unless a block is long: more than 6 lines (code: 12, table: 6 rows) in its grid cell at the starting size (28 px for prose), counted with core\'s estimate, never a host font. In an `auto` region a paragraph that wraps takes a reading measure of about 70 average characters of its size (never at the cost of size; it follows the content alignment) and a lone block of up to two lines uses the 32 px lead size. |\n\nSeveral timelines in one region are a stack of horizontal bands whatever the region\'s `flow` and `contentDirection`: one column, or two when one column does not fit at the readability floor (see [Dynamic composition](dynamic-composition.md#timeline-internals)).\n\n`design.contentDirection` makes every flowing region one row or one column. A slide\'s own `composition.mode`, `columns` and\n`weights` arrange its first primary flowing region with the 0.18 modes, above `contentDirection`. A list in a region\nwith `listColumns: "auto"` (the lone list of the design, and, since the RR-81 review, any list of the region that does not\nfit its own cell), or any list payload with `columns: "auto"`, tries 1, 2 then 3 columns at the starting size (a column at\nleast a quarter of the slide wide); `columns: 2` or `3` fixes the count. `auto` never deals a list of 6 or fewer entries\nacross columns (LH-42): such a list shrinks in its one column instead.\n\n**Several lists in a region (LH-42).** A region (on a slide without `design.contentDirection`) that\nreceives 2 or more lists and nothing else lays them out one list per cell, a card when the slide draws cards, so sibling\nlists never read as one table: 2 to 4 lists in that many columns, a multiple of 3 in 3 columns, any other count in 4\n(7 as 4 + 3). A column stays at least 7.5 list ems (240 px) wide; a narrower region fills its rows evenly (4 lists in 2 x 2),\nand a region taller than wide stacks up to 3 lists and takes at most 2 columns. Each row is as tall as its tallest list needs,\ndescriptions and nested entries counted, at the largest one size at which every row fits, and the region\'s lists share that\nsize. Cards share the height left over, so they fill the region; lists without cards keep their rows and the region\'s\n`anchor` places them. No list of the grid is dealt across columns.\n\n### Tracks\n\nColumns share the content width in proportion. Rows are allocated so that no row with content is squeezed to nothing:\n\n1. A heading `auto` row takes what its headings need, at most half the content box.\n2. The numeric rows keep at least what their content needs at the starting size, up to half of the space under the\n headings.\n3. The other `auto` rows take what they need from what is left (the implicit row below the grid holds what no region\n took). When that is not enough they shrink together: each gives up the same fraction of what it can give up above its\n content\'s height at the minimum font size, so a one-line note keeps nearly its need beside a dense row, and no row\n overflows while those heights fit.\n An empty region with `empty: "keep"` holds two lines of body text in an `auto` row (plus the card insets on a slide\n that draws cards, as a filled region does).\n4. The numeric rows share the rest in proportion to their sizes.\n\nParagraphs and lists of one stacked column that do not fit at their role sizes shrink together to the largest one size that fits, and read at that one size.\n\nSibling blocks share one size per kind (LH-43): the blocks of one region whatever its arrangement (every row of a `grid`,\na `row`, a stacked column), regions of one role in the same rows (the columns of `two-column` or `comparison`), and blocks\ndrawn below the grid with the parallel primary regions they continue (a lone primary region, such as a statement\'s message,\nkeeps its own size). Their prose, and their lists, are refitted at the smallest size any of them fitted at; sibling metrics\nshare it role by role (value, unit, label, description, delta, trend). A sibling the shared size would make overflow keeps\nits own fit, so the shared size never takes a block under the readability floor.\n\nSibling quotes in one row share one body size too (LH-78), and a region\'s similar paragraphs, a lead beside a stack and the start\nalignment of long text in a centered layout follow the rules in [Reading measure, alignment and\nleads](dynamic-composition.md#reading-measure-alignment-and-leads) (LH-70, LH-67, LH-72). A paragraph grid and a lead plus\nstack replace a lone fixed region\'s lead plus cards when they are no smaller; a `flow: grid` region never takes a lead plus stack.\n\nWhere sibling text and lists span several rows, the rows are sized jointly with the shared size instead of being fixed first:\nat each size of the type scale, from the largest start down, every row asks for its tallest cell\'s need at that size (a card\'s\ninsets included), and the largest size at which the rows fit is kept. This applies to a region\'s grid of paragraphs and lists\n(as LH-42 did for a list grid), to a stacked column, to an automatic grid, and to the parallel primary regions with the blocks\ndrawn below them (their template rows are allocated at that size). Leftover height goes to the rows in proportion to their\nneeds (cards, a grid of paragraphs, an automatic grid) or stays at the region\'s anchor (lists without cards), so a row of short\ntexts is a short row and a row of long ones a tall one. The cells of one row keep its height and columns keep their widths.\nSets that mix in other blocks (a metric, a picture, a chart) keep their rows and share sizes as above.\n\nA block that shrinks takes a size of the type scale (LH-17): from `minFontSize` up by a ratio of (28/16)^\xBC, rounded to whole\nreference pixels, which is 16, 18, 21, 24, 28 and 32 px at the default floor, with the half step between each two (LH-149: the\nratio to a half power, 17, 20, 23, 26 and 30 px). A block that fits at its starting size keeps it, on the scale or not. The half\nsteps matter most to siblings sized jointly: one size for all of them, the largest at which every row fits, so a whole step under\nthe size they fit cost every sibling a step (six FAQ pairs that fit 24 px drew at 21, now 23). They are a guarded rule\n(`half-steps`): a joint fit at a half step gives its rows other heights than the step under it, so the half steps are kept only\nwhere no block reads smaller than without them (dense comparison options that would reach 20 px only by setting the verdict\nunder them from 28 to 21 px keep 18 and 28). Half steps never change which arrangement wins: every choice between arrangements\n(the guard\'s rule sets, step badges, tracks, LH-83\'s recomposition at the floor) counts a block that shrank onto a half step at the\nstep under it, so a gain of half a step alone (16 to 17 px) keeps the slide\'s arrangement and an agenda keeps its step badges. The scale depends only on the floor and the canvas, so every slide composes\nindependently and the engines agree.\n\nComposed content never crosses a heading or another region and never leaves its region\'s box. What still does not fit\nuses the design\'s tools in order: text fits down to `minFontSize`, lists flow into columns where the region allows, blocks\nbeyond the room go to the overflow region and, through `paginate`, to a continuation slide; what remains is the\n`opf/text-overflow` or `opf/layout-unplaced` diagnostic.\n\nPagination continues on a new slide with the same layout: blocks beyond a region\'s `max` move first, in source order, and\ncarry a `region` pin to the region they came from. The pages of one slide share its type sizes (LH-144): each page after the\nfirst carries `composition.maxFontSize`, the largest size the first page draws for the kinds of block it holds (paragraphs,\nlists, quotes, metrics, timelines), so a last page with one timeline or a short list does not read larger than the pages before\nit. The cap only lowers sizes, never under `minFontSize`; headings, tables, code and charts keep theirs. A block that no region of the layout accepts, on a layout with no\noverflow region, stays below the grid on every page and never drives a split.\n\nThe export does one split on its own (LH-90). A slide whose body is two or more units of one kind (eight timelines, five\ntables; a unit is a block of the first block\'s kind with the blocks that follow it, so a timeline keeps its note) and that\noverflows at its readability floor continues on further slides of the same layout, split between whole units: the fewest\npages that fit, the units spread evenly, every page bound by the layout as the first is (no pins, so each page can\nrecompose). `opf convert` and `convert` draw that deck for the preview and the PPTX alike and report each such slide\n(`slide-continued`, report field `continued`); a strict slide still fails, and `paginate: false` (`--keep-slides`) draws\nthe slide as written. See [dynamic composition](dynamic-composition.md#pagination).\n\n## Design keys\n\nPer key: the slide\'s `design`, the deck\'s `design`, the theme record\'s `design` (new in 0.19: `titleAlignment`,\n`contentAlignment`, `contentBox`, `contentDirection`, `imageFit`, `listBullet`, `listStyle`), the layout\'s `design`, then the engine\ndefault. `design.mirror: true` draws a template mirrored (each row\'s cells and the column sizes reversed); a right-to-left\ndeck mirrors on top. `layout: "auto"` is automatic composition: reserved, never a catalog id, and `opf format` drops it.\n\n## Composition output\n\nFor a slide with a template layout, `composeSlide` adds (see the declarations on `/composition`):\n\n| Field | Meaning |\n| --- | --- |\n| `regions` | Every region in reading order: `name`, `box` (after collapse, mirroring and bleed), `accepts`, `role`, `flow`, `max`, `anchor`, `arrangement` (`grid`, `row`, `column`, or `composition`), `content` (root block paths bound within `max`), `overflow` (paths drawn beyond it), `collapsed`, `bleed` and, on a bled region, `areaBox` (its cell before bleed). It replaces `slots` for templates. |\n| `headingAreas` | The `title` (and `subtitle`) areas with their boxes, `collapsed` or `implicit`. On a template without a `subtitle` area the title area carries `parts: { title, subtitle }`: it is split where the stacked heading group puts the subtitle, so `title` runs from the area\'s top to the bottom of the title (the tag above it included) and `subtitle` from the subtitle\'s top (half a gap under the title when the slide has none) to the area\'s bottom. PowerPoint\'s `ctrTitle` and `subTitle` placeholders use these boxes. |\n| `items[].region` | The region an item was drawn in, for tagging shapes. |\n| `steps` | LH-07: what each `sequence` region draws besides its text, in reading order: `form` (`row`, `column` or `flow`), `badges` (`cx`, `cy`, `radius`, `label`, `fontSize`, `baseline`, and `list` when the badge draws a list entry\'s own number), `connector` (`x1`, `y1`, `x2`, `y2`), `chips` and `arrows` of a flow, and `lineWidth`. |\n| `items[].listColumns` | A list in columns: one `{ box, start, end, text }` per column at one shared size; numbering continues. The item\'s `text` is the whole list (every entry at its column\'s position), so a consumer that ignores `listColumns` still draws every item. Entry paths are the payload\'s: `<list>.<n>` for a string item, `<list>.<n>.text` for an object. |\n\n### Step sequences (LH-07)\n\nA region with `sequence` lists the steps of a sequence, and composition draws them as Claude Design does:\n\n- **Steps side by side** (`steps`): two or more text or list blocks are the steps. Each draws under a numbered badge, an accent circle\n 1.75 times the step text across with its numeral at the step text size, in the scheme color readable on the accent. The badge sits\n 0.4 of its width above the text, at the block\'s start (its right edge in a right-to-left deck), or over its middle when the block is\n centered. The badges of a row share one line, and a connector in the border color runs through their centers. A one-entry numbered\n list gives its badge its number and draws as a heading over its description (LH-77); any other block is numbered by its position.\n Each block keeps the band for its badge in the height it asks for and in its cell.\n- **A list\'s entries** (`steps` for a lone list of two or more entries, `numbered` for every list of two or more entries of one level,\n numbered or not, since an agenda runs in time): each entry draws beside its\n badge in the list\'s marker column (the side its paragraph starts), centered on its first line, with a connector down the column. The\n badges are at least 0.4 of their width apart. The list keeps its numbers (`marker.number`); a list without `numbering` is counted in\n arabic as drawing only: the document keeps no numbering and the PPTX import gives the list back unnumbered. In a `numbered`\n region the unnumbered lists count on from one list to the next, as one agenda, and keep their markers when one of the region\'s\n lists cannot take badges (a lone entry, nested entries), so a part of the agenda is never numbered alone.\n- **A flow** (`steps`): a lone list of 3 to 6 entries of one or two words (24 characters at most), without descriptions, is a row of\n chips (cards) joined by accent block arrows in reading order. The chips share the region\'s width when the widest entry fits each,\n else each hugs its entry; each entry is a list column centered in its chip.\n- **Numbered rows** (`numbered`, LH-134): an agenda whose every entry, in every list of the region, has a description draws as ruled\n rows instead of badges: each number a numeral at the list size, bold in the accent and in two digits under 10 ("01"), in a column at\n the row\'s start (the right in a right-to-left list), the label bold and the description in a second column beside it when the labels\n fit 40% of the width, a hairline between two rows and no connector. One entry without a description keeps every list of the agenda\n beside badges, so an agenda is drawn one way. The numbers stay drawing, as the badges\' are.\n\nSteps keep their text size: the badges are a guarded rule (`step-badges`, and `numerals` for numbered rows), so a slide whose blocks\nwould get smaller under them draws as before (LH-168: the comparison is also of the smallest size each block draws, a list\'s label and description\nsizes, not of the list\'s base size, which is the label\'s in columns and the description\'s beside a badge; steps whose descriptions wrap\ndraw as a stepper in every language, and a row of steps is centered under the title as the columns are). A step\'s label never splits a word (LH-173): a label whose widest word does not fit its column at 1.25 times the list size steps down to the size the word fits at, never under the list size, and the labels of the row take that size too; LH-48\'s growth stops at the step before one that breaks a word of any label or description. A flow that does not fit one line at the list\'s size stays a list. A lone badge list\ngrows (LH-48) as the plain list would, as long as it fits with its badges (or numerals). The preview draws the badges, numerals,\nconnector, chips and arrows from `steps`, and the PPTX export writes them as native shapes (an ellipse holding its numeral, a text box\nholding a numeral, a line, rounded rectangles and `rightArrow` or `leftArrow` presets), tagged so that import consumes them and gives a\nlist its numbering back. Which of numerals, badges and plain rows a list takes is one rule, written down in\n[Dynamic composition](dynamic-composition.md#numerals-badges-or-rows-lh-134).\n\n### A body that fills too little (LH-48)\n\nShort content steps up instead of sitting small at the top of an empty body, as Claude Design sets a short message.\n\n- **A lone block.** When a slide\'s whole body is one paragraph, list, quote, code panel, metric or table (the only block of\n an automatic slide, or a template slide\'s only block, with nothing below the grid), its region\'s cell reaches the foot of\n the content box when every other region is empty, and the block takes the body. When it fills under half of that height\n at its role sizes it steps up: a paragraph or a list by the steps of the type scale above its size, a quote, code panel,\n metric or table by the scale\'s ratio on every role, to the largest step at which it fills at most 60% of the body and\n every part keeps the size it asks for. No role grows past its display size (`LONE_DISPLAY_SIZES`: text 43 px, a list 37,\n a quote 56, code 32, a metric\'s value 152, a table 32, at a 720-pixel short edge). The block then sits in the middle of\n the body, its card hugging it; a grown table\'s rows grow with its type (`items[].tableGrowth`, which both engines pass to\n `layoutTable`). A block that fills half the body or more keeps its sizes and its place.\n- **A body of paragraphs and lists.** Two or more text and list blocks (in a layout\'s regions, or on a slide without a layout)\n that fill under half of the body below the headings (the height their text covers, so the empty space inside cards that share\n the body, as LH-86\'s rows, does not count), with nothing overflowing and no text at the floor, are composed again one, two or three type-scale steps larger (each up to a\n list\'s display size, 37 px), and the largest step that adds no finding, sets every block larger and fills at most 60%\n is kept; siblings keep one size (LH-43) and no block reads smaller than before. On a layout the body then sits in the\n middle of the space under the headings: rows that hug\n their content move down, regions take the height their blocks need in the middle of their cells, and cards hug their\n text (LH-64\'s hug, whatever it fills of a card).\n- **Never grown by these two rules.** A stacked record (`statement`, `quote`, `closing`, which place their message as one stack, a closing at the foot (LH-155), and grow by\n LH-129\'s rule below), blocks below\n the grid (a section\'s notes), a body with a picture, chart, video or timeline beside its text, a captioned block, a\n list in columns, an overflowing composition, and `composeSlide(slide, { fill: false })`, for hosts and tests of the\n role sizes. Both engines read the result from core.\n- **A message in the middle of the slide (LH-129).** A slide whose title stands free (centered in a sized title area, or in a\n stacked record) over no primary or secondary block, such as `cover`, `section` and `closing` or a slide with no body and no\n layout record, grows its title and subtitle by one, two or three steps of the type scale, each up to its display size\n (`HEADING_DISPLAY_SIZES`: title 75 px, subtitle 37; the tag is LH-32\'s eyebrow at its 22 px role size and keeps it); a\n title over a primary block (a quote\'s) keeps its size; a statement\'s title over its paragraph is LH-09\'s message below. A stacked record (`statement`, `quote`, `closing`) grows its body by the same steps: paragraphs and lists up to a list\'s\n display size, quotes by the scale\'s ratio on every role (`LONE_DISPLAY_SIZES`). The largest step is kept at which nothing\n overflows, every text is at least as large as at the step before, no heading takes another line or lands off the scale, every\n region keeps its arrangement and blocks, LH-06\'s band or pill stays, no block reads smaller under the guard, and the text covers\n at most 60% of the content box. The record\'s stack or centered title area places the larger text as it placed the smaller.\n- **Statements and short messages (LH-09, LH-69).** The `statement` record is start-aligned with LH-130\'s rule over its title.\n A sentence title over a paragraph is the message: it grows to display size (75 px), the paragraph keeps its size. A metric, or a\n text under a title of at most 4 words, is the message: the stack gives way, the title is the running head and the block fills the\n body (LH-48, LH-101). A lone text of at most 25 words (`messageWords`, any script) grows on to 56 px (75 px at 4 words or fewer)\n on at most 4 balanced lines, and (RR-105) only to a step whose lines keep the minimum measure of LH-66 (28 average characters once it runs to 4 lines), so on a narrow slide, portrait or square, it stops one step lower (49 px) instead of falling back to its plain size; its bold runs draw in the primary color where that reads 4.5:1. A lone one-entry list with a short\n label draws it as a display word over a short rule; a placed region\'s short text is a bold heading, drawn as a tile when it is no\n sentence (see [Placed tiles](dynamic-composition.md), `placed-tiles`). Guarded rules\n `statement-message` and `display-message`.\n LH-163: where the primary does not read 4.5:1 on a dark or accent surface, a display message\'s bold words draw in a lighter tint of\n the primary that does (hue and saturation kept, lightness raised), never in a color the author did not mark. LH-164: a slide whose\n whole body is one such message takes the accent surface on a light deck, where the accent is calm enough to fill a slide (docs/design-resolution.md, "A message-only slide").\n- **Pricing tiers (LH-135).** A slide whose body is 2 to 5 groups, each a metric with a `label` followed by a list or text (a\n tier\'s name, price and what it includes), draws each group as one card of its region\'s cell, in one row: the label is the\n metric\'s eyebrow (bold capitals with tracking, at the tag\'s 22 px, in the eyebrow\'s color; `MetricLayout.eyebrow`), the price\n under it at display size (80 to 96 px, 96 to 128 px for two tiers, stepped down to the one line the card holds, so "$49" and\n "$1,200/mo" never split), then the description and the details, from the top of the card. The cards share one top edge and one\n height (LH-22\'s full-height cards) and every item of a tier shares the tier\'s `frameBox`, so a card is drawn once. The prices that\n reach their 76 px role size read at one size; each tier\'s details keep the size they fit at. The guard holds every block to the\n size it had as two cards, so a price too wide for the narrower card (a four-tier row with "$1,200/mo") keeps them. A group with\n `emphasis: true` keeps LH-06\'s surface and the other tiers are cards. The group\'s `composition` is read as a column.\n- **Rows of figures (LH-169).** A list of 2 to 4 first-level entries that each lead with a short figure (`figureText`: a number with\n its unit or comparison, after an optional sign and currency symbol, at most 4 words: "62 minutes a day", "1 in 6 reports", "$3.2M",\n "\u0666\u0662 \u062F\u0642\u064A\u0642\u0629 \u064A\u0648\u0645\u064A\u064B\u0627"; not a step number, a clock time, a year or a day of a month) and carry a description (`figureList`) draws as a row\n of metrics, as Claude Design draws narrative n15: one column per entry across the list\'s box, in reading order (from the right in a\n right-to-left deck), each the figure bold in the accent at display size (at most the metric value size, 76 px) over an accent rule,\n its description as the label under it at the size the list draws its descriptions. The figures share one size, the smallest any of\n them fits on one line at, never under the list size; a figure that would split there, or a label that overflows its column, keeps the\n list. A list where only some entries lead with a figure, figures without descriptions, a numbered list, a list with icons, columns, a\n caption or the author\'s `listStyle` stay lists. The row is drawn at the size the list has after the guard and LH-48\'s growth, so its\n labels never read smaller than the list\'s descriptions; a region that holds only such a list has no card. It is a list in columns\n (`listColumns`, each entry `accent` and `heading`), which both engines draw natively. The guarded rule `figure-row`.\n- **Pillars with one-word titles (LH-136).** A slide whose body is 2 to 5 lists of one entry each, a single word (at most 14\n characters) with its description, draws each as the word at display size (2.3 times the description\'s size, stepped down to one\n line and to the height the box leaves over the description) in bold over an accent rule of 0.14 em across the block (a native\n line in PowerPoint, `ListFit.rules` with `accent`), with no card. Sibling words read at one size. Any other set, a title of\n several words included, keeps its cards. fitList\'s `display` option (with `heading`) draws one list this way.\n- **A lone timeline (LH-129)** in a template\'s timeline region, or an automatic slide\'s only block, first tries three and then two\n steps of the type scale on its labels (its 18 and 22 px roles to 28 and 32, or 24 and 28 px), and keeps the first at which it fits\n its box in the same arrangement and no label (the name, a date, an event) takes another line; otherwise it grows by LH-41\'s few\n pixels as before.\n- **A lone code panel (LH-101)** grows its code in type-scale steps up to the code display size (32 px) while it covers at most\n 60% of the body, and its panel hugs it in the middle of the body. Only code that covers at least 60% of the body takes the whole\n body, its lines in the middle of the panel (`layoutCode`\'s `fill`).\n- **A body of other kinds (LH-102).** A body of text, lists, quotes, metrics, code, tables or timelines (a picture only in a bled\n region, such as hero\'s media) that covers under 60% of the body height after its regions take their need sits in the middle\n of the space under the headings, as a body of paragraphs does, when it moves as one (a region the layout holds at the foot keeps\n the body where it is) and no block reads smaller. Pictures, charts and videos in other regions keep the layout\'s cells.\n Without a layout, a short body of paragraphs and lists that still covers under half of the body after LH-48\'s three steps\n grows on past a list\'s display size, as LH-05\'s compact grid does: step by step up to 56 px, each step larger, nothing\n overflowing, at most 60% of the body covered, the body keeping its rows and columns (a body that may draw step badges or\n cards keeps the three steps, so those drawings are held to the same body). The stack then sits in the middle of the body under the headings, rather than\n at its top over an empty foot. Promoted regions that\n each run the body\'s full height (`start`, `center+end`) and hold only paragraphs and lists set them as one band in the\n middle of the body, each block starting at the band\'s top. Both are composed with LH-48\'s centering and kept only when\n no block reads smaller and nothing overflows.\n- **Mixed cards (LH-64).** A row of middle- or bottom-anchored cards with a table, code panel or timeline among other measured\n kinds starts at the card top (or hugs and centers in an under-filled body) instead of each kind at its own anchor.\n- **Reading measure (LH-10).** A paragraph in a region wider than about 70 average characters of its size is set on that\n measure at the start edge, unless the body would then fill too much to grow: a readable size outranks the measure.\n\n### Recomposition at the readability floor (LH-83)\n\nA layout whose regions leave its content too little room sets that content at the readability floor. When a template\'s\ncomposition sets a body role at the floor, `composeSlide` composes the same blocks again as the automatic grid\n([dynamic composition](dynamic-composition.md)) and keeps that result when its smallest body size is larger (or as large and it reports less overflow), it reports no\nmore overflow (`text-overflow`, `small-cell`) and no more of its fits break a line inside a word; otherwise the layout\'s\nresult stands. Both compositions are pure, so the choice is deterministic, and both engines read it from core.\n\n**Before the floor (LH-186).** A template\'s composition that sets a paragraph, list or table more than one step of the type scale\n(16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 32 px) under its role size (28 px prose, 32 px lists, 25 px table cells, each held to\n`composition.maxFontSize`), but above the floor, is composed as the automatic grid too, under the guarded rule `layout-first`. That\nresult is kept (`recomposed`) only when it adds no finding, sets no block smaller, reads as well (no more split words, no prose\nunder the minimum measure) and sets the most shrunk block at least one step larger: an agenda\'s two lists that the agenda-split\nlayout sets at 18 px beside its title read at 32 px across the slide. A text run with its own `fontSize`, a block pinned to a\nregion, `recompose: false` and `fill: false` keep the layout. So composition grows short content to fill, changes the arrangement\n(columns, the automatic grid, another design) before it sets text smaller, and fits dense content that no arrangement holds down\nthe type scale to the readability floor, never below it, flagging what still does not fit.\n\n- **Body roles.** Text, lists and table cells, and the main part of the other payloads: a quote\'s and a code panel\'s body, a\n metric\'s value and label, and a timeline event\'s `what`. The other parts (attribution, filename, language, unit, delta,\n description, trend, a timeline\'s name, dates and notes) ask for 14 to 20 px by design, so reaching the floor is no squeeze\n and never triggers it. Headings are not body. The floor is the composition\'s `minFontSize` (16 reference pixels at a\n 720-pixel short edge, 12 pt).\n- **What stays.** Every block is drawn, in source order. The header and footer bands, the footnote area, placed images and\n the background are the slide\'s own and do not change. The layout record\'s `design` (alignment, cards, list bullet, image\n fit, background variant) and `composition` (padding, gap, `minFontSize`) still apply. The slide keeps its `layout`, so\n the PPTX export still uses that layout\'s native slide layout, and an edit that gives the content room (fewer blocks,\n `paginate`) returns the slide to its regions.\n- **What changes.** The tag, title and subtitle are a content slide\'s heading group above the body, as on an automatic slide\n (the one-line title steps of LH-51 and LH-76), not the layout\'s title area. Region semantics do not apply: the result\n has no `regions` or `headingAreas`, no item names a `region`, and no `opf/layout-unplaced` is reported, since every block\n is in the grid.\n- **Reported as** `recomposed: { layoutSize, size }` on the composition: the smallest body size the layout fitted and the\n smallest of the result, in reference pixels. Validate reports the findings of the result it composes.\n- **A chart too short (LH-49).** A layout that leaves a chart\'s plot shorter than its minimum (the larger of 120 reference\n pixels and 22% of the body\'s height, `chartPlotBox`) is recomposed the same way, at any body size, when the automatic grid\n draws the shortest plot taller and reads as well: no more overflow or split words, no more paragraphs under the reading\n measure, and no block\'s body size smaller (only a layout that overflows may trade size, to overflow less, never at the floor). `recomposed.chart` then holds the shortest\n plot of the layout and of the result, `{ layoutPlot, plot }`. A wide chart region the layout draws on purpose (`chart`,\n `dashboard`) keeps its proportions: only the plot\'s height triggers it. chart-beside with its notes holding further charts\n (a few pixels of plot each) becomes the automatic grid of charts above their notes.\n- **Never recomposed.** A slide the layout fits above the floor, a cover, a slide with promoted regions, a slide with a block\n pinned to a region (`region`: the author chose the region), and `composeSlide(slide, { recompose: false })`, for hosts\n that need the regions and for tests of a layout\'s own geometry. A strict composition (`overflow: "error"`) that the layout\n cannot fit still fails, and an automatic grid that fails strictly is not kept.\n\n`composeLayoutAreas(record, options)` gives the areas of the empty layout: where a PowerPoint slide layout puts a placeholder\nper area. It is `composeSlide`\'s own geometry for a slide with a one-line title and subtitle and every region kept, so it\ntakes `composeSlide`\'s options (`width`, `height`, `presentation` for the deck\'s header and footer, `direction`, ...) plus\n`mirror`, `placements` (placed-image bands to reserve, `{ edge, size, inset }`) and `bleed` (default `true`: a bled region\nreaches the slide edge as on a slide; `false` gives its cell inside the content box). Its title area carries the same\n`parts` as a slide\'s. `bindRegions`, `layoutTemplate`, `regionAccepts` and `gridFlowShape` expose the rest of the model.\n\n## No migration from the 0.18 ids\n\n0.19 breaks layouts: there is no migration path. A layout id of the 0.18 default catalog that 0.19 does not have is an\nunknown layout like any other (`opf/unresolved-reference`: the slide composes automatically and a strict export fails).\nSix 0.18 ids are also 0.19 built-ins and resolve to them: `agenda`, `comparison`, `dashboard`, `faq`, `timeline` and\n`two-column`. The release notes list the 40 built-ins.\n'
231
+ "markdown": '# Layout templates\n\nA layout is **one ordered list of regions, declared once, in reading order.** Each region says how much of the slide it\ntakes (`size`), which content it accepts and how several blocks share it. The list has a `direction`: `row` puts the\nregions side by side, left to right; `column` stacks them top to bottom. For two dimensions, an entry of the list can be\na **split**: a nested list that runs the other way. That is the whole format. There is no grid of cell names to keep in\nstep with a table of sizes and a table of rules.\n\nA layout record (`https://openpresentation.org/schema/opf-layout/v2`) is an ordinary JSON object. The built-in layouts\nand a deck\'s own layouts are records of this one schema; a custom layout is embedded under `catalogs.custom.layouts` (or\na named catalog group) and referenced by id like any other. This page is the reference for what core implements.\n\n> The 40 built-in templates come from the matching `@openpresentation/gallery` package. Core and Gallery 5 use the region\n> lists documented below; Gallery 4 and earlier used a grid of area names (`areas`). Use coordinated core and Gallery\n> versions. V1 layout records, including `placeholders` and placeholder groups, remain unsupported; there are no aliases or\n> migration API.\n\n## A record\n\nA story on the left and the evidence beside it, a third of the width:\n\n```json\n{\n "$schema": "https://openpresentation.org/schema/opf-layout/v2",\n "id": "story-and-evidence",\n "name": "Story and evidence",\n "direction": "row",\n "anchor": "middle",\n "regions": [\n { "name": "main", "size": 2, "accepts": ["text"] },\n { "name": "aside", "size": 1, "accepts": ["metric"] }\n ]\n}\n```\n\nRead it left to right, because the record\'s `direction` is `row`: `main` first, then `aside`, and `main` is twice as wide.\n`anchor: "middle"` is written once and applies to both regions. A block targets a region by name (`"region": "aside"`),\nand a slide\'s blocks otherwise bind to regions by kind, role and the order of the list.\n\nA layout with a title and a row of two regions, the most common shape of the built-ins, nests one split:\n\n```json\n{\n "name": "Two column",\n "regions": [\n { "name": "title" },\n { "direction": "row", "regions": [\n { "name": "first", "accepts": ["text", "list"] },\n { "name": "second", "accepts": ["text", "list"] }\n ] }\n ]\n}\n```\n\nThe record\'s `direction` is omitted, so it is `column`: the title on top, then one entry, a split whose own `direction` is\n`row`. A split has no name; it is a place to put regions the other way. Splits nest up to three levels, so a record can\ndescribe any layout made of full-width and full-height cuts (a guillotine partition), which is every built-in layout.\n\n`hero` nests the other way, with sizes: a row of a text column (the title, the lead and the supporting content) and a\npicture two thirds as wide, bled to the slide\'s edges. A heading region may sit inside a split.\n\n```json\n{\n "name": "Hero",\n "direction": "row",\n "regions": [\n { "direction": "column", "size": 3, "regions": [\n { "name": "title" },\n { "name": "lead", "size": "auto", "accepts": ["text", "quote", "metric"], "flow": "none" },\n { "name": "support", "accepts": ["text", "list", "metric", "group"], "role": "supporting", "flow": "grid" }\n ] },\n { "name": "media", "size": 2, "accepts": ["image", "video"], "role": "media", "flow": "none", "bleed": true }\n ]\n}\n```\n\n| Field | Meaning |\n| --- | --- |\n| `direction` | `row` (side by side, left to right in reading order) or `column` (stacked, top to bottom). Default `column`. |\n| `regions` | 1 to 12 entries in reading order, each a region or a split. |\n| `anchor` | Vertical position of the content of every body region under the record (or split) that does not set its own. Inherited by body regions only, never by `title` or `subtitle`. Exception: on a column record whose entries are all `auto`, it places the whole stack (see Choosing an anchor). |\n| `overflowRegion` | Where content no region accepts goes. Omitted: the first `primary` region whose flow is not `none`. |\n| `design` | The layout\'s design defaults (below). |\n| `composition` | Only `gap`, `padding`, `minFontSize` and `overflow`, with their 0.18 meaning. |\n\nAn entry of `regions` is one of three things:\n\n- a **region**: `{ "name": "...", "size"?, ...rules }`, the rules below;\n- a **heading region**: `{ "name": "title" }` or `{ "name": "subtitle" }`, which take only a `size`, an `anchor` and (the\n `title`) a `rule` (see [Display headings](#display-headings-lh-130));\n- a **split**: `{ "direction": "row" | "column", "regions": [...], "size"?, "anchor"? }`, a nested list.\n\n`size` is a number above 0 and up to 100 (default 1). Siblings share their parent\'s length in proportion, separated by the\ngap, so `2` and `1` are two thirds and one third. `"auto"` is the height the content needs, up to the space the headings and\nthe numeric rows\' content leave (see Tracks), and an `auto` region with no content takes no space; it is allowed only on an entry of a `column` (a `row` has no height\nto ask for), and elsewhere it is the validate finding `opf/layout-template`.\n\n`title` and `subtitle` are reserved heading regions: `title` holds the tag, title and subtitle stacked, and a `subtitle`\nregion takes the subtitle out of it (a `subtitle` needs a `title`). Their `size` defaults to `auto` inside a `column` and to\n1 inside a `row`, so a cover that puts the title beside a picture is `{ "direction": "row", "regions": [{ "name": "title" },\n{ "name": "media", ... }] }`. A layout with no `title` region gets an implicit `auto` row on top for a slide that has\nheadings. Region names are unique across the whole record and may not be `tag`, `auto` or a promoted-region word (`start`,\n`center`, `end`, `top`, `middle`, `bottom`).\n\n### Regions\n\n| Field | Values | Default |\n| --- | --- | --- |\n| `name` | lowercase kebab-case, unique in the record; a block\'s `region` names it | required |\n| `size` | a number above 0 and up to 100, or `auto` (columns only) | 1 |\n| `accepts` | `text`, `list`, `image`, `video`, `chart`, `table`, `code`, `metric`, `quote`, `timeline`, `diagram`, `group` | every body kind and `group` |\n| `role` | `primary`, `secondary`, `media`, `supporting` | `primary` |\n| `flow` | `none`, `grid`, `column`, `auto` | `auto` |\n| `max` | 1 to 12 (`none` requires 1) | 1 for `none`, else 6 |\n| `bleed` | boolean: outer edges on the content box reach the slide edge; never a card | `false` |\n| `listColumns` | `"auto"` (a list of more than 6 entries that does not fit its cell flows into up to three columns before it shrinks) or `1` | `1` |\n| `metrics` | `stack` (value, unit, label and the rest as one block at the anchor) or `tile` (LH-68: each metric fills its cell, label first as an eyebrow, the value asking for a quarter of the cell\'s height between 76 and 152 px, description, delta and trend at the cell\'s foot, start-aligned; the gallery `scorecard` uses it) | `stack` |\n| `sequence` | `steps` or `numbered` (LH-07: the region lists the steps of a sequence, drawn under numbered badges joined by a connector, see [Step sequences](#step-sequences-lh-07); the gallery `process` uses `steps`, `agenda` and `agenda-split` use `numbered`) | none |\n| `arrangement` | `pyramid`, `matrix`, `cycle`, `chevrons`, `flow`, `vertical-flow`, `org-chart`, `hierarchy` or `venn` (SH-09, SH-18: the region\'s lone list of one level draws as PowerPoint\'s Basic Pyramid, Basic Matrix or Basic Cycle geometry, exported as live SmartArt where PowerPoint draws it as the preview does, or as OPF\'s own design of the arrangement where PowerPoint\'s does not hold the entries; a matrix of other than four entries draws cards; see [Pyramids, matrices and live SmartArt](smartart.md); the gallery `pyramid`, `matrix` and `cycle` use them; SH-17: `chevrons` draws the list as PowerPoint\'s Basic Chevron Process, `flow` as its Basic Process (boxes with arrows) and `vertical-flow` as its Vertical Process, or OPF\'s own rows or columns of them, used by the gallery layouts of the same names; SH-21: `org-chart` and `hierarchy` preserve a single-root tree through list-entry `level` (an org chart also places an entry with `assistant: true` beside the line below its manager), and `venn` holds one to seven flat set labels (and a last entry with `overlap: true` that labels their common overlap); malformed trees or labels that do not fit keep the complete list with a finding) | none |\n| `pyramidDirection` | `up` (default: narrow tip at the top) or `down` (widest first, tip at the bottom), only with `arrangement: pyramid`. The `inverted-pyramid` gallery layout uses `down`. Entries retain their authored top-to-bottom order; downward pyramids export as editable native shapes until a live SmartArt domain is measured. | `up` |\n| `anchor` | `top`, `middle`, `bottom` | inherited from the nearest split or the record, else `top` |\n| `empty` | `collapse`, `keep` | `collapse` |\n\n### Choosing an anchor\n\nA block\'s `region` selects a named region; that region\'s `anchor` controls vertical placement inside it. Region names such\nas `main` and `aside` have no special positioning behavior. Declare the names in the layout\'s region list. Write `anchor`\nonce on the record (or on a split) when every region under it shares it: body regions inherit it, a region\'s own `anchor`\nwins, and the heading regions never inherit it (they set their own, see [Display headings](#display-headings-lh-130)).\n\nUse middle anchoring for a compact statement, quotation, headline metric or short explanation beside a visual. Keep\nsubstantial text, lists, charts and tables top-aligned so readers can compare common starting positions. A region\'s\nanchor never moves the title: it stays in its own heading region. Anchoring does not enlarge short text to fill unused space.\n\n#### Display headings (LH-130)\n\nA heading region takes its own `anchor`, which places the heading group (tag, title and subtitle) in a sized area: `middle`\n(the default) centers it, `bottom` sets it at the foot of the area and `top` at its top. An `auto` area is as tall as the\ngroup, so its anchor changes nothing. The `title` region also takes `rule: true`: a slide whose headings are its message\n(no primary or secondary region holds a block and nothing sits below the grid) and that has a title but no tag draws a short\naccent rule, 80 by 5 px at a 720 px short edge, half a gap above the title at its start edge (the right in a right-to-left\ntitle). A tag is the group\'s eyebrow and takes the rule\'s place. Both engines fill it in the tag\'s color: the primary, or the\ntext color where the primary is under 4.5:1 on the slide (`SlideComposition.titleRule`; the PPTX export writes a native\nrectangle tagged `OPF_TITLE_RULE_V1`, which import consumes as the layout\'s drawing). The gallery `cover` and `section` use\nboth, with `titleAlignment` and `contentAlignment` `start`, so a display title sits low at the start edge as Claude\nDesign sets it, with the section\'s tag ("Part 1") as its eyebrow.\n\nOver a picture background the group goes where the measured picture is calm under its text (LH-158, see\n[text on a picture](image-treatments.md#text-on-a-picture)); in a run that measured nothing, a `bottom` group is centered as\nbefore LH-130, keeping its start alignment, rule and eyebrow. Plain and variant backgrounds keep the low anchor.\n\nLH-155: the gallery `closing` takes the same treatment as a stacked record: its all-`auto` column has `anchor: "bottom"`, so the stack (the title\nunder the accent rule, then the contact lines) stands at the foot of the content box at the start edge, as Claude Design sets a closing. The\nrule rides on the title (`rule: true`) and is a guarded rule (`title-rule`): where the stack has no room to spare, so that the rule\nwould set the contact lines smaller, the slide has no rule. Over a picture background the low stack is placed by the same scores as a\nheading group (LH-158), as one group (title and contact lines) at the top, middle or foot of the content box, keeping its alignment and\nwith no panel; `textPlacement` picks its anchor. In a run that measured nothing the stack is centered, as it was before.\n\nSuch a title grows to display size by steps of the type scale (LH-129, up to 75 px). A title that fits one line at its role\nsize may take a second line on the way (LH-130) when the two lines read as one balanced block: the shorter at least half the\nlonger, and no line but the last ending in a one-letter word or an article. A title that already wraps keeps the breaks its\nrole size balanced (LH-148). Nothing is set smaller than without the growth.\n\n#### Placing the whole group\n\nA single-message slide (a statement, a closing, a quotation) reads best when the title and what belongs to it sit together\nin the middle of the slide. A column has no numeric row to hold the leftover height when **every entry of the record\'s\n`regions` list is sized `auto`** (`title`, `subtitle` and the body regions alike), so the record\'s `anchor` then places\nthe whole stack, headings included, in the content box\'s leftover height: `middle` centres it, `bottom` sits it at the foot,\n`top` (the default) starts it at the top. Empty optional regions collapse and take no space, so a title-only slide centres\nthe title alone.\n\n```json\n{ "id": "closing", "direction": "column", "anchor": "middle",\n "regions": [ { "name": "title" }, { "name": "details", "size": "auto", "accepts": ["text", "list", "image"], "flow": "auto" } ] }\n```\n\nThe rule applies only to the record\'s own `anchor` on a column record with all-`auto` entries (an `auto` split counts as an\n`auto` entry). A record with any numeric entry, a row record, and a split\'s own `anchor` keep the behaviour above, so no\nexisting record changes until it opts in. `LayoutTemplate.stack` reports the resolved anchor.\n\nThe measured-content implementation supports text/list leaves and uncaptioned quote/metric leaves. A quote keeps\nits body, attribution and photo together. A metric keeps its value and metadata together without reducing the\nnominal font size merely because its placement box becomes shorter. Grid and horizontal rows share an origin\nbased on their tallest measured content, so differing description lengths do not stagger headline numbers.\nContent that does not fit retains its allocation and overflow diagnostics. Nested groups, captioned quotes/metrics,\ncharts, tables and explicit slide composition overrides keep their existing allocation behavior; an anchor is not\na promise to measure arbitrary content.\n\nOn a slide that draws content cards (`design.contentBox`), a row of cards is one row of a region\'s grid, or the lone blocks\nof regions side by side (two-column, three-column). The anchor sets how the row stands:\n\n- `middle` or `bottom`: a card fills its cell (starting half a gap down, clear of the heading) and the anchor places its\n content inside it, while a card carries a picture, a metric or a heading line (a labeled list item). A row of body text\n only (paragraphs and plain lists) does not (LH-64): when the tallest text fills under 45% of a filled card, the cards hug\n it with one height and the row centers in the region, since short text at the foot of a tall card reads as an empty card;\n rows that all hug stack one gap apart. When the texts are longer and their heights more than 1.5x apart, the cards still\n fill but every text starts at the card\'s top, so a short text does not sit alone at a foot beside long ones.\n- `top`: cards of measured blocks (text, lists, quotes, metrics) hug the tallest of their row, from the top, with one height\n per row (LH-04); a row with a picture, chart, table or group keeps cells the size of the region\'s share.\n\nLong texts are drawn as full-width rows (LH-86). Side by side, two or three paragraphs of at least 80 characters read as narrow\ncolumns of long lines, or as a short one in a wide card beside a long one in a narrow card when an empty region collapsed into it.\nOn a slide that draws cards, when the filled regions of a layout lie in one row and hold only such paragraphs (two or three, in\nseveral regions or in one region\'s grid), every paragraph moves to the first region of that row in reading order. The other\nregions are left empty and collapse into it, and that region stacks them one card per row across the row. The slide must have no\n`contentDirection` and no composition of its own, and must have nothing beyond a region\'s room or below the grid.\n\nA stacked column of such cards (these rows, or more long paragraphs one region stacks) shares the region\'s height. The text is\nset at the largest size of the type scale at which every row fits, each card as tall as its text plus the insets of a card that\ntall. The gap between the cards closes to half a gap when that sets the text larger. The cards share the leftover height in\nproportion to their needs, and each card\'s text sits in the middle of its card. When the texts would fill under 45% of that\nheight (a few short paragraphs), the cards hug their text instead and the stack sits in the middle of the region, as LH-64\'s rows do.\nThe rows are kept only when their smallest body size is at least the one the regions side by side give, or they overflow less;\notherwise the layout\'s regions stand.\n\nPictures shown whole and videos follow the anchor too (WI-3). A picture with `fit: "contain"` (a layout\'s `imageFit`, or the\nblock\'s own, or `auto` that resolves to contain: LH-104, the `image` layout\'s default) takes a frame of its own proportions, as wide as its cell allows and centered across, and sits at the region\'s\nanchor down the cell, so a landscape picture beside text starts on the text\'s first line instead of floating in the middle of\na tall cell. A video draws in a 16:9 frame, the largest that fits its cell, placed the same way. A frame the block shapes with\n`aspectRatio` or a circle stays centered, and `cover` and `stretch` fill the cell. `image-beside` and `logos` write\n`anchor: "middle"` on their media regions to keep their centered look.\n\n### Validation\n\nThe schema checks types, enums and ranges; an embedded record that fails it is `opf/catalog-record`. `validate` adds:\n\n| Rule | Severity | Raised for |\n| --- | --- | --- |\n| `opf/layout-template` | error | A `regions` list that is not 1 to 12 entries; an entry that is neither a region nor a split; a bad `direction` or `size`; `auto` outside a column; splits nested more than three levels (the record\'s own list is level 1); regions that compile to a grid over 12 x 12. |\n| `opf/layout-region` | error | A name used twice; a reserved region name; a heading region with content rules; a `subtitle` without a `title`; a region that accepts no kind; `flow: none` with `max` other than 1; an `overflowRegion` that is not a body region. |\n\n`composeSlide` refuses such a record (`OPFLayoutTemplateError`). `layoutTemplate(record)` parses, checks and compiles a record\nand `layoutTemplateIssues(record)` lists the problems, both on `@openpresentation/opf/composition`.\n\n### How a record becomes a grid\n\nEvery region list is a guillotine partition: each split cuts its cell across, all the way. So the engine compiles the tree\ninto the grid it has always composed with, and composition, the renderer, the PPTX export and the editor read that grid:\n\n1. Each split divides its cell among its entries in proportion to their `size`; `auto` entries take the height their\n content needs.\n2. The cuts of all splits along one axis are collected into the grid\'s tracks (rows and columns), and a region fills the\n rectangle of tracks it covers.\n3. `layoutTemplate(record)` returns that grid (`rows` as numbers or `auto`, `columns`, a cell grid of names, the areas with\n their spans) and the regions in reading order with every default and inherited `anchor` applied.\n\nNested sizes are relative to the entry\'s own parent, so a split of `{ "size": 2 }` beside a region of `{ "size": 1 }` is\ntwice as large, whatever its children\'s sizes. Because the grid is shared, the gaps between regions are the grid\'s gaps: a\nrow of two regions inside a column puts one gap between the two columns, as the cell grid does. The 40 built-in layouts\ncompile to exactly the grids they had in Gallery 4, so nothing they draw moved.\n\n## Binding content to regions\n\nSlide content stays flat. `bindRegions(slide, record)` (pure, on `/composition`) binds the slide\'s root nodes to regions,\nin source order; placed images (`placement`) take their band and never occupy a region, and a content group is one node of\nkind `group`.\n\n1. **Pins.** A block with `region: "<name>"` goes to that region when it exists, accepts the block\'s kind and has room.\n Otherwise the pin is ignored (`opf/region-unknown`, `opf/region-kind`, `opf/region-full`, warnings) and the block\n joins step 2.\n2. **Everything else.** Of the regions that accept the block and have room, the lowest role rank wins (pictures:\n media, primary, secondary, supporting; every other kind: primary, secondary, supporting, media), then the first in\n reading order (the order of the `regions` list, depth first). Then source order is kept across regions where the\n layout allows it (LH-122): a block drawn on the wrong side of another bound block moves to the equally ranked region\n that accepts it, has room and leaves it out of order with the fewest blocks, being drawn before a block it follows\n counting more than being drawn after one it precedes. The `timeline` layout has a `lead` region (text, auto height)\n between the title and the timeline and `notes` after it, so a text authored before the timeline is its lead and one\n after it (or between two timelines) a note.\n3. **No candidate.** The block goes to the overflow region whatever its `accepts` while it has room, and beyond `max`\n it is drawn there anyway with `opf/layout-unplaced` (`paginate` moves it to a continuation slide). A layout with no\n overflow region draws it in an implicit row below the grid.\n\n### Grouping before placement (layout harvest)\n\n`composeSlide` then groups the bound blocks before it places a cell (`groupBinding`, on `/composition`). The rules read\nblock kinds, counts and text lengths, never a layout or slide id, and work for any count and in right-to-left decks. A\nslide that pins any block with `region` keeps the binding above as written.\n\n1. **Repeated pairs (LH-58).** A block sequence that repeats one pair of kinds is one cell per pair: a figure (`metric`,\n `chart`, `table`, `image`, `video`, `code`) and a paragraph, in either order, or a long and a short paragraph (one at\n least twice the other\'s length, the long one on the same side of every pair), two pairs or more. The pairs go to the\n region the figure binds to, which may hold up to 6 of them (or its `max`, when larger); the other regions are empty\n and collapse. Inside its cell a pair is one row (each half at least 0.8 of the cell\'s height wide) or one column\n (the figure above its text), half a gap apart; every pair of a grid has one cell size, so the pairs match. On a slide\n that draws cards each block keeps its own card.\n2. **Group by kind (LH-82, LH-73).** A flowing region whose blocks are mostly (more than half, at least 2) of a kind it\n accepts keeps only those. The blocks it took only as the overflow region (within its room) go to another region that\n accepts them, beyond that region\'s `max`, or else to the implicit row below the grid; they are not\n `opf/layout-unplaced`. Up to 4 such blocks sit side by side in one row under the grid (or stacked, when that is\n shorter), and the row asks for at most 30% of the content box, down to its height at the minimum font size, so the\n grid keeps about 60 to 65% of the body. On `metrics`, 3 metrics and 2 notes are a row of metrics over a row of two\n notes; on `chart`, 3 charts and 2 notes the same.\n3. **Extra blocks join a region (LH-46).** A block no region had room for, on a layout with no overflow region, joins\n the region that accepts it instead of the row below the grid: a `flow: none` region takes up to 6 blocks (accepted,\n no finding: the region then flows as `auto`); a flowing region takes up to 12, drawn beyond its `max` with\n `opf/layout-unplaced` as an overflow region draws them (so `paginate` can still move them).\n - `flow: none` regions of one role side by side (the `first` and `second` columns of `comparison` or `two-column`)\n become one region of N cells: the first takes their blocks and any block bound between them in source order (the\n `verdict`), and the others collapse into it. Four texts on `comparison` are a 2 x 2 grid in reading order.\n - A lone fixed region arranges pictures as a **mosaic** and text, quotes and metrics as a **lead plus cards**. A\n mosaic is 2 or 3 pictures in a row, and 4 to 6 a lead picture at full height beside the others in two rows (the\n lead as wide as two of their columns); a region taller than wide stacks 2 and sets a lead picture across the top of\n 3 to 6. Mosaic pictures are cropped to fill (`cover`) unless the block, slide, deck or theme sets `imageFit` (the\n layout\'s own `contain` gives way). A lead plus cards is the first block across the region (a short one at the lead\n size) over the others in the balanced grid below, each row at the height it needs, placed by the region\'s anchor.\n - The closing\'s `details` region already flows, so its blocks join nothing; it takes the same lead plus cards (the\n guarded rule `closing-lead`). A layout whose one body region is a flowing `supporting` region, holding 3 to 6 plain\n texts that its `auto` flow would stack (a text too long for a cell of the balanced grid) and that read as neither\n paragraph columns (LH-70) nor a lead plus stack (LH-67), and whose other texts fill whole rows of the balanced grid (2, 3 or 4 of them, never a short last row), sets the first text, its call to action, across the region\n over the others in the balanced grid, as Claude Design draws a closing\'s details under its call to action. It is\n kept only when no text reads smaller and nothing more is found (the size guard).\n - The join is kept unless it overflows more than leaving the extra blocks below the grid (counting `text-overflow` and\n `small-cell`): measured blocks such as tables or timelines that need more room than the joined cells give stay below\n the grid with `opf/layout-unplaced`, where they read whole (three tables in `table-beside`\'s narrow region broke their\n words).\n\nAn empty region collapses into a neighbour that shares the full length of one of its edges (start side, end side, below,\nabove; a body region before a heading region). A column of the grid that holds nothing but empty regions (and heading or\nbelow-the-grid areas that span other columns too) gives way first (LH-65) when at least two columns with content remain, or\nwhen its empty region has no neighbor to collapse into (a `hero`\'s media column beside its stack of rows): it takes no width\nand no gap, and the columns left share the width by their own sizes, so two blocks in `three-column` draw 1:1 instead of one\ncolumn beside a neighbor that took the third column\'s width too. The empty region reports `collapsed` and a zero-wide cell where\nits column was. The column, and a nested group\'s new default gap (LH-89), are kept only when no block reads smaller than with\nthe columns and gaps of before (unless that removes overflow). Headings are centered vertically in their region unless every\nrow it spans is `auto`, so a `cover` or a title-only slide centers its title. A slide with promoted regions (`start`, `top:start`, ...)\ncomposes them as in 0.18.\n\nIn the Markdown dialect, `<!-- block: region=metrics -->` pins a block; a promoted-region key keeps its 0.18 meaning.\n\n## Flow\n\n| `flow` | Blocks are arranged |\n| --- | --- |\n| `none` | One block fills the region. |\n| `grid` | By count: 1 fills; 2, 3 in a row; 4 as 2 x 2; 5 as 3 + 2; 6 as 3 x 2; 7 to 12 in balanced rows of at most four (7 as 4 + 3, 8 as 4 + 4, 9 as 3 x 3, 10 as 4 + 3 + 3; LH-47: no row is more than one cell short of another). Rows and columns swap in a portrait region (7 as 3 + 2 + 2). The cells of a short row stretch to the full width; in a grid of only pictures and videos they keep the full rows\' size, one aspect, and are centered. |\n| `column` | Stacked at the heights the blocks need, one gap apart, and placed by the region\'s `anchor`. Charts, pictures, videos and diagrams take what the measured blocks (text, lists, quotes, metrics, code, timelines, tables) leave; a table (LH-44) needs its rows at the starting size, gives up height down to its rows at the floor and takes a share of any spare height. Blocks that do not fit share the region: each gives up the same fraction of what it can give up above its height at the minimum font size. A group\'s blocks in one column stack the same way. |\n| `auto` | `grid` unless a block is long: more than 6 lines (code: 12, table: 6 rows) in its grid cell at the starting size (28 px for prose), counted with core\'s estimate, never a host font. In an `auto` region a paragraph that wraps takes a reading measure of about 70 average characters of its size (never at the cost of size; it follows the content alignment) and a lone block of up to two lines uses the 32 px lead size. |\n\nSeveral timelines in one region are a stack of horizontal bands whatever the region\'s `flow` and `contentDirection`: one column, or two when one column does not fit at the readability floor (see [Dynamic composition](dynamic-composition.md#timeline-internals)).\n\n`design.contentDirection` makes every flowing region one row or one column. A slide\'s own `composition.mode`, `columns` and\n`weights` arrange its first primary flowing region with the 0.18 modes, above `contentDirection`. A list in a region\nwith `listColumns: "auto"` (the lone list of the design, and, since the RR-81 review, any list of the region that does not\nfit its own cell), or any list payload with `columns: "auto"`, tries 1, 2 then 3 columns at the starting size (a column at\nleast a quarter of the slide wide); `columns: 2` or `3` fixes the count. `auto` never deals a list of 6 or fewer entries\nacross columns (LH-42): such a list shrinks in its one column instead.\n\n**Several lists in a region (LH-42).** A region (on a slide without `design.contentDirection`) that\nreceives 2 or more lists and nothing else lays them out one list per cell, a card when the slide draws cards, so sibling\nlists never read as one table: 2 to 4 lists in that many columns, a multiple of 3 in 3 columns, any other count in 4\n(7 as 4 + 3). A column stays at least 7.5 list ems (240 px) wide; a narrower region fills its rows evenly (4 lists in 2 x 2),\nand a region taller than wide stacks up to 3 lists and takes at most 2 columns. Each row is as tall as its tallest list needs,\ndescriptions and nested entries counted, at the largest one size at which every row fits, and the region\'s lists share that\nsize. Cards share the height left over, so they fill the region; lists without cards keep their rows and the region\'s\n`anchor` places them. No list of the grid is dealt across columns.\n\n### Tracks\n\nColumns share the content width in proportion. Rows are allocated so that no row with content is squeezed to nothing:\n\n1. A heading `auto` row takes what its headings need, at most half the content box.\n2. The numeric rows keep at least what their content needs at the starting size, up to half of the space under the\n headings.\n3. The other `auto` rows take what they need from what is left (the implicit row below the grid holds what no region\n took). When that is not enough they shrink together: each gives up the same fraction of what it can give up above its\n content\'s height at the minimum font size, so a one-line note keeps nearly its need beside a dense row, and no row\n overflows while those heights fit.\n An empty region with `empty: "keep"` holds two lines of body text in an `auto` row (plus the card insets on a slide\n that draws cards, as a filled region does).\n4. The numeric rows share the rest in proportion to their sizes.\n\nParagraphs and lists of one stacked column that do not fit at their role sizes shrink together to the largest one size that fits, and read at that one size.\n\nSibling blocks share one size per kind (LH-43): the blocks of one region whatever its arrangement (every row of a `grid`,\na `row`, a stacked column), regions of one role in the same rows (the columns of `two-column` or `comparison`), and blocks\ndrawn below the grid with the parallel primary regions they continue (a lone primary region, such as a statement\'s message,\nkeeps its own size). Their prose, and their lists, are refitted at the smallest size any of them fitted at; sibling metrics\nshare it role by role (value, unit, label, description, delta, trend). A sibling the shared size would make overflow keeps\nits own fit, so the shared size never takes a block under the readability floor.\n\nSibling quotes in one row share one body size too (LH-78), and a region\'s similar paragraphs, a lead beside a stack and the start\nalignment of long text in a centered layout follow the rules in [Reading measure, alignment and\nleads](dynamic-composition.md#reading-measure-alignment-and-leads) (LH-70, LH-67, LH-72). A paragraph grid and a lead plus\nstack replace a lone fixed region\'s lead plus cards when they are no smaller; a `flow: grid` region never takes a lead plus stack.\n\nWhere sibling text and lists span several rows, the rows are sized jointly with the shared size instead of being fixed first:\nat each size of the type scale, from the largest start down, every row asks for its tallest cell\'s need at that size (a card\'s\ninsets included), and the largest size at which the rows fit is kept. This applies to a region\'s grid of paragraphs and lists\n(as LH-42 did for a list grid), to a stacked column, to an automatic grid, and to the parallel primary regions with the blocks\ndrawn below them (their template rows are allocated at that size). Leftover height goes to the rows in proportion to their\nneeds (cards, a grid of paragraphs, an automatic grid) or stays at the region\'s anchor (lists without cards), so a row of short\ntexts is a short row and a row of long ones a tall one. The cells of one row keep its height and columns keep their widths.\nSets that mix in other blocks (a metric, a picture, a chart) keep their rows and share sizes as above.\n\nA block that shrinks takes a size of the type scale (LH-17): from `minFontSize` up by a ratio of (28/16)^\xBC, rounded to whole\nreference pixels, which is 16, 18, 21, 24, 28 and 32 px at the default floor, with the half step between each two (LH-149: the\nratio to a half power, 17, 20, 23, 26 and 30 px). A block that fits at its starting size keeps it, on the scale or not. The half\nsteps matter most to siblings sized jointly: one size for all of them, the largest at which every row fits, so a whole step under\nthe size they fit cost every sibling a step (six FAQ pairs that fit 24 px drew at 21, now 23). They are a guarded rule\n(`half-steps`): a joint fit at a half step gives its rows other heights than the step under it, so the half steps are kept only\nwhere no block reads smaller than without them (dense comparison options that would reach 20 px only by setting the verdict\nunder them from 28 to 21 px keep 18 and 28). Half steps never change which arrangement wins: every choice between arrangements\n(the guard\'s rule sets, step badges, tracks, LH-83\'s recomposition at the floor) counts a block that shrank onto a half step at the\nstep under it, so a gain of half a step alone (16 to 17 px) keeps the slide\'s arrangement and an agenda keeps its step badges. The scale depends only on the floor and the canvas, so every slide composes\nindependently and the engines agree.\n\nComposed content never crosses a heading or another region and never leaves its region\'s box. What still does not fit\nuses the design\'s tools in order: text fits down to `minFontSize`, lists flow into columns where the region allows, blocks\nbeyond the room go to the overflow region and, through `paginate`, to a continuation slide; what remains is the\n`opf/text-overflow` or `opf/layout-unplaced` diagnostic.\n\nPagination continues on a new slide with the same layout: blocks beyond a region\'s `max` move first, in source order, and\ncarry a `region` pin to the region they came from. The pages of one slide share its type sizes (LH-144): each page after the\nfirst carries `composition.maxFontSize`, the largest size the first page draws for the kinds of block it holds (paragraphs,\nlists, quotes, metrics, timelines), so a last page with one timeline or a short list does not read larger than the pages before\nit. The cap only lowers sizes, never under `minFontSize`; headings, tables, code and charts keep theirs. A block that no region of the layout accepts, on a layout with no\noverflow region, stays below the grid on every page and never drives a split.\n\nThe export does one split on its own (LH-90). A slide whose body is two or more units of one kind (eight timelines, five\ntables; a unit is a block of the first block\'s kind with the blocks that follow it, so a timeline keeps its note) and that\noverflows at its readability floor continues on further slides of the same layout, split between whole units: the fewest\npages that fit, the units spread evenly, every page bound by the layout as the first is (no pins, so each page can\nrecompose). `opf convert` and `convert` draw that deck for the preview and the PPTX alike and report each such slide\n(`slide-continued`, report field `continued`); a strict slide still fails, and `paginate: false` (`--keep-slides`) draws\nthe slide as written. See [dynamic composition](dynamic-composition.md#pagination).\n\n## Design keys\n\nPer key: the slide\'s `design`, the deck\'s `design`, the theme record\'s `design` (new in 0.19: `titleAlignment`,\n`contentAlignment`, `contentBox`, `contentDirection`, `imageFit`, `listBullet`, `listStyle`), the layout\'s `design`, then the engine\ndefault. `design.mirror: true` draws a template mirrored (each row\'s cells and the column sizes reversed); a right-to-left\ndeck mirrors on top. `layout: "auto"` is automatic composition: reserved, never a catalog id, and `opf format` drops it.\n\n## Composition output\n\nFor a slide with a template layout, `composeSlide` adds (see the declarations on `/composition`):\n\n| Field | Meaning |\n| --- | --- |\n| `regions` | Every region in reading order: `name`, `box` (after collapse, mirroring and bleed), `accepts`, `role`, `flow`, `max`, `anchor`, `arrangement` (`grid`, `row`, `column`, or `composition`), `content` (root block paths bound within `max`), `overflow` (paths drawn beyond it), `collapsed`, `bleed` and, on a bled region, `areaBox` (its cell before bleed). It replaces `slots` for templates. |\n| `headingAreas` | The `title` (and `subtitle`) areas with their boxes, `collapsed` or `implicit`. On a template without a `subtitle` area the title area carries `parts: { title, subtitle }`: it is split where the stacked heading group puts the subtitle, so `title` runs from the area\'s top to the bottom of the title (the tag above it included) and `subtitle` from the subtitle\'s top (half a gap under the title when the slide has none) to the area\'s bottom. PowerPoint\'s `ctrTitle` and `subTitle` placeholders use these boxes. |\n| `items[].region` | The region an item was drawn in, for tagging shapes. |\n| `steps` | LH-07: what each `sequence` region draws besides its text, in reading order: `form` (`row`, `column` or `flow`), `badges` (`cx`, `cy`, `radius`, `label`, `fontSize`, `baseline`, and `list` when the badge draws a list entry\'s own number), `connector` (`x1`, `y1`, `x2`, `y2`), `chips` and `arrows` of a flow, and `lineWidth`. |\n| `items[].listColumns` | A list in columns: one `{ box, start, end, text }` per column at one shared size; numbering continues. The item\'s `text` is the whole list (every entry at its column\'s position), so a consumer that ignores `listColumns` still draws every item. Entry paths are the payload\'s: `<list>.<n>` for a string item, `<list>.<n>.text` for an object. |\n\n### Step sequences (LH-07)\n\nA region with `sequence` lists the steps of a sequence, and composition draws them as Claude Design does:\n\n- **Steps side by side** (`steps`): two or more text or list blocks are the steps. Each draws under a numbered badge, an accent circle\n 1.75 times the step text across with its numeral at the step text size, in the scheme color readable on the accent. The badge sits\n 0.4 of its width above the text, at the block\'s start (its right edge in a right-to-left deck), or over its middle when the block is\n centered. The badges of a row share one line, and a connector in the border color runs through their centers. A one-entry numbered\n list gives its badge its number and draws as a heading over its description (LH-77); any other block is numbered by its position.\n Each block keeps the band for its badge in the height it asks for and in its cell.\n- **A list\'s entries** (`steps` for a lone list of two or more entries, `numbered` for every list of two or more entries of one level,\n numbered or not, since an agenda runs in time): each entry draws beside its\n badge in the list\'s marker column (the side its paragraph starts), centered on its first line, with a connector down the column. The\n badges are at least 0.4 of their width apart. The list keeps its numbers (`marker.number`); a list without `numbering` is counted in\n arabic as drawing only: the document keeps no numbering and the PPTX import gives the list back unnumbered. In a `numbered`\n region the unnumbered lists count on from one list to the next, as one agenda, and keep their markers when one of the region\'s\n lists cannot take badges (a lone entry, nested entries), so a part of the agenda is never numbered alone.\n- **A flow** (`steps`): a lone list of 3 to 6 entries of one or two words (24 characters at most), without descriptions, is a row of\n chips (cards) joined by accent block arrows in reading order. The chips share the region\'s width when the widest entry fits each,\n else each hugs its entry; each entry is a list column centered in its chip.\n- **Numbered rows** (`numbered`, LH-134): an agenda whose every entry, in every list of the region, has a description draws as ruled\n rows instead of badges: each number a numeral at the list size, bold in the accent and in two digits under 10 ("01"), in a column at\n the row\'s start (the right in a right-to-left list), the label bold and the description in a second column beside it when the labels\n fit 40% of the width, a hairline between two rows and no connector. One entry without a description keeps every list of the agenda\n beside badges, so an agenda is drawn one way. The numbers stay drawing, as the badges\' are.\n\nSteps keep their text size: the badges are a guarded rule (`step-badges`, and `numerals` for numbered rows), so a slide whose blocks\nwould get smaller under them draws as before (LH-168: the comparison is also of the smallest size each block draws, a list\'s label and description\nsizes, not of the list\'s base size, which is the label\'s in columns and the description\'s beside a badge; steps whose descriptions wrap\ndraw as a stepper in every language, and a row of steps is centered under the title as the columns are). A step\'s label never splits a word (LH-173): a label whose widest word does not fit its column at 1.25 times the list size steps down to the size the word fits at, never under the list size, and the labels of the row take that size too; LH-48\'s growth stops at the step before one that breaks a word of any label or description. A flow that does not fit one line at the list\'s size stays a list. A lone badge list\ngrows (LH-48) as the plain list would, as long as it fits with its badges (or numerals). The preview draws the badges, numerals,\nconnector, chips and arrows from `steps`, and the PPTX export writes them as native shapes (an ellipse holding its numeral, a text box\nholding a numeral, a line, rounded rectangles and `rightArrow` or `leftArrow` presets), tagged so that import consumes them and gives a\nlist its numbering back. Which of numerals, badges and plain rows a list takes is one rule, written down in\n[Dynamic composition](dynamic-composition.md#numerals-badges-or-rows-lh-134).\n\n### A body that fills too little (LH-48)\n\nShort content steps up instead of sitting small at the top of an empty body, as Claude Design sets a short message.\n\n- **A lone block.** When a slide\'s whole body is one paragraph, list, quote, code panel, metric or table (the only block of\n an automatic slide, or a template slide\'s only block, with nothing below the grid), its region\'s cell reaches the foot of\n the content box when every other region is empty, and the block takes the body. When it fills under half of that height\n at its role sizes it steps up: a paragraph or a list by the steps of the type scale above its size, a quote, code panel,\n metric or table by the scale\'s ratio on every role, to the largest step at which it fills at most 60% of the body and\n every part keeps the size it asks for. No role grows past its display size (`LONE_DISPLAY_SIZES`: text 43 px, a list 37,\n a quote 56, code 32, a metric\'s value 152, a table 32, at a 720-pixel short edge). The block then sits in the middle of\n the body, its card hugging it; a grown table\'s rows grow with its type (`items[].tableGrowth`, which both engines pass to\n `layoutTable`). A block that fills half the body or more keeps its sizes and its place.\n- **A body of paragraphs and lists.** Two or more text and list blocks (in a layout\'s regions, or on a slide without a layout)\n that fill under half of the body below the headings (the height their text covers, so the empty space inside cards that share\n the body, as LH-86\'s rows, does not count), with nothing overflowing and no text at the floor, are composed again one, two or three type-scale steps larger (each up to a\n list\'s display size, 37 px), and the largest step that adds no finding, sets every block larger and fills at most 60%\n is kept; siblings keep one size (LH-43) and no block reads smaller than before. On a layout the body then sits in the\n middle of the space under the headings: rows that hug\n their content move down, regions take the height their blocks need in the middle of their cells, and cards hug their\n text (LH-64\'s hug, whatever it fills of a card).\n- **Never grown by these two rules.** A stacked record (`statement`, `quote`, `closing`, which place their message as one stack, a closing at the foot (LH-155), and grow by\n LH-129\'s rule below), blocks below\n the grid (a section\'s notes), a body with a picture, chart, video or timeline beside its text, a captioned block, a\n list in columns, an overflowing composition, and `composeSlide(slide, { fill: false })`, for hosts and tests of the\n role sizes. Both engines read the result from core.\n- **A message in the middle of the slide (LH-129).** A slide whose title stands free (centered in a sized title area, or in a\n stacked record) over no primary or secondary block, such as `cover`, `section` and `closing` or a slide with no body and no\n layout record, grows its title and subtitle by one, two or three steps of the type scale, each up to its display size\n (`HEADING_DISPLAY_SIZES`: title 75 px, subtitle 37; the tag is LH-32\'s eyebrow at its 22 px role size and keeps it); a\n title over a primary block (a quote\'s) keeps its size; a statement\'s title over its paragraph is LH-09\'s message below. A stacked record (`statement`, `quote`, `closing`) grows its body by the same steps: paragraphs and lists up to a list\'s\n display size, quotes by the scale\'s ratio on every role (`LONE_DISPLAY_SIZES`). The largest step is kept at which nothing\n overflows, every text is at least as large as at the step before, no heading takes another line or lands off the scale, every\n region keeps its arrangement and blocks, LH-06\'s band or pill stays, no block reads smaller under the guard, and the text covers\n at most 60% of the content box. The record\'s stack or centered title area places the larger text as it placed the smaller.\n- **Statements and short messages (LH-09, LH-69).** The `statement` record is start-aligned with LH-130\'s rule over its title.\n A sentence title over a paragraph is the message: it grows to display size (75 px), the paragraph keeps its size. A metric, or a\n text under a title of at most 4 words, is the message: the stack gives way, the title is the running head and the block fills the\n body (LH-48, LH-101). A lone text of at most 25 words (`messageWords`, any script) grows on to 56 px (75 px at 4 words or fewer)\n on at most 4 balanced lines, and (RR-105) only to a step whose lines keep the minimum measure of LH-66 (28 average characters once it runs to 4 lines), so on a narrow slide, portrait or square, it stops one step lower (49 px) instead of falling back to its plain size; its bold runs draw in the primary color where that reads 4.5:1. A lone one-entry list with a short\n label draws it as a display word over a short rule; a placed region\'s short text is a bold heading, drawn as a tile when it is no\n sentence (see [Placed tiles](dynamic-composition.md), `placed-tiles`). Guarded rules\n `statement-message` and `display-message`.\n LH-163: where the primary does not read 4.5:1 on a dark or accent surface, a display message\'s bold words draw in a lighter tint of\n the primary that does (hue and saturation kept, lightness raised), never in a color the author did not mark. LH-164: a slide whose\n whole body is one such message takes the accent surface on a light deck, where the accent is calm enough to fill a slide (docs/design-resolution.md, "A message-only slide").\n- **Pricing tiers (LH-135).** A slide whose body is 2 to 5 groups, each a metric with a `label` followed by a list or text (a\n tier\'s name, price and what it includes), draws each group as one card of its region\'s cell, in one row: the label is the\n metric\'s eyebrow (bold capitals with tracking, at the tag\'s 22 px, in the eyebrow\'s color; `MetricLayout.eyebrow`), the price\n under it at display size (80 to 96 px, 96 to 128 px for two tiers, stepped down to the one line the card holds, so "$49" and\n "$1,200/mo" never split), then the description and the details, from the top of the card. The cards share one top edge and one\n height (LH-22\'s full-height cards) and every item of a tier shares the tier\'s `frameBox`, so a card is drawn once. The prices that\n reach their 76 px role size read at one size; each tier\'s details keep the size they fit at. The guard holds every block to the\n size it had as two cards, so a price too wide for the narrower card (a four-tier row with "$1,200/mo") keeps them. A group with\n `emphasis: true` keeps LH-06\'s surface and the other tiers are cards. The group\'s `composition` is read as a column.\n- **Rows of figures (LH-169).** A list of 2 to 4 first-level entries that each lead with a short figure (`figureText`: a number with\n its unit or comparison, after an optional sign and currency symbol, at most 4 words: "62 minutes a day", "1 in 6 reports", "$3.2M",\n "\u0666\u0662 \u062F\u0642\u064A\u0642\u0629 \u064A\u0648\u0645\u064A\u064B\u0627"; not a step number, a clock time, a year or a day of a month) and carry a description (`figureList`) draws as a row\n of metrics, as Claude Design draws narrative n15: one column per entry across the list\'s box, in reading order (from the right in a\n right-to-left deck), each the figure bold in the accent at display size (at most the metric value size, 76 px) over an accent rule,\n its description as the label under it at the size the list draws its descriptions. The figures share one size, the smallest any of\n them fits on one line at, never under the list size; a figure that would split there, or a label that overflows its column, keeps the\n list. A list where only some entries lead with a figure, figures without descriptions, a numbered list, a list with icons, columns, a\n caption or the author\'s `listStyle` stay lists. The row is drawn at the size the list has after the guard and LH-48\'s growth, so its\n labels never read smaller than the list\'s descriptions; a region that holds only such a list has no card. It is a list in columns\n (`listColumns`, each entry `accent` and `heading`), which both engines draw natively. The guarded rule `figure-row`.\n- **Pillars with one-word titles (LH-136).** A slide whose body is 2 to 5 lists of one entry each, a single word (at most 14\n characters) with its description, draws each as the word at display size (2.3 times the description\'s size, stepped down to one\n line and to the height the box leaves over the description) in bold over an accent rule of 0.14 em across the block (a native\n line in PowerPoint, `ListFit.rules` with `accent`), with no card. Sibling words read at one size. Any other set, a title of\n several words included, keeps its cards. fitList\'s `display` option (with `heading`) draws one list this way.\n- **A lone timeline (LH-129)** in a template\'s timeline region, or an automatic slide\'s only block, first tries three and then two\n steps of the type scale on its labels (its 18 and 22 px roles to 28 and 32, or 24 and 28 px), and keeps the first at which it fits\n its box in the same arrangement and no label (the name, a date, an event) takes another line; otherwise it grows by LH-41\'s few\n pixels as before.\n- **A lone code panel (LH-101)** grows its code in type-scale steps up to the code display size (32 px) while it covers at most\n 60% of the body, and its panel hugs it in the middle of the body. Only code that covers at least 60% of the body takes the whole\n body, its lines in the middle of the panel (`layoutCode`\'s `fill`).\n- **A body of other kinds (LH-102).** A body of text, lists, quotes, metrics, code, tables or timelines (a picture only in a bled\n region, such as hero\'s media) that covers under 60% of the body height after its regions take their need sits in the middle\n of the space under the headings, as a body of paragraphs does, when it moves as one (a region the layout holds at the foot keeps\n the body where it is) and no block reads smaller. Pictures, charts and videos in other regions keep the layout\'s cells.\n Without a layout, a short body of paragraphs and lists that still covers under half of the body after LH-48\'s three steps\n grows on past a list\'s display size, as LH-05\'s compact grid does: step by step up to 56 px, each step larger, nothing\n overflowing, at most 60% of the body covered, the body keeping its rows and columns (a body that may draw step badges or\n cards keeps the three steps, so those drawings are held to the same body). The stack then sits in the middle of the body under the headings, rather than\n at its top over an empty foot. Promoted regions that\n each run the body\'s full height (`start`, `center+end`) and hold only paragraphs and lists set them as one band in the\n middle of the body, each block starting at the band\'s top. Both are composed with LH-48\'s centering and kept only when\n no block reads smaller and nothing overflows.\n- **Mixed cards (LH-64).** A row of middle- or bottom-anchored cards with a table, code panel or timeline among other measured\n kinds starts at the card top (or hugs and centers in an under-filled body) instead of each kind at its own anchor.\n- **Reading measure (LH-10).** A paragraph in a region wider than about 70 average characters of its size is set on that\n measure at the start edge, unless the body would then fill too much to grow: a readable size outranks the measure.\n\n### Recomposition at the readability floor (LH-83)\n\nA layout whose regions leave its content too little room sets that content at the readability floor. When a template\'s\ncomposition sets a body role at the floor, `composeSlide` composes the same blocks again as the automatic grid\n([dynamic composition](dynamic-composition.md)) and keeps that result when its smallest body size is larger (or as large and it reports less overflow), it reports no\nmore overflow (`text-overflow`, `small-cell`) and no more of its fits break a line inside a word; otherwise the layout\'s\nresult stands. Both compositions are pure, so the choice is deterministic, and both engines read it from core.\n\n**Before the floor (LH-186).** A template\'s composition that sets a paragraph, list or table more than one step of the type scale\n(16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 32 px) under its role size (28 px prose, 32 px lists, 25 px table cells, each held to\n`composition.maxFontSize`), but above the floor, is composed as the automatic grid too, under the guarded rule `layout-first`. That\nresult is kept (`recomposed`) only when it adds no finding, sets no block smaller, reads as well (no more split words, no prose\nunder the minimum measure) and sets the most shrunk block at least one step larger: an agenda\'s two lists that the agenda-split\nlayout sets at 18 px beside its title read at 32 px across the slide. A text run with its own `fontSize`, a block pinned to a\nregion, `recompose: false` and `fill: false` keep the layout. So composition grows short content to fill, changes the arrangement\n(columns, the automatic grid, another design) before it sets text smaller, and fits dense content that no arrangement holds down\nthe type scale to the readability floor, never below it, flagging what still does not fit.\n\n- **Body roles.** Text, lists and table cells, and the main part of the other payloads: a quote\'s and a code panel\'s body, a\n metric\'s value and label, and a timeline event\'s `what`. The other parts (attribution, filename, language, unit, delta,\n description, trend, a timeline\'s name, dates and notes) ask for 14 to 20 px by design, so reaching the floor is no squeeze\n and never triggers it. Headings are not body. The floor is the composition\'s `minFontSize` (16 reference pixels at a\n 720-pixel short edge, 12 pt).\n- **What stays.** Every block is drawn, in source order. The header and footer bands, the footnote area, placed images and\n the background are the slide\'s own and do not change. The layout record\'s `design` (alignment, cards, list bullet, image\n fit, background variant) and `composition` (padding, gap, `minFontSize`) still apply. The slide keeps its `layout`, so\n the PPTX export still uses that layout\'s native slide layout, and an edit that gives the content room (fewer blocks,\n `paginate`) returns the slide to its regions.\n- **What changes.** The tag, title and subtitle are a content slide\'s heading group above the body, as on an automatic slide\n (the one-line title steps of LH-51 and LH-76), not the layout\'s title area. Region semantics do not apply: the result\n has no `regions` or `headingAreas`, no item names a `region`, and no `opf/layout-unplaced` is reported, since every block\n is in the grid.\n- **Reported as** `recomposed: { layoutSize, size }` on the composition: the smallest body size the layout fitted and the\n smallest of the result, in reference pixels. Validate reports the findings of the result it composes.\n- **A chart too short (LH-49).** A layout that leaves a chart\'s plot shorter than its minimum (the larger of 120 reference\n pixels and 22% of the body\'s height, `chartPlotBox`) is recomposed the same way, at any body size, when the automatic grid\n draws the shortest plot taller and reads as well: no more overflow or split words, no more paragraphs under the reading\n measure, and no block\'s body size smaller (only a layout that overflows may trade size, to overflow less, never at the floor). `recomposed.chart` then holds the shortest\n plot of the layout and of the result, `{ layoutPlot, plot }`. A wide chart region the layout draws on purpose (`chart`,\n `dashboard`) keeps its proportions: only the plot\'s height triggers it. chart-beside with its notes holding further charts\n (a few pixels of plot each) becomes the automatic grid of charts above their notes.\n- **Never recomposed.** A slide the layout fits above the floor, a cover, a slide with promoted regions, a slide with a block\n pinned to a region (`region`: the author chose the region), and `composeSlide(slide, { recompose: false })`, for hosts\n that need the regions and for tests of a layout\'s own geometry. A strict composition (`overflow: "error"`) that the layout\n cannot fit still fails, and an automatic grid that fails strictly is not kept.\n\n`composeLayoutAreas(record, options)` gives the areas of the empty layout: where a PowerPoint slide layout puts a placeholder\nper area. It is `composeSlide`\'s own geometry for a slide with a one-line title and subtitle and every region kept, so it\ntakes `composeSlide`\'s options (`width`, `height`, `presentation` for the deck\'s header and footer, `direction`, ...) plus\n`mirror`, `placements` (placed-image bands to reserve, `{ edge, size, inset }`) and `bleed` (default `true`: a bled region\nreaches the slide edge as on a slide; `false` gives its cell inside the content box). Its title area carries the same\n`parts` as a slide\'s. `bindRegions`, `layoutTemplate`, `regionAccepts` and `gridFlowShape` expose the rest of the model.\n\n## No migration from the 0.18 ids\n\n0.19 breaks layouts: there is no migration path. A layout id of the 0.18 default catalog that 0.19 does not have is an\nunknown layout like any other (`opf/unresolved-reference`: the slide composes automatically and a strict export fails).\nSix 0.18 ids are also 0.19 built-ins and resolve to them: `agenda`, `comparison`, `dashboard`, `faq`, `timeline` and\n`two-column`. The release notes list the 40 built-ins.\n'
232
232
  },
233
233
  {
234
234
  "slug": "libreoffice",
@@ -258,7 +258,7 @@ var docsData = Object.freeze([
258
258
  "slug": "mcp",
259
259
  "file": "docs/mcp.md",
260
260
  "title": "OPF MCP server",
261
- "markdown": "# OPF MCP server\n\n`@openpresentation/mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server for OPF, so an agent or editor that speaks MCP can learn the format, look things up and check a deck without shelling out and parsing text. It teaches OPF (documentation, schemas, the default catalog, example decks and the six agent skills, all as resources, with a `start_here` tool that gives a path for a goal), and it runs the checks the CLI runs (`validate_deck`, `convert`).\n\nIt also shows decks: `show_deck` opens the OPF viewer inside a client that supports MCP Apps (Claude on the web and desktop), with Preview, Source and Both, where the user can edit the deck and the edits come back to the model ([The OPF viewer](#the-opf-viewer-show_deck)).\n\nIt keeps no state, reads no file (everything it serves is bundled in the package, and tools work on the text you pass in; the one exception is the renderer's font files, which `opf-mcp` hands to the viewer), fetches nothing and has no network access. It runs two ways: locally over stdio (this page), and hosted on an edge runtime (the same server definition over Streamable HTTP). The hosted connection target is `https://www.openpresentation.org/mcp`; its deployed version, tools and viewer availability follow that site\u2019s deployment, separately from the npm package. Check the [hosted MCP guide](https://www.openpresentation.org/docs/mcp) for that deployment. The packaged `show_deck` viewer described here does not establish that a hosted deployment offers it. The local server measures layout with real fonts when `@openpresentation/opf-render` is installed.\n\n## Set it up\n\n**Hosted, nothing to install.** `https://www.openpresentation.org/mcp` is this server over Streamable HTTP: no account, no key, read-only, and it keeps nothing. In Claude (web or desktop), open the Connectors page and add a custom connector: name it `OPF` and paste the URL `https://www.openpresentation.org/mcp`. Claude moves these menus; on 2026-11-14 the page was Customize (in the left sidebar), then its Connectors tab, then Add and Add custom connector, and the older Settings, Connectors page only pointed there. If a label has moved, look for \"Connectors\" and \"custom connector\". Other clients take the same URL as a remote MCP server.\n\n**Your first request.** Claude has its own slide feature, and a plain \"make a pitch deck\" may be answered by it without calling OPF. Name OPF and the viewer in the first message, for example: *Use the OPF tools to make a ten-slide deck about our Q3 results, validate it, and show it in the OPF viewer.* Naming OPF only tells the host which tools you mean; whether and how Claude uses them is the host's decision, so if a reply comes from another feature, say so and repeat the request naming OPF. Once the viewer opens, ordinary follow-ups (\"add a slide on risks\") continue in it.\n\n**What the hosted server keeps.** A deck you pass to `validate_deck`, `convert` or `show_deck` is read in memory for that one call and not stored; the viewer itself edits, checks, draws and exports the deck on your machine. The hosted server allows 600 requests a minute per address and bodies up to 4 MB.\n\n**Local.** Any MCP client that starts a local server takes a command and arguments:\n\n```json\n{\n \"mcpServers\": {\n \"opf\": { \"command\": \"npx\", \"args\": [\"-y\", \"@openpresentation/mcp\"] }\n }\n}\n```\n\nPin a version (`@openpresentation/mcp@0.27.0`) to make the setup repeatable. Node 22 or later is required.\n\n| Client | How |\n| --- | --- |\n| Claude Code | `claude mcp add opf -- npx -y @openpresentation/mcp` (add `--scope project` to write `.mcp.json` for the team) |\n| Cursor | Add the JSON above to `.cursor/mcp.json` in the project, or to `~/.cursor/mcp.json` |\n| Claude Desktop | Install the extension (`opf-<version>.mcpb`, below), or add the JSON above to `claude_desktop_config.json` |\n| Any other client | Run `npx -y @openpresentation/mcp` as a stdio server (installed, the binary is `opf-mcp`) |\n\nCheck it with the official inspector: `npx @modelcontextprotocol/inspector npx -y @openpresentation/mcp`.\n\n### Claude Desktop extension (`.mcpb`)\n\nThe server also comes as an MCP Bundle, a one-file Claude Desktop extension: open `opf-<version>.mcpb` (double-click it, or drag it into Claude Desktop's Settings, Extensions) and Claude Desktop installs and starts it. It needs no Node install, no `npx` and no configuration, and it carries the renderer and its fonts, so the OPF viewer draws decks with the exact faces and validation measures layout with them.\n\nWhen the matching [GitHub release](https://github.com/OpenPresentation/opf/releases) lists `opf-<version>.mcpb` and its SHA-256 file, download both assets from that release. Release-bundle publication is planned from 0.34.0; 0.33.0 has no published bundle asset. The trusted publish workflow builds and checks the full bundle before attaching it after registry verification. Verify it with `sha256sum --check opf-<version>.mcpb.sha256` on Linux, or compare `Get-FileHash opf-<version>.mcpb -Algorithm SHA256` to the file on Windows.\n\nBuild it from a checkout: `pnpm --filter \"@openpresentation/mcp...\" run build`, then `pnpm --filter @openpresentation/mcp run build:mcpb`. It writes `packages/mcp/artifacts/opf-<version>.mcpb` (about 81 MB, every font the renderer draws with); `node scripts/build-mcpb.mjs --no-script-fonts` writes `opf-<version>-lite.mcpb` (about 33 MB) without the script faces (Japanese, Chinese, Korean, Arabic, Devanagari and the other scripts), whose text then draws with fallbacks. `--check` also unpacks the bundle and drives its server the way Claude Desktop starts it. The build packs this checkout's `@openpresentation/opf`, `gallery`, `opf-render` and `mcp`, and installs their third-party dependencies and the renderer's font packages from the npm registry, keeping only the font files the renderer's manifests name. The manifest is `packages/mcp/mcpb/manifest.json`; `test/mcpb-manifest.test.mjs` keeps its tool list in step with the server.\n\n`opf mcp` of the CLI is a convenience: it runs this server when `@openpresentation/mcp` is installed beside the CLI or in the working directory, and otherwise prints `npx -y @openpresentation/mcp` and exits with 2. The CLI itself carries no MCP code.\n\n## Tools\n\nEvery tool takes JSON arguments and returns structured JSON (`structuredContent`, with the same JSON as text for clients that read only text; `show_deck`, `read_font_file` and `read_icons` answer in their own text). A failure comes back with `isError: true` and a text report `{ ok: false, code, error, ... }` (no structured content), with a stable `code` (`unknown-id`, `invalid-document`, ...) and, where it helps, a suggestion (\"Did you mean two-column?\"). All tools are read-only.\n\n| Tool | Arguments | Returns |\n| --- | --- | --- |\n| `start_here` | `goal?` (what you are trying to do, in your own words) | `{ goal, summary, steps[], docs[], skills[], examples[], layouts[], themes[], validate }`: a short ordered path. Which documentation pages and skill to read, two or three example decks, layouts and themes from the catalog, and the validate step (`validate_deck` with `failOn: \"warning\"`). With no goal, the general learning path. Everything it names is a resource URI or a tool to call next. |\n| `validate_deck` | `document` (a JSON object, or deck text), `format?` (`json`, `yaml`, `markdown`; default JSON), `failOn?` (`error`, `warning`, `info`; default `error`) | `{ ok, valid, schemaValid, failOn, format, counts, findings[], checks, hint? }`. The findings are the ones `opf validate` reports (rule id, severity, category, JSON Pointer `path`, message, `help`, `fixes`, and a `location` with line and column for JSON, YAML and Markdown text). `ok` is false when a finding is at or above `failOn`. It does not look for local image files (it reads none). |\n| `get_schema` | `name?` (a schema such as `presentation` or `layout`, or a `$defs` name such as `Chart`), `pointer?` (a JSON Pointer into the schema, or a `$defs` name) | `{ name, pointer, id, schema, opfVersion }`, like `opf schema`. `$ref`s stay as written. A whole schema names the `@openpresentation/opf` release it came from in its `$comment`; a part is as it is. |\n| `search_catalog` | `kind` (`layouts`, `themes`, `color-schemes`, `font-schemes`, `narratives`, `audiences`, `purposes`, `tones`, `chart-types`, `languages`, `social-platforms`, `examples`), `query?`, `limit?` | `{ kind, total, returned, records[] }`: short records (id, name, summary, description, tags), best match first. |\n| `get_catalog_record` | `kind`, `id` | `{ kind, id, uri, record }`: the record in full, like `opf catalog <kind> <id>`. |\n| `convert` | `document`, `from?`, `to` (`json`, `yaml`, `markdown`) | `{ ok, from, to, text, findings, counts }`, like `opf convert`. The deck must be valid; otherwise nothing is converted and the findings are returned. This tool converts text formats only. The viewer separately offers PowerPoint, PDF and PNG Export in a host that can save files; the local `opf convert` also writes rendered formats. |\n| `search_docs` | `query`, `limit?` | `{ total, results[] }`: ranked pages and skills, each with `uri`, `title`, the `heading` the snippet sits under, a `snippet` and a `score`. |\n| `search_shapes` | `query?`, `category?` (`lines`, `rectangles`, `basic`, `blockArrows`, `equations`, `flowchart`, `starsBanners`, `callouts`, `actionButtons`), `limit?` | `{ query, total, returned, shapes[], categories[] }`: the 187 preset shapes of a shape block or an overlay shape, searched by DrawingML name (`rightArrow`) and common words (`speech bubble`, `cylinder`, `cog`; every word must match, a name ranks first; an empty query browses PowerPoint's gallery in order). Each shape has `shape` (the value to write), `category` and `categoryTitle`, `aspect` (the default frame, width over height), `adjust[]` (each adjust value's `name`, `default`, `min`, `max`, `unit` of `fraction` or `degrees`, and whether a `handle` moves it, at a square frame) and `svg`, a small drawing from the preset's own geometry. |\n| `list_examples` | `category?`, `query?` | `{ total, categories, examples[] }`: slug, name, category, slide count and `uri` for each bundled example deck. |\n| `show_deck` | `document` (a JSON object, or deck text), `format?`, `view?` (`preview`, `source`, `both`; default `preview`), `slide?` (from 1), `session?` | Opens the deck in the OPF viewer (`_meta.ui.resourceUri: ui://opf/deck`). `{ opened, checked, view, slide?, format, name, slides, outline[], valid, counts, findings[], viewer, iconSets }`, and as text the deck's name, slide titles, findings and the viewer session key, so a client without MCP Apps still gets an answer. With `processDecks: false` (a hosted server that does no deck work), `{ opened, checked: false, view, format?, viewer, iconSets }` only: the viewer does the checks. `iconSets` names the icon sets the viewer can read through `read_icons` (`[]` when the server has none). A later call for the same deck (the same name) replaces the open viewer of it; `session` chooses another session. `viewer` is `{ session, createdAt, tie }` ([Instances](#instances-and-the-viewer-session)). |\n| `open_editor` | `example?` (a bundled example's slug), `title?` (the deck's name: the starter deck's title, or a new name for the example), `session?`; all optional | Opens the OPF viewer's editor with a deck to edit: with `{}` a two-slide starter deck (\"Untitled deck\"), or the example named. `{ opened, editor: true, example, name, slides, document, examples[], viewer, iconSets }`; an unknown slug still opens the starter deck and the text names the nearest slug. Title \"OPF deck editor\". Its `_meta` carries `ui.resourceUri` and `\"openai/ui\": { \"entrypoints\": [{ \"type\": \"global\" }] }`, the marker Claude reads to offer the app as a direct entry point ([Entry point](#the-direct-entry-point-open_editor)). |\n| `read_font_file` | `file` (a path from the renderer's font manifest), `offset?` | For the viewer only (`_meta.ui.visibility: [\"app\"]`; a host hides it from the model). `{ file, offset, total, bytes }`: at most 512 KiB of the file, base64. Offered by `opf-mcp` when `@openpresentation/opf-render` is installed beside it. |\n| `read_icons` | `set` (`lucide`, `tabler`), `names` (at most 100 icon names), `index?` | For the viewer only (`_meta.ui.visibility: [\"app\"]`). `{ set, icons, errors?, index? }`: the path data of the icons the set has (a name it lacks is left out: the index names every icon), why a name could not be read, and with `index` the set's index (`names`, `viewBox`, `style`, stroke settings, `name`, `version`, `license`, `copyright`, `licenseText`). The viewer asks for the index once per set. Offered when the server has icon sets (`sources.iconSets`; `opf-mcp` and the `.mcpb` read the installed files) and the viewer. |\n\n## Resources\n\nResources have stable URIs. The server lists them (`resources/list`) and also offers URI templates (`resources/templates/list`) so a client can read a URI it builds itself.\n\n| URI | What it is |\n| --- | --- |\n| `opf://docs/index` | Every documentation page and skill, with its URI |\n| `opf://docs/whats-new` | The most recent release notes: the newest release, and older ones while there are at most five and the page is under 120,000 characters, from the changelog of `@openpresentation/opf` (the format, the validators and the engine), newest first, as text |\n| `opf://docs/<slug>` | A documentation page as Markdown: `format-card` (the whole authoring surface on one page, sized for pasting into a model's context), `how-opf-works`, `schema-reference`, `validate`, `cli`, and the other pages meant for people who use OPF. Handoff, evidence, status and release notes are not served. |\n| `opf://schema/<name>` | A JSON Schema (`opf://schema/presentation`) |\n| `opf://schema/<name>#<pointer or $defs name>` | Part of a schema: `opf://schema/presentation#Chart`, `opf://schema/presentation#/properties/slides`. `opf://schema/Chart` also works. |\n| `opf://examples/<slug>` | A valid example deck as JSON |\n| `opf://catalog/<kind>/<id>` | A record of the default catalog (`@openpresentation/gallery`): `opf://catalog/layouts/two-column` |\n| `opf://skills/<name>` | A skill entrypoint (`opf-author`, `opf-layout`, `opf-presets`, `opf-edit`, `opf-export`, `opf-inspect`) |\n| `opf://skills/<name>/<path>` | A reference or asset of a skill: `opf://skills/opf-author/references/content.md` |\n| `ui://opf/deck` | The OPF viewer (`text/html;profile=mcp-app`): one HTML page (about 9.1 MB of UTF-8; `pnpm --filter @openpresentation/mcp build` prints the exact size and the JSON-RPC frame's headroom under the 10 MiB stdio limit) that `show_deck` and `open_editor` open. The `resources/read` content item carries `_meta.ui` `{ prefersBorder: false, preferredDisplayMode: \"fullscreen\" }`; the viewer declares no `csp`, `domain` or `permissions` (any of them would go on the same content item). |\n\nSkill scripts and agent manifests are not served; the server runs no code from them.\n\n## The OPF viewer (`show_deck`)\n\n`show_deck` is an [MCP App](https://github.com/modelcontextprotocol/ext-apps) (SEP-1865): in a client that supports MCP Apps, such as Claude on the web and desktop, the deck opens in the conversation with the openpresentation.org playground's three views.\n\n- **Preview** shows the slides, with the thumbnail strip under them. **Source** shows the deck's text (JSON, YAML or OPF Markdown) in the editor's source pane, checked as you type. **Both** puts them side by side; in a container narrower than 860px it stacks the slide over the source, and choosing it there asks the client for a larger view. The slide itself can be edited in place too. The model is told to open on Preview unless the user asked for the source.\n- **The bar** (48px, one row down to a 640px container, two rows and no Both below it, and every control still in two rows at 320px): Undo and Redo, the deck's name (a little room from 640px, a row of its own below 640px; renaming opens the editor's Save and Cancel over the whole bar, or over the name's own row where the bar wraps, and Enter or Save commits one undoable edit, Escape or Cancel puts the name back, and leaving the field closes an untouched rename and keeps a typed draft), the view switch, the editor's Design menu (theme, colors, fonts and the slide's layout, each one undoable edit), Find and replace (Ctrl/Cmd F), Export, Expand, and **Send to Claude**. Undo stops at the deck as it was opened. Present is left out (a sandboxed iframe cannot go full screen on its own), and the source pane's Copy works without the clipboard permission.\n- **Export** is the editor's own menu: PowerPoint (`@openpresentation/opf-pptx`, editable), PDF (vector, selectable text), SVG and PNG slides, and the OPF source as JSON, YAML or Markdown. Every file is made in the viewer, on the user's machine, with the fonts the slides draw with, and handed to the client to save (`ui/download-file`), since a sandboxed iframe cannot download. The menu, and the source pane's Download, show only in a client that declares that capability; the agent handoff is left out, the deck being in a conversation already.\n- **Your edits go back to the model.** A second after the last edit, the viewer sends the whole deck to the model as context (`ui/update-model-context`), so its next answer continues from your version; the footer says so (`Edits not shared yet`, then `Claude has your edits`). **Send to Claude** also asks for a turn (`ui/message`): it is the view's one primary button, filled while there are edits you have not sent, and it stays usable to send again. In a client that is not Claude the wording is \"the assistant\". Where the client offers the viewer's tools, the model changes the open deck in place ([The viewer's tools](#the-viewers-tools-editing-together)); otherwise it calls `show_deck` again and a new viewer opens, and with the session key the earlier one steps aside.\n- **The checks run in the viewer.** It runs core's validators on every change, with text measured by the fonts the slides draw with, and sends the findings to the model with the deck. The status footer (28px) shows the verdict at the left, the editor's review pill (`Valid OPF`, `2 issues`), which opens the Review panel in a drawer. While the text in Source is not a valid deck, the slides keep the last valid version, but the verdict is the text's: the pill counts its errors (`1 issue`, never `Valid OPF`), the Review panel lists them first and says the findings under them describe the last valid version, and the model's context and `read_deck` carry them as `sourceChecks`; all of it clears once the text is valid again. Then come the slide navigator (previous, `01 / 16`, next), the editor's status line, and the version at the right.\n- **One palette, the client's.** The viewer is built to the openpresentation.org design system (the playground's bar and footer) and reads only the editor's `--opf-ui-*` tokens. In a client that sends the standard MCP Apps style variables, the neutral tokens (surfaces, text, borders) are derived from the client's background and text colors and its fonts, for the viewer's own chrome and the editor's parts alike, in the client's light or dark theme; the accent and the status colors stay OPF's, and the slides keep the deck's theme. Without those variables it uses the design system's own values.\n- **It is as tall as the deck needs.** Inline, the stage takes the shape of the deck's slides (up to 480px) with 16px around the slide on every side, so a 16:9 deck in a 660px column is about 545px tall; until the deck is drawn, a slide-shaped placeholder holds its place and says what the viewer is waiting for; Source and Both have a fixed height. Full screen, and a client that fixes the height, fill the frame.\n\n- **Saving is controlled by the host.** Source downloads preserve the current JSON, YAML or Markdown text, MIME type and suggested filename; the host controls confirmation and saving. Each outcome is worded as the host reports it ([capabilities](#what-the-viewer-does-with-each-host-capability)); \"Download started.\" is not proof that a file was saved. Without download support the file controls stay hidden; the viewer never substitutes a direct iframe Blob/anchor download. Source text can still be selected and copied manually.\n\n**Everything runs on the user's machine.** The page bundles `@openpresentation/opf-editor`, `@openpresentation/opf-render` and core's precompiled validators, so the editing, rendering and checking happen in the client, not on the server. The client runs it in a sandboxed iframe with no network, no `eval` and no WebAssembly (the restrictive default CSP of SEP-1865, since the viewer declares no domains), so the page loads nothing: its script, styles and the startup font (Roboto Regular) are inline. Any other face a deck draws comes from the server through the client: the viewer calls the app-only tool `read_font_file`, which serves the installed renderer's files in pieces of 512 KiB, and the renderer checks each file against its pinned SHA-256 before it registers it as bytes (`FontFace` from an `ArrayBuffer`, which needs no `font-src`). Without the renderer beside the server, or on a server that offers no `read_font_file`, the viewer draws those faces with Roboto and names the substitution. Images in a deck draw when they are data URIs; the sandbox blocks a remote image.\n\n**Set icons** (`\"icon\": \"lucide:rocket\"`) come from the server the same way: the viewer registers the gallery's sets as loaders that call the app-only tool `read_icons` for the icons a deck names (at most 100 a call, so a deck with more makes more calls) and for each set's index once (every name, so a check suggests the nearest names, and the license). The page carries no icon data. The viewer learns which sets the server reads from `iconSets` in the `show_deck` or `open_editor` result; a set the server does not offer, a server without `read_icons`, or a call that fails settles the load: the slide draws without the icon, and `opf/icon-unknown` says it could not be loaded and why. The viewer's checks, and the checks in `read_deck` and `edit_deck` results, wait for the deck's icons, so a known icon is never reported and an unknown name gets the same finding and suggestions as `validate_deck`. The viewer has no icon picker (that is the editor's Content panel), so it never reads the sets' search keywords.\n\n**In a client without MCP Apps** (Claude Code, the API), `show_deck` returns the deck's name, slide titles and findings as text, like a short `validate_deck`, and `open_editor` returns its deck and the example slugs.\n\n### What the viewer does with each host capability\n\nEvery capability below is the host's to offer, and Claude can limit each one by connector type (several need a remote connector: a custom connector added by URL or a directory listing, not a local server), by organization and by client. Nothing here is available to every user, and none of it was verified in Claude from this repository; the stand-in host in `test/deck-app-tools-browser.mjs` and `test/deck-app-browser.mjs` behaves as Claude's MCP Apps documentation describes. The viewer keeps working without each one.\n\n| Capability | Where the host offers it | Where it does not |\n| --- | --- | --- |\n| **The viewer's own tools** (`read_deck`, `select_slide`, `edit_deck`) | The model reads the open deck and changes it in place, one undoable edit per call, and the user sees it at once. Claude gets a view's tools from the user's next message after the view opened, and only for a remote connector. | The tools are never called; the model sees the user's edits as context and opens a new viewer with `show_deck` to change the deck. |\n| **Model context** (`ui/update-model-context`) | A second after the last edit the whole deck goes to the model, with its revision and the viewer session key. A viewer that `open_editor` opened sends the deck it opened (the starter deck or the example, named) in its first context too. | The footer says nothing about sharing; Send still asks for a turn where messages work. |\n| **Messages** (`ui/message`) | **Send to Claude** asks for a turn on the user's click. In Claude: `Sent to Claude for your approval` when Claude took it (not proof that the user approved or the model read it); in another host: `Sent to the assistant`. `Claude didn't take the message` when it was refused, `The message couldn't be confirmed` when the request failed or timed out. Send stays usable to try again. The message is one short sentence; the deck goes as context, never in the message. | No Send button. |\n| **Downloads** (`ui/download-file`) | Export and the source pane's Download hand the file to the host: `Download started.`, `The download didn't finish.`, or `The download couldn't be confirmed.` (a rejection or the ten-minute timeout; the host's dialog may still save it). A host that answers \"method not found\" gets `This host does not offer downloads here. Select the source text to copy it.`, and Download and Export are no longer offered. One request at a time: a click while one waits sends nothing and says so. The file name is the URI's last segment as written (never percent-encoded); the viewer turns / \\\\ % : \" * < > \\| ~ # ? into `_` itself, so the name the user sees is the one it chose. The viewer makes only PowerPoint, PDF, PNG, SVG, ZIP and OPF source files, none of a type a host refuses outright. | No Export menu or Download button; the source text can be selected and copied. |\n| **A larger view** (`ui/request-display-mode`, `availableDisplayModes: [\"inline\", \"fullscreen\"]`) | **Expand** asks from the click itself (Claude honors it only right after a press in the view and opens its side panel or full screen; both report `fullscreen`); the label becomes **Back to the conversation**. A refusal leaves the label as it was and says the host kept the viewer where it was. The content item's `preferredDisplayMode: \"fullscreen\"` asks Claude to open the side panel when the tool returns; Claude decides. | No Expand button; the viewer stays inline. |\n| **Server tools from the view** (`tools/call`) | Fonts (`read_font_file`), set icons (`read_icons`) and the editor's example picker (`get_catalog_record`). | The deck draws with Roboto in place of faces it cannot get and without its set icons (each with an `opf/icon-unknown` finding that says it could not be loaded), and the editor offers only its starter deck and Paste. |\n\n**Layout** follows the container the host reports (`containerDimensions`: its width, and a fixed or a maximum height): the side panel and full screen are both `fullscreen` and the side panel can be resized down to about 320px. A fixed height fills the frame, and so does `fullscreen` when the host sends no dimensions with it (borderless); a maximum height keeps the inline view as tall as its slide. The host's `safeAreaInsets` pad the view, and `hostcontextchanged` lays it out again. In the narrowest container (under 400px) every control in the bar, the start row and the footer is at least 44 by 44 CSS pixels, Send has a row of its own, and the footer wraps a long message instead of cutting it short. A status message clears itself after eight seconds.\n\n### The viewer's tools (editing together)\n\nThe viewer registers three tools before it connects, and their names, titles, descriptions and schemas never change while it runs (Claude may ask the user to approve a tool again when one does); changing values go in results. Each answers in text, which is what the model reads, and acts on its own view only: with two viewers open, a call reaches one. Inputs a model is likely to get wrong (an unknown `op`, too many operations, a negative or fractional `offset` or `index`, both or neither of `index` and `id`) come back as normal results that say how to fix them, not as validation errors.\n\n| Tool | Arguments | What it does |\n| --- | --- | --- |\n| `read_deck` | `source?` (`json`, `yaml`, `markdown`), `offset?` | The open deck's `revision` (core's `documentHash`, `sha256:...`), viewer `session`, `name`, `slideCount`, `selected` `{ index, id }`, `outline[]` `{ index, id, title, layout }` (indexes from 0, as in `/slides/0`), `sourceDraft` and `checks` (counts and up to 20 findings). While the source pane's text is not a valid deck, `checks` describe the deck at `revision` (the last valid version, which the slides show) and `sourceChecks` (the same shape) the text's own findings; a syntax error is one error with rule id `syntax`. It is bounded whatever the deck: names, ids, titles and finding paths at most 200 characters, finding messages 300, the outline at most 30,000 characters of JSON (then `outlineTruncated: { listed, of }`). With `source`, also the deck's text, in pages that keep the result under 100,000 characters with at least 40,000 characters of text each; pages after the first leave the outline out, a page never starts or ends inside a surrogate pair, and every page carries a `textHash` of the whole text (when it changes between pages, start again at 0). The form open in the source pane comes back as the pane shows it, a draft the deck has not taken included (`draft: true`), and nothing the user is typing is applied by the read. |\n| `select_slide` | `index?` (a whole number from 0) or `id?`, exactly one | Shows that slide; the deck does not change. Refused (`busy`) while the user has text open on the slide, since changing slides would commit it. |\n| `edit_deck` | `expectedRevision`, `operations` (1 to 100 JSON Patch operations, as `opf edit` takes them; paths may name slides and blocks by id, `/slides/@intro/title`) | Applies the operations through the editor session's `applyPatch` with `expectHash`: all or none, as one undo step, with the source pane, the slide and the model's context following. Refused, changing nothing: a revision that is not the current one (`stale-revision`, read again); an edit while the user is typing, with text open on the slide or typing the source pane has not applied yet (`busy`: the user's edit is never committed for them; try again after their next message); a source draft that is not a valid deck (`source-draft`); an operation on the whole deck, `path` or `from` `\"\"` (`whole-deck`); any operation but `test` whose `path` or `from` is `/slides` itself, that is adding, replacing, removing, moving or copying the whole slides array (`whole-slides`: edit slides one at a time); more than 200,000 characters of operations (`too-large`); and an edit that would make the deck invalid (`invalid-result`, with the findings). The deck in the viewer is always valid in format and references: a JSON deck that is not does not open (the tools answer `not-open`), and YAML or Markdown text that is not stays a draft in Source (`source-draft`). In the source pane, JSON keeps its formatting (only the changed values are rewritten); YAML and Markdown text is written again from the deck, so YAML comments are dropped and the pane says so. This holds for every change made outside the source pane (the Design menu, an edit on the slide, Undo), not only for `edit_deck`. Returns the new `revision`, `previousRevision`, `changed[]` (as the operations addressed them) and the checks. |\n\nEvery tool answers with `ok: false` and a `code` (`loading`, `not-open`, `superseded`, `closed`, `busy`, `source-draft`, `stale-revision`, `whole-deck`, `whole-slides`, `too-large`, `invalid-input`, `invalid-result`, ...) and a sentence that says what to do instead, rather than an error, while the deck is loading, when no deck opened (also after the tool call was cancelled), after a newer viewer of the same session replaced the view (which also makes it read-only), and after the host tore the view down.\n\n### Instances and the viewer session\n\nEach tool call mounts its own view, and earlier views stay live. `show_deck` and `open_editor` mint `viewer: { session, createdAt, tie }` in their result; the server keeps nothing and counts nothing. Decision (vetoable, RR111-SESSION-BY-DECK): **one editing session is one deck**: the session key is the caller's `session` when it passes one (letters, digits and `- _ . :`, up to 64), and otherwise it is derived from the deck's own identity, statelessly: OPF has no document id, so it is `deck-` and 32 hex digits of the SHA-256 of the deck's `name`, trimmed, lowercased and with runs of spaces collapsed (a deck without a name gets a random key of its own). So a model that shows a newer version of the same deck replaces the older viewer without passing anything back, a deck with another name stays independent, and `open_editor` derives the key from the starter or example deck it opens. Both tools' descriptions say so. Views of one session meet on a `BroadcastChannel` named by that key and compare the server's keys only: `createdAt` (the server's clock), then `tie` (random, minted per call), then the instance id; never a key a view made up. The older view greys out, becomes read-only, clears its sharing state and any selection, says that a newer viewer is open, and stops sending context, messages and tool edits. A view whose result carries no key, a view where the browser has no `BroadcastChannel`, and every view of another session stay independent. The channel is per conversation because the viewer declares no `ui.domain` (its origin is then the conversation's); a host that gave it a fixed domain would let two conversations with a deck of the same name meet, so that would need the session key to include something the host scopes.\n\n### The direct entry point (`open_editor`)\n\nWhere Claude offers it (a remote custom connector or a directory listing, the newer conversation experience, an organization that allows it; not a local server), a user can open the OPF viewer's editor without asking the model: Claude lists it as \"OPF deck editor\" beside the connector's name and calls `open_editor` with `{}`. The starter deck can be edited at once; the start row under the bar (\"A starter deck to edit.\", an example picker capped at 280px, and **Paste a deck**, all on one row from 600px) opens a bundled example (through `get_catalog_record`) or pastes a deck. **Paste a deck** switches to Source, selects the whole text and focuses it, so what the user pastes replaces it; where the host lets the view read the clipboard, the deck on it goes in at once. The label goes once the user opens an example, pastes or edits. The model can call it too, with a `title` (with an `example`, the title renames the example deck, and the result says so) or an `example`.\n\n**Not built:** embedding the pptx.dev workspace as a website inside the app. It would need explicit `frameDomains`, framing headers on pptx.dev and a listing that allows embedded sites, and it is a separate review.\n\nTry it locally: run the server in Claude Desktop (the setup above) and ask Claude for a deck. To see the viewer outside a client, `node packages/mcp/test/deck-app-browser.mjs` (after `pnpm --filter @openpresentation/mcp build`) runs it in Chromium behind a stand-in host that frames it the way a client does; with `OPF_DECK_APP_SCREENSHOTS=<directory>` it saves a screenshot of each view. ext-apps' `basic-host` example is a reference host for a server over HTTP.\n\n## Prompts\n\n| Prompt | Arguments | Use |\n| --- | --- | --- |\n| `learn_opf` | none | Orient an agent that has not used OPF; includes the format card |\n| `author_deck` | `brief`, `audience?`, `slides?` | Write a deck from a brief, then validate and fix it; includes the format card and the `opf-author` skill |\n| `fix_validation_findings` | `document`, `format?` | Repair a deck that does not validate with the smallest change; includes the `opf-inspect` skill |\n| `choose_layout` | `content`, `intent?` | Pick a layout from the content a slide carries; includes the `opf-layout` skill |\n\n## A typical session\n\n1. The agent calls `start_here { goal: \"a board update with a revenue chart\" }` (or reads `opf://docs/format-card`, or runs the `learn_opf` prompt).\n2. It reads what the path names, finds layouts with `search_catalog { kind: \"layouts\", query: \"two columns\" }` and reads one with `get_catalog_record`.\n3. It writes the deck and calls `validate_deck` with `failOn: \"warning\"`; each finding names a rule, a JSON Pointer and a hint. It fixes the findings and repeats until `ok` is true. A field it is unsure of comes from `get_schema { name: \"Chart\" }`.\n4. It shows the deck with `show_deck`: in a client with MCP Apps the user sees the slides, can edit them, and the edits come back to the agent. Or it uses `convert` to hand the deck over as YAML or Markdown. In a host that advertises file saving, the viewer's Export menu hands PowerPoint, PDF and PNG files to the host. The local `opf convert deck.opf.json deck.pdf` (or `.pptx`) is another way to write an export.\n\nValidation checks the file. It does not render the deck, so it is not proof of how the deck looks.\n\n## Host it\n\nThe package is a library as well as a command. Its entries:\n\n| Entry | What it is |\n| --- | --- |\n| `@openpresentation/mcp` | `createOpfServer(options)`: the server with the bundled docs, examples, skills and release notes. Edge-safe. |\n| `@openpresentation/mcp/server` | `createOpfMcpServer(options)`: the same server with no bundled data; you pass `sources`. Edge-safe, and small. |\n| `@openpresentation/mcp/stdio` | `runStdio()`: the Node stdio wrapper that `opf-mcp` and `opf mcp` run. Uses Node. |\n| `opf-mcp` (bin) | The stdio server; `npx -y @openpresentation/mcp` runs it. |\n\nThe two library entries import no Node builtin and read no file; documentation, examples, skills and release notes are bundled data; validation uses the precompiled validators (`@openpresentation/opf/precompiled`), so they run where code generation from strings is refused, such as Cloudflare Workers (the tests bundle them the way Wrangler does and run them in workerd):\n\n```ts\nimport { createOpfServer } from \"@openpresentation/mcp\";\nimport { WebStandardStreamableHTTPServerTransport } from \"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js\";\n\nexport default {\n async fetch(request: Request): Promise<Response> {\n const server = createOpfServer({ version: \"0.27.0\" });\n const transport = new WebStandardStreamableHTTPServerTransport({ sessionIdGenerator: undefined, enableJsonResponse: true });\n await server.connect(transport);\n return transport.handleRequest(request);\n },\n};\n```\n\n`createOpfServer({ version, opfVersion?, sources?, checkText?, deckApp?, processDecks? })` returns an SDK `McpServer`. `sources` replaces any of the bundled `docs`, `examples`, `skills` and `whatsNew`. `checkText` replaces the check behind `validate_deck`; `opf-mcp` passes the one that measures layout with the fonts `opf convert` draws with. Without it, layout is estimated and the report's `hint` says so.\n\nThe default entry bundles the viewer, example decks and public documentation. A host that must stay small imports `createOpfMcpServer` from `@openpresentation/mcp/server`, which bundles none of that data, and takes `sources: { docs, examples, skills, whatsNew? }` from wherever it keeps them (KV, R2, static assets): `docs` is `[{ slug, title, markdown }]`, `examples` is `[{ slug, category, file, deck }]`, `skills` maps a skill name to `{ \"SKILL.md\": text, ... }`. `defaultSources()` and `DOC_SLUGS` (the pages served) are exported from `@openpresentation/mcp`.\n\n**A hosted server that does no deck work.** A tool call always runs on the server the client calls, so a hosted server runs every call on your compute. Pass `processDecks: false` and it does no OPF processing of decks: `show_deck` only opens the viewer, which reads, checks and renders the deck on the user's machine and sends its findings to the model as context; `validate_deck`, `convert` and the `fix_validation_findings` prompt are left out, and `start_here` and the other prompts point to `show_deck`. What stays on the server is the lookups (docs, schemas, catalog, examples), which are small and the same for every caller, and handing over the viewer's HTML. A client without MCP Apps gets no check from such a server. `deckApp: { readFontFile }` gives the viewer font files (the local server reads the installed renderer's); `deckApp: false` leaves the viewer out. The lean `createOpfMcpServer` takes `deckApp: { html }` with `DECK_APP_HTML` from `@openpresentation/mcp`, or a function that returns the same page from storage; the function runs only when a client opens the viewer, so other requests never load the viewer page.\n\n**Fonts for a hosted viewer.** A site that already serves the OPF preview fonts (the layout the OpenPresentation site's `prepare-opf-fonts.mjs` writes: `/opf-fonts/manifest.json`, `base/`, `lazy/fonts/` and `scripts/`) passes `readFontFile: siteFontFiles({ fetch })`, exported by both library entries. `fetch` reads a file by its path on the site; in a Worker it is the static-assets binding, so the fonts cost no storage of their own and no request leaves the Worker:\n\n```ts\nimport { createOpfMcpServer, siteFontFiles } from \"@openpresentation/mcp/server\";\n\nconst server = createOpfMcpServer({\n version, sources,\n deckApp: { html: () => loadDeckAppHtml(), readFontFile: siteFontFiles({ fetch: (path) => env.ASSETS.fetch(new Request(new URL(path, request.url))) }) },\n});\n```\n\nIt reads only font files under the font folders and the faces the site's manifest names, and the renderer in the viewer checks each file against its pinned SHA-256. `OPF_SITE_FONTS_ORIGIN=https://www.openpresentation.org node --test packages/mcp/test/site-fonts.test.mjs` checks a deployed site serves every face the viewer can ask for (Node needs `NODE_USE_ENV_PROXY=1` behind a proxy).\n\n**Icons for a hosted viewer.** A Worker has no installed icon files, so its `defaultSources()` registers no icon set, and without one the server offers no `read_icons` and a deck's set icons are `opf/icon-unknown` in the viewer. Serve the gallery's six set-level icon files as static assets under `/opf-icons/` and pass them as `sources.iconSets`; nothing is bundled into the Worker:\n\n```ts\nimport { fetchIcons, galleryIconSets } from \"@openpresentation/gallery/icon-sets\";\n\nconst iconSets = galleryIconSets(fetchIcons(new URL(\"/opf-icons/\", request.url), env.ASSETS));\nconst server = createOpfMcpServer({ version, sources: { ...sources, iconSets }, deckApp: { html, readFontFile } });\n```\n\n```sh\n# The six set-level files (lucide.json, lucide.icons.json, lucide.tags.json and Tabler's three; 2.5 MB, 538 KB gzip) into the static assets.\nnode -e \"const fs = require('fs'); fs.mkdirSync('public/opf-icons', { recursive: true }); for (const f of fs.readdirSync('node_modules/@openpresentation/gallery/dist/icons')) if (f.endsWith('.json')) fs.copyFileSync('node_modules/@openpresentation/gallery/dist/icons/' + f, 'public/opf-icons/' + f)\"\n```\n\nThen `search_icons` and `validate_deck` read the same sets, and `test/mcp-workerd.test.mjs` runs such a Worker in workerd.\n\n## Limits\n\n- The viewer is about 9.1 MB of UTF-8 HTML (9,064,031 bytes in 0.34; the build prints the exact size), loaded once per conversation or cached by the client. Its `resources/read` frame is 9,390,901 bytes, about 1.1 MB under the default 10 MiB stdio limit, and `test/app-resource-frame.test.mjs` fails when that headroom drops below 1,000,000 bytes. The bundle carries only zod's English messages (`scripts/build-app.mjs`) and core's precompiled validators, whose errors are built by shared helper functions (`packages/javascript/scripts/validators-codegen.mjs`). A client may cap the size of an MCP App or ask the user before it shows one.\n- Export needs a client that saves files for the viewer (`ui/download-file`); in one that does not, there is no Export menu. A PowerPoint or PNG export draws an SVG picture through the browser's image decoder from a `data:` URL (`svgSource: \"data\"` of the renderer's `export-browser`), because the sandbox allows no `blob:` image. The model sees the deck as JSON, not as pictures of the slides.\n- The `convert` tool handles JSON, YAML and Markdown. Viewer Export runs in the client and requires its file-saving capability; the local `opf` command can also render and write files.\n- `validate_deck` reads no files, so a local image path in a deck is not looked up (the CLI warns with `cli/asset-missing`). Pass images as data URIs or assets.\n- Layout is measured with real fonts only under `opf-mcp` with `@openpresentation/opf-render` installed; `checks.layout` says `measured` or `estimated`.\n"
261
+ "markdown": '# OPF MCP server\n\n`@openpresentation/mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server for OPF, so an agent or editor that speaks MCP can learn the format, look things up and check a deck without shelling out and parsing text. It teaches OPF (documentation, schemas, the default catalog, example decks and the six agent skills, all as resources, with a `start_here` tool that gives a path for a goal), and it runs the checks the CLI runs (`validate_deck`, `convert`).\n\nIt also shows decks: `show_deck` opens the OPF viewer inside a client that supports MCP Apps (such as Claude on the web, on desktop and, as seen on 2026-11-16, in the iOS app), with Preview, Source and Both, where the user can edit the deck and the edits come back to the model ([The OPF viewer](#the-opf-viewer-show_deck)).\n\nIt keeps no state, reads no file (everything it serves is bundled in the package, and tools work on the text you pass in; the one exception is the renderer\'s font files, which `opf-mcp` hands to the viewer), fetches nothing and has no network access. It runs two ways: locally over stdio (this page), and hosted on an edge runtime (the same server definition over Streamable HTTP). The hosted connection target is `https://www.openpresentation.org/mcp`; its deployed version, tools and viewer availability follow that site\u2019s deployment, separately from the npm package. Check the [hosted MCP guide](https://www.openpresentation.org/docs/mcp) for that deployment. The packaged `show_deck` viewer described here does not establish that a hosted deployment offers it. The local server measures layout with real fonts when `@openpresentation/opf-render` is installed.\n\n## Set it up\n\n**Hosted, nothing to install.** `https://www.openpresentation.org/mcp` is this server over Streamable HTTP: no account, no key, read-only, and it keeps nothing. In Claude (web or desktop), open the Connectors page and add a custom connector: name it `OPF` and paste the URL `https://www.openpresentation.org/mcp`. Claude moves these menus; on 2026-11-14 the page was Customize (in the left sidebar), then its Connectors tab, then Add and Add custom connector, and the older Settings, Connectors page only pointed there. If a label has moved, look for "Connectors" and "custom connector". Other clients take the same URL as a remote MCP server.\n\n**Your first request.** Claude has its own slide feature, and a plain "make a pitch deck" may be answered by it without calling OPF. Name OPF and the viewer in the first message, for example: *Use the OPF tools to make a ten-slide deck about our Q3 results, validate it, and show it in the OPF viewer.* Naming OPF only tells the host which tools you mean; whether and how Claude uses them is the host\'s decision, so if a reply comes from another feature, say so and repeat the request naming OPF. Once the viewer opens, ordinary follow-ups ("add a slide on risks") continue in it.\n\n### Add it to your assistant\n\nSteps from each vendor\'s own documentation, read on 2026-11-16 and 2026-11-17, unless marked "seen", which means we tried it that day. The server needs no sign-in: where an assistant asks about authentication, choose the option without it. Menus move; the [hosted MCP guide](https://www.openpresentation.org/docs/mcp) has a page per assistant with the sources.\n\n| Assistant | How to add `https://openpresentation.org/mcp` | The OPF viewer |\n| --- | --- | --- |\n| ChatGPT | On the web, chatgpt.com/plugins: plus button, Add custom MCP server, name, URL, No authentication, accept the risk warning, Create as a plugin; then `@` the plugin in a new chat. OpenAI\'s help page: full MCP on Business and Enterprise/Edu on the web (on Business only admins and owners create these plugins); its FAQ: "Pro users can connect custom MCP servers with read/fetch permissions"; Free and Plus not mentioned; adding is web only. Refresh the tools from the plugin\'s Refresh. | Seen in the iOS app: opens (up to a minute on the phone); Preview, Source, Design and sending edits back work; no Export (no file saving there) |\n| Claude (web, desktop, phone apps) | Customize, Connectors, + Add, Add custom connector; name `OPF`, the URL, Authentication "No sign in". Free plans allow one custom connector; on Team and Enterprise an Owner adds it under Organization settings, Connectors. | Seen on claude.ai and in the iOS app: opens; Export not checked |\n| Claude Code | `claude mcp add --transport http opf https://openpresentation.org/mcp` (`--scope user` for every project) | Not described by Anthropic\'s Claude Code docs |\n| Codex (CLI, IDE extension, ChatGPT desktop app share one config) | `[mcp_servers.opf]` with `url = "https://openpresentation.org/mcp"` in `~/.codex/config.toml` (or a trusted project\'s `.codex/config.toml`). OpenAI\'s Docs MCP page uses the same form on the command line: `codex mcp add <name> --url <url>` | Not mentioned by OpenAI\'s Codex docs |\n| Gemini app | On gemini.google.com: Settings, Connected Apps (or Personal Intelligence first), Custom apps, Add a custom app, the URL, Next. US, 18+, personal account, History on, English; added on the web, then usable in the mobile app. Google\'s page does not say how it treats a server without sign-in; not tried. | Not stated for custom apps |\n| Antigravity CLI (`agy`) and IDE | `"mcpServers": { "opf": { "serverUrl": "https://openpresentation.org/mcp" } }` in `~/.gemini/config/mcp_config.json` (or a workspace\'s `.agents/mcp_config.json`); `serverUrl`, not `httpUrl`. `/mcp` in the CLI opens the MCP manager; the IDE edits the same file under MCP Servers, Manage MCP Servers, View raw config. | Not mentioned |\n| Gemini CLI | Google: "Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026." It stays for Gemini Code Assist Standard and Enterprise licenses and paid Gemini and Gemini Enterprise Agent Platform API keys. There: `gemini mcp add --transport http --scope user opf https://openpresentation.org/mcp`, or `"mcpServers": { "opf": { "httpUrl": "https://openpresentation.org/mcp" } }` in `~/.gemini/settings.json` | Not mentioned |\n| Muse (Meta) | Muse is rolling out in the US on iOS, Android and muse.ai (Meta, 2026-09-08). The Muse app documents connectors from Meta\'s list and custom connectors Muse creates, not adding an MCP server by URL: no steps. Muse Code: `"mcp_servers": { "opf": { "transport": "streamable_http", "url": "https://openpresentation.org/mcp", "enabled": true, "mode": "optional" } }` in `~/.config/muse/settings.json` (with `"schema_version": 1`) | Not documented |\n| Cursor | `{ "mcpServers": { "opf": { "url": "https://openpresentation.org/mcp" } } }` in `.cursor/mcp.json` or `~/.cursor/mcp.json`. Seen on 2026-11-17 (Cursor 3.29.15, Windows): Customize, MCPs listed `opf` as Disabled; its switch (Configure opf, the project\'s `.cursor/mcp.json`) turned it on, "Local: Connected", "14 tools, 580 resources enabled" (the twelve tools plus the view-only `read_font_file` and `read_icons`). | Seen on 2026-11-17: drawn in the IDE\'s chat pane (about 215px wide), not in the Agents window (there `show_deck` showed only its JSON arguments). Before it drew, Cursor asked `MCP App wants to call "read_icons"` and then the same for `read_font_file`, with Approve this server, Approve this tool and Cancel. Preview, Source, slide navigation and the Design menu (a theme) worked; no Export, Expand or Send were offered there |\n| Grok (xAI\'s chat app; xAI: Grok and Grok Bot "are two different apps") | grok.com/connectors, New Connector, Custom, the URL. Grok Business and Enterprise: "a team admin must first provision a connector in the cloud console" (console.x.ai, Grok Business, Connectors, + Add Connector, Other, the URL). The server "must be reachable over the public internet". The phone apps have connectors under Settings, Connectors; xAI does not say whether a custom server can be added there. Not tried. | Not mentioned |\n| Grok Bot (xAI: Bots "can use a persistent cloud computer, connected tools, websites, and files to complete work") | Desktop app: Connect apps, Add a custom connector, Type Remote HTTPS, the URL, Add plugin; or ask a Bot to add the server by URL. "If your team admin\'s MCP policy blocks the server, it can\'t be saved." Grok Bot itself is on Premium, Super and Ultra of The X Subscription ("Plus and Free don\'t include it"). The phone app reaches the same connectors. Not tried. | Not mentioned |\n| Grok Build (xAI: "a powerful and extensible coding agent") | `grok mcp add --transport http opf https://openpresentation.org/mcp`, or `[mcp_servers.opf]` with `url = "https://openpresentation.org/mcp"` in `~/.grok/config.toml` (`--scope project` writes `.grok/config.toml`). `grok mcp list` shows it; `/mcps` in the terminal UI, then `r`, refreshes after config edits. Not tried. | Not mentioned |\n\nWhere the viewer does not open, `show_deck` answers with the deck\'s name, slide titles and findings as text: ask for the deck as OPF JSON and open it in the [Playground](https://www.openpresentation.org/playground). Where it is slow to appear, ask the assistant to show the deck again.\n\n**What the hosted server keeps.** A deck you pass to `validate_deck`, `convert` or `show_deck` is read in memory for that one call and not stored; the viewer itself edits, checks, draws and exports the deck on your machine. The hosted server allows 600 requests a minute per address and bodies up to 4 MB.\n\n**Local.** Any MCP client that starts a local server takes a command and arguments:\n\n```json\n{\n "mcpServers": {\n "opf": { "command": "npx", "args": ["-y", "@openpresentation/mcp"] }\n }\n}\n```\n\nPin a version (`@openpresentation/mcp@0.27.0`) to make the setup repeatable. Node 22 or later is required.\n\n| Client | How |\n| --- | --- |\n| Claude Code | `claude mcp add opf -- npx -y @openpresentation/mcp` (add `--scope project` to write `.mcp.json` for the team) |\n| Cursor | Add the JSON above to `.cursor/mcp.json` in the project, or to `~/.cursor/mcp.json` |\n| Claude Desktop | Install the extension (`opf-<version>.mcpb`, below), or add the JSON above to `claude_desktop_config.json` |\n| Any other client | Run `npx -y @openpresentation/mcp` as a stdio server (installed, the binary is `opf-mcp`) |\n\nCheck it with the official inspector: `npx @modelcontextprotocol/inspector npx -y @openpresentation/mcp`.\n\n### Claude Desktop extension (`.mcpb`)\n\nThe server also comes as an MCP Bundle, a one-file Claude Desktop extension: open `opf-<version>.mcpb` (double-click it, or drag it into Claude Desktop\'s Settings, Extensions) and Claude Desktop installs and starts it. It needs no Node install, no `npx` and no configuration, and it carries the renderer and its fonts, so the OPF viewer draws decks with the exact faces and validation measures layout with them.\n\nWhen the matching [GitHub release](https://github.com/OpenPresentation/opf/releases) lists `opf-<version>.mcpb` and its SHA-256 file, download both assets from that release. Release-bundle publication is planned from 0.34.0; 0.33.0 has no published bundle asset. The trusted publish workflow builds and checks the full bundle before attaching it after registry verification. Verify it with `sha256sum --check opf-<version>.mcpb.sha256` on Linux, or compare `Get-FileHash opf-<version>.mcpb -Algorithm SHA256` to the file on Windows.\n\nBuild it from a checkout: `pnpm --filter "@openpresentation/mcp..." run build`, then `pnpm --filter @openpresentation/mcp run build:mcpb`. It writes `packages/mcp/artifacts/opf-<version>.mcpb` (about 81 MB, every font the renderer draws with); `node scripts/build-mcpb.mjs --no-script-fonts` writes `opf-<version>-lite.mcpb` (about 33 MB) without the script faces (Japanese, Chinese, Korean, Arabic, Devanagari and the other scripts), whose text then draws with fallbacks. `--check` also unpacks the bundle and drives its server the way Claude Desktop starts it. The build packs this checkout\'s `@openpresentation/opf`, `gallery`, `opf-render` and `mcp`, and installs their third-party dependencies and the renderer\'s font packages from the npm registry, keeping only the font files the renderer\'s manifests name. The manifest is `packages/mcp/mcpb/manifest.json`; `test/mcpb-manifest.test.mjs` keeps its tool list in step with the server.\n\n`opf mcp` of the CLI is a convenience: it runs this server when `@openpresentation/mcp` is installed beside the CLI or in the working directory, and otherwise prints `npx -y @openpresentation/mcp` and exits with 2. The CLI itself carries no MCP code.\n\n## Tools\n\nEvery tool takes JSON arguments and returns structured JSON (`structuredContent`, with the same JSON as text for clients that read only text; `show_deck`, `read_font_file` and `read_icons` answer in their own text). A failure comes back with `isError: true` and a text report `{ ok: false, code, error, ... }` (no structured content), with a stable `code` (`unknown-id`, `invalid-document`, ...) and, where it helps, a suggestion ("Did you mean two-column?"). All tools are read-only.\n\n| Tool | Arguments | Returns |\n| --- | --- | --- |\n| `start_here` | `goal?` (what you are trying to do, in your own words) | `{ goal, summary, steps[], docs[], skills[], examples[], layouts[], themes[], validate }`: a short ordered path. Which documentation pages and skill to read, two or three example decks, layouts and themes from the catalog, and the validate step (`validate_deck` with `failOn: "warning"`). With no goal, the general learning path. Everything it names is a resource URI or a tool to call next. |\n| `validate_deck` | `document` (a JSON object, or deck text), `format?` (`json`, `yaml`, `markdown`; default JSON), `failOn?` (`error`, `warning`, `info`; default `error`) | `{ ok, valid, schemaValid, failOn, format, counts, findings[], checks, hint? }`. The findings are the ones `opf validate` reports (rule id, severity, category, JSON Pointer `path`, message, `help`, `fixes`, and a `location` with line and column for JSON, YAML and Markdown text). `ok` is false when a finding is at or above `failOn`. It does not look for local image files (it reads none). |\n| `get_schema` | `name?` (a schema such as `presentation` or `layout`, or a `$defs` name such as `Chart`), `pointer?` (a JSON Pointer into the schema, or a `$defs` name) | `{ name, pointer, id, schema, opfVersion }`, like `opf schema`. `$ref`s stay as written. A whole schema names the `@openpresentation/opf` release it came from in its `$comment`; a part is as it is. |\n| `search_catalog` | `kind` (`layouts`, `themes`, `color-schemes`, `font-schemes`, `narratives`, `audiences`, `purposes`, `tones`, `chart-types`, `languages`, `social-platforms`, `examples`), `query?`, `limit?` | `{ kind, total, returned, records[] }`: short records (id, name, summary, description, tags), best match first. |\n| `get_catalog_record` | `kind`, `id` | `{ kind, id, uri, record }`: the record in full, like `opf catalog <kind> <id>`. |\n| `convert` | `document`, `from?`, `to` (`json`, `yaml`, `markdown`) | `{ ok, from, to, text, findings, counts }`, like `opf convert`. The deck must be valid; otherwise nothing is converted and the findings are returned. This tool converts text formats only. The viewer separately offers PowerPoint, PDF and PNG Export in a host that can save files; the local `opf convert` also writes rendered formats. |\n| `search_docs` | `query`, `limit?` | `{ total, results[] }`: ranked pages and skills, each with `uri`, `title`, the `heading` the snippet sits under, a `snippet` and a `score`. |\n| `search_shapes` | `query?`, `category?` (`lines`, `rectangles`, `basic`, `blockArrows`, `equations`, `flowchart`, `starsBanners`, `callouts`, `actionButtons`), `limit?` | `{ query, total, returned, shapes[], categories[] }`: the 187 preset shapes of a shape block or an overlay shape, searched by DrawingML name (`rightArrow`) and common words (`speech bubble`, `cylinder`, `cog`; every word must match, a name ranks first; an empty query browses PowerPoint\'s gallery in order). Each shape has `shape` (the value to write), `category` and `categoryTitle`, `aspect` (the default frame, width over height), `adjust[]` (each adjust value\'s `name`, `default`, `min`, `max`, `unit` of `fraction` or `degrees`, and whether a `handle` moves it, at a square frame) and `svg`, a small drawing from the preset\'s own geometry. |\n| `list_examples` | `category?`, `query?` | `{ total, categories, examples[] }`: slug, name, category, slide count and `uri` for each bundled example deck. |\n| `show_deck` | `document` (a JSON object, or deck text), `format?`, `view?` (`preview`, `source`, `both`; default `preview`), `slide?` (from 1), `session?` | Opens the deck in the OPF viewer (`_meta.ui.resourceUri: ui://opf/deck/<hash>`). `{ opened, checked, view, slide?, format, name, slides, outline[], valid, counts, findings[], viewer, iconSets }`, and as text the deck\'s name, slide titles, findings and the viewer session key, so a client without MCP Apps still gets an answer. With `processDecks: false` (a hosted server that does no deck work), `{ opened, checked: false, view, format?, viewer, iconSets }` only: the viewer does the checks. `iconSets` names the icon sets the viewer can read through `read_icons` (`[]` when the server has none). A later call for the same deck (the same name) replaces the open viewer of it; `session` chooses another session. `viewer` is `{ session, createdAt, tie }` ([Instances](#instances-and-the-viewer-session)). |\n| `open_editor` | `example?` (a bundled example\'s slug), `title?` (the deck\'s name: the starter deck\'s title, or a new name for the example), `session?`; all optional | Opens the OPF viewer\'s editor with a deck to edit: with `{}` a two-slide starter deck ("Untitled deck"), or the example named. `{ opened, editor: true, example, name, slides, document, examples[], viewer, iconSets }`; an unknown slug still opens the starter deck and the text names the nearest slug. Title "OpenPresentation". Its `_meta` carries `ui.resourceUri` and `"openai/ui": { "entrypoints": [{ "type": "global" }] }`, the marker Claude reads to offer the app as a direct entry point ([Entry point](#the-direct-entry-point-open_editor)). |\n| `read_font_file` | `file` (a path from the renderer\'s font manifest), `offset?` | For the viewer only (`_meta.ui.visibility: ["app"]`; a host hides it from the model). `{ file, offset, total, bytes }`: at most 512 KiB of the file, base64. Offered by `opf-mcp` when `@openpresentation/opf-render` is installed beside it. |\n| `read_icons` | `set` (`lucide`, `tabler`), `names` (at most 100 icon names), `index?` | For the viewer only (`_meta.ui.visibility: ["app"]`). `{ set, icons, errors?, index? }`: the path data of the icons the set has (a name it lacks is left out: the index names every icon), why a name could not be read, and with `index` the set\'s index (`names`, `viewBox`, `style`, stroke settings, `name`, `version`, `license`, `copyright`, `licenseText`). The viewer asks for the index once per set. Offered when the server has icon sets (`sources.iconSets`; `opf-mcp` and the `.mcpb` read the installed files) and the viewer. |\n\n## Resources\n\nResources have stable URIs. The server lists them (`resources/list`) and also offers URI templates (`resources/templates/list`) so a client can read a URI it builds itself.\n\n| URI | What it is |\n| --- | --- |\n| `opf://docs/index` | Every documentation page and skill, with its URI |\n| `opf://docs/whats-new` | The most recent release notes: the newest release, and older ones while there are at most five and the page is under 120,000 characters, from the changelog of `@openpresentation/opf` (the format, the validators and the engine), newest first, as text |\n| `opf://docs/<slug>` | A documentation page as Markdown: `format-card` (the whole authoring surface on one page, sized for pasting into a model\'s context), `how-opf-works`, `schema-reference`, `validate`, `cli`, and the other pages meant for people who use OPF. Handoff, evidence, status and release notes are not served. |\n| `opf://schema/<name>` | A JSON Schema (`opf://schema/presentation`) |\n| `opf://schema/<name>#<pointer or $defs name>` | Part of a schema: `opf://schema/presentation#Chart`, `opf://schema/presentation#/properties/slides`. `opf://schema/Chart` also works. |\n| `opf://examples/<slug>` | A valid example deck as JSON |\n| `opf://catalog/<kind>/<id>` | A record of the default catalog (`@openpresentation/gallery`): `opf://catalog/layouts/two-column` |\n| `opf://skills/<name>` | A skill entrypoint (`opf-author`, `opf-layout`, `opf-presets`, `opf-edit`, `opf-export`, `opf-inspect`) |\n| `opf://skills/<name>/<path>` | A reference or asset of a skill: `opf://skills/opf-author/references/content.md` |\n| `ui://opf/deck/<hash>` | The OPF viewer (`text/html;profile=mcp-app`). `<hash>` is the first 12 hex digits of the SHA-256 of the page, set when the package is built (`DECK_APP_URI`), so the URI changes exactly when the viewer does: a host caches a view by its URI. `ui://opf/deck` (the URI up to 0.34) and any earlier `ui://opf/deck/<hash>` read as the current viewer, for a host that holds a tool list from before an update; only the current URI is in the resource list, and the two earlier forms are resource templates (`ui://opf/deck`, `ui://opf/deck/{hash}`). The viewer is one HTML page (about 9.1 MB of UTF-8; `pnpm --filter @openpresentation/mcp build` prints the exact size and the JSON-RPC frame\'s headroom under the 10 MiB stdio limit) that `show_deck` and `open_editor` open. The `resources/read` content item carries `_meta.ui` `{ prefersBorder: false, preferredDisplayMode: "fullscreen" }`; the viewer declares no `csp`, `domain` or `permissions` (any of them would go on the same content item). |\n\nSkill scripts and agent manifests are not served; the server runs no code from them.\n\n## The OPF viewer (`show_deck`)\n\n`show_deck` is an [MCP App](https://github.com/modelcontextprotocol/ext-apps) (SEP-1865): in a client that supports MCP Apps, such as Claude on the web, on desktop and in the iOS app, the deck opens in the conversation with the openpresentation.org playground\'s three views.\n\n- **Preview** shows the slides, with the thumbnail strip under them. **Source** shows the deck\'s text (JSON, YAML or OPF Markdown) in the editor\'s source pane, checked as you type. **Both** puts them side by side; in a container narrower than 860px it stacks the slide over the source, and choosing it there asks the client for a larger view. The slide itself can be edited in place too. The model is told to open on Preview unless the user asked for the source.\n- **The bar** (48px, one row down to a 640px container; below it, a phone, two rows and no Both: the name with Open, Ask and a More menu, then Preview and Source with Undo, Redo and Design, while Find, Expand and Export are in More): Undo and Redo, the deck\'s name (a little room from 640px, the first row below 640px; renaming opens the editor\'s Save and Cancel over the whole bar, or over the name\'s own row where the bar wraps, and Enter or Save commits one undoable edit, Escape or Cancel puts the name back, and leaving the field closes an untouched rename and keeps a typed draft), the view switch, the editor\'s Design menu (theme, colors, fonts and the slide\'s layout, each one undoable edit), Find and replace (Ctrl/Cmd F), Export, Expand, and **Ask Claude to edit\u2026**. Undo stops at the deck as it was opened. Present is left out (a sandboxed iframe cannot go full screen on its own), and the source pane\'s Copy works without the clipboard permission.\n- **Export** is the editor\'s own menu: PowerPoint (`@openpresentation/opf-pptx`, editable), PDF (vector, selectable text), SVG and PNG slides, and the OPF source as JSON, YAML or Markdown. Every file is made in the viewer, on the user\'s machine, with the fonts the slides draw with, and handed to the client to save (`ui/download-file`), since a sandboxed iframe cannot download. The menu, and the source pane\'s Download, show only in a client that declares that capability; the agent handoff is left out, the deck being in a conversation already.\n- **Ask Claude to edit\u2026** opens a focused composer for the selected slide. Send submits your instruction and slide number through `ui/message`. The viewer shares deck changes separately through `ui/update-model-context` after a second of inactivity. The composer shows the sharing status and keeps the request available for retry if delivery fails.\n- **Review** opens the validation findings and viewer version. When a slide or source draft has findings, the footer shows the issue count. After an assistant edit, the viewer selects the last affected slide and briefly offers Undo beside the slide counter. The revision and findings also reach the model.\n- **One palette, the client\'s.** The viewer is built to the openpresentation.org design system (the playground\'s bar and footer) and reads only the editor\'s `--opf-ui-*` tokens. In a client that sends the standard MCP Apps style variables, the neutral tokens (surfaces, text, borders) are derived from the client\'s background and text colors and its fonts, for the viewer\'s own chrome and the editor\'s parts alike, in the client\'s light or dark theme; the accent and the status colors stay OPF\'s, and the slides keep the deck\'s theme. Without those variables it uses the design system\'s own values.\n- **It is as tall as the deck needs.** Inline, the stage takes the shape of the deck\'s slides (up to 480px) with 16px around the slide on every side, so a 16:9 deck in a 660px column is about 545px tall; until the deck is drawn, a slide-shaped placeholder holds its place and says what the viewer is waiting for; Source and Both have a fixed height. Full screen, and a client that fixes the height, fill the frame.\n\n- **Saving is controlled by the host.** Source downloads preserve the current JSON, YAML or Markdown text, MIME type and suggested filename; the host controls confirmation and saving. Each outcome is worded as the host reports it ([capabilities](#what-the-viewer-does-with-each-host-capability)); "Download started." is not proof that a file was saved. Without download support the file controls stay hidden; the viewer never substitutes a direct iframe Blob/anchor download. Source text can still be selected and copied manually.\n\n**Everything runs on the user\'s machine.** The page bundles `@openpresentation/opf-editor`, `@openpresentation/opf-render` and core\'s precompiled validators, so the editing, rendering and checking happen in the client, not on the server. The client runs it in a sandboxed iframe with no network, no `eval` and no WebAssembly (the restrictive default CSP of SEP-1865, since the viewer declares no domains), so the page loads nothing: its script, styles and the startup font (Roboto Regular) are inline. Any other face a deck draws comes from the server through the client: the viewer calls the app-only tool `read_font_file`, which serves the installed renderer\'s files in pieces of 512 KiB, and the renderer checks each file against its pinned SHA-256 before it registers it as bytes (`FontFace` from an `ArrayBuffer`, which needs no `font-src`). Without the renderer beside the server, or on a server that offers no `read_font_file`, the viewer draws those faces with Roboto and names the substitution. Images in a deck draw when they are data URIs; the sandbox blocks a remote image.\n\n**Set icons** (`"icon": "lucide:rocket"`) come from the server the same way: the viewer registers the gallery\'s sets as loaders that call the app-only tool `read_icons` for the icons a deck names (at most 100 a call, so a deck with more makes more calls) and for each set\'s index once (every name, so a check suggests the nearest names, and the license). The page carries no icon data. The viewer learns which sets the server reads from `iconSets` in the `show_deck` or `open_editor` result; a set the server does not offer, a server without `read_icons`, or a call that fails settles the load: the slide draws without the icon, and `opf/icon-unknown` says it could not be loaded and why. The viewer\'s checks, and the checks in `read_deck` and `edit_deck` results, wait for the deck\'s icons, so a known icon is never reported and an unknown name gets the same finding and suggestions as `validate_deck`. The viewer has no icon picker (that is the editor\'s Content panel), so it never reads the sets\' search keywords.\n\n**In a client without MCP Apps** (Claude Code, the API), `show_deck` returns the deck\'s name, slide titles and findings as text, like a short `validate_deck`, and `open_editor` returns its deck and the example slugs.\n\n### What the viewer does with each host capability\n\nEvery capability below is the host\'s to offer, and Claude can limit each one by connector type (several need a remote connector: a custom connector added by URL or a directory listing, not a local server), by organization and by client. Nothing here is available to every user, and none of it was verified in Claude from this repository; the stand-in host in `test/deck-app-tools-browser.mjs` and `test/deck-app-browser.mjs` behaves as Claude\'s MCP Apps documentation describes. The viewer keeps working without each one. To see what a host announced, open More: its last line names the host and then reads, for example, `message: no \xB7 save files: no \xB7 full screen: no \xB7 tools: yes \xB7 context: yes` (the footer version\'s title carries the same), one part for each row of this table.\n\n| Capability | Where the host offers it | Where it does not |\n| --- | --- | --- |\n| **The viewer\'s own tools** (`read_deck`, `select_slide`, `edit_deck`) | The model reads the open deck and changes it in place, one undoable edit per call, and the user sees it at once. Claude gets a view\'s tools from the user\'s next message after the view opened, and only for a remote connector. | The tools are never called; the model sees the user\'s edits as context and opens a new viewer with `show_deck` to change the deck. |\n| **Model context** (`ui/update-model-context`) | A second after the last edit the whole deck goes to the model, with its revision and the viewer session key. A viewer that `open_editor` opened sends the deck it opened (the starter deck or the example, named) in its first context too. | The footer says nothing about sharing; Send still asks for a turn where messages work. |\n| **Messages** (`ui/message`) | Ask opens the edit composer. Send passes the selected slide number and the typed request to the host. Claude asks for approval. A refused or unconfirmed request stays in the composer for retry. | The viewer hides Ask. |\n| **Downloads** (`ui/download-file`) | Export and the source pane\'s Download hand the file to the host: `Download started.`, `The download didn\'t finish.`, or `The download couldn\'t be confirmed.` (a rejection or the ten-minute timeout; the host\'s dialog may still save it). A host that answers "method not found" gets `This host does not offer downloads here. Select the source text to copy it.`, and Download and Export are no longer offered. One request at a time: a click while one waits sends nothing and says so. The file name is the URI\'s last segment as written (never percent-encoded); the viewer turns / \\\\ % : " * < > \\| ~ # ? into `_` itself, so the name the user sees is the one it chose. The viewer makes only PowerPoint, PDF, PNG, SVG, ZIP and OPF source files, none of a type a host refuses outright. | No Export menu or Download button; the source text can be selected and copied. |\n| **A larger view** (`ui/request-display-mode`, `availableDisplayModes: ["inline", "fullscreen"]`) | **Expand** asks from the click itself (Claude honors it only right after a press in the view and opens its side panel or full screen; both report `fullscreen`); the label becomes **Back to the conversation**. A refusal leaves the label as it was and says the host kept the viewer where it was. The content item\'s `preferredDisplayMode: "fullscreen"` asks Claude to open the side panel when the tool returns; Claude decides. | No Expand button; the viewer stays inline. |\n| **Server tools from the view** (`tools/call`) | Fonts (`read_font_file`), set icons (`read_icons`) and the editor\'s example picker (`get_catalog_record`). | The deck draws with Roboto in place of faces it cannot get and without its set icons (each with an `opf/icon-unknown` finding that says it could not be loaded), and the Open menu offers local files and Paste. |\n\n**Layout** follows the container the host reports (`containerDimensions`: its width, and a fixed or a maximum height): the side panel and full screen are both `fullscreen` and the side panel can be resized down to about 320px. A fixed height fills the frame, and so does `fullscreen` when the host sends no dimensions with it (borderless); a maximum height keeps the inline view as tall as its slide. The host\'s `safeAreaInsets` pad the view, and `hostcontextchanged` lays it out again. Below 640px (a phone) the slide comes first: two rows of chrome (about 96px), the slide as wide as the frame, a compact strip and the footer, so the inline view of a 16:9 deck is about 430px tall and Source takes the same height; the Design menu is a bottom sheet with one section at a time under the slide, and the view grows by the sheet so a choice shows at once. In the narrowest container (under 400px) every control in the bar, the More menu and the footer is at least 44 by 44 CSS pixels, and the footer wraps a long message instead of cutting it short. In a very narrow pane (under 300px; Cursor\'s IDE chat pane gives the view about 215px) the chrome stays two rows: the name with Open, Ask and More, then Preview, Source and Design, with Undo and Redo moved into More; with a mouse the controls keep their 32px size (a finger keeps 44px), the slide takes the whole width, and the Design sheet\'s section switch is two rows of two. The view lays itself out down to 200px; in a narrower frame it keeps 200px and the frame scrolls sideways. Full screen held sideways drops the strip. A status message clears itself after eight seconds.\n\n### The viewer\'s tools (editing together)\n\nThe viewer registers three tools before it connects, and their names, titles, descriptions and schemas never change while it runs (Claude may ask the user to approve a tool again when one does); changing values go in results. Each answers in text, which is what the model reads, and acts on its own view only: with two viewers open, a call reaches one. Inputs a model is likely to get wrong (an unknown `op`, too many operations, a negative or fractional `offset` or `index`, both or neither of `index` and `id`) come back as normal results that say how to fix them, not as validation errors.\n\n| Tool | Arguments | What it does |\n| --- | --- | --- |\n| `read_deck` | `source?` (`json`, `yaml`, `markdown`), `offset?` | The open deck\'s `revision` (core\'s `documentHash`, `sha256:...`), viewer `session`, `name`, `slideCount`, `selected` `{ index, id }`, `outline[]` `{ index, id, title, layout }` (indexes from 0, as in `/slides/0`), `sourceDraft` and `checks` (counts and up to 20 findings). While the source pane\'s text is not a valid deck, `checks` describe the deck at `revision` (the last valid version, which the slides show) and `sourceChecks` (the same shape) the text\'s own findings; a syntax error is one error with rule id `syntax`. It is bounded whatever the deck: names, ids, titles and finding paths at most 200 characters, finding messages 300, the outline at most 30,000 characters of JSON (then `outlineTruncated: { listed, of }`). With `source`, also the deck\'s text, in pages that keep the result under 100,000 characters with at least 40,000 characters of text each; pages after the first leave the outline out, a page never starts or ends inside a surrogate pair, and every page carries a `textHash` of the whole text (when it changes between pages, start again at 0). The form open in the source pane comes back as the pane shows it, a draft the deck has not taken included (`draft: true`), and nothing the user is typing is applied by the read. |\n| `select_slide` | `index?` (a whole number from 0) or `id?`, exactly one | Shows that slide; the deck does not change. Refused (`busy`) while the user has text open on the slide, since changing slides would commit it. |\n| `edit_deck` | `expectedRevision`, `operations` (1 to 100 JSON Patch operations, as `opf edit` takes them; paths may name slides and blocks by id, `/slides/@intro/title`) | Applies the operations through the editor session\'s `applyPatch` with `expectHash`: all or none, as one undo step, with the source pane, the slide and the model\'s context following. Refused, changing nothing: a revision that is not the current one (`stale-revision`, read again); an edit while the user is typing, with text open on the slide or typing the source pane has not applied yet (`busy`: the user\'s edit is never committed for them; try again after their next message); a source draft that is not a valid deck (`source-draft`); an operation on the whole deck, `path` or `from` `""` (`whole-deck`); any operation but `test` whose `path` or `from` is `/slides` itself, that is adding, replacing, removing, moving or copying the whole slides array (`whole-slides`: edit slides one at a time); more than 200,000 characters of operations (`too-large`); and an edit that would make the deck invalid (`invalid-result`, with the findings). The deck in the viewer is always valid in format and references: a JSON deck that is not does not open (the tools answer `not-open`), and YAML or Markdown text that is not stays a draft in Source (`source-draft`). In the source pane, JSON keeps its formatting (only the changed values are rewritten); YAML and Markdown text is written again from the deck, so YAML comments are dropped and the pane says so. This holds for every change made outside the source pane (the Design menu, an edit on the slide, Undo), not only for `edit_deck`. Returns the new `revision`, `previousRevision`, `changed[]` (as the operations addressed them) and the checks. |\n\nEvery tool answers with `ok: false` and a `code` (`loading`, `not-open`, `superseded`, `closed`, `busy`, `source-draft`, `stale-revision`, `whole-deck`, `whole-slides`, `too-large`, `invalid-input`, `invalid-result`, ...) and a sentence that says what to do instead, rather than an error, while the deck is loading, when no deck opened (also after the tool call was cancelled), after a newer viewer of the same session replaced the view (which also makes it read-only), and after the host tore the view down.\n\n### Instances and the viewer session\n\nEach tool call mounts its own view, and earlier views stay live. `show_deck` and `open_editor` mint `viewer: { session, createdAt, tie }` in their result; the server keeps nothing and counts nothing. Decision (vetoable, RR111-SESSION-BY-DECK): **one editing session is one deck**: the session key is the caller\'s `session` when it passes one (letters, digits and `- _ . :`, up to 64), and otherwise it is derived from the deck\'s own identity, statelessly: OPF has no document id, so it is `deck-` and 32 hex digits of the SHA-256 of the deck\'s `name`, trimmed, lowercased and with runs of spaces collapsed (a deck without a name gets a random key of its own). So a model that shows a newer version of the same deck replaces the older viewer without passing anything back, a deck with another name stays independent, and `open_editor` derives the key from the starter or example deck it opens. Both tools\' descriptions say so. Views of one session meet on a `BroadcastChannel` named by that key and compare the server\'s keys only: `createdAt` (the server\'s clock), then `tie` (random, minted per call), then the instance id; never a key a view made up. The older view greys out, becomes read-only, clears its sharing state and any selection, says that a newer viewer is open, and stops sending context, messages and tool edits. A view whose result carries no key, a view where the browser has no `BroadcastChannel`, and every view of another session stay independent. The channel is per conversation because the viewer declares no `ui.domain` (its origin is then the conversation\'s); a host that gave it a fixed domain would let two conversations with a deck of the same name meet, so that would need the session key to include something the host scopes.\n\n### The direct entry point (`open_editor`)\n\nWhere Claude offers it (a remote custom connector or a directory listing, the newer conversation experience, an organization that allows it; not a local server), a user can open the OPF viewer\'s editor without asking the model: Claude lists it as "OpenPresentation" beside the connector\'s name and calls `open_editor` with `{}`. The starter deck opens in Preview. **Open** beside the deck name offers **Open from device\u2026** for local OPF JSON, YAML or Markdown, **Paste a deck\u2026**, and **Browse examples\u2026** when the host supplies bundled examples. Opening a file or example selects its first slide and can be undone. Paste focuses and selects the source text, or reads the clipboard directly where the host permits it. The model can call it too, with a `title` (with an `example`, the title renames the example deck, and the result says so) or an `example`.\n\n**+ Slide** adds a Title, Bullets, or Blank slide after the selected thumbnail. Use **\u2022\u2022\u2022** on the selected thumbnail to delete, duplicate, hide or move it. Delete keeps one slide in the deck, and Undo restores a deleted slide. Enter commits a slide title and Shift+Enter inserts a line break. In the default starter, editing the opening title also names the deck until you rename it explicitly.\n\n**Not built:** embedding the pptx.dev workspace as a website inside the app. It would need explicit `frameDomains`, framing headers on pptx.dev and a listing that allows embedded sites, and it is a separate review.\n\nTry it locally: run the server in Claude Desktop (the setup above) and ask Claude for a deck. To see the viewer outside a client, `node packages/mcp/test/deck-app-browser.mjs` (after `pnpm --filter @openpresentation/mcp build`) runs it in Chromium behind a stand-in host that frames it the way a client does; with `OPF_DECK_APP_SCREENSHOTS=<directory>` it saves a screenshot of each view. ext-apps\' `basic-host` example is a reference host for a server over HTTP.\n\n## Prompts\n\n| Prompt | Arguments | Use |\n| --- | --- | --- |\n| `learn_opf` | none | Orient an agent that has not used OPF; includes the format card |\n| `author_deck` | `brief`, `audience?`, `slides?` | Write a deck from a brief, then validate and fix it; includes the format card and the `opf-author` skill |\n| `fix_validation_findings` | `document`, `format?` | Repair a deck that does not validate with the smallest change; includes the `opf-inspect` skill |\n| `choose_layout` | `content`, `intent?` | Pick a layout from the content a slide carries; includes the `opf-layout` skill |\n\n## A typical session\n\n1. The agent calls `start_here { goal: "a board update with a revenue chart" }` (or reads `opf://docs/format-card`, or runs the `learn_opf` prompt).\n2. It reads what the path names, finds layouts with `search_catalog { kind: "layouts", query: "two columns" }` and reads one with `get_catalog_record`.\n3. It writes the deck and calls `validate_deck` with `failOn: "warning"`; each finding names a rule, a JSON Pointer and a hint. It fixes the findings and repeats until `ok` is true. A field it is unsure of comes from `get_schema { name: "Chart" }`.\n4. It shows the deck with `show_deck`: in a client with MCP Apps the user sees the slides, can edit them, and the edits come back to the agent. Or it uses `convert` to hand the deck over as YAML or Markdown. In a host that advertises file saving, the viewer\'s Export menu hands PowerPoint, PDF and PNG files to the host. The local `opf convert deck.opf.json deck.pdf` (or `.pptx`) is another way to write an export.\n\nValidation checks the file. It does not render the deck, so it is not proof of how the deck looks.\n\n## Host it\n\nThe package is a library as well as a command. Its entries:\n\n| Entry | What it is |\n| --- | --- |\n| `@openpresentation/mcp` | `createOpfServer(options)`: the server with the bundled docs, examples, skills and release notes. Edge-safe. |\n| `@openpresentation/mcp/server` | `createOpfMcpServer(options)`: the same server with no bundled data; you pass `sources`. Edge-safe, and small. |\n| `@openpresentation/mcp/stdio` | `runStdio()`: the Node stdio wrapper that `opf-mcp` and `opf mcp` run. Uses Node. |\n| `opf-mcp` (bin) | The stdio server; `npx -y @openpresentation/mcp` runs it. |\n\nThe two library entries import no Node builtin and read no file; documentation, examples, skills and release notes are bundled data; validation uses the precompiled validators (`@openpresentation/opf/precompiled`), so they run where code generation from strings is refused, such as Cloudflare Workers (the tests bundle them the way Wrangler does and run them in workerd):\n\n```ts\nimport { createOpfServer } from "@openpresentation/mcp";\nimport { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";\n\nexport default {\n async fetch(request: Request): Promise<Response> {\n const server = createOpfServer({ version: "0.27.0" });\n const transport = new WebStandardStreamableHTTPServerTransport({ sessionIdGenerator: undefined, enableJsonResponse: true });\n await server.connect(transport);\n return transport.handleRequest(request);\n },\n};\n```\n\n`createOpfServer({ version, opfVersion?, sources?, checkText?, deckApp?, processDecks? })` returns an SDK `McpServer`. `sources` replaces any of the bundled `docs`, `examples`, `skills` and `whatsNew`. `checkText` replaces the check behind `validate_deck`; `opf-mcp` passes the one that measures layout with the fonts `opf convert` draws with. Without it, layout is estimated and the report\'s `hint` says so.\n\nThe default entry bundles the viewer, example decks and public documentation. A host that must stay small imports `createOpfMcpServer` from `@openpresentation/mcp/server`, which bundles none of that data, and takes `sources: { docs, examples, skills, whatsNew? }` from wherever it keeps them (KV, R2, static assets): `docs` is `[{ slug, title, markdown }]`, `examples` is `[{ slug, category, file, deck }]`, `skills` maps a skill name to `{ "SKILL.md": text, ... }`. `defaultSources()` and `DOC_SLUGS` (the pages served) are exported from `@openpresentation/mcp`.\n\n**A hosted server that does no deck work.** A tool call always runs on the server the client calls, so a hosted server runs every call on your compute. Pass `processDecks: false` and it does no OPF processing of decks: `show_deck` only opens the viewer, which reads, checks and renders the deck on the user\'s machine and sends its findings to the model as context; `validate_deck`, `convert` and the `fix_validation_findings` prompt are left out, and `start_here` and the other prompts point to `show_deck`. What stays on the server is the lookups (docs, schemas, catalog, examples), which are small and the same for every caller, and handing over the viewer\'s HTML. A client without MCP Apps gets no check from such a server. `deckApp: { readFontFile }` gives the viewer font files (the local server reads the installed renderer\'s); `deckApp: false` leaves the viewer out. The lean `createOpfMcpServer` takes `deckApp: { html }` with `DECK_APP_HTML` from `@openpresentation/mcp`, or a function that returns the same page from storage; the function runs only when a client opens the viewer, so other requests never load the viewer page.\n\n**Fonts for a hosted viewer.** A site that already serves the OPF preview fonts (the layout the OpenPresentation site\'s `prepare-opf-fonts.mjs` writes: `/opf-fonts/manifest.json`, `base/`, `lazy/fonts/` and `scripts/`) passes `readFontFile: siteFontFiles({ fetch })`, exported by both library entries. `fetch` reads a file by its path on the site; in a Worker it is the static-assets binding, so the fonts cost no storage of their own and no request leaves the Worker:\n\n```ts\nimport { createOpfMcpServer, siteFontFiles } from "@openpresentation/mcp/server";\n\nconst server = createOpfMcpServer({\n version, sources,\n deckApp: { html: () => loadDeckAppHtml(), readFontFile: siteFontFiles({ fetch: (path) => env.ASSETS.fetch(new Request(new URL(path, request.url))) }) },\n});\n```\n\nIt reads only font files under the font folders and the faces the site\'s manifest names, and the renderer in the viewer checks each file against its pinned SHA-256. `OPF_SITE_FONTS_ORIGIN=https://www.openpresentation.org node --test packages/mcp/test/site-fonts.test.mjs` checks a deployed site serves every face the viewer can ask for (Node needs `NODE_USE_ENV_PROXY=1` behind a proxy).\n\n**Icons for a hosted viewer.** A Worker has no installed icon files, so its `defaultSources()` registers no icon set, and without one the server offers no `read_icons` and a deck\'s set icons are `opf/icon-unknown` in the viewer. Serve the gallery\'s six set-level icon files as static assets under `/opf-icons/` and pass them as `sources.iconSets`; nothing is bundled into the Worker:\n\n```ts\nimport { fetchIcons, galleryIconSets } from "@openpresentation/gallery/icon-sets";\n\nconst iconSets = galleryIconSets(fetchIcons(new URL("/opf-icons/", request.url), env.ASSETS));\nconst server = createOpfMcpServer({ version, sources: { ...sources, iconSets }, deckApp: { html, readFontFile } });\n```\n\n```sh\n# The six set-level files (lucide.json, lucide.icons.json, lucide.tags.json and Tabler\'s three; 2.5 MB, 538 KB gzip) into the static assets.\nnode -e "const fs = require(\'fs\'); fs.mkdirSync(\'public/opf-icons\', { recursive: true }); for (const f of fs.readdirSync(\'node_modules/@openpresentation/gallery/dist/icons\')) if (f.endsWith(\'.json\')) fs.copyFileSync(\'node_modules/@openpresentation/gallery/dist/icons/\' + f, \'public/opf-icons/\' + f)"\n```\n\nThen `search_icons` and `validate_deck` read the same sets, and `test/mcp-workerd.test.mjs` runs such a Worker in workerd.\n\n## Limits\n\n- The viewer is about 9.1 MB of UTF-8 HTML (9,064,031 bytes in 0.34; the build prints the exact size), loaded once per conversation or cached by the client. Its `resources/read` frame was 9,390,901 bytes in 0.34.0 and 9,160,454 bytes after the November 2026 cut (1,325,306 under the default 10 MiB stdio limit, measured with core\'s changes of #1343 to #1345 in), and `test/app-resource-frame.test.mjs` fails when that headroom drops below 1,000,000 bytes. The bundle carries only zod\'s English messages (`scripts/build-app.mjs`), core\'s precompiled validators, whose errors are built by shared helper functions (`packages/javascript/scripts/validators-codegen.mjs`), and string literals in whichever quote makes the JSON frame shorter (`scripts/app-quotes.mjs`). What the frame is made of, and what is left to cut: `docs/programs/release-readiness/mcp-viewer-size.md`. A client may cap the size of an MCP App or ask the user before it shows one.\n- Export needs a client that saves files for the viewer (`ui/download-file`); in one that does not, there is no Export menu. A PowerPoint or PNG export draws an SVG picture through the browser\'s image decoder from a `data:` URL (`svgSource: "data"` of the renderer\'s `export-browser`), because the sandbox allows no `blob:` image. The model sees the deck as JSON, not as pictures of the slides.\n- The `convert` tool handles JSON, YAML and Markdown. Viewer Export runs in the client and requires its file-saving capability; the local `opf` command can also render and write files.\n- `validate_deck` reads no files, so a local image path in a deck is not looked up (the CLI warns with `cli/asset-missing`). Pass images as data URIs or assets.\n- Layout is measured with real fonts only under `opf-mcp` with `@openpresentation/opf-render` installed; `checks.layout` says `measured` or `estimated`.\n'
262
262
  },
263
263
  {
264
264
  "slug": "native-content-release-2026-09-09",
@@ -282,7 +282,7 @@ var docsData = Object.freeze([
282
282
  "slug": "node",
283
283
  "file": "docs/node.md",
284
284
  "title": "OPF files in Node: `@openpresentation/opf`",
285
- "markdown": '# OPF files in Node: `@openpresentation/opf`\n\n`@openpresentation/opf` is one import for every runtime. In Node (and Bun and Deno) it is core plus the file API: it converts,\nopens and saves OPF files, and draws them as PDF, PNG, SVG and PPTX through the optional engines. In a browser or a worker the\nsame import gives the browser-safe build, with the same names, where only the file functions refuse.\n\n```ts\nimport * as opf from "@openpresentation/opf";\n\nawait opf.convert("deck.opf.md", "deck.pdf");\nconst deck = await opf.open("deck.opf.md");\ndeck.slides.push({ title: "Q4" });\nawait opf.save(deck, "deck.opf.md");\nconst { files } = await opf.convert(deck, { format: "pptx" }); // bytes, nothing written\n```\n\nThe namespace is all of core (`validate`, `parse`, `stringify`, `paginate`, `parseSlideSelection`, the types and the error\nclasses), so one import covers an application. The pptx.gallery catalog is the package `@openpresentation/gallery` (`gallery`, a\ndependency of core, RR-78); in Node, `open`, `save` and `convert` register it when no `catalogs` are passed. Core and the gallery release together and\n`pnpm check:catalog-schema` holds their `CATALOG_SCHEMA` constants equal, so Node does not check it at runtime.\n\n## The CLI\'s verbs, with the CLI\'s defaults\n\nOPF 0.18 gives the Node build the verbs of the `opf` command, so a script calls them instead of spawning `opf`:\n\n| Function | Command | In Node, when `catalogs` is omitted |\n| --- | --- | --- |\n| `validate(deck, options?)` | `opf validate` | the gallery is registered, so `opf validate deck` and `validate(deck)` report the same findings |\n| `stats(deck, options?)` | `opf stats` | the gallery |\n| `paginate(deck, options?)` | `opf paginate` | the gallery. Pass `fonts` (opf-render\'s `loadFonts()`) for measured page breaks; without it the result says `layout: "estimated"`. `opf paginate` measures with the office pack, prepared once per process, as `convert` does for an export with `paginate: true` |\n| `embed(deck, options?)` | `opf embed` | the gallery |\n| `edit(deck, patch, options?)` | `opf edit` | the gallery for the check. Applies a JSON Patch whole or not at all (`OPFPatchError`), checks the result (`OPFValidationError`; `validate: false` skips it) and returns `{ presentation, findings, inverse }` |\n| `fill(template, data?, options?)` | `opf fill` | no catalog: `data` is CSV, TSV or JSON text, a record or a list of records; returns `{ decks, complete, unfilled, diagnostics }`, and `presentation` with `combine: true`. `fillRecords(text)` reads the records alone |\n| `diff(a, b)`, `merge(base, ours, theirs)` | `opf diff`, `opf merge` | no catalog |\n\nAn explicit `catalogs: []` registers none. The browser build exports the same functions and registers no catalog (FA-21): a\nbrowser host passes `{ catalogs: [gallery] }` itself (`import { gallery } from "@openpresentation/gallery"`). Only `open`, `save` and `convert` are Node only.\n\nA shorter name is available as an npm alias, if you want one: `npm i opf@npm:@openpresentation/opf` installs the same package\nas `opf`, so `import * as opf from "opf"` works too. The docs keep the full name.\n\n## One import for every runtime\n\nOPF 0.18 removed the `@openpresentation/opf/node` subpath of 0.17: import `@openpresentation/opf` instead, with the same names\n(OPF 0.19 removed `@openpresentation/opf/catalog` and `defaultCatalog`, with no alias: import `gallery` from\n`@openpresentation/gallery`).\nThe package\'s conditional exports pick the build:\n\n| Condition | Build | `open`, `save`, `convert` |\n| --- | --- | --- |\n| `bun`, `deno`, `node` | the full build (`dist/index.js`) | work on files, and `convert` also returns bytes |\n| `workerd` (Cloudflare), `worker`, `browser`, `default` | the browser-safe build (`dist/browser.js`) | reject with `OPFApiError` code `node-only` |\n\nThe condition also decides how `validate` runs the JSON Schemas; see [Edge runtimes](#edge-runtimes-validators-that-never-compile-code).\n\n- **One type surface.** Both builds share `dist/index.d.ts` (the `types` condition, first in the map), so TypeScript sees the\n same declarations under `NodeNext` and `Bundler` resolution; the file functions are documented there as Node only. The\n declarations need no Node types.\n- **The browser-safe build** imports no Node builtin, no file system and neither engine (`scripts/check-browser-safe.mjs`\n bundles it for the browser and worker conditions). Its `node-only` messages name the alternative: `parse(text, { filename })`\n for `open`, `stringify(deck, { filename })` for `save`, and for `convert` the deck forms through `parse` and `stringify` and\n drawing through opf-render\'s `/export-browser` entry. The in-memory `convert(deck, { format })` is Node only in 0.18 too; a\n later release adds a browser implementation through `/export-browser`.\n- **The Node build** loads its file engine on the first file call, so importing the root costs no more than core.\n- **Bundlers** pick the browser build for a browser target and the full build for a Node target. A bundler that sets neither\n condition gets `default`, the browser-safe build: for a Node bundle, add the `node` condition (Rollup\'s node-resolve\n `exportConditions: ["node"]`, esbuild\'s `platform: "node"`).\n\n## Edge runtimes: validators that never compile code\n\n`validate` checks a document against the JSON Schemas with Ajv, and Ajv compiles each schema to JavaScript with `new Function` the\nfirst time it is used. Cloudflare Workers, Vercel Edge and a page under a Content-Security-Policy without `unsafe-eval` refuse\ncode generation from strings (Workers: "Code generation from strings disallowed for this context", while a request is handled), so\non those hosts the package ships the same validators compiled at build time (Ajv\'s standalone code generation, `scripts/validators-codegen.mjs`).\nThey give the same verdicts and the same findings: `test/precompiled-validators.test.mjs` compares them with Ajv on every example deck,\non catalog records and on random mutants of both, and on every `oneOf` and `anyOf` branch of the schemas.\n\nThe choice is made by the package\'s export conditions, through the internal `#schema-engine` import (package.json `imports`), so a\nhost needs no alias, no build step and no option:\n\n| Condition | Validators |\n| --- | --- |\n| `workerd` (Cloudflare Workers), `worker`, `edge-light` (Vercel Edge) | precompiled; no code is generated at runtime |\n| `node`, `bun`, `deno`, `browser`, `default` | Ajv, compiled on the first `validate` of the process |\n\nWrangler and OpenNext set `workerd`, `worker` and `browser` when they bundle a Worker, and the Edge runtime of Next.js sets `edge-light`,\nso a Worker needs nothing from you. Two cases do not get them by condition. Code that runs on a worker but was bundled for Node (a\nNext.js route handler that Turbopack or webpack resolved with the `node` condition before OpenNext packaged it, for one), and a browser\npage under a strict Content-Security-Policy. Import the precompiled validators once, before the first `validate`:\n\n```ts\nimport "@openpresentation/opf/precompiled"; // installs the build-time validators for this process; it exports nothing\n```\n\nThe price is size: the precompiled validators add about 78 KB gzipped (1.4 MB minified, mostly generated code) to the browser-safe\nbuild, which is why the browser keeps Ajv by default. In the package they are one minified chunk of `dist/` (1.5 MB, 121 KB gzipped;\nthe schemas are shared with the rest of the package, not copied), which adds about 125 KB to the tarball. On the first `validate` they save the time Ajv spends compiling the schemas\n(the first `validate` took about 100 ms with Ajv and about 10 ms precompiled in Node). A schema you compile yourself with Ajv is not covered: the precompiled build validates the OPF schemas that\nship in the package.\n\nThe `workerd` CI lane (`packages/javascript/test/workerd.test.mjs`, in the core job of `ci.yml`) bundles the package the way Wrangler\ndoes, runs it in the real `workerd` runtime from the `workerd` npm package (no Cloudflare account, no login), validates the example\ndecks, and requires the findings to equal Node\'s. A control in the same file bundles a Worker without the worker conditions and\nrequires workerd to refuse it, so the lane fails if the default validators go back to runtime compilation. Fonts, rasterizing and the\nin-memory `convert` are not part of this lane yet (CE-02, CE-03 in `docs/programs/cloud-editor/`).\n\n## The stack\n\nOPF is six packages. **Core** (`@openpresentation/opf`) is the format and its API: schemas, types, `validate`, `parse` and\n`stringify`, composition and pagination, and in Node the files. **The gallery** (`@openpresentation/gallery`) is the pptx.gallery\ncatalog, a dependency of core released on its own version line. **The CLI** (`@openpresentation/cli`) is the `opf` command;\nits `convert` command runs core\'s Node engine (through `@openpresentation/opf/internal/engine`,\nwhich the package exports under the `node` condition for the CLI only; it is not an application API). **opf-render**,\n**opf-pptx** and **opf-editor** are the engines: drawing (SVG, PNG, PDF), PowerPoint (export and import) and the editor.\n\n## Install\n\n```sh\nnpm install @openpresentation/opf @openpresentation/opf-render @openpresentation/opf-pptx \\\n @resvg/resvg-js sharp pdf-lib \\\n @expo-google-fonts/roboto@0.4.3 @expo-google-fonts/roboto-mono@0.4.2 @expo-google-fonts/caladea@0.4.2 \\\n @expo-google-fonts/arimo@0.4.3 @expo-google-fonts/tinos@0.4.2 @expo-google-fonts/cousine@0.4.3 \\\n @expo-google-fonts/gelasio@0.4.1 @expo-google-fonts/noto-sans@0.4.2\n```\n\n`@openpresentation/opf-render` and `@openpresentation/opf-pptx` are optional peer dependencies of core: npm does not install them\nfor you, and an application that only reads, validates or converts between deck forms needs neither. Core loads them the\nfirst time a call needs them, from core\'s own install location and then from the working directory; a missing one throws\n`peer-not-installed` with the install command. What each output needs is listed in [the CLI reference](cli.md#install): PNG\nneeds `@resvg/resvg-js` and `sharp`, raster PDF `pdf-lib`, pictures in a PDF `sharp`, every format the office font pack, and\n`.pptx` input or output `@openpresentation/opf-pptx`.\n\n## `convert(input, output, options?)`\n\n```ts\nawait opf.convert("deck.opf.md", "deck.pdf");\nawait opf.convert("deck.opf.md", "deck.pptx");\nawait opf.convert("deck.opf.md", "slides/deck.png"); // one PNG per slide: slides/deck-1.png, -2, ...\nawait opf.convert("deck.opf.md", "slides/slide-{n}.png"); // always numbered: slides/slide-1.png, slide-2.png, ...\nawait opf.convert("deck.pptx", "deck.opf.yaml"); // import\nawait opf.convert("deck.opf.json", "deck.opf.md"); // change the deck form\nawait opf.convert("deck.opf.md", "deck.png", { slides: "1-3", scale: 2 });\nawait opf.convert("deck.opf.md", "slides.zip", { format: "svg" });\n```\n\n`input` is a file path, a presentation object or the bytes of a `.pptx` file (`Uint8Array`). The formats come from the names:\n\n| Input | Read as |\n| --- | --- |\n| `.pptx`, PPTX bytes | imported through opf-pptx |\n| `.opf.md` | a Markdown deck |\n| `.yaml`, `.yml` | a YAML deck |\n| `.json` | a JSON deck |\n\n| Output | Written as |\n| --- | --- |\n| `.pdf`, `.pptx` | one file |\n| `.png`, `.svg` | one file per slide, named after the output: `slides/deck.png` gives `slides/deck-1.png`, `-2`, ... (the numbers are the deck\'s slide numbers, padded with zeros to the width of the largest number written: `deck-01.png` from ten slides, `deck-001.png` from a hundred; `slides: "2,5"` gives `deck-2.png` and `deck-5.png`). When one slide is selected (or the deck has one), it is written to the output name itself, as `opf convert deck.opf.json slide.png --slides 2` does. With `{n}` in the output (`"slides/slide-{n}.png"`) the files are always numbered, even for one slide, and `{n}` is the slide number padded by the same rule. `{n}` is the only placeholder: any other `{key}`, and `{n}` in a `.pdf`, `.pptx`, `.zip` or deck-form output, rejects with `invalid-option`. |\n| `.zip` | one archive of the slides, its entries named as the plain `.png` and `.svg` files above (`slides.zip` holds `slides-1.png`, ...; always numbered; the archive\'s own name takes no `{n}`). The slides are PNG unless `format: "svg"`. |\n| `.opf.md`, `.yaml`, `.yml`, `.json` | the deck in that form |\n\nAny other extension, and a plain `.md` file, rejects with `invalid-option`, which names the supported extensions. A `format`\nthat disagrees with the output\'s extension is refused too; it is only needed for a `.zip`.\n\n**Without an output path**, pass the format in the options: `convert(input, { format })` writes nothing and returns the files\nwith their names and bytes. `name` sets the base name of the files; without it they follow the deck: its `filename`, else its\nslugified `name`, else the input file\'s stem (`Q4-Review.pdf`, `Q4-Review-1.png`; padded like the files above, `Q4-Review-01.png` from ten slides, `deck.opf.yaml`). `zip: true` returns one archive of\nthe PNG or SVG slides; with an output path a `.zip` name makes the archive instead.\n\n**Options** are the flags of `opf convert` in camel case: `slides` (`3`, `"1,3-5"` or `[1, 3]`, read by `parseSlideSelection`), `includeHidden`, `paginate`, `scale`\n(0.1 to 8, PNG and raster PDF), `raster` (`true` draws a PDF as a picture per page; vector text is the default), `text` (an SVG\ncarries `"fonts"`, the default, which embeds the faces the slide uses; `"system"`, none, for a page that has the fonts; or\n`"paths"`, glyph outlines, so the file needs no font), `charts` (`"auto"`, `"native"` or `"picture"`), `diagrams` (`"shapes"`, the default, or `"picture"`), `provenance` and `images`\n(`"compatible"` or `"preserve"`) for PPTX, `date` (`YYYY-MM-DD` for date fields; nothing reads a clock), `catalogs` (the default\ncatalog when omitted), `fonts` (a prepared `loadFonts()` handle of `@openpresentation/opf-render/fonts-node`, or a folder or a list\nof folders of `.ttf`/`.otf` files), `assetDir`, plus `signals` (a `.pptx` input: also return the importer\'s per-shape\nsignals), and for output without a path `zip` and `name`, and `overwrite`. An option that does not apply to the pair rejects with\n`invalid-option`: `scale` for a deck output, `slides` for a PPTX, `raster` for anything but a PDF, `text` for anything but an SVG,\n`zip` or `name` with an output path. The 0.17 names (`pdfMode`, `svgFonts`, `chartex`, `imageFormat`, `fontDirs`, `filename`) were\nrenamed in 0.18 and are refused with the new name.\n\n**Writing.** Inputs are checked and all results are produced and staged before destination files are published. A preflight,\nrender or staging failure publishes no destination files, though parent folders may have been created. Each final file is\npublished atomically from a temporary sibling, so no partial file has the final name. Multiple files are not one transaction:\na later publication I/O failure can leave earlier complete outputs in place. Keep that possibility in your recovery logic.\nExisting regular outputs are replaced by default, as `save` and `fs.writeFile` do: running the same `convert` again rebuilds\nthe file. `overwrite: false` checks for existing outputs during preflight and reports `output-exists`, the rule the `opf`\ncommands apply without `--force`. A symlink, a directory or another non-regular file is refused (`output-not-file`). The result\nis `{ files: [{ name, path, type, bytes, ... }], findings }`, with the slide number, id and size of each picture and the pages of a PDF.\n\n**Images.** When `input` is a path, a deck\'s relative image paths resolve against the input file\'s folder, from any working\ndirectory; `assetDir` replaces that folder. Only image files inside it are read, and URLs are never fetched.\n\n**Chaining.** A `.pptx` input is imported, checked and then exported or written. `findings` holds both steps: the importer\'s\ndiagnostics carry the `import/` rule prefix, the format and references check `opf/`, and the engines `render/`, `pptx/`,\n`pdf/`, `fonts/` and `cli/`.\n\n## `open(pathOrBytes, options?)`\n\nReturns the presentation itself. A `.opf.md`, `.yaml`/`.yml` or `.json` file is read in the form its extension names and\nchecked for format and references; a `.pptx` path or its bytes are imported. An invalid deck throws `OPFValidationError`,\nwhose findings are located by line and column in the file; a PowerPoint file that cannot be imported throws `OPFImportError`.\nWarnings are not returned: `validate` reports them, and `convert("deck.pptx", "deck.opf.yaml")` returns what an import could\nnot keep. `catalogs` (default: the default catalog) is where references resolve.\n\n## `save(deck, path, options?)`\n\nWrites the deck in the form the file name names (`.opf.md`, `.yaml`/`.yml` or `.json`), atomically, creating folders and\nreplacing the file. It checks format and references first and refuses an invalid deck with `OPFValidationError`; `validate:\nfalse` writes work in progress, as an editor\'s autosave does (the YAML and Markdown writers still refuse a document that is\nnot well-formed OPF). `schemaComment: true` starts a YAML file with the editor modeline. Returns `{ path, format }`.\n\n## Errors\n\nEvery error has a `code`; branch on it, never on the message.\n\n| Class | Codes |\n| --- | --- |\n| `OPFApiError` (the base class) | `node-only` (the browser-safe build), `invalid-option`, `input-not-found`, `input-unreadable`, `invalid-presentation` (a deck written as a deck), `output-exists`, `output-not-file`, `output-unwritable` |\n| `OPFExportError` | the export step: `peer-not-installed` (the message carries the install command; `details` the package and range), `peer-too-old`, `peer-load-failed`, `invalid-option`, `invalid-presentation`, `no-slides`, `all-slides-hidden`, `layout-overflow` (strict composition), `export-failed`, a font code |\n| `OPFImportError` | the import step and `open` of a PowerPoint file: `peer-not-installed`, `peer-too-old`, `peer-load-failed`, `import-failed`, `invalid-presentation` |\n| `OPFValidationError` | `open` and `save` of an invalid deck; also thrown by core\'s `parse` and `assertValid` |\n\nAn engine failure with its own string `code` keeps that code; `export-failed` and `import-failed` are fallbacks for errors without one. For example, strict composition rejects with `OPFExportError` and code `layout-overflow`, retaining the original `OPFCompositionError` and its located `diagnostics` on `error.cause`.\n\n`findings` on an error holds any located findings supplied by the failed step.\n\n## Fonts, determinism and the network\n\nDrawing uses the renderer\'s bundled open font pack (the office pack with visual substitution) plus the files in the `fonts` folders, never\nsystem fonts. The pack is prepared once per process and reused by every call that passes no `fonts` (with `fonts` folders, once per\nlist of files); a deck that draws a script beyond Latin, Greek and Cyrillic gets a handle with its script\nfaces. Concurrent calls share the one preparation and draw one at a time on it. The output is the same bytes as with a handle\nof the caller\'s own. Nothing is fetched and no clock is read: the same input, options and installed versions give the same\nbytes on every machine.\n\n## Reading and writing text without files\n\nCore reads and writes deck text in every runtime: `parse(text, { filename?, format?, catalogs? })` returns the\npresentation and throws `OPFValidationError` on syntax, schema or reference errors (findings located by line and column);\n`stringify(deck, { format? | filename? })` returns text; `validate(text)` returns the full report, warnings included.\n\n## Slide selections\n\n`parseSlideSelection(selection, total, label?)` (both builds) turns a selection into slide numbers, one-based, ascending and\nwithout repeats: `3`, `[1, 3]`, `"1,3-5"`, `"2-"` (to the end) and `"-3"` (from the start). It throws `OPFApiError`\n`invalid-option` for a malformed selection, a number that is not a whole number from 1, a reversed range or a slide past the\nend, and `no-slides` when `total` is 0. `convert` and the opf CLI\'s `--slides` read selections with it, and an engine can share it.\n'
285
+ "markdown": '# OPF files in Node: `@openpresentation/opf`\n\n`@openpresentation/opf` is one import for every runtime. In Node (and Bun and Deno) it is core plus the file API: it converts,\nopens and saves OPF files, and draws them as PDF, PNG, SVG and PPTX through the optional engines. In a browser or a worker the\nsame import gives the browser-safe build, with the same names, where only the file functions refuse.\n\n```ts\nimport * as opf from "@openpresentation/opf";\n\nawait opf.convert("deck.opf.md", "deck.pdf");\nconst deck = await opf.open("deck.opf.md");\ndeck.slides.push({ title: "Q4" });\nawait opf.save(deck, "deck.opf.md");\nconst { files } = await opf.convert(deck, { format: "pptx" }); // bytes, nothing written\n```\n\nThe namespace is all of core (`validate`, `parse`, `stringify`, `paginate`, `parseSlideSelection`, the types and the error\nclasses), so one import covers an application. The pptx.gallery catalog is the package `@openpresentation/gallery` (`gallery`, a\ndependency of core, RR-78); in Node, `open`, `save` and `convert` register it when no `catalogs` are passed. Core and the gallery release together and\n`pnpm check:catalog-schema` holds their `CATALOG_SCHEMA` constants equal, so Node does not check it at runtime.\n\n## The CLI\'s verbs, with the CLI\'s defaults\n\nOPF 0.18 gives the Node build the verbs of the `opf` command, so a script calls them instead of spawning `opf`:\n\n| Function | Command | In Node, when `catalogs` is omitted |\n| --- | --- | --- |\n| `validate(deck, options?)` | `opf validate` | the gallery is registered, so `opf validate deck` and `validate(deck)` report the same findings |\n| `stats(deck, options?)` | `opf stats` | the gallery |\n| `paginate(deck, options?)` | `opf paginate` | the gallery. Pass `fonts` (opf-render\'s `loadFonts()`) for measured page breaks; without it the result says `layout: "estimated"`. `opf paginate` measures with the office pack, prepared once per process, as `convert` does for an export with `paginate: true` |\n| `embed(deck, options?)` | `opf embed` | the gallery |\n| `edit(deck, patch, options?)` | `opf edit` | the gallery for the check. Applies a JSON Patch whole or not at all (`OPFPatchError`), checks the result (`OPFValidationError`; `validate: false` skips it) and returns `{ presentation, findings, inverse }` |\n| `fill(template, data?, options?)` | `opf fill` | no catalog: `data` is CSV, TSV or JSON text, a record or a list of records; returns `{ decks, complete, unfilled, diagnostics }`, and `presentation` with `combine: true`. `fillRecords(text)` reads the records alone |\n| `diff(a, b)`, `merge(base, ours, theirs)` | `opf diff`, `opf merge` | no catalog |\n\nAn explicit `catalogs: []` registers none. The browser build exports the same functions and registers no catalog (FA-21): a\nbrowser host passes `{ catalogs: [gallery] }` itself (`import { gallery } from "@openpresentation/gallery"`). Only `open`, `save` and `convert` are Node only.\n\nA shorter name is available as an npm alias, if you want one: `npm i opf@npm:@openpresentation/opf` installs the same package\nas `opf`, so `import * as opf from "opf"` works too. The docs keep the full name.\n\n## One import for every runtime\n\nOPF 0.18 removed the `@openpresentation/opf/node` subpath of 0.17: import `@openpresentation/opf` instead, with the same names\n(OPF 0.19 removed `@openpresentation/opf/catalog` and `defaultCatalog`, with no alias: import `gallery` from\n`@openpresentation/gallery`).\nThe package\'s conditional exports pick the build:\n\n| Condition | Build | `open`, `save`, `convert` |\n| --- | --- | --- |\n| `bun`, `deno`, `node` | the full build (`dist/index.js`) | work on files, and `convert` also returns bytes |\n| `workerd` (Cloudflare), `worker`, `browser`, `default` | the browser-safe build (`dist/browser.js`) | reject with `OPFApiError` code `node-only` |\n\nThe condition also decides how `validate` runs the JSON Schemas; see [Edge runtimes](#edge-runtimes-validators-that-never-compile-code).\n\n- **One type surface.** Both builds share `dist/index.d.ts` (the `types` condition, first in the map), so TypeScript sees the\n same declarations under `NodeNext` and `Bundler` resolution; the file functions are documented there as Node only. The\n declarations need no Node types.\n- **The browser-safe build** imports no Node builtin, no file system and neither engine (`scripts/check-browser-safe.mjs`\n bundles it for the browser and worker conditions). Its `node-only` messages name the alternative: `parse(text, { filename })`\n for `open`, `stringify(deck, { filename })` for `save`, and for `convert` the deck forms through `parse` and `stringify` and\n drawing through opf-render\'s `/export-browser` entry. The in-memory `convert(deck, { format })` is Node only in 0.18 too; a\n later release adds a browser implementation through `/export-browser`.\n- **The Node build** loads its file engine on the first file call, so importing the root costs no more than core.\n- **Bundlers** pick the browser build for a browser target and the full build for a Node target. A bundler that sets neither\n condition gets `default`, the browser-safe build: for a Node bundle, add the `node` condition (Rollup\'s node-resolve\n `exportConditions: ["node"]`, esbuild\'s `platform: "node"`).\n\n## Edge runtimes: validators that never compile code\n\n`validate` checks a document against the JSON Schemas with Ajv, and Ajv compiles each schema to JavaScript with `new Function` the\nfirst time it is used. Cloudflare Workers, Vercel Edge and a page under a Content-Security-Policy without `unsafe-eval` refuse\ncode generation from strings (Workers: "Code generation from strings disallowed for this context", while a request is handled), so\non those hosts the package ships the same validators compiled at build time (Ajv\'s standalone code generation, `scripts/validators-codegen.mjs`).\nThey give the same verdicts and the same findings: `test/precompiled-validators.test.mjs` compares them with Ajv on every example deck,\non catalog records and on random mutants of both, and on every `oneOf` and `anyOf` branch of the schemas.\n\nThe choice is made by the package\'s export conditions, through the internal `#schema-engine` import (package.json `imports`), so a\nhost needs no alias, no build step and no option:\n\n| Condition | Validators |\n| --- | --- |\n| `workerd` (Cloudflare Workers), `worker`, `edge-light` (Vercel Edge) | precompiled; no code is generated at runtime |\n| `node`, `bun`, `deno`, `browser`, `default` | Ajv, compiled on the first `validate` of the process |\n\nWrangler and OpenNext set `workerd`, `worker` and `browser` when they bundle a Worker, and the Edge runtime of Next.js sets `edge-light`,\nso a Worker needs nothing from you. Two cases do not get them by condition. Code that runs on a worker but was bundled for Node (a\nNext.js route handler that Turbopack or webpack resolved with the `node` condition before OpenNext packaged it, for one), and a browser\npage under a strict Content-Security-Policy. Import the precompiled validators once, before the first `validate`:\n\n```ts\nimport "@openpresentation/opf/precompiled"; // installs the build-time validators for this process; it exports nothing\n```\n\nThe price is size: the precompiled validators add about 78 KB gzipped (1.4 MB minified, mostly generated code) to the browser-safe\nbuild, which is why the browser keeps Ajv by default. In the package they are one minified chunk of `dist/` (1.5 MB, 121 KB gzipped;\nthe schemas are shared with the rest of the package, not copied), which adds about 125 KB to the tarball. On the first `validate` they save the time Ajv spends compiling the schemas\n(the first `validate` took about 100 ms with Ajv and about 10 ms precompiled in Node). A schema you compile yourself with Ajv is not covered: the precompiled build validates the OPF schemas that\nship in the package.\n\nThe `workerd` CI lane (`packages/javascript/test/workerd.test.mjs`, in the core job of `ci.yml`) bundles the package the way Wrangler\ndoes, runs it in the real `workerd` runtime from the `workerd` npm package (no Cloudflare account, no login), validates the example\ndecks, and requires the findings to equal Node\'s. A control in the same file bundles a Worker without the worker conditions and\nrequires workerd to refuse it, so the lane fails if the default validators go back to runtime compilation. Fonts, rasterizing and the\nin-memory `convert` are not part of this lane yet (CE-02, CE-03 in `docs/programs/cloud-editor/`).\n\n## The stack\n\nOPF is six packages. **Core** (`@openpresentation/opf`) is the format and its API: schemas, types, `validate`, `parse` and\n`stringify`, composition and pagination, and in Node the files. **The gallery** (`@openpresentation/gallery`) is the pptx.gallery\ncatalog, a dependency of core released on its own version line. **The CLI** (`@openpresentation/cli`) is the `opf` command;\nits `convert` command runs core\'s Node engine (through `@openpresentation/opf/internal/engine`,\nwhich the package exports under the `node` condition for the CLI only; it is not an application API). **opf-render**,\n**opf-pptx** and **opf-editor** are the engines: drawing (SVG, PNG, PDF), PowerPoint (export and import) and the editor.\n\n## Install\n\n```sh\nnpm install @openpresentation/opf @openpresentation/opf-render @openpresentation/opf-pptx \\\n @resvg/resvg-js sharp pdf-lib \\\n @expo-google-fonts/roboto@0.4.3 @expo-google-fonts/roboto-mono@0.4.2 @expo-google-fonts/caladea@0.4.2 \\\n @expo-google-fonts/arimo@0.4.3 @expo-google-fonts/tinos@0.4.2 @expo-google-fonts/cousine@0.4.3 \\\n @expo-google-fonts/gelasio@0.4.1 @expo-google-fonts/noto-sans@0.4.2\n```\n\n`@openpresentation/opf-render` and `@openpresentation/opf-pptx` are optional peer dependencies of core: npm does not install them\nfor you, and an application that only reads, validates or converts between deck forms needs neither. Core loads them the\nfirst time a call needs them, from core\'s own install location and then from the working directory; a missing one throws\n`peer-not-installed` with the install command. What each output needs is listed in [the CLI reference](cli.md#install): PNG\nneeds `@resvg/resvg-js` and `sharp`, raster PDF `pdf-lib`, pictures in a PDF `sharp`, every drawn format the font packages its deck\'s faces use, and\n`.pptx` input or output `@openpresentation/opf-pptx`.\n\n## `convert(input, output, options?)`\n\n```ts\nawait opf.convert("deck.opf.md", "deck.pdf");\nawait opf.convert("deck.opf.md", "deck.pptx");\nawait opf.convert("deck.opf.md", "slides/deck.png"); // one PNG per slide: slides/deck-1.png, -2, ...\nawait opf.convert("deck.opf.md", "slides/slide-{n}.png"); // always numbered: slides/slide-1.png, slide-2.png, ...\nawait opf.convert("deck.pptx", "deck.opf.yaml"); // import\nawait opf.convert("deck.opf.json", "deck.opf.md"); // change the deck form\nawait opf.convert("deck.opf.md", "deck.png", { slides: "1-3", scale: 2 });\nawait opf.convert("deck.opf.md", "slides.zip", { format: "svg" });\n```\n\n`input` is a file path, a presentation object or the bytes of a `.pptx` file (`Uint8Array`). The formats come from the names:\n\n| Input | Read as |\n| --- | --- |\n| `.pptx`, PPTX bytes | imported through opf-pptx |\n| `.opf.md` | a Markdown deck |\n| `.yaml`, `.yml` | a YAML deck |\n| `.json` | a JSON deck |\n\n| Output | Written as |\n| --- | --- |\n| `.pdf`, `.pptx` | one file |\n| `.png`, `.svg` | one file per slide, named after the output: `slides/deck.png` gives `slides/deck-1.png`, `-2`, ... (the numbers are the deck\'s slide numbers, padded with zeros to the width of the largest number written: `deck-01.png` from ten slides, `deck-001.png` from a hundred; `slides: "2,5"` gives `deck-2.png` and `deck-5.png`). When one slide is selected (or the deck has one), it is written to the output name itself, as `opf convert deck.opf.json slide.png --slides 2` does. With `{n}` in the output (`"slides/slide-{n}.png"`) the files are always numbered, even for one slide, and `{n}` is the slide number padded by the same rule. `{n}` is the only placeholder: any other `{key}`, and `{n}` in a `.pdf`, `.pptx`, `.zip` or deck-form output, rejects with `invalid-option`. |\n| `.zip` | one archive of the slides, its entries named as the plain `.png` and `.svg` files above (`slides.zip` holds `slides-1.png`, ...; always numbered; the archive\'s own name takes no `{n}`). The slides are PNG unless `format: "svg"`. |\n| `.opf.md`, `.yaml`, `.yml`, `.json` | the deck in that form |\n\nAny other extension, and a plain `.md` file, rejects with `invalid-option`, which names the supported extensions. A `format`\nthat disagrees with the output\'s extension is refused too; it is only needed for a `.zip`.\n\n**Without an output path**, pass the format in the options: `convert(input, { format })` writes nothing and returns the files\nwith their names and bytes. `name` sets the base name of the files; without it they follow the deck: its `filename`, else its\nslugified `name`, else the input file\'s stem (`Q4-Review.pdf`, `Q4-Review-1.png`; padded like the files above, `Q4-Review-01.png` from ten slides, `deck.opf.yaml`). `zip: true` returns one archive of\nthe PNG or SVG slides; with an output path a `.zip` name makes the archive instead.\n\n**Options** are the flags of `opf convert` in camel case: `slides` (`3`, `"1,3-5"` or `[1, 3]`, read by `parseSlideSelection`), `includeHidden`, `paginate`, `scale`\n(0.1 to 8, PNG and raster PDF), `raster` (`true` draws a PDF as a picture per page; vector text is the default), `text` (an SVG\ncarries `"fonts"`, the default, which embeds the faces the slide uses; `"system"`, none, for a page that has the fonts; or\n`"paths"`, glyph outlines, so the file needs no font), `charts` (`"auto"`, `"native"` or `"picture"`), `diagrams` (`"shapes"`, the default, or `"picture"`), `provenance` and `images`\n(`"compatible"` or `"preserve"`) for PPTX, `date` (`YYYY-MM-DD` for date fields; nothing reads a clock), `catalogs` (the default\ncatalog when omitted), `fonts` (a prepared `loadFonts()` handle of `@openpresentation/opf-render/fonts-node`, or a folder or a list\nof folders of `.ttf`/`.otf` files), `assetDir`, plus `signals` (a `.pptx` input: also return the importer\'s per-shape\nsignals), and for output without a path `zip` and `name`, and `overwrite`. An option that does not apply to the pair rejects with\n`invalid-option`: `scale` for a deck output, `slides` for a PPTX, `raster` for anything but a PDF, `text` for anything but an SVG,\n`zip` or `name` with an output path. The 0.17 names (`pdfMode`, `svgFonts`, `chartex`, `imageFormat`, `fontDirs`, `filename`) were\nrenamed in 0.18 and are refused with the new name.\n\n**Writing.** Inputs are checked and all results are produced and staged before destination files are published. A preflight,\nrender or staging failure publishes no destination files, though parent folders may have been created. Each final file is\npublished atomically from a temporary sibling, so no partial file has the final name. Multiple files are not one transaction:\na later publication I/O failure can leave earlier complete outputs in place. Keep that possibility in your recovery logic.\nExisting regular outputs are replaced by default, as `save` and `fs.writeFile` do: running the same `convert` again rebuilds\nthe file. `overwrite: false` checks for existing outputs during preflight and reports `output-exists`, the rule the `opf`\ncommands apply without `--force`. A symlink, a directory or another non-regular file is refused (`output-not-file`). The result\nis `{ files: [{ name, path, type, bytes, ... }], findings }`, with the slide number, id and size of each picture and the pages of a PDF.\n\n**Images.** When `input` is a path, a deck\'s relative image paths resolve against the input file\'s folder, from any working\ndirectory; `assetDir` replaces that folder. Only image files inside it are read, and URLs are never fetched.\n\n**Chaining.** A `.pptx` input is imported, checked and then exported or written. `findings` holds both steps: the importer\'s\ndiagnostics carry the `import/` rule prefix, the format and references check `opf/`, and the engines `render/`, `pptx/`,\n`pdf/`, `fonts/` and `cli/`.\n\n## `open(pathOrBytes, options?)`\n\nReturns the presentation itself. A `.opf.md`, `.yaml`/`.yml` or `.json` file is read in the form its extension names and\nchecked for format and references; a `.pptx` path or its bytes are imported. An invalid deck throws `OPFValidationError`,\nwhose findings are located by line and column in the file; a PowerPoint file that cannot be imported throws `OPFImportError`.\nWarnings are not returned: `validate` reports them, and `convert("deck.pptx", "deck.opf.yaml")` returns what an import could\nnot keep. `catalogs` (default: the default catalog) is where references resolve.\n\n## `save(deck, path, options?)`\n\nWrites the deck in the form the file name names (`.opf.md`, `.yaml`/`.yml` or `.json`), atomically, creating folders and\nreplacing the file. It checks format and references first and refuses an invalid deck with `OPFValidationError`; `validate:\nfalse` writes work in progress, as an editor\'s autosave does (the YAML and Markdown writers still refuse a document that is\nnot well-formed OPF). `schemaComment: true` starts a YAML file with the editor modeline. Returns `{ path, format }`.\n\n## Errors\n\nEvery error has a `code`; branch on it, never on the message.\n\n| Class | Codes |\n| --- | --- |\n| `OPFApiError` (the base class) | `node-only` (the browser-safe build), `invalid-option`, `input-not-found`, `input-unreadable`, `invalid-presentation` (a deck written as a deck), `output-exists`, `output-not-file`, `output-unwritable` |\n| `OPFExportError` | the export step: `peer-not-installed` (the message carries the install command; `details` the package and range), `peer-too-old`, `peer-load-failed`, `invalid-option`, `invalid-presentation`, `no-slides`, `all-slides-hidden`, `layout-overflow` (strict composition), `export-failed`, a font code |\n| `OPFImportError` | the import step and `open` of a PowerPoint file: `peer-not-installed`, `peer-too-old`, `peer-load-failed`, `import-failed`, `invalid-presentation` |\n| `OPFValidationError` | `open` and `save` of an invalid deck; also thrown by core\'s `parse` and `assertValid` |\n\nAn engine failure with its own string `code` keeps that code; `export-failed` and `import-failed` are fallbacks for errors without one. For example, strict composition rejects with `OPFExportError` and code `layout-overflow`, retaining the original `OPFCompositionError` and its located `diagnostics` on `error.cause`.\n\n`findings` on an error holds any located findings supplied by the failed step.\n\n## Fonts, determinism and the network\n\nDrawing uses the renderer\'s bundled open font pack (the office pack with visual substitution) plus the files in the `fonts` folders, never\nsystem fonts. The pack is prepared once per process and reused by every call that passes no `fonts` (with `fonts` folders, once per\nlist of files); a deck that draws a script beyond Latin, Greek and Cyrillic gets a handle with its script\nfaces. Concurrent calls share the one preparation and draw one at a time on it. The output is the same bytes as with a handle\nof the caller\'s own. Nothing is fetched and no clock is read: the same input, options and installed versions give the same\nbytes on every machine.\n\n## Reading and writing text without files\n\nCore reads and writes deck text in every runtime: `parse(text, { filename?, format?, catalogs? })` returns the\npresentation and throws `OPFValidationError` on syntax, schema or reference errors (findings located by line and column);\n`stringify(deck, { format? | filename? })` returns text; `validate(text)` returns the full report, warnings included.\n\n## Slide selections\n\n`parseSlideSelection(selection, total, label?)` (both builds) turns a selection into slide numbers, one-based, ascending and\nwithout repeats: `3`, `[1, 3]`, `"1,3-5"`, `"2-"` (to the end) and `"-3"` (from the start). It throws `OPFApiError`\n`invalid-option` for a malformed selection, a number that is not a whole number from 1, a reversed range or a slide past the\nend, and `no-slides` when `total` is 0. `convert` and the opf CLI\'s `--slides` read selections with it, and an engine can share it.\n'
286
286
  },
287
287
  {
288
288
  "slug": "numbered-lists",
@@ -330,7 +330,7 @@ var docsData = Object.freeze([
330
330
  "slug": "schema-reference",
331
331
  "file": "docs/schema-reference.md",
332
332
  "title": "OPF Presentation Schema Reference",
333
- "markdown": "# OPF Presentation Schema Reference\n\nThis reference documents the author-facing shape of a complete `*.opf.json` presentation document. It summarizes the canonical schema in `spec/schemas/opf.schema.json`; the schema remains the source of truth for validators.\n\n## Document Contract\n\n- Schema id: `https://openpresentation.org/schema/opf/v1`\n- Required top-level fields: `slides`\n- Additional top-level fields: not allowed\n\n## Top-Level Fields\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | no | `const:\"https://openpresentation.org/schema/opf/v1\"` | Optional OPF schema version. When omitted, validators and engines should assume the latest supported OPF schema. |\n| `name` | no | `string` | Display name of the presentation for GUI/TUI lists, library/search indexing, OS-level metadata, and default export filenames. This is deck identity, not slide content. Use slides[].title and slides[].subtitle for text... |\n| `description` | no | `string` | Free-form prose describing what this presentation is about. Used by agents and humans as a deck-level summary; complements purpose (the goal) and narrative (the structured storyline). Round-trips to OOXML 'docProps/co... |\n| `filename` | no | `string` | Optional base filename for exports (without extension). The opf CLI (convert) and the editor strip a trailing .pptx, .pdf, .png, or .svg (case-insensitive) and append the target format's extension. When omitted, they... |\n| `organization` | no | `oneOf:ref:Organization / array<ref:Organization>` | Organization associated with the presentation, usually the presenting company. Array form supports hosts, partners, clients, and sponsors. The primary organization (Organization.role 'primary', else the first item) su... |\n| `speaker` | no | `oneOf:ref:Speaker / array<ref:Speaker>` | Person presenting the deck. Array form supports panels and multi-speaker decks. The first speaker is the primary speaker: the built-in variables 'speaker.<field>' read it, 'speakers' lists every name, and 'speaker.<id... |\n| `author` | no | `oneOf:string / array<string>` | Optional credit for the person who authored or contributed to the deck, distinct from speaker. Array form supports multiple contributors. Round-trips to OOXML 'docProps/core.xml' as '<dc:creator>' (semicolon-joined wh... |\n| `audience` | no | `oneOf:string / ref:Audience / array<oneOf:string / ref:Audience>` | Intended audiences for the presentation. Accepts any of: - A single string: an audiences reference ('executive', or 'acme:board' for a record of the catalogs.acme group), or free-form text ('Series B investors'). A st... |\n| `purpose` | no | `oneOf:string / ref:Purpose` | Primary goal of the presentation. Accepts either: - A string: a purposes reference ('decide', or 'acme:fundraise' for a record of the catalogs.acme group), or a free-form goal ('Raise a Series B round of $30M'). A str... |\n| `language` | no | `oneOf:ref:LanguageTag / ref:Language` | Language of the presentation content, an engine vocabulary: a BCP-47 language tag, validated directly with no catalog lookup. Accepts either: - A BCP-47 tag ('en-US', 'en-GB', 'ja', 'zh-Hans', 'ar-SA'). - An inline La... |\n| `tone` | no | `oneOf:ref:CatalogReference / ref:Tone` | Desired tone for the presentation. Accepts either: - A tones reference: a bare id ('formal') or 'name:id' for a record of a named catalogs group. - An inline Tone object for custom tone metadata or overrides on a refe... |\n| `takeaway` | no | `oneOf:string / array<string>` | Audience-facing takeaway the presentation should leave behind. Array form supports multiple takeaways. Deck-level intent used by AI to seed and pressure-test slide content. |\n| `duration` | no | `integer` | Target presentation duration, as an integer number of minutes. The opf-render presenter view counts the elapsed time against it, and core validate warns when it lies outside the resolved narrative's 'duration' range.... |\n| `tags` | no | `array<string>` | Free-form labels used for categorization, search, and filtering. Lowercase kebab-case is recommended for consistency across a deck library. |\n| `design` | no | `ref:Design` | Optional design system covering theme, color scheme, font scheme, dimensions, background, logo, watermark, header, and footer applied to the deck. When omitted, engines use their default design configuration. |\n| `variables` | no | `ref:Variables` | Optional named variables: deck colors referenced as 'var:<id>' (the original use), and typed content variables (text, number, date, image, url, list) referenced inline as '{{<id>}}' or whole as 'var:<id>'. Variables a... |\n| `template` | no | `boolean` | Marks this document as a template: an incomplete OPF file. A template declares variables (top-level 'variables') and references them from content, and may leave required variables unfilled; validation then reports the... |\n| `narrative` | no | `ref:CatalogReference` | The deck's narrative plan, by reference: a bare narratives id ('classic-story') or 'name:id' for a record of a named catalogs group ('acme:founder-pitch'). The deck holds only this pointer; the plan (the arc, its beat... |\n| `slides` | yes | `array<ref:Slide>` | Ordered array of slides that make up the presentation. |\n| `references` | no | `array<ref:Reference>` | Sources that text runs cite with 'cite'. Ids are unique. A cited reference is listed in the footnote area of every slide that cites it, with a marker number assigned per deck in order of first use; a reference no run... |\n| `datasets` | no | `ref:Datasets` | Optional shared data tables, keyed by id. A chart ('chart.data': { \"dataset\": \"<id>\" }) or a table ('table': { \"dataset\": \"<id>\" }) references one instead of holding its own copy; engines inline the reference before c... |\n| `assets` | no | `ref:Assets` | Optional reusable asset registry for images, data files, videos, documents, fonts, and other resources referenced elsewhere in the deck via 'asset:<id>' strings. |\n| `icons` | no | `ref:Icons` | Optional deck-local icons, keyed by name: an author's or an LLM's own SVG, written once and named by any `icon` of the deck. See docs/icons.md. |\n| `catalogs` | no | `ref:Catalogs` | The catalog records this document embeds, grouped by the catalog they came from: 'default' (the catalog bare ids come from), 'custom' (records the document defines itself) and any number of named catalogs ('acme', ref... |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows; ignored by the engine but preserved across read/write round-trips. |\n\n## Object And Type Reference\n\n### Assets\n\n- Type: `object`\n- Required fields: none\n- Purpose: Reusable asset registry for resources used by slides, charts, metadata, and design. Keys are stable asset ids referenced elsewhere as 'asset:<id>'. Each asset can be a source string or an object with src plus optional metadata.\n\n_No named properties._\n\n\n### Asset\n\n- Type: `oneOf:string / object`\n- Required fields: none\n- Purpose: Reusable or inline resource. A string is shorthand for { \"src\": value }. Source strings accept 'asset:<id>' references, HTTPS URLs, data URIs, relative paths resolved against the OPF file location, or local filesystem paths. Use object form when metadata such as alt text, title or mediaType matters.\n\n_No named properties._\n\n\n### ImagePayload\n\n- Type: `oneOf:string / object`\n- Required fields: none\n- Purpose: An image source and optional image-local text callouts. Other resource kinds use Asset and do not accept callouts.\n\n_No named properties._\n\n\n### ImageCallout\n\n- Type: `object`\n- Required fields: `text`, `x`, `y`, `width`, `height`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `text` | yes | `string` | Plain editable text. Native edits preserve current words; an empty string is retained. |\n| `x` | yes | `ref:FiniteNumber` | Signed fraction of the visible image frame width from its physical left edge. A callout points at pixels, and a picture never mirrors, so this coordinate is physical in every language. Negative values or values greate... |\n| `y` | yes | `ref:FiniteNumber` | Signed fraction of the visible image frame height from its physical top edge. Negative values or values greater than 1 position the panel outside the image; its text is not clipped to the image. The slide crops what l... |\n| `width` | yes | `number` | Positive fraction of the visible image frame width, at most 1. The signed x origin controls placement outside the frame. |\n| `height` | yes | `number` | Positive fraction of the visible image frame height, at most 1. The signed y origin controls placement outside the frame. |\n\n\n### Audience\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: Inline audience metadata for the presentation. Use 'id' to reference an audiences record (a bare id or 'name:id') and override selected fields, or use 'name' for a custom inline audience.\n- Conditional requirement: `id` or `name`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Optional audiences reference (a bare id or 'name:id') resolved before applying the inline overrides. |\n| `name` | no | `string` | Human-readable audience name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the audience. |\n| `description` | no | `string` | Longer prose describing the audience and how to address them. |\n| `seniority` | no | `enum:ic \\| manager \\| director \\| vp \\| c-suite \\| mixed` | Typical seniority level of the audience. |\n| `technicalFluency` | no | `enum:low \\| medium \\| high \\| mixed` | Typical technical fluency of the audience. |\n| `decisionPower` | no | `enum:informational \\| advisory \\| decision-maker` | Whether the audience is expected to be informed, advise, or decide. |\n| `attentionBudgetMinutes` | no | `number` | Realistic upper bound on focused attention for a single presentation, in minutes. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: narrative ids that work well for this audience, for picker UIs. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: tone ids that work well for this audience, for picker UIs. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Purpose\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: Inline purpose metadata for the presentation. Use 'id' to reference a purposes record (a bare id or 'name:id') and override selected fields, or use 'name' for a custom inline purpose.\n- Conditional requirement: `id` or `name`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Optional purposes reference (a bare id or 'name:id') resolved before applying the inline overrides. |\n| `name` | no | `string` | Human-readable purpose name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the purpose. |\n| `description` | no | `string` | Longer prose describing when to use this purpose and how it should shape a deck. |\n| `outcome` | no | `string` | Desired audience outcome after the presentation. |\n| `successCriteria` | no | `array<string>` | Observable signals that the deck accomplished this purpose. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: narrative ids that work well for this purpose, for picker UIs. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: tone ids that work well for this purpose, for picker UIs. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Language\n\n- Type: `object`\n- Required fields: `bcp47`\n- Purpose: Inline language metadata for the presentation: a BCP-47 'bcp47' tag plus overrides of what engines know about it. Languages are an engine vocabulary, not catalog records, so there is no 'id'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | no | `string` | Human-readable language name. |\n| `bcp47` | yes | `ref:LanguageTag` | BCP-47 language tag used for locale-aware rendering, proofing, and accessibility metadata. Use 'en-GB' for UK English; 'en-UK' is not a valid BCP-47 region form. |\n| `ooxmlLang` | no | `string` | Culture tag for OOXML text-run language attributes (a:rPr/@lang, a:endParaRPr/@lang), in the language-[Script-]REGION form Office recognizes (e.g. 'ja-JP', 'ar-SA', 'ms-MY', 'nb-NO', 'fil-PH', 'zh-CN'). Without it, en... |\n| `code` | no | `string` | ISO 639-3 or 639-2 language code carried for engines that prefer ISO codes. |\n| `direction` | no | `enum:ltr \\| rtl` | Base text direction for the language. When omitted, engines derive it from the script: Arabic (Arab), Hebrew (Hebr), Syriac (Syrc), Thaana (Thaa), N'Ko (Nkoo), Adlam (Adlm), Samaritan (Samr), Mandaic (Mand) and Hanifi... |\n| `script` | no | `string` | ISO 15924 script code of the language's writing system. The script selects the OOXML font slot the language's text uses: East Asian scripts (Hans, Hant, Hani, Jpan, Kore, Hang, Hira, Kana, Bopo, Yiii) use the eastAsia... |\n| `fontScheme` | no | `ref:CatalogReference` | Font-scheme reference (a bare id or 'name:id') for this language's script slot when targeting PowerPoint output. Its major/minor families fill the language's script slot (eastAsian or complexScript, chosen by 'script'... |\n| `googleFontScheme` | no | `ref:CatalogReference` | Font-scheme reference (a bare id or 'name:id') used in place of 'fontScheme' when resolving script fonts for Google Slides output. |\n| `summary` | no | `string` | One-sentence note about coverage or font defaults. |\n| `description` | no | `string` | Longer prose describing the language record and any font-pairing rationale. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Tone\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: Inline tone metadata for the presentation. Use 'id' to reference a tones record (a bare id or 'name:id') and override selected fields, or use 'name' for a custom inline tone.\n- Conditional requirement: `id` or `name`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Optional tones reference (a bare id or 'name:id') resolved before applying the inline overrides. |\n| `name` | no | `string` | Human-readable tone name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the tone. |\n| `description` | no | `string` | Longer prose describing the tone and the kinds of decks it suits. |\n| `voiceCues` | no | `array<string>` | Short directives that shape AI generation toward this tone. |\n| `avoid` | no | `array<string>` | Anti-patterns that AI generation should not produce when this tone is active. |\n| `samplePhrases` | no | `array<string>` | Short example phrases that exemplify this tone. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: narrative ids this tone pairs well with, for picker UIs. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Organization\n\n- Type: `object`\n- Required fields: `id`, `name`\n- Purpose: An organization associated with the presentation, typically the presenting company, but also hosts, partners, clients, or sponsors. The primary organization (role 'primary', else the first one) supplies the cover and section logo (unless design.logo overrides it) and the 'socials' header/footer field (its socials). Every field is also a built-in variable ('{{organization.name}}', 'organization.<id>.<field>'), and every logo a slide-scoped image ('var:organization.logo.icon', 'var:organization...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable identifier for the organization, used to reference it from Speaker.organizationId and to address it in built-in variables as 'organization.<id>.<field>'. Must be unique among organizations (a duplicate is a val... |\n| `name` | yes | `string` | Display name. The built-in variable 'organization.name' (primary organization) or 'organization.<id>.name' carries it into any string, such as a header or footer text of '{{organization.name}}'. |\n| `legalName` | no | `string` | Optional legal entity name when it differs from the display name. Never drawn automatically; available as the built-in variable 'organization.legalName'. |\n| `logo` | no | `oneOf:ref:Asset / ref:OrganizationLogo` | The organization's logo. A path, URL or Asset is one logo for every shape; an object gives up to four shapes (full, stacked, icon, wordmark), each a path or Asset, or { onLight, onDark } for the two backgrounds. A pat... |\n| `domain` | no | `string` | Bare internet domain for the organization. Never drawn automatically and not used to look up assets; available as the built-in variable 'organization.domain'. |\n| `email` | no | `string` | General contact email for the organization. Never drawn automatically; available as the built-in variable 'organization.email'. |\n| `phone` | no | `string` | Main contact phone number for the organization. E.164 format is recommended. Never drawn automatically; available as the built-in variable 'organization.phone'. |\n| `tagline` | no | `string` | Short tagline. Never drawn automatically (cover slides do not show it); available as the built-in variable 'organization.tagline', for example in a footer 'text' of '{{organization.tagline}}'. |\n| `role` | no | `enum:primary \\| partner \\| client \\| sponsor \\| host` | Role of the organization relative to the presentation. Only 'primary' has behavior: it selects the primary organization (cover and section logo, the 'socials' header/footer field, and the 'organization.<field>' built-... |\n| `socials` | no | `ref:Socials` | Optional social media handles or URLs for the organization. The primary organization's socials render in header/footer zones that set socials: true; otherwise they are authoring metadata. |\n\n\n### Speaker\n\n- Type: `object`\n- Required fields: `id`, `name`\n- Purpose: A person presenting the deck. A speaker is drawn only through built-in variables ('{{speaker.name}}' inside any string, a header or footer text included, and 'var:speaker.photo' as a whole image field). No layout, cover or bio slide places a speaker on its own. See docs/templates-and-variables.md.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable identifier for the speaker. Must be unique among speakers (a duplicate is a validation error). Addresses this speaker in built-in variables as 'speaker.<id>.<field>', such as '{{speaker.alice.title}}'. |\n| `name` | yes | `string` | Display name. Built-in variable 'speaker.name' (first speaker) or 'speaker.<id>.name'; every name is listed by 'speakers'. |\n| `title` | no | `string` | Role or title. Built-in variable 'speaker.title' (or 'speaker.<id>.title'), for example in a footer text of '{{speaker.name}}, {{speaker.title}}'. |\n| `photo` | no | `ref:Asset` | Source for the speaker's headshot image. Accepts an HTTPS URL, data URI, relative path (resolved against the OPF file location), local path, or 'asset:<id>' reference. Common formats are JPG or PNG; SVG is not appropr... |\n| `email` | no | `string` | Contact email. Never drawn automatically; available as the built-in variable 'speaker.email'. |\n| `phone` | no | `string` | Contact phone number for the speaker. E.164 format is recommended. Never drawn automatically; available as the built-in variable 'speaker.phone'. |\n| `bio` | no | `string` | Short biographical paragraph. Never drawn automatically; available as the built-in variable 'speaker.bio', for a bio or 'about the speaker' slide you write. |\n| `organizationId` | no | `string` | Reference to an Organization.id in organization; it must name an existing organization (a validation error otherwise). Attribution metadata for hosts: no engine draws it or changes which organization is primary becaus... |\n| `socials` | no | `ref:Socials` | Optional social media handles or URLs for the speaker. Authoring metadata only: nothing draws speaker socials and there is no built-in variable for them (the 'socials' header/footer field draws the primary organizatio... |\n\n\n### Socials\n\n- Type: `object`\n- Required fields: none\n- Purpose: Social media handles or URLs, keyed by platform. The keys are an engine vocabulary validated directly (no catalog lookup): engines link a handle with the platform's URL pattern and handle prefix (spec/reference/engine-vocabularies.json). Each value is a string, either a full URL or a platform handle (e.g., '@acme'). Brand colours and icons are catalog display metadata for authoring UIs; engines render the profile URL, not icons or brand colours. Used both for organization and speaker records.\n\n_No named properties._\n\n\n### Design\n\n- Type: `object`\n- Required fields: none\n- Purpose: Visual design system applied to the presentation; individual slides may override fields via Slide.design.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `theme` | no | `ref:CatalogReference` | Theme for the deck: a themes reference, a bare id ('minimal') or 'name:id' ('acme:brand'). The theme supplies the default colour scheme, font scheme, background and dimensions; design.colorScheme, design.fontScheme, d... |\n| `colorScheme` | no | `oneOf:string / ref:ColorScheme` | Color scheme for the presentation. Accepts two forms: - A colorSchemes reference: a bare id ('cool-horizon') or 'name:id' ('acme:ocean'). - Object form: a ColorScheme with an optional 'id' reference as the base plus s... |\n| `fontScheme` | no | `oneOf:string / ref:FontScheme` | Font scheme for heading, body, accent, and code text. Accepts two forms: - A fontSchemes reference: a bare id ('aptos') or 'name:id' ('acme:inter'). - Object form: a FontScheme with an optional 'id' reference as the b... |\n| `dimensions` | no | `oneOf:ref:DimensionPreset / ref:Dimensions` | Slide dimensions and aspect ratio. String shorthand such as 'widescreen' is equivalent to { preset: 'widescreen' }. |\n| `background` | no | `oneOf:ref:BackgroundShortcut / ref:Background` | Default slide background applied across the deck unless overridden on a slide (slides.N.design.background); the resolved theme's background is the fallback. A background is the only canvas fill and never moves content... |\n| `variant` | no | `oneOf:ref:ColorVariantSlot / ref:ColorVariant` | Optional color variant, as a background slot ('light1', 'light2', 'dark1', 'dark2', or an accent 'accent1' to 'accent6'; the same as { background: slot }) or the object form, which is needed only for an accent order:... |\n| `logo` | no | `oneOf:string / const:false` | Which logo covers, section dividers and picture bullets draw. Logos live on the organization (Organization.logo); without this field covers and sections draw the primary organization's full logo and picture bullets it... |\n| `watermark` | no | `oneOf:const:false / ref:Asset / ref:Watermark` | Optional decorative watermark applied across slides: an image or a text stamp, in the fixed frame and at the opacity described on Watermark. Use false to suppress an inherited watermark in slide-level design; a string... |\n| `header` | no | `oneOf:const:false / ref:HeaderFooter` | Repeated header furniture rendered outside the main slide content. Use false to suppress an inherited header. |\n| `footer` | no | `oneOf:const:false / ref:HeaderFooter` | Repeated footer furniture rendered outside the main slide content. Use false to suppress an inherited footer. |\n| `titleAlignment` | no | `enum:start \\| center \\| end` | Default horizontal alignment for the title heading area (the title and the tag) in resolved layouts. Effective value: the slide's design, then the deck's design, then the theme's design.titleAlignment, then the layout... |\n| `contentAlignment` | no | `enum:start \\| center \\| end` | Default horizontal alignment for body/content regions in resolved layouts. Effective value: the slide's design, then the deck's design, then the theme's design.contentAlignment, then the layout record's design.content... |\n| `contentBox` | no | `boolean` | Whether body/content regions are rendered inside a visible card or surface. Effective value: the slide's design, then the deck's design, then the theme's design.contentBox, then the layout record's design.contentBox,... |\n| `contentDirection` | no | `enum:horizontal \\| vertical` | Axis along which parallel body content is arranged: 'vertical' is a column, 'horizontal' a row. Effective value: the slide's design, then the deck's design, then the theme's design.contentDirection, then the layout re... |\n| `chartPrimary` | no | `enum:none \\| top \\| bottom \\| start \\| end` | Where the primary chart sits relative to supporting content. Effective value: slide design, then deck design, then the layout record's design.chartPrimary. It applies to automatic slides only; a template layout says t... |\n| `imageFit` | no | `enum:cover \\| contain \\| stretch \\| auto` | Default fit of image blocks (and Slide.image) that set no fit of their own: 'cover' fills the frame and crops what overflows around the block's focus, 'contain' shows the whole picture in a frame of its own proportion... |\n| `listBullet` | no | `enum:character \\| image \\| none` | Marker style for items and bullets lists. Effective value: the slide's design, then the deck's design, then the theme's design.listBullet, then the layout record's design.listBullet, then 'character'. 'character' (the... |\n| `listStyle` | no | `enum:stack \\| rows` | How list entries are arranged. 'stack' draws each entry's text with its description under it, the entries close together, as before. 'rows' draws ruled rows: a hairline between two first-level entries (the scheme's bo... |\n| `mirror` | no | `boolean` | Draw the slide's template layout mirrored: each row's cells and the column sizes reversed, so a 'beside' layout puts its picture, chart or table at the end. Logical: a right-to-left deck mirrors on top. Binding and re... |\n\n\n### ColorScheme\n\n- Type: `object`\n- Required fields: none\n- Purpose: Color palette used by the design system. Every slot and role is a hex color ('#RGB', '#RRGGBB' or '#RRGGBBAA'); a color-scheme name or a 'var:<id>' reference is not valid here, because those resolve through the scheme. The slot fields (accent1-accent6, dark1, dark2, light1, light2, hyperlink, followedHyperlink) mirror color-scheme.schema.json (https://openpresentation.org/schema/opf-color-scheme/v1) so library records and inline OPF overrides are interchangeable on those fields. Two parallel...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | no | `string` | Name of this palette. PPTX export writes it as the name of the theme's color scheme (a:clrScheme name), which PowerPoint lists under Design, Variants, Colors; without it, an object form with 'id' writes that id, and t... |\n| `id` | no | `ref:CatalogReference` | Colour-scheme reference (a bare id or 'name:id') resolved as the base; slot and role overrides on the surrounding ColorScheme object take precedence over the resolved scheme. |\n| `accent1` | no | `ref:HexColor` | Accent 1 color (hex). Mirrors the OOXML accent1 slot. |\n| `accent2` | no | `ref:HexColor` | Accent 2 color (hex). Mirrors the OOXML accent2 slot. |\n| `accent3` | no | `ref:HexColor` | Accent 3 color (hex). Mirrors the OOXML accent3 slot. |\n| `accent4` | no | `ref:HexColor` | Accent 4 color (hex). Mirrors the OOXML accent4 slot. |\n| `accent5` | no | `ref:HexColor` | Accent 5 color (hex). Mirrors the OOXML accent5 slot. |\n| `accent6` | no | `ref:HexColor` | Accent 6 color (hex). Mirrors the OOXML accent6 slot. |\n| `dark1` | no | `ref:HexColor` | Dark 1 color (hex). Typically the deepest neutral; OOXML dark1. |\n| `dark2` | no | `ref:HexColor` | Dark 2 color (hex). Secondary dark; OOXML dark2. |\n| `light1` | no | `ref:HexColor` | Light 1 color (hex). Typically the slide canvas; OOXML lt1. |\n| `light2` | no | `ref:HexColor` | Light 2 color (hex). Secondary light surface; OOXML lt2. |\n| `hyperlink` | no | `ref:HexColor` | Hyperlink color (hex). OOXML hlink. Link runs with no color of their own are drawn underlined in it, in the preview and in PowerPoint, unless it has under 4.5:1 contrast against the slide background, then in the slide... |\n| `followedHyperlink` | no | `ref:HexColor` | Followed-hyperlink color (hex). OOXML folHlink. |\n| `primary` | no | `ref:HexColor` | Abstract role: primary brand color (hex). The engine maps this onto an OOXML accent slot when serializing. |\n| `secondary` | no | `ref:HexColor` | Abstract role: secondary brand color (hex). |\n| `accent` | no | `ref:HexColor` | Abstract role: accent color used for highlights and emphasis (hex). |\n| `background` | no | `ref:HexColor` | Abstract role: default slide background color (hex), used when the design names no single-color background (and for gradient and picture backgrounds). Overrides light1 as that default. |\n| `surface` | no | `ref:HexColor` | Abstract role: color for elevated surfaces such as cards and panels (hex). Overrides the default of light2 (dark2 on a dark slide). |\n| `text` | no | `ref:HexColor` | Abstract role: primary body text color (hex). Overrides dark1 on a light slide only; a dark slide always uses light1. |\n| `textSecondary` | no | `ref:HexColor` | Abstract role: secondary or muted text color used for captions and supporting copy (hex). Overrides the default of dark2 (light2 on a dark slide). |\n\n\n### FontScheme\n\n- Type: `object`\n- Required fields: none\n- Purpose: Typography selections used by the design system. The pair fields (major, minor) and refinement fields (type, app, languageFamily) mirror font-scheme.schema.json (https://openpresentation.org/schema/opf-font-scheme/v1) so library records and inline OPF overrides are interchangeable on those fields. Two parallel models are supported and may be mixed: - OOXML pairs (major, minor) - heading and body family names that round-trip directly to PowerPoint majorFont/minorFont entries. - Abstract roles...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Font-scheme reference (a bare id or 'name:id') resolved as the base; field overrides on the surrounding FontScheme object take precedence over the resolved scheme. |\n| `major` | no | `string` | Heading (major) font family mirrors the OOXML majorFont entry. Pairs with 'minor'. |\n| `minor` | no | `string` | Body (minor) font family mirrors the OOXML minorFont entry. Pairs with 'major'. |\n| `eastAsian` | no | `object` | East Asian script fonts. Maps to the OOXML a:ea element of majorFont (major) and minorFont (minor), and to run-level a:ea. When set, they fill the eastAsian slot for every language; when omitted, the slot comes from t... |\n| `complexScript` | no | `object` | Complex-script fonts (for example Arabic, Hebrew, Indic and Thai). Maps to the OOXML a:cs element of majorFont (major) and minorFont (minor), and to run-level a:cs. When set, they fill the complexScript slot for every... |\n| `type` | no | `enum:sans-serif \\| serif \\| monospace` | High-level typographic class of the scheme. |\n| `app` | no | `enum:powerpoint \\| google-slides` | Target application this font pairing is intended for. Metadata for pickers and catalog filters: no engine changes its output by it. |\n| `languageFamily` | no | `enum:latin \\| ea \\| cs \\| eastAsian \\| complexScript` | Font-language family this scheme is intended for: 'latin' for Latin-script content, 'ea' (or 'eastAsian', the same value) for East Asian scripts, 'cs' (or 'complexScript', the same value) for Complex Scripts. The long... |\n| `heading` | no | `string` | Abstract role: font family name used for slide titles and headings. Maps onto the OOXML major slot when serializing. |\n| `body` | no | `string` | Abstract role: font family name used for body copy. Maps onto the OOXML minor slot when serializing. |\n| `accent` | no | `string` | Abstract role: font family name used for accent text. When set, the slide tag (eyebrow) and the quote body use this family instead of the body and heading families; nothing else changes. resolveFontFamilies() returns... |\n| `code` | no | `string` | Abstract role: monospaced font family name used for code blocks and for inline code runs (TextRun.code). No direct OOXML slot. Resolution: this override, then the resolved font-scheme record's 'code' (for example Cons... |\n\n\n### SlideDesign\n\n- Type: `allOf:ref:Design + schema`\n- Required fields: none\n- Purpose: A slide's design: every Design field except dimensions. A PPTX has one slide size, so the size is set once, on the deck's design.dimensions (or its theme), and a slide's design cannot set it. A slide-level theme whose resolved dimensions differ from the deck's is a validate warning (opf/slide-theme-dimensions); exporting such a deck to PPTX fails with mixed-slide-dimensions.\n\n_No named properties._\n\n\n### DimensionPreset\n\n- Type: `enum:16:9 | 4:3 | 16:10 | 1:1 | 4:5 | 9:16 | letter | a4 | widescreen | standard`\n- Required fields: none\n- Purpose: Named preset; sets aspect ratio and physical size. 16:9 ('widescreen'): 13.333 x 7.5 in, PowerPoint's Widescreen. 4:3 ('standard'): 10 x 7.5 in. 16:10: 10 x 6.25 in. letter (11 x 8.5 in) and a4 (11.69 x 8.27 in) are paper sizes, not PowerPoint's Letter Paper or A4 Paper. 1:1, 4:5 and 9:16 are 7.5 in on the short edge.\n\n_No named properties._\n\n\n### Dimensions\n\n- Type: `object`\n- Required fields: none\n- Purpose: Slide dimensions: a preset, or custom inches that override it. PowerPoint's Letter Paper (10 x 7.5 in), A4 Paper (10.8333 x 7.5 in) and On-screen Show (16:9) (10 x 5.625 in) are not OPF presets; use widthInches and heightInches. docs/slide-sizes.md compares every preset.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `preset` | no | `ref:DimensionPreset` | |\n| `widthInches` | no | `number` | Custom slide width in inches; overrides the preset width when provided. |\n| `heightInches` | no | `number` | Custom slide height in inches; overrides the preset height when provided. |\n\n\n### ColorVariantSlot\n\n- Type: `enum:light1 | light2 | dark1 | dark2 | accent1 | accent2 | accent3 | accent4 | accent5 | accent6`\n- Required fields: none\n- Purpose: The scheme slot a color variant puts behind the slide (bg1): a light or dark slot, or an accent. On an accent the text side is the light family (tx1 = light1, tx2 = light2) or the dark family (tx1 = dark1, tx2 = dark2), whichever text slot has the higher contrast on that accent; tx2 falls back to tx1's slot where it is under 4.5:1 on the accent, and bg2 is the accent itself.\n\n_No named properties._\n\n\n### ThemeBackgroundSlot\n\n- Type: `enum:light1 | light2 | dark1 | dark2`\n- Required fields: none\n- Purpose: PowerPoint theme-controlled slide background slot from the active color scheme. These are slots, not assumptions about actual colors: light1 is usually white and dark1 is usually black by convention, but the color scheme controls the real values.\n\n_No named properties._\n\n\n### HexColor\n\n- Type: `string`\n- Required fields: none\n- Purpose: Hex color shorthand accepted by selected string fields.\n\n_No named properties._\n\n\n### ColorRef\n\n- Type: `anyOf:ref:HexColor / enum:accent1 | accent2 | accent3 | accent4 | accent5 | accent6 | dark1 | dark2 | light1 | light2 | hyperlink | followedHyperlink | primary | secondary | accent | background | surface | surfaceAlt | text | textSecondary / string / ref:ColorTransform`\n- Required fields: none\n- Purpose: A color value or reference, enforced on shape fills and strokes, image strokes, styled table cell fill and text colors, cell border colors, solid background colors, gradient stop colors and pattern foreground and background colors. Four forms: - Literal hex: '#RGB', '#RRGGBB', or '#RRGGBBAA'. - Color-scheme name, resolved through the effective color scheme after design resolution: an OOXML slot ('accent1'-'accent6', 'dark1', 'dark2', 'light1', 'light2', 'hyperlink', 'followedHyperlink') or an...\n\n_No named properties._\n\n\n### ColorTransform\n\n- Type: `oneOf:schema / schema`\n- Required fields: `color`\n- Purpose: A ColorRef made lighter or darker, as PowerPoint's theme color tints and shades: 'lighten' moves the color's HSL luminance that share of the way to white (lumMod 1 - lighten, lumOff lighten), 'darken' that share of the way to black (lumMod 1 - darken). Exactly one of the two. PPTX export writes a:lumMod and a:lumOff on the base color, a scheme color where the base names one, so re-theming the deck keeps the tint.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | yes | `ref:ColorRef` | The base color: any ColorRef. |\n| `lighten` | no | `number` | Share of the way to white, 0 to 1. 0.4 is PowerPoint's \"Lighter 40%\". |\n| `darken` | no | `number` | Share of the way to black, 0 to 1. 0.25 is PowerPoint's \"Darker 25%\". |\n\n\n### Variables\n\n- Type: `object`\n- Required fields: none\n- Purpose: Named variables, keyed by stable kebab-case id. A variable is a typed, named value the deck declares once and uses in many places: a color ('var:<id>' in color fields, the original use), or content that fills a template (text, number, date, image, url, list). Content is referenced inline as '{{<id>}}' inside any string, or whole as 'var:<id>' in a field of the matching type; '\\{{' writes a literal '{{'. A hex string is shorthand for a color variable. A variable with no 'value' is unfilled: ex...\n\n_No named properties._\n\n\n### Variable\n\n- Type: `oneOf:ref:HexColor / ref:ColorVariable / ref:TextVariable / ref:NumberVariable / ref:DateVariable / ref:ImageVariable / ref:UrlVariable / ref:ListVariable`\n- Required fields: none\n- Purpose: A single named variable: a hex string (shorthand for a color variable) or an object whose 'type' is color, text, number, date, image, url or list. 'value' is the current value and is optional: a variable with no value is unfilled, which a template allows and a normal deck does not. 'example' only illustrates the slot (fill forms, template previews) and never reaches output.\n\n_No named properties._\n\n\n### ColorVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A named color. Content color fields reference it as 'var:<id>'. Colors resolve at render time through the ordinary color-reference path, so a color variable keeps working as before.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"color\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `ref:HexColor` | Hex color this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `ref:HexColor` | Illustrative color shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### TextVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: Text content. Plain string or rich TextRun[]. Insert it inline as '{{<id>}}' inside any string (rich text is flattened to plain text there), or reference it whole as 'var:<id>' in a field that accepts string or TextRun[] (the rich runs are kept).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"text\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `oneOf:string / array<ref:TextRun>` | Text this variable resolves to: a plain string, or TextRun[] for rich text. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `oneOf:string / array<ref:TextRun>` | Illustrative text shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### NumberVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A number. '{{<id>}}' inserts it as text using 'format'; 'var:<id>' as a whole field supplies the number itself (chart values, font sizes).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"number\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `number` | Number this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `number` | Illustrative number shown in fill forms and used when a template is previewed with examples. Never written to output. |\n| `format` | no | `ref:NumberFormat` | Display pattern used by '{{<id>}}' (the shared NumberFormat syntax). A literal prefix, a numeric part of '#', '0', ',' and '.', and a literal suffix. '0' pads digits, '#' is optional, ',' groups thousands, digits afte... |\n\n\n### NumberFormat\n\n- Type: `string`\n- Required fields: none\n- Purpose: Number display pattern, shared by NumberVariable.format, data column formats (DataColumn.format) and table cell formats (StyledTableCell.format). An optional literal prefix, a numeric part of '#', '0', ',' and '.', and an optional literal suffix. '0' pads digits, '#' is optional, ',' groups thousands, digits after '.' fix the decimals ('0' required, '#' optional), and a '%' in the prefix or suffix multiplies the value by 100. English separators only. A format applies only to number values; st...\n\n_No named properties._\n\n\n### DateVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A calendar date as an ISO YYYY-MM-DD string. No time zone and no clock are involved. '{{<id>}}' inserts it formatted with 'format'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"date\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `string` | ISO calendar date (YYYY-MM-DD) this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `string` | Illustrative ISO date shown in fill forms and used when a template is previewed with examples. Never written to output. |\n| `format` | no | `string` | Date display pattern, the same LDML-style tokens as header/footer dateFormat: yyyy, yy, MMMM, MMM, MM, M, dd, d, EEEE, EEE and quoted literals. English names. Default 'MMMM d, yyyy'. |\n\n\n### ImageVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: An image source: any Asset (an 'asset:<id>' reference, HTTPS URL, data URI, relative or local path, or an object with src, alt and metadata). Reference it whole as 'var:<id>' in an image, asset or src field; '{{<id>}}' inserts the source string.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"image\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `ref:Asset` | Image source this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `ref:Asset` | Illustrative image source shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### UrlVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A link target (http, https, mailto or tel). Use it as '{{<id>}}' inside a link string or reference it whole as 'var:<id>' in a link field.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"url\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `string` | Link target this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `string` | Illustrative link shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### ListVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A list of strings, for bullets and list items. A whole-string array element 'var:<id>' splices every entry into the array in place; a whole field 'var:<id>' becomes the array; '{{<id>}}' joins the entries with ', ' (or the separator after a pipe: '{{<id>|; }}').\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"list\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `array<string>` | Entries this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `array<string>` | Illustrative entries shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### BackgroundShortcut\n\n- Type: `oneOf:ref:ThemeBackgroundSlot / ref:HexColor / ref:ImageSource`\n- Required fields: none\n- Purpose: String shorthand for a background. Theme slots ('light1', 'light2', 'dark1', 'dark2') are equivalent to { type: 'theme', slot: value }; hex colors are equivalent to { type: 'solid', color: value }; an image source (starting with 'asset:', 'https://', 'data:', './' or '../') is equivalent to { type: 'image', src: value }, a cover image. Any other string is invalid.\n\n_No named properties._\n\n\n### ImageSource\n\n- Type: `string`\n- Required fields: none\n- Purpose: An image source in a string shorthand: an 'asset:<id>' reference, an HTTPS URL, a data URI, or a relative path starting with './' or '../' (resolved against the OPF file location).\n\n_No named properties._\n\n\n### ColorVariant\n\n- Type: `object`\n- Required fields: `background`\n- Purpose: A variant of the deck's single color scheme, as a mapping over its twelve slots (PowerPoint's clrMap): 'background' is the slot the slide background and the role bg1 take, and with it the other roles: light1 maps bg1 = light1, tx1 = dark1, bg2 = light2, tx2 = dark2; dark1 maps bg1 = dark1, tx1 = light1, bg2 = dark2, tx2 = light2; light2 and dark2 make that slot both the background and the alternate surface (light2: bg1 = bg2 = light2, tx1 = dark1, tx2 = dark2; dark2: bg1 = bg2 = dark2, tx1 =...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `background` | yes | `ref:ColorVariantSlot` | The scheme slot that is the background (bg1) of the variant. |\n| `accents` | no | `array<enum:accent1 \\| accent2 \\| accent3 \\| accent4 \\| accent5 \\| accent6>` | Optional accent order: a permutation of accent1 to accent6. Entry i is the scheme slot drawn as accent i + 1, so primary, secondary and accent (the first three) and the chart series colors follow it. Default: the sche... |\n\n\n### Background\n\n- Type: `oneOf:ref:ThemeBackground / ref:SolidBackground / ref:GradientBackground / ref:ImageBackground / ref:PatternBackground`\n- Required fields: none\n- Purpose: Background fill applied to slides. Theme backgrounds preserve PowerPoint's color-scheme background choice; other variants represent fixed background fills.\n\n_No named properties._\n\n\n### ThemeBackground\n\n- Type: `object`\n- Required fields: `type`, `slot`\n- Purpose: Theme-controlled PowerPoint slide background. The slot is resolved through the active color scheme and remains theme-aware.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"theme\"` | Theme-controlled background fill. |\n| `slot` | yes | `ref:ThemeBackgroundSlot` | |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). Default 1; the selected theme slot remains unchanged. |\n\n\n### SolidBackground\n\n- Type: `object`\n- Required fields: `type`, `color`\n- Purpose: Fixed solid slide background fill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"solid\"` | Fixed solid background fill. |\n| `color` | yes | `ref:ColorRef` | Fixed solid fill color: a hex string, a color-scheme slot or role name, or a var:<id> variable reference (a ColorRef, resolved against the effective color scheme and the deck variables). Use { type: 'theme', slot: ...... |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### GradientBackground\n\n- Type: `object`\n- Required fields: `type`, `gradient`\n- Purpose: Fixed gradient slide background fill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `tone` | no | `enum:dark \\| light` | Whether the background is dark or light, which picks the color map (dark1 or light1) so text, lines and neutrals read on it. Without a tone a picture or gradient takes the deck's variant, else counts as light. |\n| `type` | yes | `const:\"gradient\"` | Fixed gradient background fill. |\n| `gradient` | yes | `object` | Gradient fill definition: a linear gradient along 'angle' (default 0, left to right). A shape fill's Gradient also takes radial and path types; a background does not. |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### ImageBackground\n\n- Type: `object`\n- Required fields: `type`, `src`\n- Purpose: Picture background: the image fills the whole canvas behind everything and never moves content (to push content aside, use an image block with placement). The string shorthand 'asset:x' (or any image source) is { type: 'image', src: 'asset:x' }, a cover image. Paint order: the colour scheme's default slide background, the picture, then the overlay, then furniture and content.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `tone` | no | `enum:dark \\| light` | Whether the background is dark or light, which picks the color map (dark1 or light1) so text, lines and neutrals read on it. Without a tone a picture takes the tone its recolor, opacity and overlay imply (a duotone in... |\n| `type` | yes | `const:\"image\"` | Picture background. |\n| `src` | yes | `string` | Source for the background image: an 'asset:<id>' reference, HTTPS URL, data URI, or a relative path resolved against the OPF file location. |\n| `alt` | no | `string` | Alternative text. A background with alt is meaningful: PowerPoint export draws it as a full-slide picture at the back that carries the text, so screen readers see it. Without alt it is decorative and exports as the na... |\n| `fit` | no | `enum:cover \\| contain \\| stretch \\| tile` | How the picture fills the canvas: 'cover' fills it and crops what overflows around focus; 'contain' shows the whole picture centered over the colour scheme's default background; 'stretch' scales it to the canvas exact... |\n| `focus` | no | `ref:ImageFocus` | Point of the picture to keep in view when 'cover' crops it. Ignored by the other fits. Without a focus a portrait picture (taller than wide) cropped into a wider frame keeps y 0.3 so heads stay in frame; every other c... |\n| `opacity` | no | `number` | Picture opacity from 0 (fully transparent) to 1 (fully opaque); the overlay keeps its own opacity. Default 1. |\n| `recolor` | no | `ref:ImageRecolor` | Grayscale or duotone treatment of the picture's pixels, as on an image block: recolor and opacity apply to the pixels, then the overlay is drawn above. |\n| `overlay` | no | `oneOf:ref:Overlay / const:false` | Scrim over the whole picture or a band along one edge (edge, size), beneath furniture and content, for example to keep a title readable over a busy photo. Without an overlay, core draws an automatic scrim in the slide... |\n| `textPlacement` | no | `enum:top-start \\| top-center \\| middle-start \\| middle-center \\| bottom-start \\| bottom-center \\| panel` | Where a cover's or section's heading group goes on this picture: the top, middle or bottom of its area, start-aligned or centered, or 'panel' (a start-side column on the background color; needs no overlay key). Absent... |\n\n\n### ImageFocus\n\n- Type: `object`\n- Required fields: `x`, `y`\n- Purpose: A point of a picture as fractions of its width and height, from the top-left corner. A cover fit centers this point in the frame as far as the picture still covers the frame, so it always stays in view: { x: 0.5, y: 0.5 } (the default) is a center crop, { x: 0, y: 0 } keeps the top-left corner.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `x` | yes | `number` | Horizontal position, 0 (left edge) to 1 (right edge). |\n| `y` | yes | `number` | Vertical position, 0 (top edge) to 1 (bottom edge). |\n\n\n### Overlay\n\n- Type: `object`\n- Required fields: `color`, `opacity`\n- Purpose: Solid scrim over a picture: the whole frame in the frame's shape, or a band along one edge. Shared by image backgrounds and image blocks. Drawn directly above its picture and beneath headings and content; PowerPoint export writes one native shape above the picture.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | yes | `ref:ColorRef` | Overlay fill color: a hex color (eight-digit hex keeps its alpha), a color-scheme slot or role name, or a 'var:<id>' variable reference. |\n| `opacity` | yes | `number` | Overlay fill opacity. |\n| `edge` | no | `enum:top \\| bottom \\| start \\| end` | Cover only a band along this edge of the frame, for example a caption strip. Backgrounds and rectangle image frames only; on another shape the overlay is not drawn and composition reports unsupported-image-treatment.... |\n| `size` | no | `number` | Band share of the frame for an edge overlay. Default 0.3. Ignored without edge. |\n\n\n### ImagePlacement\n\n- Type: `object`\n- Required fields: `edge`\n- Purpose: Bleeds an image block to one edge of the slide: the image takes a band along that edge, edge to edge, and the headings and other content compose in the rest of the slide at the normal padding. Only top-level blocks (slides.N.blocks.I) can be placed, at most one per edge. Template layout regions do not supply image placement; set it on the image block itself. Bands are taken in block order, each spanning the free area left by earlier ones. Placement is the only mechanism that moves content asi...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `edge` | yes | `enum:start \\| end \\| top \\| bottom` | The slide edge the image bleeds to. |\n| `size` | no | `number` | Share of the slide width (start, end) or height (top, bottom) given to the band. Default 0.5. |\n| `inset` | no | `boolean` | Draw the frame inside the slide padding on every side of the band, like a card, instead of edge to edge. Default false. |\n\n\n### Stroke\n\n- Type: `anyOf:const:\"none\" / object`\n- Required fields: none\n- Purpose: A line along an outline: a shape block's outline or a picture's frame (the picture key 'border' was renamed 'stroke' in 0.33, with no alias). DrawingML a:ln. 'none' removes the line.\n\n_No named properties._\n\n\n### Arrowhead\n\n- Type: `object`\n- Required fields: none\n- Purpose: An arrowhead at one end of an open path or a line preset (DrawingML a:headEnd at the start, a:tailEnd at the end). Closed outlines have no ends, so arrowheads draw only on open paths such as arc, line or a custom path that is not closed.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | no | `enum:none \\| triangle \\| stealth \\| diamond \\| oval \\| arrow` | Arrowhead kind, DrawingML's ST_LineEndType. Default 'triangle' when the object is given. |\n| `width` | no | `enum:small \\| medium \\| large` | Arrowhead width relative to the stroke width (2, 3 or 5 stroke widths). Default medium. |\n| `length` | no | `enum:small \\| medium \\| large` | Arrowhead length relative to the stroke width (2, 3 or 5 stroke widths). Default medium. |\n\n\n### Gradient\n\n- Type: `object`\n- Required fields: `stops`\n- Purpose: A gradient fill: the background gradient object extended with 'type'. DrawingML a:gradFill: a:lin for linear, a:path circle, rect or shape for the others. The gradient rotates with the shape.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | no | `enum:linear \\| radial \\| rectangle \\| shape` | linear runs along 'angle'; radial spreads from the center as a circle, rectangle as a rectangle and shape along the shape's own outline (a:path circle, rect, shape). Default linear. |\n| `angle` | no | `number` | Linear gradients only: angle in degrees (0 = left to right, 90 = top to bottom). Default 90. |\n| `stops` | yes | `array<object>` | Ordered color stops; at least two. A radial, rectangle or shape gradient runs from the center (position 0) to the outline (position 1). |\n\n\n### Pattern\n\n- Type: `object`\n- Required fields: `preset`\n- Purpose: A two-color pattern fill (the background pattern object), DrawingML a:pattFill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `preset` | yes | `string` | DrawingML pattern preset (ECMA-376 ST_PresetPatternVal), for example pct5, ltHorz, wdUpDiag, smGrid or dotDmnd. |\n| `foregroundColor` | no | `ref:ColorRef` | Pattern color. Default the shape style's fill color. |\n| `backgroundColor` | no | `ref:ColorRef` | Color behind the pattern. Default the slide background. |\n\n\n### ShapeFill\n\n- Type: `anyOf:const:\"none\" / ref:ColorRef / object / object`\n- Required fields: none\n- Purpose: A shape block's fill: 'none', a ColorRef, { gradient } or { pattern }. Without a fill a shape takes its style's fill (the theme's accent1 for the default style). Fills rotate with the shape (rotWithShape).\n- Conditional requirement: `gradient` or `pattern`\n\n_No named properties._\n\n\n### ShapePreset\n\n- Type: `enum:line | lineInv | triangle | rtTriangle | rect | diamond | parallelogram | trapezoid | nonIsoscelesTrapezoid | pentagon | hexagon | heptagon | octagon | decagon | dodecagon | star4 | star5 | star6 | star7 | star8 | star10 | star12 | star16 | star24 | star32 | roundRect | round1Rect | round2SameRect | round2DiagRect | snipRoundRect | snip1Rect | snip2SameRect | snip2DiagRect | plaque | ellipse | teardrop | homePlate | chevron | pieWedge | pie | blockArc | donut | noSmoking | rightArrow | leftArrow | upArrow | downArrow | stripedRightArrow | notchedRightArrow | bentUpArrow | leftRightArrow | upDownArrow | leftUpArrow | leftRightUpArrow | quadArrow | leftArrowCallout | rightArrowCallout | upArrowCallout | downArrowCallout | leftRightArrowCallout | upDownArrowCallout | quadArrowCallout | bentArrow | uturnArrow | circularArrow | leftCircularArrow | leftRightCircularArrow | curvedRightArrow | curvedLeftArrow | curvedUpArrow | curvedDownArrow | swooshArrow | cube | can | lightningBolt | heart | sun | moon | smileyFace | irregularSeal1 | irregularSeal2 | foldedCorner | bevel | frame | halfFrame | corner | diagStripe | chord | arc | leftBracket | rightBracket | leftBrace | rightBrace | bracketPair | bracePair | straightConnector1 | bentConnector2 | bentConnector3 | bentConnector4 | bentConnector5 | curvedConnector2 | curvedConnector3 | curvedConnector4 | curvedConnector5 | callout1 | callout2 | callout3 | accentCallout1 | accentCallout2 | accentCallout3 | borderCallout1 | borderCallout2 | borderCallout3 | accentBorderCallout1 | accentBorderCallout2 | accentBorderCallout3 | wedgeRectCallout | wedgeRoundRectCallout | wedgeEllipseCallout | cloudCallout | cloud | ribbon | ribbon2 | ellipseRibbon | ellipseRibbon2 | leftRightRibbon | verticalScroll | horizontalScroll | wave | doubleWave | plus | flowChartProcess | flowChartDecision | flowChartInputOutput | flowChartPredefinedProcess | flowChartInternalStorage | flowChartDocument | flowChartMultidocument | flowChartTerminator | flowChartPreparation | flowChartManualInput | flowChartManualOperation | flowChartConnector | flowChartPunchedCard | flowChartPunchedTape | flowChartSummingJunction | flowChartOr | flowChartCollate | flowChartSort | flowChartExtract | flowChartMerge | flowChartOfflineStorage | flowChartOnlineStorage | flowChartMagneticTape | flowChartMagneticDisk | flowChartMagneticDrum | flowChartDisplay | flowChartDelay | flowChartAlternateProcess | flowChartOffpageConnector | actionButtonBlank | actionButtonHome | actionButtonHelp | actionButtonInformation | actionButtonForwardNext | actionButtonBackPrevious | actionButtonEnd | actionButtonBeginning | actionButtonReturn | actionButtonDocument | actionButtonSound | actionButtonMovie | gear6 | gear9 | funnel | mathPlus | mathMinus | mathMultiply | mathDivide | mathEqual | mathNotEqual | cornerTabs | squareTabs | plaqueTabs | chartX | chartStar | chartPlus`\n- Required fields: none\n- Purpose: A DrawingML preset geometry (ECMA-376 ST_ShapeType, all 187), with PowerPoint's own names: rect, roundRect, ellipse, triangle, rightArrow, chevron, wedgeRectCallout, flowChartDecision and the rest. docs/shapes.md lists them with their default frames and adjust values.\n\n_No named properties._\n\n\n### ShapePath\n\n- Type: `anyOf:string / object`\n- Required fields: none\n- Purpose: Custom geometry: SVG path data (M, L, H, V, C, S, Q, T, A and Z, absolute or relative) instead of a preset. PPTX export writes a:custGeom with the same path. A subpath that ends without Z is open: arrowheads draw at its ends (its fill closes it, as in PowerPoint).\n- Conditional requirement: `d` and `viewBox`\n\n_No named properties._\n\n\n### ShapePadding\n\n- Type: `anyOf:number / ref:TableCellPadding`\n- Required fields: none\n- Purpose: Text insets inside the shape's text rectangle (a:bodyPr lIns, tIns, rIns, bIns), in reference pixels at a 720-pixel short edge: one number for every side or { top, right, bottom, left }. Default 9.6 left and right, 4.8 top and bottom, PowerPoint's 0.1 and 0.05 inch.\n\n_No named properties._\n\n\n### Shadow\n\n- Type: `anyOf:enum:soft | hard | perspective / object`\n- Required fields: none\n- Purpose: Outer shadow (a:outerShdw): a preset name (soft, hard, perspective) or { color, opacity, blur, distance, angle, size }.\n\n_No named properties._\n\n\n### InnerShadow\n\n- Type: `object`\n- Required fields: none\n- Purpose: Inner shadow (a:innerShdw).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | no | `ref:ColorRef` | Shadow color. Default black. |\n| `opacity` | no | `number` | Shadow opacity. |\n| `blur` | no | `number` | Blur radius in reference pixels at a 720-pixel short edge. |\n| `distance` | no | `number` | Offset in reference pixels at a 720-pixel short edge. |\n| `angle` | no | `number` | Direction of the offset in degrees (0 = right, 90 = down). |\n\n\n### Glow\n\n- Type: `object`\n- Required fields: none\n- Purpose: Glow around the outline (a:glow).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | no | `ref:ColorRef` | Glow color. Default accent. |\n| `opacity` | no | `number` | Glow opacity. |\n| `radius` | no | `number` | Glow size in reference pixels at a 720-pixel short edge. |\n\n\n### Reflection\n\n- Type: `object`\n- Required fields: none\n- Purpose: Reflection below the shape (a:reflection).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `opacity` | no | `number` | Opacity where the reflection starts. |\n| `size` | no | `number` | Share of the shape's height reflected. |\n| `distance` | no | `number` | Gap between the shape and its reflection in reference pixels at a 720-pixel short edge. |\n| `blur` | no | `number` | Blur radius in reference pixels at a 720-pixel short edge. |\n\n\n### ImageRecolor\n\n- Type: `oneOf:const:\"grayscale\" / object`\n- Required fields: none\n- Purpose: Color treatment for the image pixels. Luminance uses Rec. 601 weights (0.299, 0.587, 0.114) on sRGB values.\n\n_No named properties._\n\n\n### PatternBackground\n\n- Type: `object`\n- Required fields: `type`, `pattern`\n- Purpose: Fixed pattern slide background fill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"pattern\"` | Fixed pattern background fill. |\n| `pattern` | yes | `object` | Pattern fill definition. |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### OrganizationLogo\n\n- Type: `object`\n- Required fields: none\n- Purpose: An organization's logo in up to four shapes. Each shape is a path or Asset, or { onLight, onDark } for the two backgrounds. A missing shape falls back to full, and full to the first defined of wordmark, stacked and icon; within a shape a missing onLight or onDark uses the other. Shapes are placed with slide-scoped references such as 'var:organization.logo.icon'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `full` | no | `ref:LogoSource` | The full logo (lockup): mark and name side by side. Drawn on cover and section slides, and placed by 'var:organization.logo'. |\n| `stacked` | no | `ref:LogoSource` | The stacked lockup: mark above the name, for portrait or square slots. Placed by 'var:organization.logo.stacked'. |\n| `icon` | no | `ref:LogoSource` | The mark or symbol without the name, for tight spaces such as header and footer zones and picture bullets. Placed by 'var:organization.logo.icon'. |\n| `wordmark` | no | `ref:LogoSource` | The name set in the brand's lettering, without the mark. Placed by 'var:organization.logo.wordmark'. |\n\n\n### LogoSource\n\n- Type: `oneOf:ref:Asset / object`\n- Required fields: none\n- Purpose: One logo shape: a path or Asset for every background, or { onLight, onDark }. onLight is drawn on light backgrounds (usually dark artwork) and onDark on dark backgrounds (usually light artwork), by each slide's background; a missing one uses the other.\n\n_No named properties._\n\n\n### Watermark\n\n- Type: `oneOf:schema / schema`\n- Required fields: `opacity`\n- Purpose: Decorative watermark: an image ('src') or a text stamp ('text'), exactly one of the two, with its opacity. An image is drawn once per slide, contained and centered in a fixed frame (the middle 40% of the slide width and height, from 30% to 70% on each axis). A text watermark is one line of text in the heading font and the theme text color at the given opacity, centered on the slide and rotated 30 degrees counterclockwise (rising to the right), sized to span at most 70% of the slide width and...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `src` | no | `string` | Source for the watermark image: an 'asset:<id>' reference, HTTPS URL, data URI, relative path or local path, as for Asset.src. Exactly one of src and text is set. |\n| `text` | no | `string` | Text for a text watermark, such as DRAFT or CONFIDENTIAL; line breaks are drawn as spaces. Exactly one of src and text is set. |\n| `opacity` | yes | `number` | Watermark opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### HeaderFooter\n\n- Type: `object`\n- Required fields: none\n- Purpose: Repeated header or footer content split into start, center, and end zones. The zones follow the deck's direction: 'start' is at the left of a left-to-right deck and at the right of a right-to-left one. Header/footer content is slide furniture, separate from the main slide content payloads.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `start` | no | `ref:HeaderFooterItem` | Content at the start edge, aligned to it. |\n| `center` | no | `ref:HeaderFooterItem` | Centered header/footer content. |\n| `end` | no | `ref:HeaderFooterItem` | Content at the end edge, aligned to it. |\n\n\n### HeaderFooterItem\n\n- Type: `object`\n- Required fields: none\n- Purpose: One header/footer zone. Every configured field renders, side by side in one row in the order image, text, socials, date (mirrored in a right-to-left deck), aligned to the zone's edge (the start edge, the center or the end edge) and vertically centered on each other; a line break inside text or socials ('\\n') stacks lines within that part. When the parts are wider than the zone their text wraps, and a row that cannot fit even so is reported as overflow. Generated values such as the slide numbe...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `text` | no | `string` | Text rendered in this zone. Variables resolve inside it like any string: deck-wide ones ('{{organization.name}}', '{{speaker.name}}, {{speaker.title}}', '{{customer}}') before composition, and the slide-scoped built-i... |\n| `image` | no | `ref:Asset` | Image rendered first in this zone's row, such as a logo, partner mark, certification badge, or icon: a path, URL or Asset, or an organization logo reference ('var:organization.logo.icon', 'var:organization.<id>.logo.w... |\n| `date` | no | `oneOf:boolean / string` | true renders the current date: the renderer or exporter must be given an explicit ISO date by its host (core never reads a clock). PPTX export writes a native date field only for a supported dateFormat whose complete... |\n| `dateFormat` | no | `string` | Date pattern for date. Tokens: yyyy (2026), yy (26), MMMM (April), MMM (Apr), MM (04), M (4), dd (09), d (9), EEEE (Thursday), EEE (Thu). Text in single quotes and other non-letter characters are literal. Month and we... |\n| `socials` | no | `boolean` | Whether to render the primary organization's social profiles from organization.socials, one line per platform in key order. A handle is formatted through the platform's socialPlatforms record (companyUrlPattern, else... |\n\n\n### OverlayShape\n\n- Type: `object`\n- Required fields: none\n- Purpose: An entry of slide 'shapes', drawn over the composed slide above the content and the furniture, later entries on top; it never moves content. An entry with 'connector' is a connector between two blocks or overlay shapes: it takes only 'id', 'connector', 'adjust', 'stroke', 'alt', 'decorative', 'hidden' and 'extensions'; core routes it as PowerPoint's own connector presets and PPTX export writes a native p:cxnSp glued to the shapes at its ends, so it follows them when they are moved in PowerPoi...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `string` | Optional stable identifier, unique among slide, payload and overlay ids in the document. A connector names it in 'from' or 'to'. |\n| `x` | no | `ref:FiniteNumber` | The shape's start edge as a signed fraction of the slide width, measured from the slide's start edge: the left edge in a left-to-right deck, the right edge in a right-to-left one. A shape sits over the layout, and the... |\n| `y` | no | `ref:FiniteNumber` | Top edge as a signed fraction of the slide height, from the top edge. Negative values or values greater than 1 place the shape partly or wholly outside the slide. |\n| `width` | no | `number` | Width as a fraction of the slide width, from 0 (a vertical line) up to 8. Above 1 the shape is wider than the slide, for a circle or band that bleeds off it; the slide crops what lies outside. |\n| `height` | no | `number` | Height as a fraction of the slide height, from 0 (a horizontal line) up to 8. Above 1 the shape is taller than the slide. |\n| `at` | no | `ref:OverlayAnchor` | |\n| `layer` | no | `enum:front \\| back` | Overlay shapes only. front (the default) draws the shape over the slide: above the content and the furniture. back draws it behind the slide: above the background and the watermark, below the content and the furniture... |\n| `connector` | no | `ref:Connector` | Makes the entry a connector: what it joins and how it runs. |\n| `shape` | no | `ref:ShapePreset` | The preset geometry, as on a shape block. Default rect. |\n| `path` | no | `ref:ShapePath` | Custom geometry instead of a preset (a:custGeom), as on a shape block. |\n| `adjust` | no | `object` | The preset's adjust handles (a:avLst) in OPF units, as on a shape block. On a connector, the adjust values of its connector preset (adj1 of an elbow or a curve between sites on one axis, a fraction of the frame's widt... |\n| `fill` | no | `ref:ShapeFill` | 'none', a ColorRef, { gradient } or { pattern }. Default the style's fill. |\n| `opacity` | no | `number` | The fill's opacity (a:alpha). Default 1. |\n| `stroke` | no | `ref:Stroke` | A shape's line along its outline (default the style's line), or a connector's line: color, width, dash, compound, sketch and arrowheads ('start' at 'from', 'end' at 'to'; default a 2-pixel line in the slide's text col... |\n| `style` | no | `enum:none \\| subtle \\| moderate \\| intense` | The theme shape style, as on a shape block. Default moderate. |\n| `shadow` | no | `ref:Shadow` | Outer shadow. |\n| `innerShadow` | no | `ref:InnerShadow` | Inner shadow. |\n| `glow` | no | `ref:Glow` | Glow. |\n| `softEdge` | no | `number` | Soft edges (a:softEdge), radius in reference pixels at a 720-pixel short edge. |\n| `reflection` | no | `ref:Reflection` | Reflection. |\n| `blur` | no | `number` | Blur of the whole shape (a:blur), radius in reference pixels at a 720-pixel short edge. |\n| `rotate` | no | `number` | Rotation in degrees, clockwise, about the shape's center (a:xfrm rot). Its connection sites turn with it. |\n| `flip` | no | `enum:horizontal \\| vertical \\| both` | Mirror the geometry (a:xfrm flipH, flipV). The text is not mirrored. |\n| `text` | no | `ref:text` | Text inside the shape's text rectangle (a string or TextRun[]), fitted by OPF's measured fonts from the body size down to the readability floor and never below it. |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical placement of the text in the text rectangle (a:bodyPr anchor). Default middle. |\n| `padding` | no | `ref:ShapePadding` | Text insets inside the text rectangle. |\n| `textDirection` | no | `enum:horizontal \\| vertical \\| vertical270 \\| stacked` | Text direction (a:bodyPr vert). Default horizontal. |\n| `alt` | no | `string` | Alternative text (p:cNvPr descr). Without it the shape's text is what is read. |\n| `decorative` | no | `boolean` | Mark the shape decorative (a16:decorative): screen readers skip it. |\n| `hidden` | no | `boolean` | Keep the shape in the file but do not draw it (p:cNvPr hidden). A link on a hidden shape is a validation finding (opf/shape-link-hidden). |\n| `link` | no | `string` | URL opened when the shape is clicked in a slide show (a:hlinkClick): an http(s) URL, a 'mailto:' address or a 'tel:' number. |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows; ignored by the engine but preserved across read/write round-trips. |\n\n\n### OverlayAnchor\n\n- Type: `allOf:schema + schema`\n- Required fields: `block`, `edge`\n- Purpose: Places an overlay shape against a composed block's box, so the shape follows the block wherever composition puts it. 'edge' puts the shape outside that edge, centered along it ('start' and 'end' follow the deck's direction: left and right in a left-to-right deck, right and left in a right-to-left one); 'center' puts it on the block's center. A block id that is not on the slide is a finding (opf/shape-anchor-missing) and the shape is not drawn. With point, block must carry a supported classic...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `block` | yes | `string` | The id of a block on this slide (a content payload or a group, at any depth). |\n| `edge` | yes | `enum:top \\| bottom \\| start \\| end \\| center` | The edge of the block the shape sits outside of, or its center. |\n| `offset` | no | `number` | The gap between the block's edge and the shape, in reference pixels at a 720-pixel short edge; a negative offset overlaps the block. Default 0. Ignored for 'center'. |\n| `width` | no | `number` | The shape's width as a fraction of its target's width: the block's box, or with 'point' the chart mark's bounds. 1 is the target's own width and 1.08 a frame 8% wider, up to 8. For a size in pixels use 'widthPx'; not... |\n| `height` | no | `number` | The shape's height as a fraction of its target's height, up to 8. For a size in pixels use 'heightPx'; not both. Default as for width. |\n| `widthPx` | no | `number` | The shape's width in reference pixels at a 720-pixel short edge, whatever size its target has: a badge or a ring of a fixed size. Instead of 'width'. |\n| `heightPx` | no | `number` | The shape's height in reference pixels at a 720-pixel short edge. Instead of 'height'. |\n| `point` | no | `oneOf:string / integer` | Exact unique category label or zero-based data row index of the chart. Numeric strings name labels; numbers index rows. Empty/duplicate labels can be selected by index. Requires a supported classic chart block. |\n| `series` | no | `oneOf:string / integer` | Exact unique plotted value-column name or zero-based plotted-series index; omission selects the first plotted series. Requires point. Scatter X is not a value series. |\n\n\n### Connector\n\n- Type: `object`\n- Required fields: `from`, `to`\n- Purpose: What a connector joins and how it runs. Each end attaches to a connection site of its shape: a preset's own sites (turned and flipped with the shape), or the four edge midpoints of a block that is not a shape (DrawingML's rect: 0 top, 1 left, 2 bottom, 3 right). Without 'fromSite' and 'toSite' core chooses the pair of sites that face each other with the shortest route.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `from` | yes | `string` | The id of the block or overlay shape on this slide the connector starts at. An id that is not on the slide is a finding (opf/connector-end-missing) and the connector is not drawn. |\n| `to` | yes | `string` | The id of the block or overlay shape on this slide the connector ends at. |\n| `route` | no | `enum:straight \\| elbow \\| curved` | straight is one segment (straightConnector1); elbow runs horizontally and vertically (bentConnector3, bentConnector2 between perpendicular sites); curved is PowerPoint's curved connector (curvedConnector3, curvedConne... |\n| `fromSite` | no | `integer` | The connection site index at 'from' (DrawingML's cxn idx), instead of the automatic choice. An index the shape does not have is a validation error. |\n| `toSite` | no | `integer` | The connection site index at 'to', instead of the automatic choice. |\n\n\n### Slide\n\n- Type: `object`\n- Required fields: none\n- Purpose: A single slide. Content can be authored as a full-slide root payload, or inside promoted named region keys such as 'start', 'center+end', and 'top:start'. The columns of that grid are logical: 'start' is the left column in a left-to-right deck and the right column in a right-to-left one.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `string` | Optional stable identifier for the slide within the document. Use when another system needs to reference a slide across edits, comments, generation state, exports, or narrative tooling. Slide order is defined by the s... |\n| `language` | no | `oneOf:ref:LanguageTag / ref:Language` | Language of this slide, overriding the presentation language. Accepts the same BCP-47 tag or inline Language object as the presentation. Omission inherits the deck language. Direction, script fonts, quotation marks, l... |\n| `type` | no | `enum:text \\| list \\| image \\| chart \\| table \\| video \\| code \\| metric \\| quote \\| timeline \\| diagram` | Optional full-slide content kind. When omitted, engines infer the kind from root payload fields. |\n| `beat` | no | `oneOf:string / array<string>` | Optional reference to one or more beats of the deck's narrative (each value is the id of a beat in the narrative record that the root 'narrative' resolves to). A single string declares the slide's primary beat; an arr... |\n| `layout` | no | `ref:CatalogReference` | Optional layout: a layouts reference, a bare id ('pillars') or 'name:id' ('acme:hero'), or 'auto'. When omitted or 'auto', the slide is composed with no layout record: engines arrange title, subtitle, tag and content... |\n| `title` | no | `oneOf:string / array<ref:TextRun>` | Slide-level title content. A v2 layout renders this in its title heading area, or an implicit heading row when that area is absent. Use a string for plain text or TextRun[] for inline rich text (a colored word, bold,... |\n| `subtitle` | no | `oneOf:string / array<ref:TextRun>` | Slide-level subtitle or supporting line. A v2 layout renders this in its subtitle area when present, otherwise in the title heading group. Use a string for plain text or TextRun[] for inline rich text (a colored word,... |\n| `tag` | no | `oneOf:string / array<ref:TextRun>` | Small slide-level label or badge. A v2 layout renders this before the title in its title heading group; tag is not a separate layout area. Engines draw it as an eyebrow: 22 reference pixels, bold, in the primary color... |\n| `text` | no | `oneOf:string / array<ref:TextRun>` | Full-slide text payload. Use a string for plain text or TextRun[] for inline rich text. TextRun items may be plain strings or formatted run objects. |\n| `items` | no | `array<ref:ListItem>` | Full-slide structured list payload. Presence of this field infers type 'list'. Entries are strings, TextRun[] or objects with `text`, optional `description` (supporting detail under the entry), `level` and `start`. Us... |\n| `bullets` | no | `array<ref:BulletItem>` | Full-slide prose bullet payload: short talking points, each standing alone. Presence of this field infers type 'text', so it may sit beside `text` in one payload. Entries are strings, TextRun[] or objects with `text`,... |\n| `numbering` | no | `ref:NumberingSpec` | Number the full-slide `items` or `bullets` instead of bulleting them. A style name (arabic, roman-upper, roman-lower, alpha-upper, alpha-lower) or a Numbering object applies to every list level; an array gives one ent... |\n| `image` | no | `ref:ImagePayload` | Shorthand for one image block: the picture composes as body content, like { type: 'image', image: value }, with the effective design.imageFit. A v2 layout binds it to a compatible body region; a region's bleed setting... |\n| `video` | no | `ref:Asset` | Full-slide video source. Presence of this field infers type 'video'. Engines do not play video: the preview draws a placeholder (a play badge with the asset's title or source as its caption), and PPTX export draws the... |\n| `chart` | no | `ref:Chart` | Full-slide chart payload. Presence of this field infers type 'chart'. |\n| `table` | no | `ref:Table` | Full-slide table payload. Presence of this field infers type 'table'. |\n| `code` | no | `oneOf:string / ref:Code` | Full-slide code payload. A string is shorthand for { \"source\": value }; object form carries optional syntax language and filename metadata. |\n| `metric` | no | `oneOf:string / number / ref:Metric` | Full-slide metric payload. A string or number is shorthand for { \"value\": value }; object form carries optional label, description, unit, delta, trend, and sentiment metadata. Numeric values remain numbers; renderers... |\n| `quote` | no | `oneOf:string / ref:Quote` | Full-slide quote payload. A string is shorthand for { \"text\": value }; object form carries optional attribution and source metadata. Presence of this field infers type 'quote'. |\n| `timeline` | no | `ref:Timeline` | Full-slide timeline payload. An array is shorthand for { \"events\": value }; object form carries optional name and description metadata. Presence of this field infers type 'timeline'. |\n| `diagram` | no | `oneOf:string / ref:Diagram` | Full-slide diagram payload: Mermaid, Graphviz DOT or PlantUML source drawn in the deck's fonts and colors. A string is shorthand for { \"source\": value }; object form carries the source syntax and a text alternative. P... |\n| `caption` | no | `ref:Caption` | Caption for the slide's root image, chart, table, video or diagram payload. Valid only when the slide root holds exactly one of those payloads. |\n| `blocks` | no | `array<ref:ContentPayload>` | Layout-agnostic content blocks rendered together as a composed payload when exact placement is unspecified. At slide root, multiple content payload kinds with no explicit type, blocks, or regions are accepted as short... |\n| `shapes` | no | `array<ref:OverlayShape>` | Shapes and connectors drawn over the composed slide, above its content and furniture, in array order (later entries on top). They never move content. An entry with connector is a connector between two blocks or overla... |\n| `design` | no | `ref:SlideDesign` | Slide-level design applied on top of the deck-wide design. |\n| `start` | no | `ref:ContentPayload` | |\n| `center` | no | `ref:ContentPayload` | |\n| `end` | no | `ref:ContentPayload` | |\n| `start+center` | no | `ref:ContentPayload` | |\n| `center+end` | no | `ref:ContentPayload` | |\n| `start+center+end` | no | `ref:ContentPayload` | |\n| `top` | no | `ref:ContentPayload` | |\n| `middle` | no | `ref:ContentPayload` | |\n| `bottom` | no | `ref:ContentPayload` | |\n| `top+middle` | no | `ref:ContentPayload` | |\n| `middle+bottom` | no | `ref:ContentPayload` | |\n| `top+middle+bottom` | no | `ref:ContentPayload` | |\n| `top:start` | no | `ref:ContentPayload` | |\n| `top:center` | no | `ref:ContentPayload` | |\n| `top:end` | no | `ref:ContentPayload` | |\n| `top:start+center` | no | `ref:ContentPayload` | |\n| `top:center+end` | no | `ref:ContentPayload` | |\n| `top:start+center+end` | no | `ref:ContentPayload` | |\n| `middle:start` | no | `ref:ContentPayload` | |\n| `middle:center` | no | `ref:ContentPayload` | |\n| `middle:end` | no | `ref:ContentPayload` | |\n| `middle:start+center` | no | `ref:ContentPayload` | |\n| `middle:center+end` | no | `ref:ContentPayload` | |\n| `middle:start+center+end` | no | `ref:ContentPayload` | |\n| `bottom:start` | no | `ref:ContentPayload` | |\n| `bottom:center` | no | `ref:ContentPayload` | |\n| `bottom:end` | no | `ref:ContentPayload` | |\n| `bottom:start+center` | no | `ref:ContentPayload` | |\n| `bottom:center+end` | no | `ref:ContentPayload` | |\n| `bottom:start+center+end` | no | `ref:ContentPayload` | |\n| `top+middle:start` | no | `ref:ContentPayload` | |\n| `top+middle:center` | no | `ref:ContentPayload` | |\n| `top+middle:end` | no | `ref:ContentPayload` | |\n| `top+middle:start+center` | no | `ref:ContentPayload` | |\n| `top+middle:center+end` | no | `ref:ContentPayload` | |\n| `top+middle:start+center+end` | no | `ref:ContentPayload` | |\n| `middle+bottom:start` | no | `ref:ContentPayload` | |\n| `middle+bottom:center` | no | `ref:ContentPayload` | |\n| `middle+bottom:end` | no | `ref:ContentPayload` | |\n| `middle+bottom:start+center` | no | `ref:ContentPayload` | |\n| `middle+bottom:center+end` | no | `ref:ContentPayload` | |\n| `middle+bottom:start+center+end` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:start` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:center` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:end` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:start+center` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:center+end` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:start+center+end` | no | `ref:ContentPayload` | |\n| `notes` | no | `string` | Speaker notes shown in presenter view. |\n| `section` | no | `string` | PowerPoint-style slide section label. Consecutive slides with the same value belong to the same section in presenter view, outlines, and PowerPoint section-aware exports. Also the slide-scoped built-in variable '{{sli... |\n| `hidden` | no | `boolean` | Whether the slide is hidden from the presented sequence. The player skips it, the PPTX export writes it as a hidden slide, and per-slide image and PDF output skips it unless the caller asks to include hidden slides (o... |\n| `composition` | no | `ref:Composition` | |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows at slide scope; ignored by the engine but preserved across read/write round-trips. Use for review state, generation provenance, or authoring conventions such as { \"authoring... |\n\n\n### ImageBlockOption\n\n- Type: `schema`\n- Required fields: `image`\n- Purpose: An option of image blocks only (fit, focus, recolor, overlay, placement, portrait): the block must hold an 'image'.\n\n_No named properties._\n\n\n### ImageOrShapeBlockOption\n\n- Type: `anyOf:schema / schema / schema`\n- Required fields: none\n- Purpose: An option of image blocks and shape blocks (aspectRatio, adjust, stroke, opacity): the block must hold an 'image', a 'shape' or a 'path'.\n- Conditional requirement: `image` or `shape` or `path`\n\n_No named properties._\n\n\n### ShapeBlockOption\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: An option of shape blocks only (fill, style, rotate, flip, the text frame, accessibility, link and the six effects): the block must be a shape block, which is a 'shape' with no 'image', or a 'path'.\n- Conditional requirement: `shape` or `path`\n\n_No named properties._\n\n\n### ContentPayload\n\n- Type: `allOf:schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema`\n- Required fields: none\n- Purpose: A content leaf or recursively composed group. A group contains blocks and optional composition; it cannot mix blocks with leaf payload fields. Groups may nest up to 32 levels.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `string` | Optional stable identifier for this payload, unique among slide and payload ids in the document. Use when another system needs to address the payload across edits patch-style agent edits, comments, review state, or ge... |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows at payload scope; ignored by the engine but preserved across read/write round-trips. |\n| `region` | no | `string` | Pin a root block (slides.N.blocks.I) to a region of the slide's template layout by name. The block goes to that region when the region exists, accepts the block's kind and has room; otherwise the pin is ignored with a... |\n| `type` | no | `enum:text \\| list \\| image \\| chart \\| table \\| video \\| code \\| metric \\| quote \\| timeline \\| diagram \\| shape \\| group` | Optional content kind. When omitted, engines infer the kind from the fields present: a block with 'shape' and no 'image', or with 'path', is a shape block. |\n| `text` | no | `oneOf:string / array<ref:TextRun>` | Text payload. Use a string for plain text or TextRun[] for inline rich text. TextRun items may be plain strings or formatted run objects. |\n| `items` | no | `array<ref:ListItem>` | Structured list payload (type 'list'). Each item is either a plain string, a TextRun[] rich text sequence, or a ListItem object with optional `description`. List nesting uses item.level rather than nested content payl... |\n| `bullets` | no | `array<ref:BulletItem>` | Prose bullet payload: short talking points, each standing alone. Presence of this field infers type 'text', so it may sit beside `text` in one payload. Entries have no `description`; use `items` for entries with suppo... |\n| `numbering` | no | `ref:NumberingSpec` | Number the payload's `items` or `bullets` instead of bulleting them. A style name (arabic, roman-upper, roman-lower, alpha-upper, alpha-lower) or a Numbering object applies to every list level; an array gives one entr... |\n| `columns` | no | `oneOf:const:\"auto\" / integer` | Lay the payload's `items` or `bullets` out in columns. 'auto' tries 1, 2 then 3 equal columns at the starting text size and uses the first count at which the list fits, as long as a column stays at least a quarter of... |\n| `image` | no | `ref:ImagePayload` | Source for an image item. |\n| `fit` | no | `enum:cover \\| contain \\| stretch \\| auto` | Image payloads only. How the picture fills its frame: 'cover' fills it and crops what overflows around focus; 'contain' shows the whole picture, in a frame of its own proportions placed at the region's anchor (top by... |\n| `focus` | no | `ref:ImageFocus` | Image payloads only. Point of the picture to keep in view when 'cover' crops it. Ignored by the other fits. Without a focus a portrait picture (taller than wide) cropped into a wider frame keeps y 0.3 so heads stay in... |\n| `aspectRatio` | no | `number` | Image payloads only. Width-to-height ratio of the frame: the frame becomes the largest centered box with this ratio inside the block's region, for example 2.39 for a cinematic letterbox or 0.5 for a phone-shaped frame... |\n| `shape` | no | `ref:ShapePreset` | The preset geometry. Without 'image' it makes the block a shape block: the preset drawn at the block's own fitted size with 'fill', 'stroke' and 'style', and 'text' inside its text rectangle. On an image block it is t... |\n| `stroke` | no | `ref:Stroke` | Shape and image blocks. The line along the outline: a shape's outline or the picture frame's shape (renamed from the picture key 'border' in 0.33, no alias). Without it a shape takes its style's line; a picture has none. |\n| `path` | no | `ref:ShapePath` | Shape blocks only. Custom geometry instead of a preset (a:custGeom): SVG path data in a 0 to 1 box, or { d, viewBox }. A block with 'path' is a shape block. |\n| `fill` | no | `ref:ShapeFill` | Shape blocks only. 'none', a ColorRef, { gradient } or { pattern }. Default the style's fill. |\n| `style` | no | `enum:none \\| subtle \\| moderate \\| intense` | Shape blocks only. The theme shape style, as PowerPoint's shape styles (p:style with a:lnRef, a:fillRef, a:effectRef and a:fontRef): subtle is a light tint of accent1 with an accent1 line and dark text, moderate (the... |\n| `rotate` | no | `number` | Shape blocks only. Rotation in degrees, clockwise, about the shape's center (a:xfrm rot). Composition keeps the unrotated box; the rotated outline may reach past it. |\n| `flip` | no | `enum:horizontal \\| vertical \\| both` | Shape blocks only. Mirror the geometry (a:xfrm flipH, flipV). The text is not mirrored. |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Shape blocks only. Vertical placement of the text in the text rectangle (a:bodyPr anchor t, ctr, b). Default middle. |\n| `padding` | no | `ref:ShapePadding` | Shape blocks only. Text insets inside the text rectangle. |\n| `textDirection` | no | `enum:horizontal \\| vertical \\| vertical270 \\| stacked` | Shape blocks only. Text direction (a:bodyPr vert horz, vert, vert270, wordArtVert): vertical turns the text 90 degrees clockwise, vertical270 270, stacked stacks the letters top to bottom. Default horizontal. |\n| `alt` | no | `string` | Shape blocks only. Alternative text for screen readers (p:cNvPr descr). Without it a shape's text is what is read. |\n| `decorative` | no | `boolean` | Shape blocks only. Mark the shape decorative (a16:decorative): screen readers skip it and the accessibility checker does not ask for alt text. |\n| `hidden` | no | `boolean` | Shape blocks only. Keep the shape in the file but do not draw it (p:cNvPr hidden). Composition still gives it its room. A link on a hidden shape cannot be clicked and is a validation finding (opf/shape-link-hidden). |\n| `link` | no | `string` | Shape blocks only. URL opened when the shape is clicked in a slide show (a:hlinkClick): an http(s) URL, a 'mailto:' address or a 'tel:' number. |\n| `shadow` | no | `ref:Shadow` | Shape blocks only. Outer shadow. |\n| `innerShadow` | no | `ref:InnerShadow` | Shape blocks only. Inner shadow. |\n| `glow` | no | `ref:Glow` | Shape blocks only. Glow. |\n| `softEdge` | no | `number` | Shape blocks only. Soft edges (a:softEdge): the radius over which the outline fades, in reference pixels at a 720-pixel short edge. |\n| `reflection` | no | `ref:Reflection` | Shape blocks only. Reflection. |\n| `blur` | no | `number` | Shape blocks only. Blur of the whole shape (a:blur), radius in reference pixels at a 720-pixel short edge. |\n| `adjust` | no | `object` | Shape and image blocks. The preset's adjust handles (a:avLst), named as DrawingML's guides (adj, adj1, adj2 ... and hexagon's vf): fractions of the shape's shorter side or of its size as the preset defines them, degre... |\n| `opacity` | no | `number` | Image and shape blocks. On an image: the picture's opacity, exported as a native alphaModFix; the stroke and overlay keep their own. On a shape: the fill's opacity (a:alpha on the fill color, multiplied with an eight-... |\n| `recolor` | no | `ref:ImageRecolor` | Image payloads only. Grayscale or duotone treatment of the picture's pixels. |\n| `overlay` | no | `ref:Overlay` | Image payloads only. Scrim over the picture in the frame's shape, or a band along one edge of a rectangle frame. |\n| `placement` | no | `ref:ImagePlacement` | Image payloads only, and only on a top-level block (slides.N.blocks.I), at most one per edge. Bleeds the image to one slide edge; the headings and the other blocks compose in the rest of the slide. |\n| `portrait` | no | `enum:avatar \\| side \\| top` | Image payloads only: how a person's picture is drawn in a team. A person is a group of a picture followed by a name (a list of one entry, whose description holds the role and a line, or a short text); a slide whose bo... |\n| `video` | no | `ref:Asset` | Source for a video item. Engines do not play video: the preview draws a placeholder (a play badge with the asset's title or source as its caption), and PPTX export draws the same placeholder as native shapes linked to... |\n| `chart` | no | `ref:Chart` | Chart payload. Presence of this field infers type 'chart'. |\n| `table` | no | `ref:Table` | Table payload. Presence of this field infers type 'table'. |\n| `code` | no | `oneOf:string / ref:Code` | Code payload. A string is shorthand for { \"source\": value }; object form carries optional syntax language and filename metadata. |\n| `metric` | no | `oneOf:string / number / ref:Metric` | Metric payload. A string or number is shorthand for { \"value\": value }; object form carries optional label, description, unit, delta, trend, and sentiment metadata. Numeric values remain numbers; renderers format them... |\n| `quote` | no | `oneOf:string / ref:Quote` | Quote payload. A string is shorthand for { \"text\": value }; object form carries optional attribution, role, photo and source metadata. |\n| `timeline` | no | `ref:Timeline` | Timeline payload ordered by narrative or chronology. |\n| `diagram` | no | `oneOf:string / ref:Diagram` | Diagram payload: Mermaid source (flowchart, sequence, state, class, ER, mindmap, timeline, journey, C4, architecture and the other built-in Mermaid families), or Graphviz DOT or PlantUML source with 'syntax', drawn in... |\n| `caption` | no | `ref:Caption` | Caption for an image, chart, table, video or diagram payload, composed inside the block's region (below the media by default). Invalid on other payload kinds and on groups. |\n| `blocks` | no | `array<ref:ContentPayload>` | Ordered children of a group. Each child is a leaf or another group. |\n| `composition` | no | `ref:Composition` | Arrangement within this group. Only minFontSize, maxFontSize and overflow inherit from the parent; strict overflow cannot be weakened. |\n| `emphasis` | no | `boolean` | true draws this block or group on the slide's emphasis surface: a contrasting card in its cell (a dark card on a light slide, an accent card on a dark one), from the deck's own scheme slots, with every text color on i... |\n| `icon` | no | `ref:IconReference` | Groups only: an icon drawn on a chip at the top of the group, before its heading, as a card of features or topics draws one: \"<set>:<name>\" (\"lucide:shield-check\"), a name from the deck's icons, or an SVG source. A li... |\n\n\n### Quote\n\n- Type: `object`\n- Required fields: `text`\n- Purpose: Quote content with optional attribution metadata. Use 'text' for the quoted text, 'attribution' for the credited person or organization, 'role' for that person's title and organization, 'photo' for their headshot and 'source' for a citation or URL. A string value in a quote field is shorthand for { \"text\": value }.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `text` | yes | `oneOf:string / array<ref:TextRun>` | Quoted text: a string, or TextRun[] for inline rich text (a colored phrase, bold, a link, or a citation or footnote marker). The engine draws the surrounding quotation marks. |\n| `attribution` | no | `string` | Person or organization credited for the quote. Drawn after the quote text, in the muted text color. |\n| `role` | no | `string` | Title and organization of the attributed person. Drawn on its own line under the attribution; without an attribution it stands alone. It does not replace the attribution, so the person's name belongs in 'attribution'. |\n| `photo` | no | `ref:Asset` | Headshot of the attributed person, drawn as a circle beside the attribution and role lines (on the logical start side: left in a left-to-right deck, right in a right-to-left deck), or as a tall portrait beside the quo... |\n| `portrait` | no | `enum:avatar \\| side` | How the `photo` is drawn. 'side' draws it as a tall picture at the start of the quote (about a quarter of its width, rounded, cropped around the upper third), the quote text beside it and centered against it; 'avatar'... |\n| `source` | no | `string` | Optional quote source, citation, or URL. Follows the attribution and role after ' - '. |\n\n\n### Code\n\n- Type: `object`\n- Required fields: `source`\n- Purpose: Code content with optional rendering metadata. Use 'source' for the code text, 'language' for syntax highlighting, 'filename' when the rendered block should show a file label, and 'highlight' to emphasize lines. A string value in a code field is shorthand for { \"source\": value }.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `source` | yes | `string` | Source code text to display. |\n| `language` | no | `string` | Language identifier used for syntax highlighting. |\n| `filename` | no | `string` | Optional file label shown with the code block. |\n| `highlight` | no | `array<oneOf:integer / array<integer>>` | Source lines to emphasize, 1-based: each entry is a line number or an inclusive [start, end] range, so [3, [5, 7]] marks lines 3 and 5 to 7. Lines are counted by line break in 'source', so a line that wraps stays one... |\n\n\n### Metric\n\n- Type: `object`\n- Required fields: `value`\n- Purpose: Metric content with optional display metadata. Use 'value' for the primary value, 'label' for the metric name, 'description' for supporting context, 'unit' for a suffix/currency marker, 'delta' for change, 'trend' for direction, and 'sentiment' for whether the change is good news. A string or number value in a metric field is shorthand for { \"value\": value }; numeric values remain numbers and are formatted by renderers.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `value` | yes | `oneOf:string / number` | Primary metric value. |\n| `label` | no | `string` | Metric label. |\n| `description` | no | `string` | Optional supporting context for the metric. |\n| `unit` | no | `string` | Metric unit, suffix, or currency marker. |\n| `delta` | no | `oneOf:string / number` | Metric change value. |\n| `trend` | no | `enum:up \\| down \\| flat` | Metric trend direction. The preview and the PowerPoint export draw it as an arrow that always points the way the trend does (up, down or flat), before the delta on its line (or before the label without a delta), and c... |\n| `sentiment` | no | `enum:positive \\| negative \\| neutral` | Whether the change is good news. Positive draws the trend arrow and the trend and delta text in green, negative in red and neutral in the neutral text colour, each kept at 4.5:1 contrast or more against the slide back... |\n| `icon` | no | `ref:IconReference` | An icon drawn on a chip above the metric: \"<set>:<name>\" (\"lucide:users\"), a name from the deck's icons, or an SVG source. Decoration only: when the slide has no room for it without setting text smaller, it is not dra... |\n\n\n### Diagram\n\n- Type: `object`\n- Required fields: `source`\n- Purpose: A diagram written as text (Mermaid, Graphviz DOT or PlantUML), laid out with the deck's measured fonts and resolved colors at the largest type size that fits. PPTX export defaults to editable native shapes, connectors and text in one group for qualified families; unsupported families or drawing constructs use an SVG picture with a PNG fallback. The diagrams: \"picture\" option always uses that picture form. A string diagram is shorthand for { \"source\": value }.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `source` | yes | `string` | The diagram source. With syntax 'mermaid' (the default) it is Mermaid 12.1 text whose first line names the diagram type (flowchart, sequenceDiagram, classDiagram, stateDiagram-v2, erDiagram, gantt, pie, mindmap, timel... |\n| `syntax` | no | `enum:mermaid \\| dot \\| plantuml` | The language of 'source': 'mermaid' (Mermaid 12.1, the default), 'dot' (Graphviz DOT, drawn with the layered layout) or 'plantuml' (PlantUML, drawn as the Mermaid family of the same kind). OPF reads all three itself;... |\n| `alt` | no | `string` | Text alternative that says what the diagram shows. Exported as the description of the native shape group or picture. Without it, engines derive one from the diagram's labels. |\n\n\n### Timeline\n\n- Type: `oneOf:array<ref:TimelineEvent> / object`\n- Required fields: none\n- Purpose: Timeline content. An array is shorthand for { \"events\": value }; object form carries optional name and description metadata.\n\n_No named properties._\n\n\n### TimelineEvent\n\n- Type: `object`\n- Required fields: `what`\n- Purpose: A single event inside a timeline content payload.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `when` | no | `string` | Event time, date, or sequence label. Use ISO-like values when possible, but human labels are allowed for quarters, eras, and relative milestones. |\n| `duration` | no | `number` | Relative length of this consecutive event period. Use the same unit for every event (for example 1 for Week 1 and 4 for Weeks 2 5). Omitted means one unit. When any event supplies duration, both engines draw proportio... |\n| `what` | yes | `string` | Short event label. |\n| `description` | no | `string` | Optional event detail. |\n| `status` | no | `enum:done \\| current \\| planned` | Progress of the event, drawn from the deck's own colors by both the SVG renderer and the PPTX exporter. Absent means no status and the event is drawn as a plain filled marker with normal text, which is also how 'done'... |\n\n\n### ListItem\n\n- Type: `oneOf:string / array<ref:TextRun> / object`\n- Required fields: none\n- Purpose: A flat item inside a list. Strings cover the common case, TextRun[] supports inline rich text without an object wrapper, and object form adds description and nesting depth without creating nested slide content payloads.\n\n_No named properties._\n\n\n### BulletItem\n\n- Type: `oneOf:string / array<ref:TextRun> / object`\n- Required fields: none\n- Purpose: A flat bullet item. Strings cover the common case, TextRun[] supports inline rich text without an object wrapper, and object form adds nesting depth without list-item descriptions.\n\n_No named properties._\n\n\n### NumberingStyle\n\n- Type: `enum:arabic | roman-upper | roman-lower | alpha-upper | alpha-lower`\n- Required fields: none\n- Purpose: A list number style: 1, 2, 3; I, II, III; i, ii, iii; A, B, C; a, b, c. Alphabetic numbering past 26 repeats the letter as PowerPoint does (aa, bb, cc). Roman numerals stop at 3999; larger values are drawn in arabic with a numbering-adapted diagnostic.\n\n_No named properties._\n\n\n### Numbering\n\n- Type: `object`\n- Required fields: none\n- Purpose: Numbering of one list level.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `style` | no | `ref:NumberingStyle` | Number style. Default arabic. |\n| `start` | no | `integer` | First number counted at this level. Default 1. Native PowerPoint accepts 1 to 32767. |\n| `suffix` | no | `enum:period \\| paren \\| paren-both` | Text after the number: period (1.), paren (1)) or paren-both ((1)). Default period. |\n\n\n### NumberingSpec\n\n- Type: `oneOf:ref:NumberingStyle / ref:Numbering / array<oneOf:ref:NumberingStyle / ref:Numbering>`\n- Required fields: none\n- Purpose: The value of a numbering field: a style name or Numbering object for every level, or an array with one entry per level (at most 9, the native depth).\n\n_No named properties._\n\n\n### TextRun\n\n- Type: `oneOf:string / object`\n- Required fields: none\n- Purpose: A contiguous run of text. Strings cover unformatted spans; object form adds character formatting.\n\n_No named properties._\n\n\n### Caption\n\n- Type: `oneOf:string / array<ref:TextRun> / object`\n- Required fields: none\n- Purpose: A caption for an image, chart, table, video or diagram payload. A string or TextRun[] is the caption text placed below the media; object form adds the position and alignment.\n\n_No named properties._\n\n\n### Reference\n\n- Type: `object`\n- Required fields: `id`, `text`\n- Purpose: A source that runs cite with 'cite'. Cited references are listed in the footnote area of the slides that cite them, numbered per deck in order of first use; referencesSlide() builds an ordinary list slide of them.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Identifier runs cite. Unique within the references list. |\n| `text` | yes | `oneOf:string / array<ref:TextRun>` | The reference as it is listed: a string or TextRun[] for inline rich text. |\n| `url` | no | `string` | Optional link for the reference; a references slide links its entry to it. |\n\n\n### FiniteNumber\n\n- Type: `number`\n- Required fields: none\n- Purpose: A finite number. JSON text such as 1e999 reads as Infinity in JavaScript and YAML has .inf and .nan; these bounds reject them.\n\n_No named properties._\n\n\n### Line\n\n- Type: `anyOf:const:\"none\" / object`\n- Required fields: none\n- Purpose: A plain line: its color, width and dash, or 'none' for no line. Shared by table cell borders and chart reference lines. A shape's outline is a Stroke, which adds what only an outline has (gradient, caps, joins, compound lines, arrowheads, sketch). Every part is optional and falls back to the default of the place the line is used.\n\n_No named properties._\n\n\n### ChartReferenceLine\n\n- Type: `object`\n- Required fields: `value`\n- Purpose: One explicit reference on the chart's numeric value axis. Labels and titles never select its value, units or placement. A reference at a category or a band between two values is not expressible yet; 'axis' and a separate key are reserved for them.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `value` | yes | `ref:FiniteNumber` | Finite value in the associated data-axis units. With format 0%, 0.25 means 25%; 25 means 2500%. Every reference expands automatic bounds when needed. |\n| `axis` | no | `enum:value \\| secondary` | Secondary requires a combo chart with an actual secondary line series. |\n| `label` | no | `string` | Optional nonblank plain text, shown verbatim. Omission draws no label. |\n| `labelPosition` | no | `enum:start \\| end` | Logical endpoint. Horizontal start/end mirror in RTL; on bars they mean top/bottom. Requires label. |\n| `stroke` | no | `ref:Line` | The line's color, width and dash, or 'none' to draw only the label. Defaults: the chart-text neutral, 4/3 reference pixels (1 point) and 'dash'. The value expands the axis bounds whether or not the line is drawn. |\n\n\n### Chart\n\n- Type: `object`\n- Required fields: `type`, `data`\n- Purpose: Chart content. The chart object keeps chart-specific fields together so slides and regions do not expose loose chart fields. OPF charts are `{ type, data }` where `data` is `{ columns, rows }`: the first column holds the category labels and every further column is one series. There are no `categories`, `series`, `labels` or `datasets` keys (the Chart.js and ECharts shape); write them as columns and rows. Example: `{ \"type\": \"column\", \"data\": { \"columns\": [\"Quarter\", \"Decks\"], \"rows\": [[\"Q1\",...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `enum:100pct-stacked-area \\| 100pct-stacked-bar \\| 100pct-stacked-column \\| area \\| bar \\| box-and-whisker \\| column \\| combo \\| doughnut \\| filled-radar \\| funnel \\| histogram \\| line \\| line-with-markers \\| pareto \\| pie \\| radar \\| radar-with-markers \\| scatter \\| stacked-area \\| stacked-bar \\| stacked-column \\| stacked-line \\| stacked-line-with-markers \\| treemap \\| waterfall \\| world` | Chart type, an engine vocabulary validated directly (no catalog lookup): the chart types OPF supports natively in its preview and PPTX export, plus 'combo' (clustered columns with line series, see 'line' and 'secondar... |\n| `data` | yes | `oneOf:ref:ChartData / ref:DatasetRef` | Chart data. Inline data uses a tabular columns/rows shape; renderers convert rows to chart series internally. A DatasetRef ({ \"dataset\": \"<id>\" }) plots a top-level dataset instead. Data from a spreadsheet or file is... |\n| `mapping` | no | `ref:ChartMapping` | Optional series mapping by column name: which column is the category, which is the X column of a scatter chart, and which columns are plotted, in order. Absent keeps the positional rule (first column the category, the... |\n| `line` | no | `array<string>` | Combo charts only (type 'combo'): the plotted series, by column name, that are drawn as lines with markers; every other plotted series is drawn as clustered columns. Absent: the last plotted series is the line. A comb... |\n| `secondaryAxis` | no | `array<string>` | Combo charts only: line series, by column name, plotted against a secondary value axis at the end of the plot (the right; the left in a right-to-left deck, where the category axis runs from the right). That axis has i... |\n| `referenceLines` | no | `array<ref:ChartReferenceLine>` | Explicit numeric references on the chart's value axis, supported on the chart types with one value axis for every series: column, bar, line, line-with-markers, area and combo. A non-empty list on any other type (the s... |\n| `axisTitles` | no | `ref:ChartAxisTitles` | Optional axis titles. Absent keeps today's untitled axes. Supported on the chart types that have a category/value (or X/Y) axis pair (column, bar, line, area, scatter, and the histogram, pareto, waterfall and box-and-... |\n| `legend` | no | `enum:none \\| top \\| bottom \\| left \\| right` | Optional legend position. 'none' hides the legend. Absent leaves it to the engines: a line chart of two to four series names its series at the line ends and a pie or one-series doughnut names its slices, with no legen... |\n| `dataLabels` | no | `oneOf:boolean / ref:ChartDataLabels` | Optional data labels. true shows value labels at each type's default position and false shows none. Absent leaves it to the engines: no labels, except on a small chart, which labels its values in place of its value ax... |\n| `alt` | no | `string` | Text alternative for the chart: what the data shows (the point and the key numbers), not 'a chart' or 'bar chart'. The preview exposes it as the chart's accessible name (role img with aria-label) and the PowerPoint ex... |\n| `colors` | no | `array<ref:ColorRef>` | Optional series colors, by position: entry i replaces palette color i, the color of series i (the i-th plotted value column), of slice or category i on a pie, doughnut, treemap or funnel chart, and of the i-th color a... |\n| `highlight` | no | `ref:ChartHighlight` | Optional emphasis: the series and/or categories that carry the message. The engines draw the highlighted marks in the deck's primary (accent) color and every other mark in a muted neutral derived from the theme (a lig... |\n\n\n### ChartAxisTitles\n\n- Type: `object`\n- Required fields: none\n- Purpose: Titles for the axes of a chart. 'category' is the axis that carries the row labels (the horizontal axis of a column or line chart, the vertical axis of a bar chart, the X axis of a scatter chart); 'value' is the other axis; 'secondary' is the secondary value axis of a combo chart.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `category` | no | `string` | Title of the category (X) axis. |\n| `value` | no | `string` | Title of the value (Y) axis. On a combo chart, the primary value axis (at the start of the plot). |\n| `secondary` | no | `string` | Combo charts only: title of the secondary value axis at the end of the plot (the right; the left in a right-to-left deck), drawn rotated like the primary value axis title. Dropped with a 'chart-option-adapted' diagnos... |\n\n\n### ChartHighlight\n\n- Type: `object`\n- Required fields: none\n- Purpose: Which series and categories a chart emphasizes. Present, it is the only source of emphasis: engines then derive none from the slide's texts. Empty lists (for example { \"categories\": [] }) highlight nothing, which switches derived emphasis off as table.highlight { \"rows\": [] } does. Names are matched exactly: series by data column name (after any 'fields' selection; a series is a plotted value column), categories by row label (the first column, or mapping.category), as text. A category label s...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `series` | no | `array<string>` | Series (value columns) to highlight: all marks of each named series. A name that is not a column is a 'chart-highlight-unknown-name' error; a column that is not plotted as a series (the category or X column, or one ma... |\n| `categories` | no | `array<string>` | Categories (row labels) to highlight: the marks of each named category (a column or bar of every series, a line's points, a pie or doughnut slice). A label no row has is a 'chart-highlight-unknown-name' error. |\n\n\n### ChartDataLabels\n\n- Type: `object`\n- Required fields: none\n- Purpose: Data label settings. A label shows the selected content parts in the fixed order category, value, percent, joined by the separator.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `content` | no | `array<enum:value \\| percent \\| category>` | Which parts a label shows. Defaults to ['value']. 'percent' is the share of the total and exists only on pie and doughnut charts; 'category' shows the category name (the X value on a scatter chart). A part a chart typ... |\n| `position` | no | `enum:auto \\| center \\| inside-end \\| inside-base \\| outside-end \\| above \\| below \\| left \\| right` | Where a label sits relative to its mark. 'auto' (the default) is the type's default: outside-end for clustered columns and bars, pie slices and the histogram, pareto and waterfall constructs; center for stacked column... |\n| `separator` | no | `string` | Text between the parts of a label that shows more than one. Defaults to ', '. |\n\n\n### Table\n\n- Type: `object`\n- Required fields: none\n- Purpose: Table content, inline or dataset-backed. An inline table has 'rows' (required) and optional 'columns'. A dataset-backed table has 'dataset' (required) and optional 'fields', and no 'rows' or 'columns': it takes its headers, rows and column formats from the dataset (per-cell styles need an inline table).\n- Conditional requirement: `dataset`, or otherwise `rows`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `columns` | no | `array<oneOf:string / array<ref:TextRun> / ref:StyledTableCell / ref:DataColumn / null>` | Optional column labels. Labels may be strings, rich runs, styled cell objects or DataColumn objects ({ \"name\", \"format\" }). A header's 'format' (DataColumn or StyledTableCell) is the column's number format; a body cel... |\n| `rows` | no | `array<array<ref:TableCell>>` | Two-dimensional table row data; each row aligns by index with columns when columns are supplied. |\n| `dataset` | no | `ref:DatasetId` | Id of a top-level dataset that supplies this table's headers, rows and column formats. Excludes 'rows' and 'columns'. An unknown id is a 'dataset-unknown' error. |\n| `fields` | no | `ref:DatasetFields` | Dataset tables only: the dataset columns to show, by name and in order. Absent shows every column. An unknown name is a 'dataset-field-unknown' error. |\n| `alt` | no | `string` | Text alternative for the table: what it shows (the point and the key numbers), not 'a table'. The preview exposes it as the table's accessible name (role group with aria-label; the cells stay readable) and the PowerPo... |\n| `highlight` | no | `object` | Optional emphasis: the body rows that carry the message, named by their first-column (key) text exactly as 'chart.highlight' names categories, as text; a key shared by several rows highlights each of them. The engines... |\n\n\n### ChartData\n\n- Type: `object`\n- Required fields: `columns`, `rows`\n- Purpose: Inline tabular data driving a chart, written as `{ \"columns\": [\"Quarter\", \"Decks\"], \"rows\": [[\"Q1\", 3], [\"Q2\", 8]] }`: one column of labels plus one column per series, not separate `categories` and `series` lists. The first column usually supplies category/x-axis labels; subsequent columns are plotted measures unless 'chart.mapping' or a chart type maps them differently. Value cells are numbers; a string is read only in strict decimal syntax ('12', '-3.5', '1e6'), and anything else ('12%', '$...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `columns` | yes | `array<oneOf:string / ref:DataColumn>` | Ordered column labels for the chart data table. A label is a string or a DataColumn ({ \"name\", \"format\" }) whose number format the data labels, value axis and exported workbook use. |\n| `rows` | yes | `array<array<ref:ChartDataCell>>` | Tabular chart rows. Each row aligns by index with columns. |\n| `source` | no | `ref:DataSourceRef` | Optional provenance: where this inline data came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import. |\n\n\n### DataColumn\n\n- Type: `object`\n- Required fields: `name`\n- Purpose: A named data column with an optional number format. Anywhere a chart or dataset column is a string it may be a DataColumn; the string form is { \"name\": value } with no format. A table column header may also be a DataColumn.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | yes | `string` | Column label, used as the series name, the table header and the name 'fields' and 'chart.mapping' address. |\n| `format` | no | `ref:NumberFormat` | Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form. |\n\n\n### DataSourceRef\n\n- Type: `object`\n- Required fields: `src`\n- Purpose: Provenance of inline data or a dataset: the file, sheet and range it came from and when. Engines never read, fetch or refresh it; they keep it through editing, export and re-import. Re-import the data to update it.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `src` | yes | `string` | Where the data came from: an 'asset:<id>' reference, a URL, or a relative or local path. |\n| `sheet` | no | `string` | Sheet or table name inside a spreadsheet source. |\n| `range` | no | `string` | A1-style range inside a spreadsheet source. |\n| `fields` | no | `array<string>` | The source fields the data was taken from, in order. |\n| `retrieved` | no | `anyOf:schema / schema` | When the data was taken from the source: an ISO 8601 date or date-time. |\n| `description` | no | `string` | Free-form note about the source. |\n\n\n### DatasetId\n\n- Type: `string`\n- Required fields: none\n- Purpose: Id of an entry in the top-level datasets map (the assets id pattern).\n\n_No named properties._\n\n\n### DatasetFields\n\n- Type: `array<string>`\n- Required fields: none\n- Purpose: Dataset column names to use, in order, each at most once. Selects and orders the dataset's columns; an unknown name is a 'dataset-field-unknown' error.\n\n_No named properties._\n\n\n### Datasets\n\n- Type: `object`\n- Required fields: none\n- Purpose: Shared data tables keyed by id (the assets id pattern). Charts reference one with 'chart.data': { \"dataset\": \"<id>\" } and tables with 'table': { \"dataset\": \"<id>\" }.\n\n_No named properties._\n\n\n### Dataset\n\n- Type: `object`\n- Required fields: `columns`, `rows`\n- Purpose: One shared data table: named columns (strings or DataColumn objects with a number format) and rows of scalar cells. Column names are unique ('data-column-duplicate' error). Rich text and styling belong in an inline table.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `title` | no | `string` | Human name of the dataset, shown by editors. |\n| `description` | no | `string` | What the dataset holds. |\n| `columns` | yes | `array<oneOf:string / ref:DataColumn>` | Ordered, uniquely named columns. |\n| `rows` | yes | `array<array<ref:ChartDataCell>>` | Rows of scalar cells (string, number, boolean, null); each row aligns by index with columns. |\n| `source` | no | `ref:DataSourceRef` | Optional provenance. Engines never read, fetch or refresh it. |\n\n\n### DatasetRef\n\n- Type: `object`\n- Required fields: `dataset`\n- Purpose: Chart data taken from a top-level dataset. Engines inline it before plotting; 'chart.mapping' names columns after the 'fields' selection.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `dataset` | yes | `ref:DatasetId` | Id of the dataset. An unknown id is a 'dataset-unknown' error. |\n| `fields` | no | `ref:DatasetFields` | The dataset columns to use, by name and in order. Absent uses every column. |\n\n\n### ChartMapping\n\n- Type: `object`\n- Required fields: none\n- Purpose: Series mapping by column name (after any 'fields' selection). Mapping only selects and orders columns; a chart type that plots one series (treemap, funnel, waterfall and the like) still plots the first and names the others in a 'chart-series-dropped' warning, and a pie or doughnut of several series draws nested rings. An unknown name is a 'chart-mapping-unknown-column' error; a series that repeats the category or X column, and an X column on a chart type without an X axis, are dropped with a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `category` | no | `string` | The label (category) column. Default: the first column. |\n| `x` | no | `string` | The X column of an XY (scatter) chart. Default: the second column (the first, when the category is the second column), and only when there are three or more columns: with two, the second column is the one series, plot... |\n| `series` | no | `array<string>` | The plotted columns, in order. Default: every column that is not the category or the X column. |\n\n\n### ChartDataCell\n\n- Type: `oneOf:string / number / boolean / null`\n- Required fields: none\n- Purpose: A cell in inline chart data.\n\n_No named properties._\n\n\n### TableCell\n\n- Type: `oneOf:ref:TableCellValue / ref:StyledTableCell`\n- Required fields: none\n- Purpose: A scalar, rich-run array, or styled/spanning cell object. Existing scalar and rich forms remain valid.\n\n_No named properties._\n\n\n### TableCellValue\n\n- Type: `oneOf:string / number / boolean / null / array<ref:TextRun>`\n- Required fields: none\n- Purpose: A scalar table value or canonical rich text runs, without cell decoration or geometry.\n\n_No named properties._\n\n\n### StyledTableCell\n\n- Type: `object`\n- Required fields: `value`\n- Purpose: A cell with explicit visual style or merged geometry. Its position remains its array column index; use null placeholders for every covered grid position.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `value` | yes | `ref:TableCellValue` | Editable cell content; styling and spans do not change its scalar type or rich runs. |\n| `style` | no | `ref:TableCellStyle` | |\n| `colSpan` | no | `integer` | Number of grid columns covered, starting at this cell. Covered positions must contain null. Default 1. |\n| `rowSpan` | no | `integer` | Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1. |\n| `format` | no | `ref:NumberFormat` | Number format. On a body cell it formats that cell's number value (and wins over the column's format); on a header cell (in 'columns') it is the column's format, the same as a DataColumn header. Strings, booleans, nul... |\n\n\n### TableCellStyle\n\n- Type: `object`\n- Required fields: none\n- Purpose: Cell appearance. Sizes use reference pixels at a 720-pixel canvas short edge and scale with the slide.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `fill` | no | `ref:ColorRef` | Cell background: a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference. Eight-digit hex colors include alpha; #00000000 is transparent. |\n| `color` | no | `ref:ColorRef` | Default text color, overridden by individual rich run colors. Accepts a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference. |\n| `bold` | no | `boolean` | Bold cell text. Runs that set their own bold keep it; a number cell stays bold and still uses the cell's or column's number format. |\n| `align` | no | `enum:start \\| center \\| end` | Horizontal text alignment inside the cell. Logical: 'start' is the edge a paragraph starts on (the left for left-to-right text, the right for right-to-left text) and 'end' is the opposite edge. |\n| `verticalAlign` | no | `enum:top \\| middle \\| bottom` | Vertical alignment inside the padded cell box. |\n| `padding` | no | `ref:TableCellPadding` | |\n| `borders` | no | `object` | Independent cell edges. An omitted edge keeps the table's default rule: a line under every row (and over the first row), none between columns. Width 0 removes an edge. |\n\n\n### TableCellPadding\n\n- Type: `object`\n- Required fields: none\n- Purpose: Text insets in reference pixels. Defaults: top 8, right 10, bottom 4, left 10.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `top` | no | `number` | |\n| `right` | no | `number` | |\n| `bottom` | no | `number` | |\n| `left` | no | `number` | |\n\n\n### TableCellBorder\n\n- Type: `ref:Line`\n- Required fields: none\n- Purpose: One explicit cell border: a Line, or 'none' to remove this edge. Defaults: the table's rule color (the scheme's border neutral), 1 reference pixel and 'solid'.\n\n_No named properties._\n\n\n### Catalogs\n\n- Type: `object`\n- Required fields: none\n- Purpose: The catalog records a document embeds, grouped by the catalog they came from. Each property is a group; inside a group, records are keyed by kind and then by id. - 'default': the catalog bare ids come from. It needs a 'source' when it holds records. Omitted: bare ids fall back to the host's default catalog. false: no catalog fallback, so every bare id must be embedded (under 'custom' or 'default'). - 'custom': the records the document defines itself. It has no source. - any other name ('acme'...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `default` | no | `oneOf:allOf:ref:CatalogGroup + schema / const:false` | The catalog bare ids come from: its source and the records of it this document embeds. false turns off the catalog fallback for bare ids. |\n| `custom` | no | `allOf:ref:CatalogGroup + schema` | Records the document defines itself, referenced by bare id. Checked first for every bare id. Forking a catalog record copies it here under a new id, so the change of ownership is visible. |\n\n\n### CatalogGroup\n\n- Type: `object`\n- Required fields: none\n- Purpose: One catalog group: the catalog's source and the records of it the document embeds, by kind and then by id.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `source` | no | `ref:CatalogSource` | |\n| `layouts` | no | `ref:CatalogRecords` | Layout records keyed by id, each with the fields of https://openpresentation.org/schema/opf-layout/v2. Referenced from Slide.layout. |\n| `themes` | no | `ref:CatalogRecords` | Theme records keyed by id, each with the fields of https://openpresentation.org/schema/opf-theme/v1. Referenced from design.theme. |\n| `colorSchemes` | no | `ref:CatalogRecords` | Colour-scheme records keyed by id, each with the fields of https://openpresentation.org/schema/opf-color-scheme/v1. Referenced from design.colorScheme and a theme's colorScheme. |\n| `fontSchemes` | no | `ref:CatalogRecords` | Font-scheme records keyed by id, each with the fields of https://openpresentation.org/schema/opf-font-scheme/v1. Referenced from design.fontScheme, a theme's fontScheme and a language's font schemes. |\n| `narratives` | no | `ref:CatalogRecords` | Narrative records keyed by id, each with the fields of https://openpresentation.org/schema/opf-narrative/v1. Referenced from narrative. |\n| `audiences` | no | `ref:CatalogRecords` | Audience records keyed by id, each with the fields of https://openpresentation.org/schema/opf-audience/v1. Referenced from audience. |\n| `purposes` | no | `ref:CatalogRecords` | Purpose records keyed by id, each with the fields of https://openpresentation.org/schema/opf-purpose/v1. Referenced from purpose. |\n| `tones` | no | `ref:CatalogRecords` | Tone records keyed by id, each with the fields of https://openpresentation.org/schema/opf-tone/v1. Referenced from tone. |\n| `iconSets` | no | `ref:CatalogRecords` | Icon-set records keyed by set id, each with the fields of https://openpresentation.org/schema/opf-icon-set/v1, holding only the icons the document uses (no licenseText or tags). Referenced from an icon as \"<set>:<name>\". |\n\n\n### IconReference\n\n- Type: `string`\n- Required fields: none\n- Purpose: An icon: \"<set>:<name>\" names an icon of a set (\"lucide:truck\", \"tabler:rocket\"; the gallery bundles Lucide and Tabler outline), a bare name names one of the deck's `icons`, and an SVG source (\"asset:<id>\", \"./icon.svg\", an HTTPS URL or a data:image/svg+xml URI) names an SVG file, as pictures accept. A one-color icon draws in the accent and exports as a native, theme-colored PowerPoint shape; a multicolor SVG draws as a picture with its own colors. Unknown names are opf/icon-unknown, unusable...\n\n_No named properties._\n\n\n### Icons\n\n- Type: `object`\n- Required fields: none\n- Purpose: Deck-local icons, keyed by name: SVG text (\"<svg >\") or an SVG source (\"asset:<id>\", \"./icon.svg\", an HTTPS URL or a data URI). An `icon` names one by its bare name. The SVG is read, never run: a script, an event handler, an external reference or a raster makes it opf/icon-invalid. One paint (or currentColor) makes it a recolorable glyph; several make it a picture with its own colors.\n\n_No named properties._\n\n\n### CatalogSource\n\n- Type: `string`\n- Required fields: none\n- Purpose: Identity of a catalog: an HTTPS URL ('https://www.pptx.gallery') or a package reference ('pkg:@acme/opf-catalog'). It names the catalog; engines never fetch or install it. A host registers the catalog's records under this exact string, and copying slides between documents matches groups by it.\n\n_No named properties._\n\n\n### CatalogRecords\n\n- Type: `object`\n- Required fields: none\n- Purpose: Embedded records of one kind, keyed by id. The key is the record's id; an embedded record carries no '$schema', 'id', origin or digest. Catalog display metadata ('x-*' members) is stripped when a record is embedded.\n\n_No named properties._\n\n\n### CatalogReference\n\n- Type: `string`\n- Required fields: none\n- Purpose: A content reference: a bare id ('two-column') or 'name:id' ('acme:hero'), where the prefix names a group of 'catalogs'. URLs and 'pkg:' strings are not references; a named catalog group replaces them. See Catalogs for the resolution order.\n\n_No named properties._\n\n\n### LanguageTag\n\n- Type: `string`\n- Required fields: none\n- Purpose: A BCP-47 language tag ('en-US', 'ja', 'zh-Hans', 'sr-Latn-ME'), an engine vocabulary. Use 'en-GB' for UK English; 'en-UK' is not a valid region. Numbers the engines generate (metric values, chart labels and ticks, table numbers, list numerals, slide numbers) are drawn in the numbering system of the language, the locale's own (Arabic-Indic digits for 'ar-SA', Latin for 'ar-AE', Persian for 'fa-IR'); the Unicode extension '-u-nu-<system>' chooses another ('ar-SA-u-nu-latn' draws Latin digits)....\n\n_No named properties._\n\n\n### Composition\n\n- Type: `object`\n- Required fields: none\n- Purpose: Automatic slide and content-group arrangement. Nested content groups arrange their children independently, inheriting only minFontSize, maxFontSize and overflow. Explicit promoted regions retain their positions. A layout defines its grid as one ordered list of regions; its composition supports gap, padding, minFontSize, maxFontSize and overflow rather than mode, columns or weights.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `mode` | no | `enum:auto \\| grid \\| row \\| column` | auto chooses a grid from available space and content; grid uses columns; row and column use one horizontal or vertical track. |\n| `columns` | no | `integer` | Column count for grid. In auto mode this caps the number of columns. |\n| `gap` | no | `number` | Space between cells as a fraction of the container short edge (canvas at slide root). Default 0.03333333333333333. |\n| `padding` | no | `number` | Inset as a fraction of the container short edge. Default 0.08 on a slide, 0 inside a group. |\n| `weights` | no | `array<number>` | Relative track sizes: columns for row/grid/auto, rows for column. Omitted tracks have weight 1; extra weights are ignored. |\n| `minFontSize` | no | `number` | Minimum readable text size in reference pixels at a 720-pixel canvas short edge. Default 16. Overflow is diagnosed when text cannot fit at this size. |\n| `maxFontSize` | no | `number` | Largest body text size in reference pixels at a 720-pixel canvas short edge: paragraphs, lists, quotes, metrics and timelines are never set larger, their growth included (headings, tables, code and charts keep their s... |\n| `overflow` | no | `enum:warn \\| error` | warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn. |\n"
333
+ "markdown": "# OPF Presentation Schema Reference\n\nThis reference documents the author-facing shape of a complete `*.opf.json` presentation document. It summarizes the canonical schema in `spec/schemas/opf.schema.json`; the schema remains the source of truth for validators.\n\n## Document Contract\n\n- Schema id: `https://openpresentation.org/schema/opf/v1`\n- Required top-level fields: `slides`\n- Additional top-level fields: not allowed\n\n## Top-Level Fields\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `$schema` | no | `const:\"https://openpresentation.org/schema/opf/v1\"` | Optional OPF schema version. When omitted, validators and engines should assume the latest supported OPF schema. |\n| `name` | no | `string` | Display name of the presentation for GUI/TUI lists, library/search indexing, OS-level metadata, and default export filenames. This is deck identity, not slide content. Use slides[].title and slides[].subtitle for text... |\n| `description` | no | `string` | Free-form prose describing what this presentation is about. Used by agents and humans as a deck-level summary; complements purpose (the goal) and narrative (the structured storyline). Round-trips to OOXML 'docProps/co... |\n| `filename` | no | `string` | Optional base filename for exports (without extension). The opf CLI (convert) and the editor strip a trailing .pptx, .pdf, .png, or .svg (case-insensitive) and append the target format's extension. When omitted, they... |\n| `organization` | no | `oneOf:ref:Organization / array<ref:Organization>` | Organization associated with the presentation, usually the presenting company. Array form supports hosts, partners, clients, and sponsors. The primary organization (Organization.role 'primary', else the first item) su... |\n| `speaker` | no | `oneOf:ref:Speaker / array<ref:Speaker>` | Person presenting the deck. Array form supports panels and multi-speaker decks. The first speaker is the primary speaker: the built-in variables 'speaker.<field>' read it, 'speakers' lists every name, and 'speaker.<id... |\n| `author` | no | `oneOf:string / array<string>` | Optional credit for the person who authored or contributed to the deck, distinct from speaker. Array form supports multiple contributors. Round-trips to OOXML 'docProps/core.xml' as '<dc:creator>' (semicolon-joined wh... |\n| `audience` | no | `oneOf:string / ref:Audience / array<oneOf:string / ref:Audience>` | Intended audiences for the presentation. Accepts any of: - A single string: an audiences reference ('executive', or 'acme:board' for a record of the catalogs.acme group), or free-form text ('Series B investors'). A st... |\n| `purpose` | no | `oneOf:string / ref:Purpose` | Primary goal of the presentation. Accepts either: - A string: a purposes reference ('decide', or 'acme:fundraise' for a record of the catalogs.acme group), or a free-form goal ('Raise a Series B round of $30M'). A str... |\n| `language` | no | `oneOf:ref:LanguageTag / ref:Language` | Language of the presentation content, an engine vocabulary: a BCP-47 language tag, validated directly with no catalog lookup. Accepts either: - A BCP-47 tag ('en-US', 'en-GB', 'ja', 'zh-Hans', 'ar-SA'). - An inline La... |\n| `tone` | no | `oneOf:ref:CatalogReference / ref:Tone` | Desired tone for the presentation. Accepts either: - A tones reference: a bare id ('formal') or 'name:id' for a record of a named catalogs group. - An inline Tone object for custom tone metadata or overrides on a refe... |\n| `takeaway` | no | `oneOf:string / array<string>` | Audience-facing takeaway the presentation should leave behind. Array form supports multiple takeaways. Deck-level intent used by AI to seed and pressure-test slide content. |\n| `duration` | no | `integer` | Target presentation duration, as an integer number of minutes. The opf-render presenter view counts the elapsed time against it, and core validate warns when it lies outside the resolved narrative's 'duration' range.... |\n| `tags` | no | `array<string>` | Free-form labels used for categorization, search, and filtering. Lowercase kebab-case is recommended for consistency across a deck library. |\n| `design` | no | `ref:Design` | Optional design system covering theme, color scheme, font scheme, dimensions, background, logo, watermark, header, and footer applied to the deck. When omitted, engines use their default design configuration. |\n| `variables` | no | `ref:Variables` | Optional named variables: deck colors referenced as 'var:<id>' (the original use), and typed content variables (text, number, date, image, url, list) referenced inline as '{{<id>}}' or whole as 'var:<id>'. Variables a... |\n| `template` | no | `boolean` | Marks this document as a template: an incomplete OPF file. A template declares variables (top-level 'variables') and references them from content, and may leave required variables unfilled; validation then reports the... |\n| `narrative` | no | `ref:CatalogReference` | The deck's narrative plan, by reference: a bare narratives id ('classic-story') or 'name:id' for a record of a named catalogs group ('acme:founder-pitch'). The deck holds only this pointer; the plan (the arc, its beat... |\n| `slides` | yes | `array<ref:Slide>` | Ordered array of slides that make up the presentation. |\n| `references` | no | `array<ref:Reference>` | Sources that text runs cite with 'cite'. Ids are unique. A cited reference is listed in the footnote area of every slide that cites it, with a marker number assigned per deck in order of first use; a reference no run... |\n| `datasets` | no | `ref:Datasets` | Optional shared data tables, keyed by id. A chart ('chart.data': { \"dataset\": \"<id>\" }) or a table ('table': { \"dataset\": \"<id>\" }) references one instead of holding its own copy; engines inline the reference before c... |\n| `assets` | no | `ref:Assets` | Optional reusable asset registry for images, data files, videos, documents, fonts, and other resources referenced elsewhere in the deck via 'asset:<id>' strings. |\n| `icons` | no | `ref:Icons` | Optional deck-local icons, keyed by name: an author's or an LLM's own SVG, written once and named by any `icon` of the deck. See docs/icons.md. |\n| `catalogs` | no | `ref:Catalogs` | The catalog records this document embeds, grouped by the catalog they came from: 'default' (the catalog bare ids come from), 'custom' (records the document defines itself) and any number of named catalogs ('acme', ref... |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows; ignored by the engine but preserved across read/write round-trips. |\n\n## Object And Type Reference\n\n### Assets\n\n- Type: `object`\n- Required fields: none\n- Purpose: Reusable asset registry for resources used by slides, charts, metadata, and design. Keys are stable asset ids referenced elsewhere as 'asset:<id>'. Each asset can be a source string or an object with src plus optional metadata.\n\n_No named properties._\n\n\n### Asset\n\n- Type: `oneOf:string / object`\n- Required fields: none\n- Purpose: Reusable or inline resource. A string is shorthand for { \"src\": value }. Source strings accept 'asset:<id>' references, HTTPS URLs, data URIs, relative paths resolved against the OPF file location, or local filesystem paths. Use object form when metadata such as alt text, title or mediaType matters.\n\n_No named properties._\n\n\n### ImagePayload\n\n- Type: `oneOf:string / object`\n- Required fields: none\n- Purpose: An image source and optional image-local text callouts. Other resource kinds use Asset and do not accept callouts.\n\n_No named properties._\n\n\n### ImageCallout\n\n- Type: `object`\n- Required fields: `text`, `x`, `y`, `width`, `height`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `text` | yes | `string` | Plain editable text. Native edits preserve current words; an empty string is retained. |\n| `x` | yes | `ref:FiniteNumber` | Signed fraction of the visible image frame width from its physical left edge. A callout points at pixels, and a picture never mirrors, so this coordinate is physical in every language. Negative values or values greate... |\n| `y` | yes | `ref:FiniteNumber` | Signed fraction of the visible image frame height from its physical top edge. Negative values or values greater than 1 position the panel outside the image; its text is not clipped to the image. The slide crops what l... |\n| `width` | yes | `number` | Positive fraction of the visible image frame width, at most 1. The signed x origin controls placement outside the frame. |\n| `height` | yes | `number` | Positive fraction of the visible image frame height, at most 1. The signed y origin controls placement outside the frame. |\n\n\n### Audience\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: Inline audience metadata for the presentation. Use 'id' to reference an audiences record (a bare id or 'name:id') and override selected fields, or use 'name' for a custom inline audience.\n- Conditional requirement: `id` or `name`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Optional audiences reference (a bare id or 'name:id') resolved before applying the inline overrides. |\n| `name` | no | `string` | Human-readable audience name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the audience. |\n| `description` | no | `string` | Longer prose describing the audience and how to address them. |\n| `seniority` | no | `enum:ic \\| manager \\| director \\| vp \\| c-suite \\| mixed` | Typical seniority level of the audience. |\n| `technicalFluency` | no | `enum:low \\| medium \\| high \\| mixed` | Typical technical fluency of the audience. |\n| `decisionPower` | no | `enum:informational \\| advisory \\| decision-maker` | Whether the audience is expected to be informed, advise, or decide. |\n| `attentionBudgetMinutes` | no | `number` | Realistic upper bound on focused attention for a single presentation, in minutes. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: narrative ids that work well for this audience, for picker UIs. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: tone ids that work well for this audience, for picker UIs. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Purpose\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: Inline purpose metadata for the presentation. Use 'id' to reference a purposes record (a bare id or 'name:id') and override selected fields, or use 'name' for a custom inline purpose.\n- Conditional requirement: `id` or `name`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Optional purposes reference (a bare id or 'name:id') resolved before applying the inline overrides. |\n| `name` | no | `string` | Human-readable purpose name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the purpose. |\n| `description` | no | `string` | Longer prose describing when to use this purpose and how it should shape a deck. |\n| `outcome` | no | `string` | Desired audience outcome after the presentation. |\n| `successCriteria` | no | `array<string>` | Observable signals that the deck accomplished this purpose. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: narrative ids that work well for this purpose, for picker UIs. Never resolved, embedded or validated as references. |\n| `recommendedTones` | no | `array<string>` | Soft cross-link: tone ids that work well for this purpose, for picker UIs. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Language\n\n- Type: `object`\n- Required fields: `bcp47`\n- Purpose: Inline language metadata for the presentation: a BCP-47 'bcp47' tag plus overrides of what engines know about it. Languages are an engine vocabulary, not catalog records, so there is no 'id'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | no | `string` | Human-readable language name. |\n| `bcp47` | yes | `ref:LanguageTag` | BCP-47 language tag used for locale-aware rendering, proofing, and accessibility metadata. Use 'en-GB' for UK English; 'en-UK' is not a valid BCP-47 region form. |\n| `ooxmlLang` | no | `string` | Culture tag for OOXML text-run language attributes (a:rPr/@lang, a:endParaRPr/@lang), in the language-[Script-]REGION form Office recognizes (e.g. 'ja-JP', 'ar-SA', 'ms-MY', 'nb-NO', 'fil-PH', 'zh-CN'). Without it, en... |\n| `code` | no | `string` | ISO 639-3 or 639-2 language code carried for engines that prefer ISO codes. |\n| `direction` | no | `enum:ltr \\| rtl` | Base text direction for the language. When omitted, engines derive it from the script: Arabic (Arab), Hebrew (Hebr), Syriac (Syrc), Thaana (Thaa), N'Ko (Nkoo), Adlam (Adlm), Samaritan (Samr), Mandaic (Mand) and Hanifi... |\n| `script` | no | `string` | ISO 15924 script code of the language's writing system. The script selects the OOXML font slot the language's text uses: East Asian scripts (Hans, Hant, Hani, Jpan, Kore, Hang, Hira, Kana, Bopo, Yiii) use the eastAsia... |\n| `fontScheme` | no | `ref:CatalogReference` | Font-scheme reference (a bare id or 'name:id') for this language's script slot when targeting PowerPoint output. Its major/minor families fill the language's script slot (eastAsian or complexScript, chosen by 'script'... |\n| `googleFontScheme` | no | `ref:CatalogReference` | Font-scheme reference (a bare id or 'name:id') used in place of 'fontScheme' when resolving script fonts for Google Slides output. |\n| `summary` | no | `string` | One-sentence note about coverage or font defaults. |\n| `description` | no | `string` | Longer prose describing the language record and any font-pairing rationale. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Tone\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: Inline tone metadata for the presentation. Use 'id' to reference a tones record (a bare id or 'name:id') and override selected fields, or use 'name' for a custom inline tone.\n- Conditional requirement: `id` or `name`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Optional tones reference (a bare id or 'name:id') resolved before applying the inline overrides. |\n| `name` | no | `string` | Human-readable tone name shown in pickers. |\n| `summary` | no | `string` | One-sentence positioning of the tone. |\n| `description` | no | `string` | Longer prose describing the tone and the kinds of decks it suits. |\n| `voiceCues` | no | `array<string>` | Short directives that shape AI generation toward this tone. |\n| `avoid` | no | `array<string>` | Anti-patterns that AI generation should not produce when this tone is active. |\n| `samplePhrases` | no | `array<string>` | Short example phrases that exemplify this tone. |\n| `recommendedNarratives` | no | `array<string>` | Soft cross-link: narrative ids this tone pairs well with, for picker UIs. Never resolved, embedded or validated as references. |\n| `tags` | no | `array<string>` | Free-form labels for filtering and search. |\n\n\n### Organization\n\n- Type: `object`\n- Required fields: `id`, `name`\n- Purpose: An organization associated with the presentation, typically the presenting company, but also hosts, partners, clients, or sponsors. The primary organization (role 'primary', else the first one) supplies the cover and section logo (unless design.logo overrides it) and the 'socials' header/footer field (its socials). Every field is also a built-in variable ('{{organization.name}}', 'organization.<id>.<field>'), and every logo a slide-scoped image ('var:organization.logo.icon', 'var:organization...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable identifier for the organization, used to reference it from Speaker.organizationId and to address it in built-in variables as 'organization.<id>.<field>'. Must be unique among organizations (a duplicate is a val... |\n| `name` | yes | `string` | Display name. The built-in variable 'organization.name' (primary organization) or 'organization.<id>.name' carries it into any string, such as a header or footer text of '{{organization.name}}'. |\n| `legalName` | no | `string` | Optional legal entity name when it differs from the display name. Never drawn automatically; available as the built-in variable 'organization.legalName'. |\n| `logo` | no | `oneOf:ref:Asset / ref:OrganizationLogo` | The organization's logo. A path, URL or Asset is one logo for every shape; an object gives up to four shapes (full, stacked, icon, wordmark), each a path or Asset, or { onLight, onDark } for the two backgrounds. A pat... |\n| `domain` | no | `string` | Bare internet domain for the organization. Never drawn automatically and not used to look up assets; available as the built-in variable 'organization.domain'. |\n| `email` | no | `string` | General contact email for the organization. Never drawn automatically; available as the built-in variable 'organization.email'. |\n| `phone` | no | `string` | Main contact phone number for the organization. E.164 format is recommended. Never drawn automatically; available as the built-in variable 'organization.phone'. |\n| `tagline` | no | `string` | Short tagline. Never drawn automatically (cover slides do not show it); available as the built-in variable 'organization.tagline', for example in a footer 'text' of '{{organization.tagline}}'. |\n| `role` | no | `enum:primary \\| partner \\| client \\| sponsor \\| host` | Role of the organization relative to the presentation. Only 'primary' has behavior: it selects the primary organization (cover and section logo, the 'socials' header/footer field, and the 'organization.<field>' built-... |\n| `socials` | no | `ref:Socials` | Optional social media handles or URLs for the organization. The primary organization's socials render in header/footer zones that set socials: true; otherwise they are authoring metadata. |\n\n\n### Speaker\n\n- Type: `object`\n- Required fields: `id`, `name`\n- Purpose: A person presenting the deck. A speaker is drawn only through built-in variables ('{{speaker.name}}' inside any string, a header or footer text included, and 'var:speaker.photo' as a whole image field). No layout, cover or bio slide places a speaker on its own. See docs/templates-and-variables.md.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Stable identifier for the speaker. Must be unique among speakers (a duplicate is a validation error). Addresses this speaker in built-in variables as 'speaker.<id>.<field>', such as '{{speaker.alice.title}}'. |\n| `name` | yes | `string` | Display name. Built-in variable 'speaker.name' (first speaker) or 'speaker.<id>.name'; every name is listed by 'speakers'. |\n| `title` | no | `string` | Role or title. Built-in variable 'speaker.title' (or 'speaker.<id>.title'), for example in a footer text of '{{speaker.name}}, {{speaker.title}}'. |\n| `photo` | no | `ref:Asset` | Source for the speaker's headshot image. Accepts an HTTPS URL, data URI, relative path (resolved against the OPF file location), local path, or 'asset:<id>' reference. Common formats are JPG or PNG; SVG is not appropr... |\n| `email` | no | `string` | Contact email. Never drawn automatically; available as the built-in variable 'speaker.email'. |\n| `phone` | no | `string` | Contact phone number for the speaker. E.164 format is recommended. Never drawn automatically; available as the built-in variable 'speaker.phone'. |\n| `bio` | no | `string` | Short biographical paragraph. Never drawn automatically; available as the built-in variable 'speaker.bio', for a bio or 'about the speaker' slide you write. |\n| `organizationId` | no | `string` | Reference to an Organization.id in organization; it must name an existing organization (a validation error otherwise). Attribution metadata for hosts: no engine draws it or changes which organization is primary becaus... |\n| `socials` | no | `ref:Socials` | Optional social media handles or URLs for the speaker. Authoring metadata only: nothing draws speaker socials and there is no built-in variable for them (the 'socials' header/footer field draws the primary organizatio... |\n\n\n### Socials\n\n- Type: `object`\n- Required fields: none\n- Purpose: Social media handles or URLs, keyed by platform. The keys are an engine vocabulary validated directly (no catalog lookup): engines link a handle with the platform's URL pattern and handle prefix (spec/reference/engine-vocabularies.json). Each value is a string, either a full URL or a platform handle (e.g., '@acme'). Brand colours and icons are catalog display metadata for authoring UIs; engines render the profile URL, not icons or brand colours. Used both for organization and speaker records.\n\n_No named properties._\n\n\n### Design\n\n- Type: `object`\n- Required fields: none\n- Purpose: Visual design system applied to the presentation; individual slides may override fields via Slide.design.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `theme` | no | `ref:CatalogReference` | Theme for the deck: a themes reference, a bare id ('minimal') or 'name:id' ('acme:brand'). The theme supplies the default colour scheme, font scheme, background and dimensions; design.colorScheme, design.fontScheme, d... |\n| `colorScheme` | no | `oneOf:string / ref:ColorScheme` | Color scheme for the presentation. Accepts two forms: - A colorSchemes reference: a bare id ('cool-horizon') or 'name:id' ('acme:ocean'). - Object form: a ColorScheme with an optional 'id' reference as the base plus s... |\n| `fontScheme` | no | `oneOf:string / ref:FontScheme` | Font scheme for heading, body, accent, and code text. Accepts two forms: - A fontSchemes reference: a bare id ('aptos') or 'name:id' ('acme:inter'). - Object form: a FontScheme with an optional 'id' reference as the b... |\n| `dimensions` | no | `oneOf:ref:DimensionPreset / ref:Dimensions` | Slide dimensions and aspect ratio. String shorthand such as 'widescreen' is equivalent to { preset: 'widescreen' }. |\n| `background` | no | `oneOf:ref:BackgroundShortcut / ref:Background` | Default slide background applied across the deck unless overridden on a slide (slides.N.design.background); the resolved theme's background is the fallback. A background is the only canvas fill and never moves content... |\n| `variant` | no | `oneOf:ref:ColorVariantSlot / ref:ColorVariant` | Optional color variant, as a background slot ('light1', 'light2', 'dark1', 'dark2', or an accent 'accent1' to 'accent6'; the same as { background: slot }) or the object form, which is needed only for an accent order:... |\n| `logo` | no | `oneOf:string / const:false` | Which logo covers, section dividers and picture bullets draw. Logos live on the organization (Organization.logo); without this field covers and sections draw the primary organization's full logo and picture bullets it... |\n| `watermark` | no | `oneOf:const:false / ref:Asset / ref:Watermark` | Optional decorative watermark applied across slides: an image or a text stamp, in the fixed frame and at the opacity described on Watermark. Use false to suppress an inherited watermark in slide-level design; a string... |\n| `header` | no | `oneOf:const:false / ref:HeaderFooter` | Repeated header furniture rendered outside the main slide content. Use false to suppress an inherited header. |\n| `footer` | no | `oneOf:const:false / ref:HeaderFooter` | Repeated footer furniture rendered outside the main slide content. Use false to suppress an inherited footer. |\n| `titleAlignment` | no | `enum:start \\| center \\| end` | Default horizontal alignment for the title heading area (the title and the tag) in resolved layouts. Effective value: the slide's design, then the deck's design, then the theme's design.titleAlignment, then the layout... |\n| `contentAlignment` | no | `enum:start \\| center \\| end` | Default horizontal alignment for body/content regions in resolved layouts. Effective value: the slide's design, then the deck's design, then the theme's design.contentAlignment, then the layout record's design.content... |\n| `contentBox` | no | `boolean` | Whether body/content regions are rendered inside a visible card or surface. Effective value: the slide's design, then the deck's design, then the theme's design.contentBox, then the layout record's design.contentBox,... |\n| `contentDirection` | no | `enum:horizontal \\| vertical` | Axis along which parallel body content is arranged: 'vertical' is a column, 'horizontal' a row. Effective value: the slide's design, then the deck's design, then the theme's design.contentDirection, then the layout re... |\n| `chartPrimary` | no | `enum:none \\| top \\| bottom \\| start \\| end` | Where the primary chart sits relative to supporting content. Effective value: slide design, then deck design, then the layout record's design.chartPrimary. It applies to automatic slides only; a template layout says t... |\n| `imageFit` | no | `enum:cover \\| contain \\| stretch \\| auto` | Default fit of image blocks (and Slide.image) that set no fit of their own: 'cover' fills the frame and crops what overflows around the block's focus, 'contain' shows the whole picture in a frame of its own proportion... |\n| `listBullet` | no | `enum:character \\| image \\| none` | Marker style for items and bullets lists. Effective value: the slide's design, then the deck's design, then the theme's design.listBullet, then the layout record's design.listBullet, then 'character'. 'character' (the... |\n| `listStyle` | no | `enum:stack \\| rows` | How list entries are arranged. 'stack' draws each entry's text with its description under it, the entries close together, as before. 'rows' draws ruled rows: a hairline between two first-level entries (the scheme's bo... |\n| `mirror` | no | `boolean` | Draw the slide's template layout mirrored: each row's cells and the column sizes reversed, so a 'beside' layout puts its picture, chart or table at the end. Logical: a right-to-left deck mirrors on top. Binding and re... |\n\n\n### ColorScheme\n\n- Type: `object`\n- Required fields: none\n- Purpose: Color palette used by the design system. Every slot and role is a hex color ('#RGB', '#RRGGBB' or '#RRGGBBAA'); a color-scheme name or a 'var:<id>' reference is not valid here, because those resolve through the scheme. The slot fields (accent1-accent6, dark1, dark2, light1, light2, hyperlink, followedHyperlink) mirror color-scheme.schema.json (https://openpresentation.org/schema/opf-color-scheme/v1) so library records and inline OPF overrides are interchangeable on those fields. Two parallel...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | no | `string` | Name of this palette. PPTX export writes it as the name of the theme's color scheme (a:clrScheme name), which PowerPoint lists under Design, Variants, Colors; without it, an object form with 'id' writes that id, and t... |\n| `id` | no | `ref:CatalogReference` | Colour-scheme reference (a bare id or 'name:id') resolved as the base; slot and role overrides on the surrounding ColorScheme object take precedence over the resolved scheme. |\n| `accent1` | no | `ref:HexColor` | Accent 1 color (hex). Mirrors the OOXML accent1 slot. |\n| `accent2` | no | `ref:HexColor` | Accent 2 color (hex). Mirrors the OOXML accent2 slot. |\n| `accent3` | no | `ref:HexColor` | Accent 3 color (hex). Mirrors the OOXML accent3 slot. |\n| `accent4` | no | `ref:HexColor` | Accent 4 color (hex). Mirrors the OOXML accent4 slot. |\n| `accent5` | no | `ref:HexColor` | Accent 5 color (hex). Mirrors the OOXML accent5 slot. |\n| `accent6` | no | `ref:HexColor` | Accent 6 color (hex). Mirrors the OOXML accent6 slot. |\n| `dark1` | no | `ref:HexColor` | Dark 1 color (hex). Typically the deepest neutral; OOXML dark1. |\n| `dark2` | no | `ref:HexColor` | Dark 2 color (hex). Secondary dark; OOXML dark2. |\n| `light1` | no | `ref:HexColor` | Light 1 color (hex). Typically the slide canvas; OOXML lt1. |\n| `light2` | no | `ref:HexColor` | Light 2 color (hex). Secondary light surface; OOXML lt2. |\n| `hyperlink` | no | `ref:HexColor` | Hyperlink color (hex). OOXML hlink. Link runs with no color of their own are drawn underlined in it, in the preview and in PowerPoint, unless it has under 4.5:1 contrast against the slide background, then in the slide... |\n| `followedHyperlink` | no | `ref:HexColor` | Followed-hyperlink color (hex). OOXML folHlink. |\n| `primary` | no | `ref:HexColor` | Abstract role: primary brand color (hex). The engine maps this onto an OOXML accent slot when serializing. |\n| `secondary` | no | `ref:HexColor` | Abstract role: secondary brand color (hex). |\n| `accent` | no | `ref:HexColor` | Abstract role: accent color used for highlights and emphasis (hex). |\n| `background` | no | `ref:HexColor` | Abstract role: default slide background color (hex), used when the design names no single-color background (and for gradient and picture backgrounds). Overrides light1 as that default. |\n| `surface` | no | `ref:HexColor` | Abstract role: color for elevated surfaces such as cards and panels (hex). Overrides the default of light2 (dark2 on a dark slide). |\n| `text` | no | `ref:HexColor` | Abstract role: primary body text color (hex). Overrides dark1 on a light slide only; a dark slide always uses light1. |\n| `textSecondary` | no | `ref:HexColor` | Abstract role: secondary or muted text color used for captions and supporting copy (hex). Overrides the default of dark2 (light2 on a dark slide). |\n\n\n### FontScheme\n\n- Type: `object`\n- Required fields: none\n- Purpose: Typography selections used by the design system. The pair fields (major, minor) and refinement fields (type, app, languageFamily) mirror font-scheme.schema.json (https://openpresentation.org/schema/opf-font-scheme/v1) so library records and inline OPF overrides are interchangeable on those fields. Two parallel models are supported and may be mixed: - OOXML pairs (major, minor) - heading and body family names that round-trip directly to PowerPoint majorFont/minorFont entries. - Abstract roles...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `ref:CatalogReference` | Font-scheme reference (a bare id or 'name:id') resolved as the base; field overrides on the surrounding FontScheme object take precedence over the resolved scheme. |\n| `major` | no | `string` | Heading (major) font family mirrors the OOXML majorFont entry. Pairs with 'minor'. |\n| `minor` | no | `string` | Body (minor) font family mirrors the OOXML minorFont entry. Pairs with 'major'. |\n| `eastAsian` | no | `object` | East Asian script fonts. Maps to the OOXML a:ea element of majorFont (major) and minorFont (minor), and to run-level a:ea. When set, they fill the eastAsian slot for every language; when omitted, the slot comes from t... |\n| `complexScript` | no | `object` | Complex-script fonts (for example Arabic, Hebrew, Indic and Thai). Maps to the OOXML a:cs element of majorFont (major) and minorFont (minor), and to run-level a:cs. When set, they fill the complexScript slot for every... |\n| `type` | no | `enum:sans-serif \\| serif \\| monospace` | High-level typographic class of the scheme. |\n| `app` | no | `enum:powerpoint \\| google-slides` | Target application this font pairing is intended for. Metadata for pickers and catalog filters: no engine changes its output by it. |\n| `languageFamily` | no | `enum:latin \\| ea \\| cs \\| eastAsian \\| complexScript` | Font-language family this scheme is intended for: 'latin' for Latin-script content, 'ea' (or 'eastAsian', the same value) for East Asian scripts, 'cs' (or 'complexScript', the same value) for Complex Scripts. The long... |\n| `heading` | no | `string` | Abstract role: font family name used for slide titles and headings. Maps onto the OOXML major slot when serializing. |\n| `body` | no | `string` | Abstract role: font family name used for body copy. Maps onto the OOXML minor slot when serializing. |\n| `accent` | no | `string` | Abstract role: font family name used for accent text. When set, the slide tag (eyebrow) and the quote body use this family instead of the body and heading families; nothing else changes. resolveFontFamilies() returns... |\n| `code` | no | `string` | Abstract role: monospaced font family name used for code blocks and for inline code runs (TextRun.code). No direct OOXML slot. Resolution: this override, then the resolved font-scheme record's 'code' (for example Cons... |\n\n\n### SlideDesign\n\n- Type: `allOf:ref:Design + schema`\n- Required fields: none\n- Purpose: A slide's design: every Design field except dimensions. A PPTX has one slide size, so the size is set once, on the deck's design.dimensions (or its theme), and a slide's design cannot set it. A slide-level theme whose resolved dimensions differ from the deck's is a validate warning (opf/slide-theme-dimensions); exporting such a deck to PPTX fails with mixed-slide-dimensions.\n\n_No named properties._\n\n\n### DimensionPreset\n\n- Type: `enum:16:9 | 4:3 | 16:10 | 1:1 | 4:5 | 9:16 | letter | a4 | widescreen | standard`\n- Required fields: none\n- Purpose: Named preset; sets aspect ratio and physical size. 16:9 ('widescreen'): 13.333 x 7.5 in, PowerPoint's Widescreen. 4:3 ('standard'): 10 x 7.5 in. 16:10: 10 x 6.25 in. letter (11 x 8.5 in) and a4 (11.69 x 8.27 in) are paper sizes, not PowerPoint's Letter Paper or A4 Paper. 1:1, 4:5 and 9:16 are 7.5 in on the short edge.\n\n_No named properties._\n\n\n### Dimensions\n\n- Type: `object`\n- Required fields: none\n- Purpose: Slide dimensions: a preset, or custom inches that override it. PowerPoint's Letter Paper (10 x 7.5 in), A4 Paper (10.8333 x 7.5 in) and On-screen Show (16:9) (10 x 5.625 in) are not OPF presets; use widthInches and heightInches. docs/slide-sizes.md compares every preset.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `preset` | no | `ref:DimensionPreset` | |\n| `widthInches` | no | `number` | Custom slide width in inches; overrides the preset width when provided. |\n| `heightInches` | no | `number` | Custom slide height in inches; overrides the preset height when provided. |\n\n\n### ColorVariantSlot\n\n- Type: `enum:light1 | light2 | dark1 | dark2 | accent1 | accent2 | accent3 | accent4 | accent5 | accent6`\n- Required fields: none\n- Purpose: The scheme slot a color variant puts behind the slide (bg1): a light or dark slot, or an accent. On an accent the text side is the light family (tx1 = light1, tx2 = light2) or the dark family (tx1 = dark1, tx2 = dark2), whichever text slot has the higher contrast on that accent; tx2 falls back to tx1's slot where it is under 4.5:1 on the accent, and bg2 is the accent itself.\n\n_No named properties._\n\n\n### ThemeBackgroundSlot\n\n- Type: `enum:light1 | light2 | dark1 | dark2`\n- Required fields: none\n- Purpose: PowerPoint theme-controlled slide background slot from the active color scheme. These are slots, not assumptions about actual colors: light1 is usually white and dark1 is usually black by convention, but the color scheme controls the real values.\n\n_No named properties._\n\n\n### HexColor\n\n- Type: `string`\n- Required fields: none\n- Purpose: Hex color shorthand accepted by selected string fields.\n\n_No named properties._\n\n\n### ColorRef\n\n- Type: `anyOf:ref:HexColor / enum:accent1 | accent2 | accent3 | accent4 | accent5 | accent6 | dark1 | dark2 | light1 | light2 | hyperlink | followedHyperlink | primary | secondary | accent | background | surface | surfaceAlt | text | textSecondary / string / ref:ColorTransform`\n- Required fields: none\n- Purpose: A color value or reference, enforced on shape fills and strokes, image strokes, styled table cell fill and text colors, cell border colors, solid background colors, gradient stop colors and pattern foreground and background colors. Four forms: - Literal hex: '#RGB', '#RRGGBB', or '#RRGGBBAA'. - Color-scheme name, resolved through the effective color scheme after design resolution: an OOXML slot ('accent1'-'accent6', 'dark1', 'dark2', 'light1', 'light2', 'hyperlink', 'followedHyperlink') or an...\n\n_No named properties._\n\n\n### ColorTransform\n\n- Type: `oneOf:schema / schema`\n- Required fields: `color`\n- Purpose: A ColorRef made lighter or darker, as PowerPoint's theme color tints and shades: 'lighten' moves the color's HSL luminance that share of the way to white (lumMod 1 - lighten, lumOff lighten), 'darken' that share of the way to black (lumMod 1 - darken). Exactly one of the two. PPTX export writes a:lumMod and a:lumOff on the base color, a scheme color where the base names one, so re-theming the deck keeps the tint.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | yes | `ref:ColorRef` | The base color: any ColorRef. |\n| `lighten` | no | `number` | Share of the way to white, 0 to 1. 0.4 is PowerPoint's \"Lighter 40%\". |\n| `darken` | no | `number` | Share of the way to black, 0 to 1. 0.25 is PowerPoint's \"Darker 25%\". |\n\n\n### Variables\n\n- Type: `object`\n- Required fields: none\n- Purpose: Named variables, keyed by stable kebab-case id. A variable is a typed, named value the deck declares once and uses in many places: a color ('var:<id>' in color fields, the original use), or content that fills a template (text, number, date, image, url, list). Content is referenced inline as '{{<id>}}' inside any string, or whole as 'var:<id>' in a field of the matching type; '\\{{' writes a literal '{{'. A hex string is shorthand for a color variable. A variable with no 'value' is unfilled: ex...\n\n_No named properties._\n\n\n### Variable\n\n- Type: `oneOf:ref:HexColor / ref:ColorVariable / ref:TextVariable / ref:NumberVariable / ref:DateVariable / ref:ImageVariable / ref:UrlVariable / ref:ListVariable`\n- Required fields: none\n- Purpose: A single named variable: a hex string (shorthand for a color variable) or an object whose 'type' is color, text, number, date, image, url or list. 'value' is the current value and is optional: a variable with no value is unfilled, which a template allows and a normal deck does not. 'example' only illustrates the slot (fill forms, template previews) and never reaches output.\n\n_No named properties._\n\n\n### ColorVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A named color. Content color fields reference it as 'var:<id>'. Colors resolve at render time through the ordinary color-reference path, so a color variable keeps working as before.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"color\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `ref:HexColor` | Hex color this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `ref:HexColor` | Illustrative color shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### TextVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: Text content. Plain string or rich TextRun[]. Insert it inline as '{{<id>}}' inside any string (rich text is flattened to plain text there), or reference it whole as 'var:<id>' in a field that accepts string or TextRun[] (the rich runs are kept).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"text\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `oneOf:string / array<ref:TextRun>` | Text this variable resolves to: a plain string, or TextRun[] for rich text. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `oneOf:string / array<ref:TextRun>` | Illustrative text shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### NumberVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A number. '{{<id>}}' inserts it as text using 'format'; 'var:<id>' as a whole field supplies the number itself (chart values, font sizes).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"number\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `number` | Number this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `number` | Illustrative number shown in fill forms and used when a template is previewed with examples. Never written to output. |\n| `format` | no | `ref:NumberFormat` | Display pattern used by '{{<id>}}' (the shared NumberFormat syntax). A literal prefix, a numeric part of '#', '0', ',' and '.', and a literal suffix. '0' pads digits, '#' is optional, ',' groups thousands, digits afte... |\n\n\n### NumberFormat\n\n- Type: `string`\n- Required fields: none\n- Purpose: Number display pattern, shared by NumberVariable.format, data column formats (DataColumn.format) and table cell formats (StyledTableCell.format). An optional literal prefix, a numeric part of '#', '0', ',' and '.', and an optional literal suffix. '0' pads digits, '#' is optional, ',' groups thousands, digits after '.' fix the decimals ('0' required, '#' optional), and a '%' in the prefix or suffix multiplies the value by 100. English separators only. A format is one to three ';'-separated sec...\n\n_No named properties._\n\n\n### DateVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A calendar date as an ISO YYYY-MM-DD string. No time zone and no clock are involved. '{{<id>}}' inserts it formatted with 'format'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"date\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `string` | ISO calendar date (YYYY-MM-DD) this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `string` | Illustrative ISO date shown in fill forms and used when a template is previewed with examples. Never written to output. |\n| `format` | no | `string` | Date display pattern, the same LDML-style tokens as header/footer dateFormat: yyyy, yy, MMMM, MMM, MM, M, dd, d, EEEE, EEE and quoted literals. English names. Default 'MMMM d, yyyy'. |\n\n\n### ImageVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: An image source: any Asset (an 'asset:<id>' reference, HTTPS URL, data URI, relative or local path, or an object with src, alt and metadata). Reference it whole as 'var:<id>' in an image, asset or src field; '{{<id>}}' inserts the source string.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"image\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `ref:Asset` | Image source this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `ref:Asset` | Illustrative image source shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### UrlVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A link target (http, https, mailto or tel). Use it as '{{<id>}}' inside a link string or reference it whole as 'var:<id>' in a link field.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"url\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `string` | Link target this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `string` | Illustrative link shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### ListVariable\n\n- Type: `object`\n- Required fields: `type`\n- Purpose: A list of strings, for bullets and list items. A whole-string array element 'var:<id>' splices every entry into the array in place; a whole field 'var:<id>' becomes the array; '{{<id>}}' joins the entries with ', ' (or the separator after a pipe: '{{<id>|; }}').\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"list\"` | Variable kind. One of color, text, number, date, image, url or list. |\n| `value` | no | `array<string>` | Entries this variable resolves to. |\n| `required` | no | `boolean` | Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot:... |\n| `label` | no | `string` | Optional short human label for forms and fill panels. |\n| `description` | no | `string` | Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents. |\n| `example` | no | `array<string>` | Illustrative entries shown in fill forms and used when a template is previewed with examples. Never written to output. |\n\n\n### BackgroundShortcut\n\n- Type: `oneOf:ref:ThemeBackgroundSlot / ref:HexColor / ref:ImageSource`\n- Required fields: none\n- Purpose: String shorthand for a background. Theme slots ('light1', 'light2', 'dark1', 'dark2') are equivalent to { type: 'theme', slot: value }; hex colors are equivalent to { type: 'solid', color: value }; an image source (starting with 'asset:', 'https://', 'data:', './' or '../') is equivalent to { type: 'image', src: value }, a cover image. Any other string is invalid.\n\n_No named properties._\n\n\n### ImageSource\n\n- Type: `string`\n- Required fields: none\n- Purpose: An image source in a string shorthand: an 'asset:<id>' reference, an HTTPS URL, a data URI, or a relative path starting with './' or '../' (resolved against the OPF file location).\n\n_No named properties._\n\n\n### ColorVariant\n\n- Type: `object`\n- Required fields: `background`\n- Purpose: A variant of the deck's single color scheme, as a mapping over its twelve slots (PowerPoint's clrMap): 'background' is the slot the slide background and the role bg1 take, and with it the other roles: light1 maps bg1 = light1, tx1 = dark1, bg2 = light2, tx2 = dark2; dark1 maps bg1 = dark1, tx1 = light1, bg2 = dark2, tx2 = light2; light2 and dark2 make that slot both the background and the alternate surface (light2: bg1 = bg2 = light2, tx1 = dark1, tx2 = dark2; dark2: bg1 = bg2 = dark2, tx1 =...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `background` | yes | `ref:ColorVariantSlot` | The scheme slot that is the background (bg1) of the variant. |\n| `accents` | no | `array<enum:accent1 \\| accent2 \\| accent3 \\| accent4 \\| accent5 \\| accent6>` | Optional accent order: a permutation of accent1 to accent6. Entry i is the scheme slot drawn as accent i + 1, so primary, secondary and accent (the first three) and the chart series colors follow it. Default: the sche... |\n\n\n### Background\n\n- Type: `oneOf:ref:ThemeBackground / ref:SolidBackground / ref:GradientBackground / ref:ImageBackground / ref:PatternBackground`\n- Required fields: none\n- Purpose: Background fill applied to slides. Theme backgrounds preserve PowerPoint's color-scheme background choice; other variants represent fixed background fills.\n\n_No named properties._\n\n\n### ThemeBackground\n\n- Type: `object`\n- Required fields: `type`, `slot`\n- Purpose: Theme-controlled PowerPoint slide background. The slot is resolved through the active color scheme and remains theme-aware.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"theme\"` | Theme-controlled background fill. |\n| `slot` | yes | `ref:ThemeBackgroundSlot` | |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). Default 1; the selected theme slot remains unchanged. |\n\n\n### SolidBackground\n\n- Type: `object`\n- Required fields: `type`, `color`\n- Purpose: Fixed solid slide background fill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"solid\"` | Fixed solid background fill. |\n| `color` | yes | `ref:ColorRef` | Fixed solid fill color: a hex string, a color-scheme slot or role name, or a var:<id> variable reference (a ColorRef, resolved against the effective color scheme and the deck variables). Use { type: 'theme', slot: ...... |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### GradientBackground\n\n- Type: `object`\n- Required fields: `type`, `gradient`\n- Purpose: Fixed gradient slide background fill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `tone` | no | `enum:dark \\| light` | Whether the background is dark or light, which picks the color map (dark1 or light1) so text, lines and neutrals read on it. Without a tone a picture or gradient takes the deck's variant, else counts as light. |\n| `type` | yes | `const:\"gradient\"` | Fixed gradient background fill. |\n| `gradient` | yes | `object` | Gradient fill definition: a linear gradient along 'angle' (default 0, left to right). A shape fill's Gradient also takes radial and path types; a background does not. |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### ImageBackground\n\n- Type: `object`\n- Required fields: `type`, `src`\n- Purpose: Picture background: the image fills the whole canvas behind everything and never moves content (to push content aside, use an image block with placement). The string shorthand 'asset:x' (or any image source) is { type: 'image', src: 'asset:x' }, a cover image. Paint order: the colour scheme's default slide background, the picture, then the overlay, then furniture and content.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `tone` | no | `enum:dark \\| light` | Whether the background is dark or light, which picks the color map (dark1 or light1) so text, lines and neutrals read on it. Without a tone a picture takes the tone its recolor, opacity and overlay imply (a duotone in... |\n| `type` | yes | `const:\"image\"` | Picture background. |\n| `src` | yes | `string` | Source for the background image: an 'asset:<id>' reference, HTTPS URL, data URI, or a relative path resolved against the OPF file location. |\n| `alt` | no | `string` | Alternative text. A background with alt is meaningful: PowerPoint export draws it as a full-slide picture at the back that carries the text, so screen readers see it. Without alt it is decorative and exports as the na... |\n| `fit` | no | `enum:cover \\| contain \\| stretch \\| tile` | How the picture fills the canvas: 'cover' fills it and crops what overflows around focus; 'contain' shows the whole picture centered over the colour scheme's default background; 'stretch' scales it to the canvas exact... |\n| `focus` | no | `ref:ImageFocus` | Point of the picture to keep in view when 'cover' crops it. Ignored by the other fits. Without a focus a portrait picture (taller than wide) cropped into a wider frame keeps y 0.3 so heads stay in frame; every other c... |\n| `opacity` | no | `number` | Picture opacity from 0 (fully transparent) to 1 (fully opaque); the overlay keeps its own opacity. Default 1. |\n| `recolor` | no | `ref:ImageRecolor` | Grayscale or duotone treatment of the picture's pixels, as on an image block: recolor and opacity apply to the pixels, then the overlay is drawn above. |\n| `overlay` | no | `oneOf:ref:Overlay / const:false` | Scrim over the whole picture or a band along one edge (edge, size), beneath furniture and content, for example to keep a title readable over a busy photo. Without an overlay, core draws an automatic scrim in the slide... |\n| `textPlacement` | no | `enum:top-start \\| top-center \\| middle-start \\| middle-center \\| bottom-start \\| bottom-center \\| panel` | Where a cover's or section's heading group goes on this picture: the top, middle or bottom of its area, start-aligned or centered, or 'panel' (a start-side column on the background color; needs no overlay key). Absent... |\n\n\n### ImageFocus\n\n- Type: `object`\n- Required fields: `x`, `y`\n- Purpose: A point of a picture as fractions of its width and height, from the top-left corner. A cover fit centers this point in the frame as far as the picture still covers the frame, so it always stays in view: { x: 0.5, y: 0.5 } (the default) is a center crop, { x: 0, y: 0 } keeps the top-left corner.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `x` | yes | `number` | Horizontal position, 0 (left edge) to 1 (right edge). |\n| `y` | yes | `number` | Vertical position, 0 (top edge) to 1 (bottom edge). |\n\n\n### Overlay\n\n- Type: `object`\n- Required fields: `color`, `opacity`\n- Purpose: Solid scrim over a picture: the whole frame in the frame's shape, or a band along one edge. Shared by image backgrounds and image blocks. Drawn directly above its picture and beneath headings and content; PowerPoint export writes one native shape above the picture.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | yes | `ref:ColorRef` | Overlay fill color: a hex color (eight-digit hex keeps its alpha), a color-scheme slot or role name, or a 'var:<id>' variable reference. |\n| `opacity` | yes | `number` | Overlay fill opacity. |\n| `edge` | no | `enum:top \\| bottom \\| start \\| end` | Cover only a band along this edge of the frame, for example a caption strip. Backgrounds and rectangle image frames only; on another shape the overlay is not drawn and composition reports unsupported-image-treatment.... |\n| `size` | no | `number` | Band share of the frame for an edge overlay. Default 0.3. Ignored without edge. |\n\n\n### ImagePlacement\n\n- Type: `object`\n- Required fields: `edge`\n- Purpose: Bleeds an image block to one edge of the slide: the image takes a band along that edge, edge to edge, and the headings and other content compose in the rest of the slide at the normal padding. Only top-level blocks (slides.N.blocks.I) can be placed, at most one per edge. Template layout regions do not supply image placement; set it on the image block itself. Bands are taken in block order, each spanning the free area left by earlier ones. Placement is the only mechanism that moves content asi...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `edge` | yes | `enum:start \\| end \\| top \\| bottom` | The slide edge the image bleeds to. |\n| `size` | no | `number` | Share of the slide width (start, end) or height (top, bottom) given to the band. Default 0.5. |\n| `inset` | no | `boolean` | Draw the frame inside the slide padding on every side of the band, like a card, instead of edge to edge. Default false. |\n\n\n### Stroke\n\n- Type: `anyOf:const:\"none\" / object`\n- Required fields: none\n- Purpose: A line along an outline: a shape block's outline or a picture's frame (the picture key 'border' was renamed 'stroke' in 0.33, with no alias). DrawingML a:ln. 'none' removes the line.\n\n_No named properties._\n\n\n### Arrowhead\n\n- Type: `object`\n- Required fields: none\n- Purpose: An arrowhead at one end of an open path or a line preset (DrawingML a:headEnd at the start, a:tailEnd at the end). Closed outlines have no ends, so arrowheads draw only on open paths such as arc, line or a custom path that is not closed.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | no | `enum:none \\| triangle \\| stealth \\| diamond \\| oval \\| arrow` | Arrowhead kind, DrawingML's ST_LineEndType. Default 'triangle' when the object is given. |\n| `width` | no | `enum:small \\| medium \\| large` | Arrowhead width relative to the stroke width (2, 3 or 5 stroke widths). Default medium. |\n| `length` | no | `enum:small \\| medium \\| large` | Arrowhead length relative to the stroke width (2, 3 or 5 stroke widths). Default medium. |\n\n\n### Gradient\n\n- Type: `object`\n- Required fields: `stops`\n- Purpose: A gradient fill: the background gradient object extended with 'type'. DrawingML a:gradFill: a:lin for linear, a:path circle, rect or shape for the others. The gradient rotates with the shape.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | no | `enum:linear \\| radial \\| rectangle \\| shape` | linear runs along 'angle'; radial spreads from the center as a circle, rectangle as a rectangle and shape along the shape's own outline (a:path circle, rect, shape). Default linear. |\n| `angle` | no | `number` | Linear gradients only: angle in degrees (0 = left to right, 90 = top to bottom). Default 90. |\n| `stops` | yes | `array<object>` | Ordered color stops; at least two. A radial, rectangle or shape gradient runs from the center (position 0) to the outline (position 1). |\n\n\n### Pattern\n\n- Type: `object`\n- Required fields: `preset`\n- Purpose: A two-color pattern fill (the background pattern object), DrawingML a:pattFill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `preset` | yes | `string` | DrawingML pattern preset (ECMA-376 ST_PresetPatternVal), for example pct5, ltHorz, wdUpDiag, smGrid or dotDmnd. |\n| `foregroundColor` | no | `ref:ColorRef` | Pattern color. Default the shape style's fill color. |\n| `backgroundColor` | no | `ref:ColorRef` | Color behind the pattern. Default the slide background. |\n\n\n### ShapeFill\n\n- Type: `anyOf:const:\"none\" / ref:ColorRef / object / object`\n- Required fields: none\n- Purpose: A shape block's fill: 'none', a ColorRef, { gradient } or { pattern }. Without a fill a shape takes its style's fill (the theme's accent1 for the default style). Fills rotate with the shape (rotWithShape).\n- Conditional requirement: `gradient` or `pattern`\n\n_No named properties._\n\n\n### ShapePreset\n\n- Type: `enum:line | lineInv | triangle | rtTriangle | rect | diamond | parallelogram | trapezoid | nonIsoscelesTrapezoid | pentagon | hexagon | heptagon | octagon | decagon | dodecagon | star4 | star5 | star6 | star7 | star8 | star10 | star12 | star16 | star24 | star32 | roundRect | round1Rect | round2SameRect | round2DiagRect | snipRoundRect | snip1Rect | snip2SameRect | snip2DiagRect | plaque | ellipse | teardrop | homePlate | chevron | pieWedge | pie | blockArc | donut | noSmoking | rightArrow | leftArrow | upArrow | downArrow | stripedRightArrow | notchedRightArrow | bentUpArrow | leftRightArrow | upDownArrow | leftUpArrow | leftRightUpArrow | quadArrow | leftArrowCallout | rightArrowCallout | upArrowCallout | downArrowCallout | leftRightArrowCallout | upDownArrowCallout | quadArrowCallout | bentArrow | uturnArrow | circularArrow | leftCircularArrow | leftRightCircularArrow | curvedRightArrow | curvedLeftArrow | curvedUpArrow | curvedDownArrow | swooshArrow | cube | can | lightningBolt | heart | sun | moon | smileyFace | irregularSeal1 | irregularSeal2 | foldedCorner | bevel | frame | halfFrame | corner | diagStripe | chord | arc | leftBracket | rightBracket | leftBrace | rightBrace | bracketPair | bracePair | straightConnector1 | bentConnector2 | bentConnector3 | bentConnector4 | bentConnector5 | curvedConnector2 | curvedConnector3 | curvedConnector4 | curvedConnector5 | callout1 | callout2 | callout3 | accentCallout1 | accentCallout2 | accentCallout3 | borderCallout1 | borderCallout2 | borderCallout3 | accentBorderCallout1 | accentBorderCallout2 | accentBorderCallout3 | wedgeRectCallout | wedgeRoundRectCallout | wedgeEllipseCallout | cloudCallout | cloud | ribbon | ribbon2 | ellipseRibbon | ellipseRibbon2 | leftRightRibbon | verticalScroll | horizontalScroll | wave | doubleWave | plus | flowChartProcess | flowChartDecision | flowChartInputOutput | flowChartPredefinedProcess | flowChartInternalStorage | flowChartDocument | flowChartMultidocument | flowChartTerminator | flowChartPreparation | flowChartManualInput | flowChartManualOperation | flowChartConnector | flowChartPunchedCard | flowChartPunchedTape | flowChartSummingJunction | flowChartOr | flowChartCollate | flowChartSort | flowChartExtract | flowChartMerge | flowChartOfflineStorage | flowChartOnlineStorage | flowChartMagneticTape | flowChartMagneticDisk | flowChartMagneticDrum | flowChartDisplay | flowChartDelay | flowChartAlternateProcess | flowChartOffpageConnector | actionButtonBlank | actionButtonHome | actionButtonHelp | actionButtonInformation | actionButtonForwardNext | actionButtonBackPrevious | actionButtonEnd | actionButtonBeginning | actionButtonReturn | actionButtonDocument | actionButtonSound | actionButtonMovie | gear6 | gear9 | funnel | mathPlus | mathMinus | mathMultiply | mathDivide | mathEqual | mathNotEqual | cornerTabs | squareTabs | plaqueTabs | chartX | chartStar | chartPlus`\n- Required fields: none\n- Purpose: A DrawingML preset geometry (ECMA-376 ST_ShapeType, all 187), with PowerPoint's own names: rect, roundRect, ellipse, triangle, rightArrow, chevron, wedgeRectCallout, flowChartDecision and the rest. docs/shapes.md lists them with their default frames and adjust values.\n\n_No named properties._\n\n\n### ShapePath\n\n- Type: `anyOf:string / object`\n- Required fields: none\n- Purpose: Custom geometry: SVG path data (M, L, H, V, C, S, Q, T, A and Z, absolute or relative) instead of a preset. PPTX export writes a:custGeom with the same path. A subpath that ends without Z is open: arrowheads draw at its ends (its fill closes it, as in PowerPoint).\n- Conditional requirement: `d` and `viewBox`\n\n_No named properties._\n\n\n### ShapePadding\n\n- Type: `anyOf:number / ref:TableCellPadding`\n- Required fields: none\n- Purpose: Text insets inside the shape's text rectangle (a:bodyPr lIns, tIns, rIns, bIns), in reference pixels at a 720-pixel short edge: one number for every side or { top, right, bottom, left }. Default 9.6 left and right, 4.8 top and bottom, PowerPoint's 0.1 and 0.05 inch.\n\n_No named properties._\n\n\n### Shadow\n\n- Type: `anyOf:enum:soft | hard | perspective / object`\n- Required fields: none\n- Purpose: Outer shadow (a:outerShdw): a preset name (soft, hard, perspective) or { color, opacity, blur, distance, angle, size }.\n\n_No named properties._\n\n\n### InnerShadow\n\n- Type: `object`\n- Required fields: none\n- Purpose: Inner shadow (a:innerShdw).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | no | `ref:ColorRef` | Shadow color. Default black. |\n| `opacity` | no | `number` | Shadow opacity. |\n| `blur` | no | `number` | Blur radius in reference pixels at a 720-pixel short edge. |\n| `distance` | no | `number` | Offset in reference pixels at a 720-pixel short edge. |\n| `angle` | no | `number` | Direction of the offset in degrees (0 = right, 90 = down). |\n\n\n### Glow\n\n- Type: `object`\n- Required fields: none\n- Purpose: Glow around the outline (a:glow).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `color` | no | `ref:ColorRef` | Glow color. Default accent. |\n| `opacity` | no | `number` | Glow opacity. |\n| `radius` | no | `number` | Glow size in reference pixels at a 720-pixel short edge. |\n\n\n### Reflection\n\n- Type: `object`\n- Required fields: none\n- Purpose: Reflection below the shape (a:reflection).\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `opacity` | no | `number` | Opacity where the reflection starts. |\n| `size` | no | `number` | Share of the shape's height reflected. |\n| `distance` | no | `number` | Gap between the shape and its reflection in reference pixels at a 720-pixel short edge. |\n| `blur` | no | `number` | Blur radius in reference pixels at a 720-pixel short edge. |\n\n\n### ImageRecolor\n\n- Type: `oneOf:const:\"grayscale\" / object`\n- Required fields: none\n- Purpose: Color treatment for the image pixels. Luminance uses Rec. 601 weights (0.299, 0.587, 0.114) on sRGB values.\n\n_No named properties._\n\n\n### PatternBackground\n\n- Type: `object`\n- Required fields: `type`, `pattern`\n- Purpose: Fixed pattern slide background fill.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `const:\"pattern\"` | Fixed pattern background fill. |\n| `pattern` | yes | `object` | Pattern fill definition. |\n| `opacity` | no | `number` | Background opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### OrganizationLogo\n\n- Type: `object`\n- Required fields: none\n- Purpose: An organization's logo in up to four shapes. Each shape is a path or Asset, or { onLight, onDark } for the two backgrounds. A missing shape falls back to full, and full to the first defined of wordmark, stacked and icon; within a shape a missing onLight or onDark uses the other. Shapes are placed with slide-scoped references such as 'var:organization.logo.icon'.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `full` | no | `ref:LogoSource` | The full logo (lockup): mark and name side by side. Drawn on cover and section slides, and placed by 'var:organization.logo'. |\n| `stacked` | no | `ref:LogoSource` | The stacked lockup: mark above the name, for portrait or square slots. Placed by 'var:organization.logo.stacked'. |\n| `icon` | no | `ref:LogoSource` | The mark or symbol without the name, for tight spaces such as header and footer zones and picture bullets. Placed by 'var:organization.logo.icon'. |\n| `wordmark` | no | `ref:LogoSource` | The name set in the brand's lettering, without the mark. Placed by 'var:organization.logo.wordmark'. |\n\n\n### LogoSource\n\n- Type: `oneOf:ref:Asset / object`\n- Required fields: none\n- Purpose: One logo shape: a path or Asset for every background, or { onLight, onDark }. onLight is drawn on light backgrounds (usually dark artwork) and onDark on dark backgrounds (usually light artwork), by each slide's background; a missing one uses the other.\n\n_No named properties._\n\n\n### Watermark\n\n- Type: `oneOf:schema / schema`\n- Required fields: `opacity`\n- Purpose: Decorative watermark: an image ('src') or a text stamp ('text'), exactly one of the two, with its opacity. An image is drawn once per slide, contained and centered in a fixed frame (the middle 40% of the slide width and height, from 30% to 70% on each axis). A text watermark is one line of text in the heading font and the theme text color at the given opacity, centered on the slide and rotated 30 degrees counterclockwise (rising to the right), sized to span at most 70% of the slide width and...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `src` | no | `string` | Source for the watermark image: an 'asset:<id>' reference, HTTPS URL, data URI, relative path or local path, as for Asset.src. Exactly one of src and text is set. |\n| `text` | no | `string` | Text for a text watermark, such as DRAFT or CONFIDENTIAL; line breaks are drawn as spaces. Exactly one of src and text is set. |\n| `opacity` | yes | `number` | Watermark opacity from 0 (fully transparent) to 1 (fully opaque). |\n\n\n### HeaderFooter\n\n- Type: `object`\n- Required fields: none\n- Purpose: Repeated header or footer content split into start, center, and end zones. The zones follow the deck's direction: 'start' is at the left of a left-to-right deck and at the right of a right-to-left one. Header/footer content is slide furniture, separate from the main slide content payloads.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `start` | no | `ref:HeaderFooterItem` | Content at the start edge, aligned to it. |\n| `center` | no | `ref:HeaderFooterItem` | Centered header/footer content. |\n| `end` | no | `ref:HeaderFooterItem` | Content at the end edge, aligned to it. |\n\n\n### HeaderFooterItem\n\n- Type: `object`\n- Required fields: none\n- Purpose: One header/footer zone. Every configured field renders, side by side in one row in the order image, text, socials, date (mirrored in a right-to-left deck), aligned to the zone's edge (the start edge, the center or the end edge) and vertically centered on each other; a line break inside text or socials ('\\n') stacks lines within that part. When the parts are wider than the zone their text wraps, and a row that cannot fit even so is reported as overflow. Generated values such as the slide numbe...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `text` | no | `string` | Text rendered in this zone. Variables resolve inside it like any string: deck-wide ones ('{{organization.name}}', '{{speaker.name}}, {{speaker.title}}', '{{customer}}') before composition, and the slide-scoped built-i... |\n| `image` | no | `ref:Asset` | Image rendered first in this zone's row, such as a logo, partner mark, certification badge, or icon: a path, URL or Asset, or an organization logo reference ('var:organization.logo.icon', 'var:organization.<id>.logo.w... |\n| `date` | no | `oneOf:boolean / string` | true renders the current date: the renderer or exporter must be given an explicit ISO date by its host (core never reads a clock). PPTX export writes a native date field only for a supported dateFormat whose complete... |\n| `dateFormat` | no | `string` | Date pattern for date. Tokens: yyyy (2026), yy (26), MMMM (April), MMM (Apr), MM (04), M (4), dd (09), d (9), EEEE (Thursday), EEE (Thu). Text in single quotes and other non-letter characters are literal. Month and we... |\n| `socials` | no | `boolean` | Whether to render the primary organization's social profiles from organization.socials, one line per platform in key order. A handle is formatted through the platform's socialPlatforms record (companyUrlPattern, else... |\n\n\n### OverlayShape\n\n- Type: `object`\n- Required fields: none\n- Purpose: An entry of slide 'shapes', drawn over the composed slide above the content and the furniture, later entries on top; it never moves content. An entry with 'connector' is a connector between two blocks or overlay shapes: it takes only 'id', 'connector', 'adjust', 'stroke', 'alt', 'decorative', 'hidden' and 'extensions'; core routes it as PowerPoint's own connector presets and PPTX export writes a native p:cxnSp glued to the shapes at its ends, so it follows them when they are moved in PowerPoi...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `string` | Optional stable identifier, unique among slide, payload and overlay ids in the document. A connector names it in 'from' or 'to'. |\n| `x` | no | `ref:FiniteNumber` | The shape's start edge as a signed fraction of the slide width, measured from the slide's start edge: the left edge in a left-to-right deck, the right edge in a right-to-left one. A shape sits over the layout, and the... |\n| `y` | no | `ref:FiniteNumber` | Top edge as a signed fraction of the slide height, from the top edge. Negative values or values greater than 1 place the shape partly or wholly outside the slide. |\n| `width` | no | `number` | Width as a fraction of the slide width, from 0 (a vertical line) up to 8. Above 1 the shape is wider than the slide, for a circle or band that bleeds off it; the slide crops what lies outside. |\n| `height` | no | `number` | Height as a fraction of the slide height, from 0 (a horizontal line) up to 8. Above 1 the shape is taller than the slide. |\n| `at` | no | `ref:OverlayAnchor` | |\n| `layer` | no | `enum:front \\| back` | Overlay shapes only. front (the default) draws the shape over the slide: above the content and the furniture. back draws it behind the slide: above the background and the watermark, below the content and the furniture... |\n| `connector` | no | `ref:Connector` | Makes the entry a connector: what it joins and how it runs. |\n| `shape` | no | `ref:ShapePreset` | The preset geometry, as on a shape block. Default rect. |\n| `path` | no | `ref:ShapePath` | Custom geometry instead of a preset (a:custGeom), as on a shape block. |\n| `adjust` | no | `object` | The preset's adjust handles (a:avLst) in OPF units, as on a shape block. On a connector, the adjust values of its connector preset (adj1 of an elbow or a curve between sites on one axis, a fraction of the frame's widt... |\n| `fill` | no | `ref:ShapeFill` | 'none', a ColorRef, { gradient } or { pattern }. Default the style's fill. |\n| `opacity` | no | `number` | The fill's opacity (a:alpha). Default 1. |\n| `stroke` | no | `ref:Stroke` | A shape's line along its outline (default the style's line), or a connector's line: color, width, dash, compound, sketch and arrowheads ('start' at 'from', 'end' at 'to'; default a 2-pixel line in the slide's text col... |\n| `style` | no | `enum:none \\| subtle \\| moderate \\| intense` | The theme shape style, as on a shape block. Default moderate. |\n| `shadow` | no | `ref:Shadow` | Outer shadow. |\n| `innerShadow` | no | `ref:InnerShadow` | Inner shadow. |\n| `glow` | no | `ref:Glow` | Glow. |\n| `softEdge` | no | `number` | Soft edges (a:softEdge), radius in reference pixels at a 720-pixel short edge. |\n| `reflection` | no | `ref:Reflection` | Reflection. |\n| `blur` | no | `number` | Blur of the whole shape (a:blur), radius in reference pixels at a 720-pixel short edge. |\n| `rotate` | no | `number` | Rotation in degrees, clockwise, about the shape's center (a:xfrm rot). Its connection sites turn with it. |\n| `flip` | no | `enum:horizontal \\| vertical \\| both` | Mirror the geometry (a:xfrm flipH, flipV). The text is not mirrored. |\n| `text` | no | `ref:text` | Text inside the shape's text rectangle (a string or TextRun[]), fitted by OPF's measured fonts from the body size down to the readability floor and never below it. |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Vertical placement of the text in the text rectangle (a:bodyPr anchor). Default middle. |\n| `padding` | no | `ref:ShapePadding` | Text insets inside the text rectangle. |\n| `textDirection` | no | `enum:horizontal \\| vertical \\| vertical270 \\| stacked` | Text direction (a:bodyPr vert). Default horizontal. |\n| `alt` | no | `string` | Alternative text (p:cNvPr descr). Without it the shape's text is what is read. |\n| `decorative` | no | `boolean` | Mark the shape decorative (a16:decorative): screen readers skip it. |\n| `hidden` | no | `boolean` | Keep the shape in the file but do not draw it (p:cNvPr hidden). A link on a hidden shape is a validation finding (opf/shape-link-hidden). |\n| `link` | no | `string` | URL opened when the shape is clicked in a slide show (a:hlinkClick): an http(s) URL, a 'mailto:' address or a 'tel:' number. |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows; ignored by the engine but preserved across read/write round-trips. |\n\n\n### OverlayAnchor\n\n- Type: `allOf:schema + schema`\n- Required fields: `block`, `edge`\n- Purpose: Places an overlay shape against a composed block's box, so the shape follows the block wherever composition puts it. 'edge' puts the shape outside that edge, centered along it ('start' and 'end' follow the deck's direction: left and right in a left-to-right deck, right and left in a right-to-left one); 'center' puts it on the block's center. A block id that is not on the slide is a finding (opf/shape-anchor-missing) and the shape is not drawn. With point, block must carry a supported classic...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `block` | yes | `string` | The id of a block on this slide (a content payload or a group, at any depth). |\n| `edge` | yes | `enum:top \\| bottom \\| start \\| end \\| center` | The edge of the block the shape sits outside of, or its center. |\n| `offset` | no | `number` | The gap between the block's edge and the shape, in reference pixels at a 720-pixel short edge; a negative offset overlaps the block. Default 0. Ignored for 'center'. |\n| `width` | no | `number` | The shape's width as a fraction of its target's width: the block's box, or with 'point' the chart mark's bounds. 1 is the target's own width and 1.08 a frame 8% wider, up to 8. For a size in pixels use 'widthPx'; not... |\n| `height` | no | `number` | The shape's height as a fraction of its target's height, up to 8. For a size in pixels use 'heightPx'; not both. Default as for width. |\n| `widthPx` | no | `number` | The shape's width in reference pixels at a 720-pixel short edge, whatever size its target has: a badge or a ring of a fixed size. Instead of 'width'. |\n| `heightPx` | no | `number` | The shape's height in reference pixels at a 720-pixel short edge. Instead of 'height'. |\n| `point` | no | `oneOf:string / integer` | Exact unique category label or zero-based data row index of the chart. Numeric strings name labels; numbers index rows. Empty/duplicate labels can be selected by index. Requires a supported classic chart block. |\n| `series` | no | `oneOf:string / integer` | Exact unique plotted value-column name or zero-based plotted-series index; omission selects the first plotted series. Requires point. Scatter X is not a value series. |\n\n\n### Connector\n\n- Type: `object`\n- Required fields: `from`, `to`\n- Purpose: What a connector joins and how it runs. Each end attaches to a connection site of its shape: a preset's own sites (turned and flipped with the shape), or the four edge midpoints of a block that is not a shape (DrawingML's rect: 0 top, 1 left, 2 bottom, 3 right). Without 'fromSite' and 'toSite' core chooses the pair of sites that face each other with the shortest route.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `from` | yes | `string` | The id of the block or overlay shape on this slide the connector starts at. An id that is not on the slide is a finding (opf/connector-end-missing) and the connector is not drawn. |\n| `to` | yes | `string` | The id of the block or overlay shape on this slide the connector ends at. |\n| `route` | no | `enum:straight \\| elbow \\| curved` | straight is one segment (straightConnector1); elbow runs horizontally and vertically (bentConnector3, bentConnector2 between perpendicular sites); curved is PowerPoint's curved connector (curvedConnector3, curvedConne... |\n| `fromSite` | no | `integer` | The connection site index at 'from' (DrawingML's cxn idx), instead of the automatic choice. An index the shape does not have is a validation error. |\n| `toSite` | no | `integer` | The connection site index at 'to', instead of the automatic choice. |\n\n\n### Slide\n\n- Type: `object`\n- Required fields: none\n- Purpose: A single slide. Content can be authored as a full-slide root payload, or inside promoted named region keys such as 'start', 'center+end', and 'top:start'. The columns of that grid are logical: 'start' is the left column in a left-to-right deck and the right column in a right-to-left one.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `string` | Optional stable identifier for the slide within the document. Use when another system needs to reference a slide across edits, comments, generation state, exports, or narrative tooling. Slide order is defined by the s... |\n| `language` | no | `oneOf:ref:LanguageTag / ref:Language` | Language of this slide, overriding the presentation language. Accepts the same BCP-47 tag or inline Language object as the presentation. Omission inherits the deck language. Direction, script fonts, quotation marks, l... |\n| `type` | no | `enum:text \\| list \\| image \\| chart \\| table \\| video \\| code \\| metric \\| quote \\| timeline \\| diagram` | Optional full-slide content kind. When omitted, engines infer the kind from root payload fields. |\n| `beat` | no | `oneOf:string / array<string>` | Optional reference to one or more beats of the deck's narrative (each value is the id of a beat in the narrative record that the root 'narrative' resolves to). A single string declares the slide's primary beat; an arr... |\n| `layout` | no | `ref:CatalogReference` | Optional layout: a layouts reference, a bare id ('pillars') or 'name:id' ('acme:hero'), or 'auto'. When omitted or 'auto', the slide is composed with no layout record: engines arrange title, subtitle, tag and content... |\n| `title` | no | `oneOf:string / array<ref:TextRun>` | Slide-level title content. A v2 layout renders this in its title heading area, or an implicit heading row when that area is absent. Use a string for plain text or TextRun[] for inline rich text (a colored word, bold,... |\n| `subtitle` | no | `oneOf:string / array<ref:TextRun>` | Slide-level subtitle or supporting line. A v2 layout renders this in its subtitle area when present, otherwise in the title heading group. Use a string for plain text or TextRun[] for inline rich text (a colored word,... |\n| `tag` | no | `oneOf:string / array<ref:TextRun>` | Small slide-level label or badge. A v2 layout renders this before the title in its title heading group; tag is not a separate layout area. Engines draw it as an eyebrow: 22 reference pixels, bold, in the primary color... |\n| `text` | no | `oneOf:string / array<ref:TextRun>` | Full-slide text payload. Use a string for plain text or TextRun[] for inline rich text. TextRun items may be plain strings or formatted run objects. |\n| `items` | no | `array<ref:ListItem>` | Full-slide structured list payload. Presence of this field infers type 'list'. Entries are strings, TextRun[] or objects with `text`, optional `description` (supporting detail under the entry), `level` and `start`. Us... |\n| `bullets` | no | `array<ref:BulletItem>` | Full-slide prose bullet payload: short talking points, each standing alone. Presence of this field infers type 'text', so it may sit beside `text` in one payload. Entries are strings, TextRun[] or objects with `text`,... |\n| `numbering` | no | `ref:NumberingSpec` | Number the full-slide `items` or `bullets` instead of bulleting them. A style name (arabic, roman-upper, roman-lower, alpha-upper, alpha-lower) or a Numbering object applies to every list level; an array gives one ent... |\n| `image` | no | `ref:ImagePayload` | Shorthand for one image block: the picture composes as body content, like { type: 'image', image: value }, with the effective design.imageFit. A v2 layout binds it to a compatible body region; a region's bleed setting... |\n| `video` | no | `ref:Asset` | Full-slide video source. Presence of this field infers type 'video'. Engines do not play video: the preview draws a placeholder (a play badge with the asset's title or source as its caption), and PPTX export draws the... |\n| `chart` | no | `ref:Chart` | Full-slide chart payload. Presence of this field infers type 'chart'. |\n| `table` | no | `ref:Table` | Full-slide table payload. Presence of this field infers type 'table'. |\n| `code` | no | `oneOf:string / ref:Code` | Full-slide code payload. A string is shorthand for { \"source\": value }; object form carries optional syntax language and filename metadata. |\n| `metric` | no | `oneOf:string / number / ref:Metric` | Full-slide metric payload. A string or number is shorthand for { \"value\": value }; object form carries optional label, description, unit, delta, trend, and sentiment metadata. Numeric values remain numbers; renderers... |\n| `quote` | no | `oneOf:string / ref:Quote` | Full-slide quote payload. A string is shorthand for { \"text\": value }; object form carries optional attribution and source metadata. Presence of this field infers type 'quote'. |\n| `timeline` | no | `ref:Timeline` | Full-slide timeline payload. An array is shorthand for { \"events\": value }; object form carries optional name and description metadata. Presence of this field infers type 'timeline'. |\n| `diagram` | no | `oneOf:string / ref:Diagram` | Full-slide diagram payload: Mermaid, Graphviz DOT or PlantUML source drawn in the deck's fonts and colors. A string is shorthand for { \"source\": value }; object form carries the source syntax and a text alternative. P... |\n| `caption` | no | `ref:Caption` | Caption for the slide's root image, chart, table, video or diagram payload. Valid only when the slide root holds exactly one of those payloads. |\n| `blocks` | no | `array<ref:ContentPayload>` | Layout-agnostic content blocks rendered together as a composed payload when exact placement is unspecified. At slide root, multiple content payload kinds with no explicit type, blocks, or regions are accepted as short... |\n| `shapes` | no | `array<ref:OverlayShape>` | Shapes and connectors drawn over the composed slide, above its content and furniture, in array order (later entries on top). They never move content. An entry with connector is a connector between two blocks or overla... |\n| `design` | no | `ref:SlideDesign` | Slide-level design applied on top of the deck-wide design. |\n| `start` | no | `ref:ContentPayload` | |\n| `center` | no | `ref:ContentPayload` | |\n| `end` | no | `ref:ContentPayload` | |\n| `start+center` | no | `ref:ContentPayload` | |\n| `center+end` | no | `ref:ContentPayload` | |\n| `start+center+end` | no | `ref:ContentPayload` | |\n| `top` | no | `ref:ContentPayload` | |\n| `middle` | no | `ref:ContentPayload` | |\n| `bottom` | no | `ref:ContentPayload` | |\n| `top+middle` | no | `ref:ContentPayload` | |\n| `middle+bottom` | no | `ref:ContentPayload` | |\n| `top+middle+bottom` | no | `ref:ContentPayload` | |\n| `top:start` | no | `ref:ContentPayload` | |\n| `top:center` | no | `ref:ContentPayload` | |\n| `top:end` | no | `ref:ContentPayload` | |\n| `top:start+center` | no | `ref:ContentPayload` | |\n| `top:center+end` | no | `ref:ContentPayload` | |\n| `top:start+center+end` | no | `ref:ContentPayload` | |\n| `middle:start` | no | `ref:ContentPayload` | |\n| `middle:center` | no | `ref:ContentPayload` | |\n| `middle:end` | no | `ref:ContentPayload` | |\n| `middle:start+center` | no | `ref:ContentPayload` | |\n| `middle:center+end` | no | `ref:ContentPayload` | |\n| `middle:start+center+end` | no | `ref:ContentPayload` | |\n| `bottom:start` | no | `ref:ContentPayload` | |\n| `bottom:center` | no | `ref:ContentPayload` | |\n| `bottom:end` | no | `ref:ContentPayload` | |\n| `bottom:start+center` | no | `ref:ContentPayload` | |\n| `bottom:center+end` | no | `ref:ContentPayload` | |\n| `bottom:start+center+end` | no | `ref:ContentPayload` | |\n| `top+middle:start` | no | `ref:ContentPayload` | |\n| `top+middle:center` | no | `ref:ContentPayload` | |\n| `top+middle:end` | no | `ref:ContentPayload` | |\n| `top+middle:start+center` | no | `ref:ContentPayload` | |\n| `top+middle:center+end` | no | `ref:ContentPayload` | |\n| `top+middle:start+center+end` | no | `ref:ContentPayload` | |\n| `middle+bottom:start` | no | `ref:ContentPayload` | |\n| `middle+bottom:center` | no | `ref:ContentPayload` | |\n| `middle+bottom:end` | no | `ref:ContentPayload` | |\n| `middle+bottom:start+center` | no | `ref:ContentPayload` | |\n| `middle+bottom:center+end` | no | `ref:ContentPayload` | |\n| `middle+bottom:start+center+end` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:start` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:center` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:end` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:start+center` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:center+end` | no | `ref:ContentPayload` | |\n| `top+middle+bottom:start+center+end` | no | `ref:ContentPayload` | |\n| `notes` | no | `string` | Speaker notes shown in presenter view. |\n| `section` | no | `string` | PowerPoint-style slide section label. Consecutive slides with the same value belong to the same section in presenter view, outlines, and PowerPoint section-aware exports. Also the slide-scoped built-in variable '{{sli... |\n| `hidden` | no | `boolean` | Whether the slide is hidden from the presented sequence. The player skips it, the PPTX export writes it as a hidden slide, and per-slide image and PDF output skips it unless the caller asks to include hidden slides (o... |\n| `composition` | no | `ref:Composition` | |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows at slide scope; ignored by the engine but preserved across read/write round-trips. Use for review state, generation provenance, or authoring conventions such as { \"authoring... |\n\n\n### ImageBlockOption\n\n- Type: `schema`\n- Required fields: `image`\n- Purpose: An option of image blocks only (fit, focus, recolor, overlay, placement, portrait): the block must hold an 'image'.\n\n_No named properties._\n\n\n### ImageOrShapeBlockOption\n\n- Type: `anyOf:schema / schema / schema`\n- Required fields: none\n- Purpose: An option of image blocks and shape blocks (aspectRatio, adjust, stroke, opacity): the block must hold an 'image', a 'shape' or a 'path'.\n- Conditional requirement: `image` or `shape` or `path`\n\n_No named properties._\n\n\n### ShapeBlockOption\n\n- Type: `anyOf:schema / schema`\n- Required fields: none\n- Purpose: An option of shape blocks only (fill, style, rotate, flip, the text frame, accessibility, link and the six effects): the block must be a shape block, which is a 'shape' with no 'image', or a 'path'.\n- Conditional requirement: `shape` or `path`\n\n_No named properties._\n\n\n### ContentPayload\n\n- Type: `allOf:schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema + schema`\n- Required fields: none\n- Purpose: A content leaf or recursively composed group. A group contains blocks and optional composition; it cannot mix blocks with leaf payload fields. Groups may nest up to 32 levels.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | no | `string` | Optional stable identifier for this payload, unique among slide and payload ids in the document. Use when another system needs to address the payload across edits patch-style agent edits, comments, review state, or ge... |\n| `extensions` | no | `object` | Custom data passthrough for agent workflows at payload scope; ignored by the engine but preserved across read/write round-trips. |\n| `region` | no | `string` | Pin a root block (slides.N.blocks.I) to a region of the slide's template layout by name. The block goes to that region when the region exists, accepts the block's kind and has room; otherwise the pin is ignored with a... |\n| `type` | no | `enum:text \\| list \\| image \\| chart \\| table \\| video \\| code \\| metric \\| quote \\| timeline \\| diagram \\| shape \\| group` | Optional content kind. When omitted, engines infer the kind from the fields present: a block with 'shape' and no 'image', or with 'path', is a shape block. |\n| `text` | no | `oneOf:string / array<ref:TextRun>` | Text payload. Use a string for plain text or TextRun[] for inline rich text. TextRun items may be plain strings or formatted run objects. |\n| `items` | no | `array<ref:ListItem>` | Structured list payload (type 'list'). Each item is either a plain string, a TextRun[] rich text sequence, or a ListItem object with optional `description`. List nesting uses item.level rather than nested content payl... |\n| `bullets` | no | `array<ref:BulletItem>` | Prose bullet payload: short talking points, each standing alone. Presence of this field infers type 'text', so it may sit beside `text` in one payload. Entries have no `description`; use `items` for entries with suppo... |\n| `numbering` | no | `ref:NumberingSpec` | Number the payload's `items` or `bullets` instead of bulleting them. A style name (arabic, roman-upper, roman-lower, alpha-upper, alpha-lower) or a Numbering object applies to every list level; an array gives one entr... |\n| `columns` | no | `oneOf:const:\"auto\" / integer` | Lay the payload's `items` or `bullets` out in columns. 'auto' tries 1, 2 then 3 equal columns at the starting text size and uses the first count at which the list fits, as long as a column stays at least a quarter of... |\n| `image` | no | `ref:ImagePayload` | Source for an image item. |\n| `fit` | no | `enum:cover \\| contain \\| stretch \\| auto` | Image payloads only. How the picture fills its frame: 'cover' fills it and crops what overflows around focus; 'contain' shows the whole picture, in a frame of its own proportions placed at the region's anchor (top by... |\n| `focus` | no | `ref:ImageFocus` | Image payloads only. Point of the picture to keep in view when 'cover' crops it. Ignored by the other fits. Without a focus a portrait picture (taller than wide) cropped into a wider frame keeps y 0.3 so heads stay in... |\n| `aspectRatio` | no | `number` | Image payloads only. Width-to-height ratio of the frame: the frame becomes the largest centered box with this ratio inside the block's region, for example 2.39 for a cinematic letterbox or 0.5 for a phone-shaped frame... |\n| `shape` | no | `ref:ShapePreset` | The preset geometry. Without 'image' it makes the block a shape block: the preset drawn at the block's own fitted size with 'fill', 'stroke' and 'style', and 'text' inside its text rectangle. On an image block it is t... |\n| `stroke` | no | `ref:Stroke` | Shape and image blocks. The line along the outline: a shape's outline or the picture frame's shape (renamed from the picture key 'border' in 0.33, no alias). Without it a shape takes its style's line; a picture has none. |\n| `path` | no | `ref:ShapePath` | Shape blocks only. Custom geometry instead of a preset (a:custGeom): SVG path data in a 0 to 1 box, or { d, viewBox }. A block with 'path' is a shape block. |\n| `fill` | no | `ref:ShapeFill` | Shape blocks only. 'none', a ColorRef, { gradient } or { pattern }. Default the style's fill. |\n| `style` | no | `enum:none \\| subtle \\| moderate \\| intense` | Shape blocks only. The theme shape style, as PowerPoint's shape styles (p:style with a:lnRef, a:fillRef, a:effectRef and a:fontRef): subtle is a light tint of accent1 with an accent1 line and dark text, moderate (the... |\n| `rotate` | no | `number` | Shape blocks only. Rotation in degrees, clockwise, about the shape's center (a:xfrm rot). Composition keeps the unrotated box; the rotated outline may reach past it. |\n| `flip` | no | `enum:horizontal \\| vertical \\| both` | Shape blocks only. Mirror the geometry (a:xfrm flipH, flipV). The text is not mirrored. |\n| `anchor` | no | `enum:top \\| middle \\| bottom` | Shape blocks only. Vertical placement of the text in the text rectangle (a:bodyPr anchor t, ctr, b). Default middle. |\n| `padding` | no | `ref:ShapePadding` | Shape blocks only. Text insets inside the text rectangle. |\n| `textDirection` | no | `enum:horizontal \\| vertical \\| vertical270 \\| stacked` | Shape blocks only. Text direction (a:bodyPr vert horz, vert, vert270, wordArtVert): vertical turns the text 90 degrees clockwise, vertical270 270, stacked stacks the letters top to bottom. Default horizontal. |\n| `alt` | no | `string` | Shape blocks only. Alternative text for screen readers (p:cNvPr descr). Without it a shape's text is what is read. |\n| `decorative` | no | `boolean` | Shape blocks only. Mark the shape decorative (a16:decorative): screen readers skip it and the accessibility checker does not ask for alt text. |\n| `hidden` | no | `boolean` | Shape blocks only. Keep the shape in the file but do not draw it (p:cNvPr hidden). Composition still gives it its room. A link on a hidden shape cannot be clicked and is a validation finding (opf/shape-link-hidden). |\n| `link` | no | `string` | Shape blocks only. URL opened when the shape is clicked in a slide show (a:hlinkClick): an http(s) URL, a 'mailto:' address or a 'tel:' number. |\n| `shadow` | no | `ref:Shadow` | Shape blocks only. Outer shadow. |\n| `innerShadow` | no | `ref:InnerShadow` | Shape blocks only. Inner shadow. |\n| `glow` | no | `ref:Glow` | Shape blocks only. Glow. |\n| `softEdge` | no | `number` | Shape blocks only. Soft edges (a:softEdge): the radius over which the outline fades, in reference pixels at a 720-pixel short edge. |\n| `reflection` | no | `ref:Reflection` | Shape blocks only. Reflection. |\n| `blur` | no | `number` | Shape blocks only. Blur of the whole shape (a:blur), radius in reference pixels at a 720-pixel short edge. |\n| `adjust` | no | `object` | Shape and image blocks. The preset's adjust handles (a:avLst), named as DrawingML's guides (adj, adj1, adj2 ... and hexagon's vf): fractions of the shape's shorter side or of its size as the preset defines them, degre... |\n| `opacity` | no | `number` | Image and shape blocks. On an image: the picture's opacity, exported as a native alphaModFix; the stroke and overlay keep their own. On a shape: the fill's opacity (a:alpha on the fill color, multiplied with an eight-... |\n| `recolor` | no | `ref:ImageRecolor` | Image payloads only. Grayscale or duotone treatment of the picture's pixels. |\n| `overlay` | no | `ref:Overlay` | Image payloads only. Scrim over the picture in the frame's shape, or a band along one edge of a rectangle frame. |\n| `placement` | no | `ref:ImagePlacement` | Image payloads only, and only on a top-level block (slides.N.blocks.I), at most one per edge. Bleeds the image to one slide edge; the headings and the other blocks compose in the rest of the slide. |\n| `portrait` | no | `enum:avatar \\| side \\| top` | Image payloads only: how a person's picture is drawn in a team. A person is a group of a picture followed by a name (a list of one entry, whose description holds the role and a line, or a short text); a slide whose bo... |\n| `video` | no | `ref:Asset` | Source for a video item. Engines do not play video: the preview draws a placeholder (a play badge with the asset's title or source as its caption), and PPTX export draws the same placeholder as native shapes linked to... |\n| `chart` | no | `ref:Chart` | Chart payload. Presence of this field infers type 'chart'. |\n| `table` | no | `ref:Table` | Table payload. Presence of this field infers type 'table'. |\n| `code` | no | `oneOf:string / ref:Code` | Code payload. A string is shorthand for { \"source\": value }; object form carries optional syntax language and filename metadata. |\n| `metric` | no | `oneOf:string / number / ref:Metric` | Metric payload. A string or number is shorthand for { \"value\": value }; object form carries optional label, description, unit, delta, trend, and sentiment metadata. Numeric values remain numbers; renderers format them... |\n| `quote` | no | `oneOf:string / ref:Quote` | Quote payload. A string is shorthand for { \"text\": value }; object form carries optional attribution, role, photo and source metadata. |\n| `timeline` | no | `ref:Timeline` | Timeline payload ordered by narrative or chronology. |\n| `diagram` | no | `oneOf:string / ref:Diagram` | Diagram payload: Mermaid source (flowchart, sequence, state, class, ER, mindmap, timeline, journey, C4, architecture and the other built-in Mermaid families), or Graphviz DOT or PlantUML source with 'syntax', drawn in... |\n| `caption` | no | `ref:Caption` | Caption for an image, chart, table, video or diagram payload, composed inside the block's region (below the media by default). Invalid on other payload kinds and on groups. |\n| `blocks` | no | `array<ref:ContentPayload>` | Ordered children of a group. Each child is a leaf or another group. |\n| `composition` | no | `ref:Composition` | Arrangement within this group. Only minFontSize, maxFontSize and overflow inherit from the parent; strict overflow cannot be weakened. |\n| `emphasis` | no | `boolean` | true draws this block or group on the slide's emphasis surface: a contrasting card in its cell (a dark card on a light slide, an accent card on a dark one), from the deck's own scheme slots, with every text color on i... |\n| `icon` | no | `ref:IconReference` | Groups only: an icon drawn on a chip at the top of the group, before its heading, as a card of features or topics draws one: \"<set>:<name>\" (\"lucide:shield-check\"), a name from the deck's icons, or an SVG source. A li... |\n\n\n### Quote\n\n- Type: `object`\n- Required fields: `text`\n- Purpose: Quote content with optional attribution metadata. Use 'text' for the quoted text, 'attribution' for the credited person or organization, 'role' for that person's title and organization, 'photo' for their headshot and 'source' for a citation or URL. A string value in a quote field is shorthand for { \"text\": value }.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `text` | yes | `oneOf:string / array<ref:TextRun>` | Quoted text: a string, or TextRun[] for inline rich text (a colored phrase, bold, a link, or a citation or footnote marker). The engine draws the surrounding quotation marks. |\n| `attribution` | no | `string` | Person or organization credited for the quote. Drawn after the quote text, in the muted text color. |\n| `role` | no | `string` | Title and organization of the attributed person. Drawn on its own line under the attribution; without an attribution it stands alone. It does not replace the attribution, so the person's name belongs in 'attribution'. |\n| `photo` | no | `ref:Asset` | Headshot of the attributed person, drawn as a circle beside the attribution and role lines (on the logical start side: left in a left-to-right deck, right in a right-to-left deck), or as a tall portrait beside the quo... |\n| `portrait` | no | `enum:avatar \\| side` | How the `photo` is drawn. 'side' draws it as a tall picture at the start of the quote (about a quarter of its width, rounded, cropped around the upper third), the quote text beside it and centered against it; 'avatar'... |\n| `source` | no | `string` | Optional quote source, citation, or URL. Follows the attribution and role after ' - '. |\n\n\n### Code\n\n- Type: `object`\n- Required fields: `source`\n- Purpose: Code content with optional rendering metadata. Use 'source' for the code text, 'language' for syntax highlighting, 'filename' when the rendered block should show a file label, and 'highlight' to emphasize lines. A string value in a code field is shorthand for { \"source\": value }.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `source` | yes | `string` | Source code text to display. |\n| `language` | no | `string` | Language identifier used for syntax highlighting. |\n| `filename` | no | `string` | Optional file label shown with the code block. |\n| `highlight` | no | `array<oneOf:integer / array<integer>>` | Source lines to emphasize, 1-based: each entry is a line number or an inclusive [start, end] range, so [3, [5, 7]] marks lines 3 and 5 to 7. Lines are counted by line break in 'source', so a line that wraps stays one... |\n\n\n### Metric\n\n- Type: `object`\n- Required fields: `value`\n- Purpose: Metric content with optional display metadata. Use 'value' for the primary value, 'label' for the metric name, 'description' for supporting context, 'unit' for a suffix/currency marker, 'delta' for change, 'trend' for direction, and 'sentiment' for whether the change is good news. A string or number value in a metric field is shorthand for { \"value\": value }; numeric values remain numbers and are formatted by renderers.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `value` | yes | `oneOf:string / number` | Primary metric value. |\n| `label` | no | `string` | Metric label. |\n| `description` | no | `string` | Optional supporting context for the metric. |\n| `unit` | no | `string` | Metric unit, suffix, or currency marker. |\n| `delta` | no | `oneOf:string / number` | Metric change value. |\n| `trend` | no | `enum:up \\| down \\| flat` | Metric trend direction. The preview and the PowerPoint export draw it as an arrow that always points the way the trend does (up, down or flat), before the delta on its line (or before the label without a delta), and c... |\n| `sentiment` | no | `enum:positive \\| negative \\| neutral` | Whether the change is good news. Positive draws the trend arrow and the trend and delta text in green, negative in red and neutral in the neutral text colour, each kept at 4.5:1 contrast or more against the slide back... |\n| `icon` | no | `ref:IconReference` | An icon drawn on a chip above the metric: \"<set>:<name>\" (\"lucide:users\"), a name from the deck's icons, or an SVG source. Decoration only: when the slide has no room for it without setting text smaller, it is not dra... |\n\n\n### Diagram\n\n- Type: `object`\n- Required fields: `source`\n- Purpose: A diagram written as text (Mermaid, Graphviz DOT or PlantUML), laid out with the deck's measured fonts and resolved colors at the largest type size that fits. PPTX export defaults to editable native shapes, connectors and text in one group for qualified families; unsupported families or drawing constructs use an SVG picture with a PNG fallback. The diagrams: \"picture\" option always uses that picture form. A string diagram is shorthand for { \"source\": value }.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `source` | yes | `string` | The diagram source. With syntax 'mermaid' (the default) it is Mermaid 12.1 text whose first line names the diagram type (flowchart, sequenceDiagram, classDiagram, stateDiagram-v2, erDiagram, gantt, pie, mindmap, timel... |\n| `syntax` | no | `enum:mermaid \\| dot \\| plantuml` | The language of 'source': 'mermaid' (Mermaid 12.1, the default), 'dot' (Graphviz DOT, drawn with the layered layout) or 'plantuml' (PlantUML, drawn as the Mermaid family of the same kind). OPF reads all three itself;... |\n| `alt` | no | `string` | Text alternative that says what the diagram shows. Exported as the description of the native shape group or picture. Without it, engines derive one from the diagram's labels. |\n\n\n### Timeline\n\n- Type: `oneOf:array<ref:TimelineEvent> / object`\n- Required fields: none\n- Purpose: Timeline content. An array is shorthand for { \"events\": value }; object form carries optional name and description metadata.\n\n_No named properties._\n\n\n### TimelineEvent\n\n- Type: `object`\n- Required fields: `what`\n- Purpose: A single event inside a timeline content payload.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `when` | no | `string` | Event time, date, or sequence label. Use ISO-like values when possible, but human labels are allowed for quarters, eras, and relative milestones. |\n| `duration` | no | `number` | Relative length of this consecutive event period. Use the same unit for every event (for example 1 for Week 1 and 4 for Weeks 2 5). Omitted means one unit. When any event supplies duration, both engines draw proportio... |\n| `what` | yes | `string` | Short event label. |\n| `description` | no | `string` | Optional event detail. |\n| `status` | no | `enum:done \\| current \\| planned` | Progress of the event, drawn from the deck's own colors by both the SVG renderer and the PPTX exporter. Absent means no status and the event is drawn as a plain filled marker with normal text, which is also how 'done'... |\n\n\n### ListItem\n\n- Type: `oneOf:string / array<ref:TextRun> / object`\n- Required fields: none\n- Purpose: A flat item inside a list. Strings cover the common case, TextRun[] supports inline rich text without an object wrapper, and object form adds description and nesting depth without creating nested slide content payloads.\n\n_No named properties._\n\n\n### BulletItem\n\n- Type: `oneOf:string / array<ref:TextRun> / object`\n- Required fields: none\n- Purpose: A flat bullet item. Strings cover the common case, TextRun[] supports inline rich text without an object wrapper, and object form adds nesting depth without list-item descriptions.\n\n_No named properties._\n\n\n### NumberingStyle\n\n- Type: `enum:arabic | roman-upper | roman-lower | alpha-upper | alpha-lower`\n- Required fields: none\n- Purpose: A list number style: 1, 2, 3; I, II, III; i, ii, iii; A, B, C; a, b, c. Alphabetic numbering past 26 repeats the letter as PowerPoint does (aa, bb, cc). Roman numerals stop at 3999; larger values are drawn in arabic with a numbering-adapted diagnostic.\n\n_No named properties._\n\n\n### Numbering\n\n- Type: `object`\n- Required fields: none\n- Purpose: Numbering of one list level.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `style` | no | `ref:NumberingStyle` | Number style. Default arabic. |\n| `start` | no | `integer` | First number counted at this level. Default 1. Native PowerPoint accepts 1 to 32767. |\n| `suffix` | no | `enum:period \\| paren \\| paren-both` | Text after the number: period (1.), paren (1)) or paren-both ((1)). Default period. |\n\n\n### NumberingSpec\n\n- Type: `oneOf:ref:NumberingStyle / ref:Numbering / array<oneOf:ref:NumberingStyle / ref:Numbering>`\n- Required fields: none\n- Purpose: The value of a numbering field: a style name or Numbering object for every level, or an array with one entry per level (at most 9, the native depth).\n\n_No named properties._\n\n\n### TextRun\n\n- Type: `oneOf:string / object`\n- Required fields: none\n- Purpose: A contiguous run of text. Strings cover unformatted spans; object form adds character formatting.\n\n_No named properties._\n\n\n### Caption\n\n- Type: `oneOf:string / array<ref:TextRun> / object`\n- Required fields: none\n- Purpose: A caption for an image, chart, table, video or diagram payload. A string or TextRun[] is the caption text placed below the media; object form adds the position and alignment.\n\n_No named properties._\n\n\n### Reference\n\n- Type: `object`\n- Required fields: `id`, `text`\n- Purpose: A source that runs cite with 'cite'. Cited references are listed in the footnote area of the slides that cite them, numbered per deck in order of first use; referencesSlide() builds an ordinary list slide of them.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `id` | yes | `string` | Identifier runs cite. Unique within the references list. |\n| `text` | yes | `oneOf:string / array<ref:TextRun>` | The reference as it is listed: a string or TextRun[] for inline rich text. |\n| `url` | no | `string` | Optional link for the reference; a references slide links its entry to it. |\n\n\n### FiniteNumber\n\n- Type: `number`\n- Required fields: none\n- Purpose: A finite number. JSON text such as 1e999 reads as Infinity in JavaScript and YAML has .inf and .nan; these bounds reject them.\n\n_No named properties._\n\n\n### Line\n\n- Type: `anyOf:const:\"none\" / object`\n- Required fields: none\n- Purpose: A plain line: its color, width and dash, or 'none' for no line. Shared by table cell borders and chart reference lines. A shape's outline is a Stroke, which adds what only an outline has (gradient, caps, joins, compound lines, arrowheads, sketch). Every part is optional and falls back to the default of the place the line is used.\n\n_No named properties._\n\n\n### ChartReferenceLine\n\n- Type: `object`\n- Required fields: `value`\n- Purpose: One explicit reference on the chart's numeric value axis. Labels and titles never select its value, units or placement. A reference at a category or a band between two values is not expressible yet; 'axis' and a separate key are reserved for them.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `value` | yes | `ref:FiniteNumber` | Finite value in the associated data-axis units. With format 0%, 0.25 means 25%; 25 means 2500%. Every reference expands automatic bounds when needed. |\n| `axis` | no | `enum:value \\| secondary` | Secondary requires a combo chart with an actual secondary line series. |\n| `label` | no | `string` | Optional nonblank plain text, shown verbatim. Omission draws no label. |\n| `labelPosition` | no | `enum:start \\| end` | Logical endpoint. Horizontal start/end mirror in RTL; on bars they mean top/bottom. Requires label. |\n| `stroke` | no | `ref:Line` | The line's color, width and dash, or 'none' to draw only the label. Defaults: the chart-text neutral, 4/3 reference pixels (1 point) and 'dash'. The value expands the axis bounds whether or not the line is drawn. |\n\n\n### Chart\n\n- Type: `object`\n- Required fields: `type`, `data`\n- Purpose: Chart content. The chart object keeps chart-specific fields together so slides and regions do not expose loose chart fields. OPF charts are `{ type, data }` where `data` is `{ columns, rows }`: the first column holds the category labels and every further column is one series. There are no `categories`, `series`, `labels` or `datasets` keys (the Chart.js and ECharts shape); write them as columns and rows. Example: `{ \"type\": \"column\", \"data\": { \"columns\": [\"Quarter\", \"Decks\"], \"rows\": [[\"Q1\",...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `type` | yes | `enum:100pct-stacked-area \\| 100pct-stacked-bar \\| 100pct-stacked-column \\| area \\| bar \\| box-and-whisker \\| column \\| combo \\| doughnut \\| filled-radar \\| funnel \\| histogram \\| line \\| line-with-markers \\| pareto \\| pie \\| radar \\| radar-with-markers \\| scatter \\| stacked-area \\| stacked-bar \\| stacked-column \\| stacked-line \\| stacked-line-with-markers \\| treemap \\| waterfall \\| world` | Chart type, an engine vocabulary validated directly (no catalog lookup): the chart types OPF supports natively in its preview and PPTX export, plus 'combo' (clustered columns with line series, see 'line' and 'secondar... |\n| `data` | yes | `oneOf:ref:ChartData / ref:DatasetRef` | Chart data. Inline data uses a tabular columns/rows shape; renderers convert rows to chart series internally. A DatasetRef ({ \"dataset\": \"<id>\" }) plots a top-level dataset instead. Data from a spreadsheet or file is... |\n| `mapping` | no | `ref:ChartMapping` | Optional series mapping by column name: which column is the category, which is the X column of a scatter chart, and which columns are plotted, in order. Absent keeps the positional rule (first column the category, the... |\n| `line` | no | `array<string>` | Combo charts only (type 'combo'): the plotted series, by column name, that are drawn as lines with markers; every other plotted series is drawn as clustered columns. Absent: the last plotted series is the line. A comb... |\n| `secondaryAxis` | no | `array<string>` | Combo charts only: line series, by column name, plotted against a secondary value axis at the end of the plot (the right; the left in a right-to-left deck, where the category axis runs from the right). That axis has i... |\n| `referenceLines` | no | `array<ref:ChartReferenceLine>` | Explicit numeric references on the chart's value axis, supported on the chart types with one value axis for every series: column, bar, line, line-with-markers, area and combo. A non-empty list on any other type (the s... |\n| `axisTitles` | no | `ref:ChartAxisTitles` | Optional axis titles. Absent keeps today's untitled axes. Supported on the chart types that have a category/value (or X/Y) axis pair (column, bar, line, area, scatter, and the histogram, pareto, waterfall and box-and-... |\n| `legend` | no | `enum:none \\| top \\| bottom \\| left \\| right` | Optional legend position. 'none' hides the legend. Absent leaves it to the engines: a line chart of two to four series names its series at the line ends and a pie or one-series doughnut names its slices, with no legen... |\n| `dataLabels` | no | `oneOf:boolean / ref:ChartDataLabels` | Optional data labels. true shows value labels at each type's default position and false shows none. Absent leaves it to the engines: no labels, except on a small chart, which labels its values in place of its value ax... |\n| `alt` | no | `string` | Text alternative for the chart: what the data shows (the point and the key numbers), not 'a chart' or 'bar chart'. The preview exposes it as the chart's accessible name (role img with aria-label) and the PowerPoint ex... |\n| `colors` | no | `array<ref:ColorRef>` | Optional series colors, by position: entry i replaces palette color i, the color of series i (the i-th plotted value column), of slice or category i on a pie, doughnut, treemap or funnel chart, and of the i-th color a... |\n| `highlight` | no | `ref:ChartHighlight` | Optional emphasis: the series and/or categories that carry the message. The engines draw the highlighted marks in the deck's primary (accent) color and every other mark in a muted neutral derived from the theme (a lig... |\n\n\n### ChartAxisTitles\n\n- Type: `object`\n- Required fields: none\n- Purpose: Titles for the axes of a chart. 'category' is the axis that carries the row labels (the horizontal axis of a column or line chart, the vertical axis of a bar chart, the X axis of a scatter chart); 'value' is the other axis; 'secondary' is the secondary value axis of a combo chart.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `category` | no | `string` | Title of the category (X) axis. |\n| `value` | no | `string` | Title of the value (Y) axis. On a combo chart, the primary value axis (at the start of the plot). |\n| `secondary` | no | `string` | Combo charts only: title of the secondary value axis at the end of the plot (the right; the left in a right-to-left deck), drawn rotated like the primary value axis title. Dropped with a 'chart-option-adapted' diagnos... |\n\n\n### ChartHighlight\n\n- Type: `object`\n- Required fields: none\n- Purpose: Which series and categories a chart emphasizes. Present, it is the only source of emphasis: engines then derive none from the slide's texts. Empty lists (for example { \"categories\": [] }) highlight nothing, which switches derived emphasis off as table.highlight { \"rows\": [] } does. Names are matched exactly: series by data column name (after any 'fields' selection; a series is a plotted value column), categories by row label (the first column, or mapping.category), as text. A category label s...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `series` | no | `array<string>` | Series (value columns) to highlight: all marks of each named series. A name that is not a column is a 'chart-highlight-unknown-name' error; a column that is not plotted as a series (the category or X column, or one ma... |\n| `categories` | no | `array<string>` | Categories (row labels) to highlight: the marks of each named category (a column or bar of every series, a line's points, a pie or doughnut slice). A label no row has is a 'chart-highlight-unknown-name' error. |\n\n\n### ChartDataLabels\n\n- Type: `object`\n- Required fields: none\n- Purpose: Data label settings. A label shows the selected content parts in the fixed order category, value, percent, joined by the separator.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `content` | no | `array<enum:value \\| percent \\| category>` | Which parts a label shows. Defaults to ['value']. 'percent' is the share of the total and exists only on pie and doughnut charts; 'category' shows the category name (the X value on a scatter chart). A part a chart typ... |\n| `position` | no | `enum:auto \\| center \\| inside-end \\| inside-base \\| outside-end \\| above \\| below \\| left \\| right` | Where a label sits relative to its mark. 'auto' (the default) is the type's default: outside-end for clustered columns and bars, pie slices and the histogram, pareto and waterfall constructs; center for stacked column... |\n| `separator` | no | `string` | Text between the parts of a label that shows more than one. Defaults to ', '. |\n\n\n### Table\n\n- Type: `object`\n- Required fields: none\n- Purpose: Table content, inline or dataset-backed. An inline table has 'rows' (required) and optional 'columns'. A dataset-backed table has 'dataset' (required) and optional 'fields', and no 'rows' or 'columns': it takes its headers, rows and column formats from the dataset (per-cell styles need an inline table).\n- Conditional requirement: `dataset`, or otherwise `rows`\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `columns` | no | `array<oneOf:string / array<ref:TextRun> / ref:StyledTableCell / ref:DataColumn / null>` | Optional column labels. Labels may be strings, rich runs, styled cell objects or DataColumn objects ({ \"name\", \"format\" }). A header's 'format' (DataColumn or StyledTableCell) is the column's number format; a body cel... |\n| `rows` | no | `array<array<ref:TableCell>>` | Two-dimensional table row data; each row aligns by index with columns when columns are supplied. |\n| `dataset` | no | `ref:DatasetId` | Id of a top-level dataset that supplies this table's headers, rows and column formats. Excludes 'rows' and 'columns'. An unknown id is a 'dataset-unknown' error. |\n| `fields` | no | `ref:DatasetFields` | Dataset tables only: the dataset columns to show, by name and in order. Absent shows every column. An unknown name is a 'dataset-field-unknown' error. |\n| `alt` | no | `string` | Text alternative for the table: what it shows (the point and the key numbers), not 'a table'. The preview exposes it as the table's accessible name (role group with aria-label; the cells stay readable) and the PowerPo... |\n| `highlight` | no | `object` | Optional emphasis: the body rows that carry the message, named by their first-column (key) text exactly as 'chart.highlight' names categories, as text; a key shared by several rows highlights each of them. The engines... |\n\n\n### ChartData\n\n- Type: `object`\n- Required fields: `columns`, `rows`\n- Purpose: Inline tabular data driving a chart, written as `{ \"columns\": [\"Quarter\", \"Decks\"], \"rows\": [[\"Q1\", 3], [\"Q2\", 8]] }`: one column of labels plus one column per series, not separate `categories` and `series` lists. The first column usually supplies category/x-axis labels; subsequent columns are plotted measures unless 'chart.mapping' or a chart type maps them differently. Value cells are numbers; a string is read only in strict decimal syntax ('12', '-3.5', '1e6'), and anything else ('12%', '$...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `columns` | yes | `array<oneOf:string / ref:DataColumn>` | Ordered column labels for the chart data table. A label is a string or a DataColumn ({ \"name\", \"format\" }) whose number format the data labels, value axis and exported workbook use. |\n| `rows` | yes | `array<array<ref:ChartDataCell>>` | Tabular chart rows. Each row aligns by index with columns. |\n| `source` | no | `ref:DataSourceRef` | Optional provenance: where this inline data came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import. |\n\n\n### DataColumn\n\n- Type: `object`\n- Required fields: `name`\n- Purpose: A named data column with an optional number format. Anywhere a chart or dataset column is a string it may be a DataColumn; the string form is { \"name\": value } with no format. A table column header may also be a DataColumn.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `name` | yes | `string` | Column label, used as the series name, the table header and the name 'fields' and 'chart.mapping' address. |\n| `format` | no | `ref:NumberFormat` | Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form. |\n\n\n### DataSourceRef\n\n- Type: `object`\n- Required fields: `src`\n- Purpose: Provenance of inline data or a dataset: the file, sheet and range it came from and when. Engines never read, fetch or refresh it; they keep it through editing, export and re-import. Re-import the data to update it.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `src` | yes | `string` | Where the data came from: an 'asset:<id>' reference, a URL, or a relative or local path. |\n| `sheet` | no | `string` | Sheet or table name inside a spreadsheet source. |\n| `range` | no | `string` | A1-style range inside a spreadsheet source. |\n| `fields` | no | `array<string>` | The source fields the data was taken from, in order. |\n| `retrieved` | no | `anyOf:schema / schema` | When the data was taken from the source: an ISO 8601 date or date-time. |\n| `description` | no | `string` | Free-form note about the source. |\n\n\n### DatasetId\n\n- Type: `string`\n- Required fields: none\n- Purpose: Id of an entry in the top-level datasets map (the assets id pattern).\n\n_No named properties._\n\n\n### DatasetFields\n\n- Type: `array<string>`\n- Required fields: none\n- Purpose: Dataset column names to use, in order, each at most once. Selects and orders the dataset's columns; an unknown name is a 'dataset-field-unknown' error.\n\n_No named properties._\n\n\n### Datasets\n\n- Type: `object`\n- Required fields: none\n- Purpose: Shared data tables keyed by id (the assets id pattern). Charts reference one with 'chart.data': { \"dataset\": \"<id>\" } and tables with 'table': { \"dataset\": \"<id>\" }.\n\n_No named properties._\n\n\n### Dataset\n\n- Type: `object`\n- Required fields: `columns`, `rows`\n- Purpose: One shared data table: named columns (strings or DataColumn objects with a number format) and rows of scalar cells. Column names are unique ('data-column-duplicate' error). Rich text and styling belong in an inline table.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `title` | no | `string` | Human name of the dataset, shown by editors. |\n| `description` | no | `string` | What the dataset holds. |\n| `columns` | yes | `array<oneOf:string / ref:DataColumn>` | Ordered, uniquely named columns. |\n| `rows` | yes | `array<array<ref:ChartDataCell>>` | Rows of scalar cells (string, number, boolean, null); each row aligns by index with columns. |\n| `source` | no | `ref:DataSourceRef` | Optional provenance. Engines never read, fetch or refresh it. |\n\n\n### DatasetRef\n\n- Type: `object`\n- Required fields: `dataset`\n- Purpose: Chart data taken from a top-level dataset. Engines inline it before plotting; 'chart.mapping' names columns after the 'fields' selection.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `dataset` | yes | `ref:DatasetId` | Id of the dataset. An unknown id is a 'dataset-unknown' error. |\n| `fields` | no | `ref:DatasetFields` | The dataset columns to use, by name and in order. Absent uses every column. |\n\n\n### ChartMapping\n\n- Type: `object`\n- Required fields: none\n- Purpose: Series mapping by column name (after any 'fields' selection). Mapping only selects and orders columns; a chart type that plots one series (treemap, funnel, waterfall and the like) still plots the first and names the others in a 'chart-series-dropped' warning, and a pie or doughnut of several series draws nested rings. An unknown name is a 'chart-mapping-unknown-column' error; a series that repeats the category or X column, and an X column on a chart type without an X axis, are dropped with a...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `category` | no | `string` | The label (category) column. Default: the first column. |\n| `x` | no | `string` | The X column of an XY (scatter) chart. Default: the second column (the first, when the category is the second column), and only when there are three or more columns: with two, the second column is the one series, plot... |\n| `series` | no | `array<string>` | The plotted columns, in order. Default: every column that is not the category or the X column. |\n\n\n### ChartDataCell\n\n- Type: `oneOf:string / number / boolean / null`\n- Required fields: none\n- Purpose: A cell in inline chart data.\n\n_No named properties._\n\n\n### TableCell\n\n- Type: `oneOf:ref:TableCellValue / ref:StyledTableCell`\n- Required fields: none\n- Purpose: A scalar, rich-run array, or styled/spanning cell object. Existing scalar and rich forms remain valid.\n\n_No named properties._\n\n\n### TableCellValue\n\n- Type: `oneOf:string / number / boolean / null / array<ref:TextRun>`\n- Required fields: none\n- Purpose: A scalar table value or canonical rich text runs, without cell decoration or geometry.\n\n_No named properties._\n\n\n### StyledTableCell\n\n- Type: `object`\n- Required fields: `value`\n- Purpose: A cell with explicit visual style or merged geometry. Its position remains its array column index; use null placeholders for every covered grid position.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `value` | yes | `ref:TableCellValue` | Editable cell content; styling and spans do not change its scalar type or rich runs. |\n| `style` | no | `ref:TableCellStyle` | |\n| `colSpan` | no | `integer` | Number of grid columns covered, starting at this cell. Covered positions must contain null. Default 1. |\n| `rowSpan` | no | `integer` | Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1. |\n| `format` | no | `ref:NumberFormat` | Number format. On a body cell it formats that cell's number value (and wins over the column's format); on a header cell (in 'columns') it is the column's format, the same as a DataColumn header. Strings, booleans, nul... |\n\n\n### TableCellStyle\n\n- Type: `object`\n- Required fields: none\n- Purpose: Cell appearance. Sizes use reference pixels at a 720-pixel canvas short edge and scale with the slide.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `fill` | no | `ref:ColorRef` | Cell background: a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference. Eight-digit hex colors include alpha; #00000000 is transparent. |\n| `color` | no | `ref:ColorRef` | Default text color, overridden by individual rich run colors. Accepts a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference. |\n| `bold` | no | `boolean` | Bold cell text. Runs that set their own bold keep it; a number cell stays bold and still uses the cell's or column's number format. |\n| `align` | no | `enum:start \\| center \\| end` | Horizontal text alignment inside the cell. Logical: 'start' is the edge a paragraph starts on (the left for left-to-right text, the right for right-to-left text) and 'end' is the opposite edge. |\n| `verticalAlign` | no | `enum:top \\| middle \\| bottom` | Vertical alignment inside the padded cell box. |\n| `padding` | no | `ref:TableCellPadding` | |\n| `borders` | no | `object` | Independent cell edges. An omitted edge keeps the table's default rule: a line under every row (and over the first row), none between columns. Width 0 removes an edge. |\n\n\n### TableCellPadding\n\n- Type: `object`\n- Required fields: none\n- Purpose: Text insets in reference pixels. Defaults: top 8, right 10, bottom 4, left 10.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `top` | no | `number` | |\n| `right` | no | `number` | |\n| `bottom` | no | `number` | |\n| `left` | no | `number` | |\n\n\n### TableCellBorder\n\n- Type: `ref:Line`\n- Required fields: none\n- Purpose: One explicit cell border: a Line, or 'none' to remove this edge. Defaults: the table's rule color (the scheme's border neutral), 1 reference pixel and 'solid'.\n\n_No named properties._\n\n\n### Catalogs\n\n- Type: `object`\n- Required fields: none\n- Purpose: The catalog records a document embeds, grouped by the catalog they came from. Each property is a group; inside a group, records are keyed by kind and then by id. - 'default': the catalog bare ids come from. It needs a 'source' when it holds records. Omitted: bare ids fall back to the host's default catalog. false: no catalog fallback, so every bare id must be embedded (under 'custom' or 'default'). - 'custom': the records the document defines itself. It has no source. - any other name ('acme'...\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `default` | no | `oneOf:allOf:ref:CatalogGroup + schema / const:false` | The catalog bare ids come from: its source and the records of it this document embeds. false turns off the catalog fallback for bare ids. |\n| `custom` | no | `allOf:ref:CatalogGroup + schema` | Records the document defines itself, referenced by bare id. Checked first for every bare id. Forking a catalog record copies it here under a new id, so the change of ownership is visible. |\n\n\n### CatalogGroup\n\n- Type: `object`\n- Required fields: none\n- Purpose: One catalog group: the catalog's source and the records of it the document embeds, by kind and then by id.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `source` | no | `ref:CatalogSource` | |\n| `layouts` | no | `ref:CatalogRecords` | Layout records keyed by id, each with the fields of https://openpresentation.org/schema/opf-layout/v2. Referenced from Slide.layout. |\n| `themes` | no | `ref:CatalogRecords` | Theme records keyed by id, each with the fields of https://openpresentation.org/schema/opf-theme/v1. Referenced from design.theme. |\n| `colorSchemes` | no | `ref:CatalogRecords` | Colour-scheme records keyed by id, each with the fields of https://openpresentation.org/schema/opf-color-scheme/v1. Referenced from design.colorScheme and a theme's colorScheme. |\n| `fontSchemes` | no | `ref:CatalogRecords` | Font-scheme records keyed by id, each with the fields of https://openpresentation.org/schema/opf-font-scheme/v1. Referenced from design.fontScheme, a theme's fontScheme and a language's font schemes. |\n| `narratives` | no | `ref:CatalogRecords` | Narrative records keyed by id, each with the fields of https://openpresentation.org/schema/opf-narrative/v1. Referenced from narrative. |\n| `audiences` | no | `ref:CatalogRecords` | Audience records keyed by id, each with the fields of https://openpresentation.org/schema/opf-audience/v1. Referenced from audience. |\n| `purposes` | no | `ref:CatalogRecords` | Purpose records keyed by id, each with the fields of https://openpresentation.org/schema/opf-purpose/v1. Referenced from purpose. |\n| `tones` | no | `ref:CatalogRecords` | Tone records keyed by id, each with the fields of https://openpresentation.org/schema/opf-tone/v1. Referenced from tone. |\n| `iconSets` | no | `ref:CatalogRecords` | Icon-set records keyed by set id, each with the fields of https://openpresentation.org/schema/opf-icon-set/v1, holding only the icons the document uses (no licenseText or tags). Referenced from an icon as \"<set>:<name>\". |\n\n\n### IconReference\n\n- Type: `string`\n- Required fields: none\n- Purpose: An icon: \"<set>:<name>\" names an icon of a set (\"lucide:truck\", \"tabler:rocket\"; the gallery bundles Lucide and Tabler outline), a bare name names one of the deck's `icons`, and an SVG source (\"asset:<id>\", \"./icon.svg\", an HTTPS URL or a data:image/svg+xml URI) names an SVG file, as pictures accept. A one-color icon draws in the accent and exports as a native, theme-colored PowerPoint shape; a multicolor SVG draws as a picture with its own colors. Unknown names are opf/icon-unknown, unusable...\n\n_No named properties._\n\n\n### Icons\n\n- Type: `object`\n- Required fields: none\n- Purpose: Deck-local icons, keyed by name: SVG text (\"<svg >\") or an SVG source (\"asset:<id>\", \"./icon.svg\", an HTTPS URL or a data URI). An `icon` names one by its bare name. The SVG is read, never run: a script, an event handler, an external reference or a raster makes it opf/icon-invalid. One paint (or currentColor) makes it a recolorable glyph; several make it a picture with its own colors.\n\n_No named properties._\n\n\n### CatalogSource\n\n- Type: `string`\n- Required fields: none\n- Purpose: Identity of a catalog: an HTTPS URL ('https://www.pptx.gallery') or a package reference ('pkg:@acme/opf-catalog'). It names the catalog; engines never fetch or install it. A host registers the catalog's records under this exact string, and copying slides between documents matches groups by it.\n\n_No named properties._\n\n\n### CatalogRecords\n\n- Type: `object`\n- Required fields: none\n- Purpose: Embedded records of one kind, keyed by id. The key is the record's id; an embedded record carries no '$schema', 'id', origin or digest. Catalog display metadata ('x-*' members) is stripped when a record is embedded.\n\n_No named properties._\n\n\n### CatalogReference\n\n- Type: `string`\n- Required fields: none\n- Purpose: A content reference: a bare id ('two-column') or 'name:id' ('acme:hero'), where the prefix names a group of 'catalogs'. URLs and 'pkg:' strings are not references; a named catalog group replaces them. See Catalogs for the resolution order.\n\n_No named properties._\n\n\n### LanguageTag\n\n- Type: `string`\n- Required fields: none\n- Purpose: A BCP-47 language tag ('en-US', 'ja', 'zh-Hans', 'sr-Latn-ME'), an engine vocabulary. Use 'en-GB' for UK English; 'en-UK' is not a valid region. Numbers the engines generate (metric values, chart labels and ticks, table numbers, list numerals, slide numbers) are drawn in the numbering system of the language, the locale's own (Arabic-Indic digits for 'ar-SA', Latin for 'ar-AE', Persian for 'fa-IR'); the Unicode extension '-u-nu-<system>' chooses another ('ar-SA-u-nu-latn' draws Latin digits)....\n\n_No named properties._\n\n\n### Composition\n\n- Type: `object`\n- Required fields: none\n- Purpose: Automatic slide and content-group arrangement. Nested content groups arrange their children independently, inheriting only minFontSize, maxFontSize and overflow. Explicit promoted regions retain their positions. A layout defines its grid as one ordered list of regions; its composition supports gap, padding, minFontSize, maxFontSize and overflow rather than mode, columns or weights.\n\n| Field | Required | Type | Notes |\n| --- | --- | --- | --- |\n| `mode` | no | `enum:auto \\| grid \\| row \\| column` | auto chooses a grid from available space and content; grid uses columns; row and column use one horizontal or vertical track. |\n| `columns` | no | `integer` | Column count for grid. In auto mode this caps the number of columns. |\n| `gap` | no | `number` | Space between cells as a fraction of the container short edge (canvas at slide root). Default 0.03333333333333333. |\n| `padding` | no | `number` | Inset as a fraction of the container short edge. Default 0.08 on a slide, 0 inside a group. |\n| `weights` | no | `array<number>` | Relative track sizes: columns for row/grid/auto, rows for column. Omitted tracks have weight 1; extra weights are ignored. |\n| `minFontSize` | no | `number` | Minimum readable text size in reference pixels at a 720-pixel canvas short edge. Default 16. Overflow is diagnosed when text cannot fit at this size. |\n| `maxFontSize` | no | `number` | Largest body text size in reference pixels at a 720-pixel canvas short edge: paragraphs, lists, quotes, metrics and timelines are never set larger, their growth included (headings, tables, code and charts keep their s... |\n| `overflow` | no | `enum:warn \\| error` | warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn. |\n"
334
334
  },
335
335
  {
336
336
  "slug": "schema-versioning",
@@ -354,7 +354,7 @@ var docsData = Object.freeze([
354
354
  "slug": "shapes",
355
355
  "file": "docs/shapes.md",
356
356
  "title": "Shapes",
357
- "markdown": '# Shapes\n\nA shape block draws one of PowerPoint\'s 187 preset shapes, or an outline of your own, with a fill, a line and optional text inside. Both engines draw the same thing from one definition: the preview evaluates the preset\'s DrawingML geometry to SVG, and the PPTX export writes the native preset (`a:prstGeom` with its adjust values), so PowerPoint draws its own shape and the two match. The same stroke vocabulary is a picture\'s line, and every preset is a picture mask.\n\n```json\n{\n "title": "How we ship",\n "blocks": [\n { "shape": "chevron", "text": "Plan" },\n { "shape": "chevron", "text": "Build", "fill": { "color": "accent1", "lighten": 0.4 } },\n { "shape": "chevron", "text": "Ship", "style": "intense" }\n ]\n}\n```\n\nThe full reference deck is [`examples/technical/shapes.opf.json`](../examples/technical/shapes.opf.json): one slide per group of properties.\n\nThis page covers [shape blocks](#a-shape-block) and their properties, [overlay shapes and connectors](#overlay-shapes-and-connectors) drawn over a composed slide, [importing shapes](#importing-shapes-from-powerpoint) from PowerPoint, [editing shapes](#editing-shapes) in the editor, and [native diagrams](#native-diagrams), Mermaid, DOT and PlantUML diagrams written as PowerPoint shapes; then validation, loading in browsers, the preset geometry and the property map.\n\n## A shape block\n\nA block with `shape` and no `image`, or with a custom `path`, is a shape block (`type: "shape"`). It composes like any other block: automatic composition and layout regions give it a cell, and the shape takes the largest frame of its own proportions centered in that cell (the region\'s anchor places it vertically). The proportions are the block\'s `aspectRatio`, else the preset\'s: 1:1 for the round and regular shapes (`ellipse`, `star5`, `hexagon`, `heart`, the flowchart connectors), 2:1 for horizontal arrows and bands (`rightArrow`, `chevron`, `ribbon`, `wave`), 1:2 for vertical ones (`upArrow`, `can`, `leftBrace`) and 3:2 otherwise (`rect`, `roundRect`, the callouts and most flowchart shapes). A layout region that takes pictures (`image`) also takes shapes; a region can name `shape` in `accepts` too.\n\nA shape draws its own fill and outline, so it is never drawn on a card. `composeSlide` reports it as an item with `field: "shape"` and `ComposedItem.shape`: the frame, the evaluated paths in slide coordinates, the text rectangle, the effective fill, stroke and text color, and the effects.\n\n### Text inside\n\n`text` (a string or rich text runs) is drawn inside the preset\'s text rectangle (each preset defines one: a chevron\'s is its middle, an ellipse\'s the square inscribed in it), less `padding`. It is fitted by OPF\'s measured fonts, as body text is: from the body size down to the composition\'s `minFontSize` and never below it. Text that holds the body size in a large shape grows as a lone body block does: up the type scale, one step at a time, to the display size of a paragraph (43 reference pixels), while it fits and fills at most 60% of the text rectangle\'s height; it never ends below the body size. Sibling shapes (the blocks of one group, or a slide\'s overlay shapes) keep one size: each that grew is set at the smallest size they all reached. Shape text never breaks inside a word (RR-105): text whose word is wider than the text rectangle is set on one line instead, centered on the text rectangle and reaching past `padding` up to the shape\'s own edges, at the largest size from the body size down at which that line fits there (`ComposedShape.textWrap: "none"`; the export writes the shape\'s text unwrapped and centered, `a:bodyPr wrap="none" anchorCtr="1"`, which import reads as layout, not as a dropped property, so PowerPoint draws it the same way); text that cannot be one line shrinks without breaking a word. Text that does not fit at that size (a word too wide even across the shape) overflows and is reported as `opf/text-overflow` at `<block>/text`; give the shape more room (a larger cell or another `aspectRatio`), shorten the text or lower its padding. PowerPoint\'s autofit is never written: PowerPoint draws the size OPF chose.\n\nPowerPoint wraps a shape\'s text itself, in the same rectangle OPF fitted it in: the export writes the shape at its frame with its adjust values and `padding` as the body insets, so PowerPoint\'s text rectangle (the preset\'s own, less the insets) is OPF\'s for every preset, and every run names the fitted size. The text is measured in the weight it is drawn in (the `intense` style\'s text is bold). Read through PowerPoint 365 (SH-11), shape text has the same size and the same line breaks in the preview and in PowerPoint. Two exceptions remain. A line that ends within about half a point of the rectangle\'s edge can break differently, because PowerPoint\'s line widths differ from the measured faces\' by up to about \xB10.35 pt. A single word too long for its line, which only happens with text that overflows (a word too wide even across the shape), is split one letter differently. Pass `fonts` to `toPptx`: without them the export fits the text with core\'s width estimate, which is wider than the real faces, so PowerPoint shows the text smaller than the preview draws it.\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `anchor` | `top`, `middle` (default) or `bottom`: where the text sits in its rectangle. | `a:bodyPr anchor` |\n| `padding` | Insets in reference pixels: one number, or `{ top, right, bottom, left }`. Default 9.6 left and right, 4.8 top and bottom (PowerPoint\'s 0.1 and 0.05 inch). | `lIns`, `tIns`, `rIns`, `bIns` |\n| `textDirection` | `horizontal` (default), `vertical` (turned 90 degrees clockwise), `vertical270`, or `stacked` (one letter under another). | `a:bodyPr vert` (`horz`, `vert`, `vert270`, `wordArtVert`) |\n\nThe text is centered. Its color is the style\'s text color (light on the default style\'s accent fill) where that reads at 4.5:1 on the fill the shape draws, else black or white (LH-151; the fill\'s color, a gradient\'s middle stop or a pattern\'s background). A run\'s own `color` wins.\n\n## Presets\n\n`shape` takes DrawingML\'s own preset names (ECMA-376 `ST_ShapeType`), as PowerPoint writes them: `rect`, `roundRect`, `ellipse`, `triangle`, `rightArrow`, `chevron`, `wedgeRectCallout`, `flowChartDecision` and the rest. The [preset table](#preset-table) lists all 187 with their default frames and adjust values. A name that is not a preset is an `opf/schema` error with the nearest names as fixes.\n\n### Adjust values\n\n`adjust` sets the preset\'s adjust handles (the yellow handles in PowerPoint), named as DrawingML\'s guides: `adj`, or `adj1`, `adj2` and so on. Values are OPF units, never DrawingML\'s 100000ths or 60000ths: a fraction for the values DrawingML writes in 100000ths (most often a share of the shape\'s shorter side) and degrees for the angle handles of `arc`, `blockArc`, `chord`, `pie`, the circular arrows and `mathNotEqual`.\n\n```json\n{ "shape": "roundRect", "adjust": { "adj": 0.3 } }\n{ "shape": "rightArrow", "adjust": { "adj1": 0.6, "adj2": 0.35 } }\n{ "shape": "pie", "adjust": { "adj1": 0, "adj2": 270 } }\n```\n\nA name the preset does not have is `opf/shape-adjust-unknown`, and a value outside its handle\'s range `opf/shape-adjust-range` (both warnings); the preset\'s default is drawn. On an image block, `adjust` shapes the mask: a `roundRect` frame\'s corner is `{ "adj": 0.05 }`.\n\n### Custom outlines\n\n`path` draws an outline of your own (`a:custGeom` in PowerPoint): SVG path data in a 0 to 1 box (`"M0 0 L1 0 L0.5 1 Z"`, stretched to the frame), or `{ "d": ..., "viewBox": "0 0 24 24" }` for a path drawn on its own grid, such as an icon. Every SVG command is accepted (M, L, H, V, C, S, Q, T, A, Z, absolute or relative). A subpath that does not end with Z is open: it takes arrowheads at its ends. A custom path\'s text rectangle is the whole frame.\n\n## Fill\n\n| `fill` | Meaning | PowerPoint |\n|---|---|---|\n| `"none"` | No fill. | `a:noFill` |\n| a ColorRef | A solid fill: hex (eight-digit hex keeps its alpha), a scheme slot or role, `var:<id>`, or a [lighter or darker color](#lighter-and-darker-colors). | `a:solidFill` |\n| `{ "gradient": { "type", "angle", "stops" } }` | `linear` along `angle` (degrees, 0 left to right, 90 top to bottom), or `radial`, `rectangle` and `shape` from the center outwards. `stops` are `{ color, position }`, at least two. | `a:gradFill` with `a:lin` or `a:path circle`, `rect`, `shape` |\n| `{ "pattern": { "preset", "foregroundColor", "backgroundColor" } }` | A two-color pattern; `preset` is DrawingML\'s (`pct20`, `ltUpDiag`, `smGrid`, `dotDmnd`). | `a:pattFill` |\n\n`opacity` (0 to 1) is the fill\'s opacity, multiplied with an eight-digit hex alpha; the line and text keep theirs. Without a fill the shape takes its [style](#style)\'s. Fills rotate with the shape (`rotWithShape`).\n\nA shape\'s path may shade its fill: DrawingML presets such as `can`, `cube`, `bevel`, `foldedCorner` and `smileyFace` draw parts of their fill lighter or darker (`lighten`, `lightenLess`, `darken`, `darkenLess`). Both engines draw them, the preview as PowerPoint\'s 60% and 80% tints and shades of the fill.\n\nBoth engines draw every gradient as PowerPoint 365 does (measured on its export of all 187 presets):\n\n- A gradient spans the bounds of the shape\'s filled paths: the frame for most presets, the drawn quarter for `arc`, the upper half for `blockArc`.\n- `radial` is a circle from the center of those bounds through their corners, whatever their proportions.\n- `rectangle` is concentric rectangles: the bounds scaled about their center.\n- `shape` follows the outline: its contours are the outline scaled about the center of the bounds (on each ray from the center, the outline\'s farthest point). Each filled part of a preset follows its own outline, except the action buttons, `bevel` and `cube`, whose parts follow the whole shape\'s outline. PowerPoint draws the `shape` gradient of 64 presets (the arrows, ribbons, scrolls, braces, waves and the like) and of every custom `path` as its circle gradient instead, and so does the preview.\n- Colors mix as PowerPoint mixes them: a gradient of exactly two stops at 0 and 1 is eased and mixed in linear light; any other set of stops is mixed straight between neighboring stops.\n\nThe preview draws a `rectangle` or `shape` gradient as a fan of triangles from the center, each a linear gradient across it to its edge, clipped to the path. Measured against PowerPoint\'s own picture of the same PPTX, the mean difference per color channel is 2.6 levels of 255 at the median preset and at most 5 for 179 of the 187; the largest are the tiny `cornerTabs` (11) and `star4` (7).\n\n## Stroke\n\n`stroke` is the line along the outline (`a:ln`): `"none"`, or an object. On a shape without one the style\'s line is drawn; `"none"` removes it.\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `color` | Any ColorRef. Default the style\'s line color. | `a:solidFill` |\n| `gradient` | A gradient line instead of a color (the fill\'s gradient object). | `a:gradFill` |\n| `width` | Reference pixels, 0 to 64; 0 removes the line. Default 4/3 (1 point) on a shape, 2 on a picture. | `w` |\n| `dash` | `solid`, `dot`, `dash`, `longDash`, `dashDot`, `longDashDot`, `longDashDotDot`, `sysDot`, `sysDash`, `sysDashDot`, `sysDashDotDot`, or an array of dash and gap lengths in line widths (`[4, 2]`). | `a:prstDash` (`lgDash` for `longDash`), `a:custDash` |\n| `cap` | `flat` (default), `round`, `square`. | `cap` |\n| `join` | `miter` (default, as PowerPoint\'s default line), `round`, `bevel`; `miterLimit` (default 8). | `a:miter lim`, `a:round`, `a:bevel` |\n| `compound` | `single`, `double`, `thickThin`, `thinThick`, `triple`. | `cmpd` |\n| `align` | `center` (default) or `inside` (closed outlines only, as in PowerPoint). | `algn` |\n| `start`, `end` | Arrowheads on an open path: `{ type, width, length }`, `type` `triangle` (default), `stealth`, `diamond`, `oval` or `arrow`, sizes `small`, `medium` (default), `large`. | `a:headEnd`, `a:tailEnd` |\n| `sketch` | `curved`, `freehand` or `scribble`: PowerPoint\'s Sketched line. | `ask:lineSketchStyleProps` |\n\nThe preview draws every property. Arrowheads are drawn at 2, 3 or 5 line widths and the line stops under a triangle or stealth head, as PowerPoint draws them. A sketched line is drawn the same in both engines. PowerPoint does not compute a sketch when it opens a file: it draws the outline stored in `ask:lineSketchStyleProps` (an `a:custGeom`), and fills a sketched shape within that outline. OPF computes that outline itself, deterministically from the seed it writes as `sd` (from the style, the frame\'s size and the outline, so a moved shape keeps its line), and the preview strokes and fills the same outline, so PowerPoint\'s picture of the PPTX matches the preview (0.7 to 0.8 levels of 255 mean difference on the sketch evidence slides). The wobble is OPF\'s own, made to look like PowerPoint\'s three styles: `curved` bows each side gently, `freehand` wavers along it, `scribble` draws a freehand pass and a second pass of strokes that run past the corners. It is not PowerPoint\'s own randomization. When PowerPoint 365 (16.0.20527) saves the file again, it keeps the sketched outline as the shape\'s own custom geometry and drops the sketch style (observed through its object model, resized or not), so the shape still looks the same. PowerPoint versions before 2021 draw the plain line.\n\n## Style\n\n`style` is the theme shape style, as PowerPoint\'s Shape Styles gallery: it decides everything the shape does not set itself. The default is `moderate`, so a bare `{ "shape": "rect" }` looks like a new PowerPoint shape and follows the theme.\n\n| `style` | Fill | Line | Text | PowerPoint |\n|---|---|---|---|---|\n| `none` | none | none | the slide\'s text color | no `p:style` |\n| `subtle` | accent1 80% lighter | 1 pt accent1 | dark | `lnRef 2`, `fillRef 1` |\n| `moderate` (default) | accent1 | 1 pt accent1 50% darker | light | `lnRef 2` (shade), `fillRef 1` |\n| `intense` | accent1 25% darker | none | light, bold | `lnRef 0`, `fillRef 1`, `effectRef 2`, with the soft shadow |\n\nAn explicit `fill`, `stroke` or effect wins over the style\'s. The export writes the style\'s references (`p:style`: `a:lnRef`, `a:fillRef`, `a:effectRef`, `a:fontRef`), so PowerPoint shows the style as applied, and writes the drawn fill and line explicitly, so the shape looks the same whatever the theme\'s format scheme.\n\n## Lighter and darker colors\n\nEvery ColorRef (fills, strokes, gradient stops, pattern colors, overlays, recolors, backgrounds, chart and table colors, and text runs) also takes a lighter or darker form, PowerPoint\'s "Lighter 40%" and "Darker 25%":\n\n```json\n{ "color": "accent1", "lighten": 0.4 }\n{ "color": "#0F4C81", "darken": 0.25 }\n```\n\n`lighten` moves the color\'s HSL luminance that share of the way to white, `darken` that share of the way to black. Core resolves it (`resolveColorRef`); the export writes the base color with `a:lumMod` and `a:lumOff` (lighten L: `lumMod` 1 - L and `lumOff` L; darken D: `lumMod` 1 - D), as a theme color where the base is one, so re-theming the deck keeps the tint.\n\n## Rotation, flip and stacking\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `rotate` | Degrees clockwise about the frame\'s center. Composition keeps the unrotated frame; a rotated outline may reach past its cell. | `a:xfrm rot` |\n| `flip` | `horizontal`, `vertical` or `both`: mirrors the geometry. The text is not mirrored; a vertical flip turns it upside down, as in PowerPoint. | `flipH`, `flipV` |\n\nShapes stack in the order the blocks compose (the shape tree order in PowerPoint); [overlay shapes and connectors](#overlay-shapes-and-connectors) stack over everything, in the order of the slide\'s `shapes`.\n\n## Accessibility and links\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `alt` | Alternative text. Without it, a shape\'s text is what is read. | `p:cNvPr descr` |\n| `decorative` | `true`: screen readers skip the shape. | the decorative extension (`adec:decorative`, "Mark as decorative") |\n| `hidden` | `true`: kept in the file but not drawn; it keeps its room. | `p:cNvPr hidden` |\n| `link` | An http(s), `mailto:` or `tel:` URL opened when the shape is clicked in a slide show. A link on a hidden shape is `opf/shape-link-hidden`. | `a:hlinkClick` |\n\nThe shape\'s name in PowerPoint is `OPF shape <path>`, from the block\'s place in the deck.\n\n## Effects\n\n`shadow` (a preset `soft`, `hard` or `perspective`, or `{ color, opacity, blur, distance, angle, size }`), `innerShadow`, `glow` (`{ color, opacity, radius }`), `softEdge` (a radius), `reflection` (`{ opacity, size, distance, blur }`) and `blur` (a radius) are part of the format; lengths are reference pixels and angles degrees. Both engines draw them: the export writes `a:effectLst` in the shape\'s `p:spPr` right after its line, and the preview draws SVG filters around the outline and its text (the outer shadow and the reflection include the text, as PowerPoint\'s do). Colors are ColorRefs, `{ color, lighten }` and `{ color, darken }` included; lengths scale with the slide\'s shorter side. See [shape effects](shape-effects.md) for the defaults, the presets and how each effect is measured against PowerPoint, and `examples/technical/shape-effects.opf.json` for every effect on shape blocks. The `intense` style adds the `soft` shadow unless the block sets its own.\n\n## Pictures\n\nAn image block\'s line is `stroke` (renamed from `border` in 0.33, with no alias) and takes every stroke property above. Its `shape` takes every preset (`rectangle`, `rounded` and `circle` became `rect`, `roundRect` and `ellipse`), and `adjust` replaces `cornerRadius`. See [image treatments](image-treatments.md).\n\n## Overlay shapes and connectors\n\nA slide\'s `shapes` array is drawn over the composed slide: above the content, the furniture and everything else, in array order (later entries on top); an overlay shape with `layer: "back"` is drawn behind the content instead (see [layers](#layers)). It never moves content: composition places the slide first and the overlay on the result. Use it for what sits on top of a layout: a callout pointing at a figure, a badge on a picture, a stamp in a corner, and connector lines between blocks.\n\n```json\n{\n "title": "How we ship",\n "blocks": [\n { "id": "plan", "shape": "roundRect", "text": "Plan" },\n { "id": "ship", "shape": "roundRect", "text": "Ship" }\n ],\n "shapes": [\n { "shape": "wedgeRectCallout", "text": "New this quarter", "x": 0.68, "y": 0.06, "width": 0.24, "height": 0.12, "style": "subtle" },\n { "shape": "ellipse", "text": "1", "at": { "block": "plan", "edge": "top", "offset": -24 } },\n { "connector": { "from": "plan", "to": "ship", "route": "elbow" }, "stroke": { "width": 2, "end": { "type": "triangle" } } }\n ]\n}\n```\n\nThe reference decks are [`examples/technical/shape-overlays.opf.json`](../examples/technical/shape-overlays.opf.json) and its right-to-left slide [`shape-overlays-rtl.opf.json`](../examples/technical/shape-overlays-rtl.opf.json).\n\n### Overlay shapes\n\nAn entry without `connector` is an overlay shape. It has the whole [shape block](#a-shape-block) vocabulary: `shape` or `path`, `adjust`, `fill`, `opacity`, `stroke`, `style`, the [effects](#effects), `rotate`, `flip`, `text` with `anchor`, `padding` and `textDirection`, `alt`, `decorative`, `hidden` and `link`, plus an optional `id` (a connector names it). Its text is fitted as a shape block\'s is, by OPF\'s measured fonts, never below the readability floor (`opf/text-overflow` at `slides.N.shapes.I.text` otherwise). It has exactly one placement:\n\n| Placement | Meaning |\n| --- | --- |\n| `x`, `y`, `width`, `height` | `x` and `y` are signed fractions of the slide from its top-left corner; they may be negative or greater than 1. For example, `y: -0.1` places the top 10% of the slide height above the slide, preserving the whole shape while the slide viewport crops what is outside. In a right-to-left deck `x` counts from the right edge, as the layout mirrors start and end; only the position mirrors, never the geometry (an arrow keeps the way it points; [#1256](https://github.com/OpenPresentation/opf/issues/1256) tracks whether it should flip). `width` and `height` are fractions from 0 (a line) to 8: above 1 the shape is larger than the slide, for a circle or band that bleeds off it. A PowerPoint shape larger than 8 slides imports at 8 with a `shape-property-dropped` diagnostic, and the editor\'s frame changes stop at 8. All four go together. Moving, resizing, detaching an anchor and PPTX import preserve the signed position. |\n| `at: { block, edge, offset, width, height, widthPx, heightPx }` | Against the composed box of the block with that `id` (a payload or a group, at any depth), so the shape follows the block wherever composition puts it. `edge` is `top`, `bottom`, `start` or `end` (outside that edge, centered along it; `start` is the left in a left-to-right deck and the right in a right-to-left one) or `center` (on the block\'s center). `offset` is the gap in reference pixels (negative overlaps the block). `width` and `height` are fractions of the block\'s width and height (1 is the block\'s own size, 1.08 a frame 8% larger, at most 8); `widthPx` and `heightPx` are reference pixels, for a badge of a fixed size; one of the two for each side. By default the shape has its preset\'s proportions with its shorter side at 15% of the block\'s shorter side. |\n\nA picture\'s box is its frame; a block on a card is its card. A shape with both placements or none is an `opf/schema` error, and one whose `at.block` is not on the slide is `opf/shape-anchor-missing`; neither is drawn.\n\nThe PPTX export writes an overlay shape as a shape block, a native `p:sp` named `OPF shape slides.N.shapes.I`.\n\n### Chart point anchors\n\nAdd `point` to `at` to follow a chart mark instead of the whole block. For example:\n\n```json\n{"shape":"ellipse","fill":"none","stroke":{"color":"accent2","width":3},"at":{"block":"costs","series":"Cost ($B)","point":"United States","edge":"end","widthPx":80,"heightPx":80}}\n```\n\n`point` is an exact unique category name or a zero-based plotted-row index. `series` is an exact unique value-column name or a zero-based plotted-series index; omission selects the first series. Indexes disambiguate repeated or empty labels. Scatter X columns are not series. References resolve against the data the chart draws, including its maintained draw plan.\n\nThe **center** of the shape sits on the chosen point. For bars and columns, `start` and `end` mean the segment baseline and value end, including signed and stacked values; `top`, `bottom` and `center` use the mark bounds. Line/area/scatter anchors use the plotted marker; their edge supplies the offset direction. On a slice, `end` is the outer arc midpoint, `start` the inner arc midpoint (the pie center), `center` the middle of its radial band, and `top`/`bottom` the sector bounds. Slice offsets are radial, and other mark offsets follow the chosen edge\'s outward direction. A zero offset centers the ring exactly on its target.\n\n`width` and `height` are fractions of the mark\'s bounds (1 is the mark\'s own size) and `widthPx` and `heightPx` reference pixels at a 720-pixel short edge, one of the two for each side. A ring of a fixed size around a point is `"widthPx": 80, "heightPx": 80`. The default retains the preset\'s proportions and uses 15% of the mark\'s shorter side, with a 12 reference-pixel floor. Whole-block anchor sizing and outside-edge placement are unchanged. Physical bar value ends do not reverse in RTL; vertical category positions follow the chart\'s category order.\n\nThe classic two-dimensional category, scatter, pie and doughnut planners share a pinned native inner plot with SVG. Unsupported 3-D, combo, radar, chartex and table-aligned-row plots are explicit `opf/shape-anchor-missing` findings and draw no attached shape. Missing/ambiguous series or categories and null/unplotted values produce the same located finding. Qualification against actual native point coordinates is required before release; source agreement alone does not prove native placement. See [the portable example](../examples/technical/chart-point-overlays.opf.json).\n\nThe editor\'s `setOverlayAnchor(editor, path, at)` and `prepareOverlayAnchor(presentation, path, at)` replace the placement atomically. `listChartPointTargets` supplies indexed choices. The selected-shape controls expose chart, point, series and edge; every change supports Undo/Redo. A native scatter chart does not carry source category names: use a numeric point index when that attachment must survive native import. Native import restores an attachment only when its current chart point still resolves; otherwise it keeps the current native shape position and reports the lost attachment.\n\n### Layers\n\n`layer` puts an overlay shape in front of the slide (the default) or behind it:\n\n| `layer` | Drawn | PowerPoint |\n| --- | --- | --- |\n| `front` | Over the slide: after its content and furniture. | After every other shape of the slide in the shape tree. |\n| `back` | Behind the slide: above the background, the watermark and the deck logo, below the content and the furniture (a panel or a band behind a block). | After the background, watermark and logo and before the content shapes in the shape tree. |\n\nArray order stacks the shapes within each layer. Connectors are always in front, also when an end is a back-layer shape: the connector is glued to it and drawn over the content between them. Mark a back panel `decorative` when it carries no meaning.\n\n### Connectors\n\nAn entry with `connector` is a connector line between two blocks or overlay shapes of the slide:\n\n| Key | Meaning |\n| --- | --- |\n| `connector.from`, `connector.to` | The `id` of a block (a payload or a group) or an overlay shape. An id that names nothing on the slide, or names a connector, is `opf/connector-end-missing`, and the connector is not drawn. |\n| `connector.route` | `straight` (default), `elbow` or `curved`. |\n| `connector.fromSite`, `connector.toSite` | The connection site index at each end, instead of the automatic choice. An index the shape does not have is an `opf/schema` error. |\n| `stroke` | The line, with every [stroke](#stroke) property: color, width, dash, compound, sketch and arrowheads (`start` at `from`, `end` at `to`). Default a 2-pixel line in the slide\'s text color with no arrowheads. |\n| `adjust` | The connector preset\'s adjust values in OPF units: `adj1` of an elbow or a curve between sites on one axis (`bentConnector3`, `curvedConnector3`), the middle line as a fraction of the frame\'s width (0.5 halfway; below 0 or above 1 runs past a site). It replaces the automatic middle, so a route drawn in PowerPoint is kept exactly; the sites are still chosen as below. The two-segment routes and a straight line have none. A name the route\'s preset does not have is `opf/shape-adjust-unknown`. |\n| `alt`, `decorative`, `hidden`, `id` | As on a shape. A connector takes no other key. |\n\n**Connection sites.** Each end attaches to a connection site of its shape: a preset\'s own sites (`presetGeometry(...).connectionSites`, turned and flipped with the shape; a picture masked by a preset has its mask\'s) or, for every other block, the four edge midpoints of its box, numbered as DrawingML numbers a rectangle\'s: 0 top, 1 left, 2 bottom, 3 right. Without `fromSite` and `toSite` core chooses the pair of sites that face each other (opposite directions) whose route leaves each site outward and is shortest; then any route that leaves both outward; then the shortest. An elbow or curve considers only the sites along an axis (directions of 0, 90, 180 or 270 degrees) when the shape has some.\n\n**Routes.** Core routes each connector once, as PowerPoint\'s own connector presets, and both engines draw that route: the preview strokes the preset\'s path evaluated in the connector\'s frame, and the PPTX writes the same preset in the same frame, so PowerPoint draws the same line.\n\n| `route` | Sites | Preset | The route |\n| --- | --- | --- | --- |\n| `straight` | any | `straightConnector1` | One segment from site to site. |\n| `elbow` | on one axis (both horizontal or both vertical) | `bentConnector3` | Out of the first site, along the middle line, into the second. Facing sites put the middle halfway (`adj1` 0.5); sites that face the same way run 24 reference pixels past the farther one and back (a U, `adj1` beyond 0 to 1). |\n| `elbow` | perpendicular | `bentConnector2` | An L through the corner. |\n| `curved` | on one axis | `curvedConnector3` | The curve through the elbow\'s middle line, tangent to both sites\' axes. |\n| `curved` | perpendicular | `curvedConnector2` | One curve tangent to both sites\' axes. |\n\nThe frame is PowerPoint\'s: the box of the two sites (`a:off`, `a:ext`), flipped for a route that runs left or up, and turned 90 or 270 degrees for one that leaves its first site vertically, as PowerPoint writes its connectors.\n\n**PowerPoint.** The export writes a connector as a native `p:cxnSp` named `OPF connector slides.N.shapes.I`, with `a:prstGeom`, core\'s `a:avLst` and the line, and glues each end to the native shape it attaches to (`a:stCxn` and `a:endCxn`: the shape\'s id and the site index). PowerPoint then reads the connector as connected (`ConnectorFormat.BeginConnectedShape`, `EndConnectedShape` and the site indexes, 1-based in its object model) and moves it with a shape that the user moves. An end glues where one native shape is the block: a shape block or overlay shape, a picture, or a block drawn on a card. A text block without a card is drawn as one text box per line, so its end is not glued: the connector still runs to the block\'s site but stays put when the line boxes move. Give the text a card, or write it as a shape with text, to glue to it.\n\n| PowerPoint and the SH-04 check | Result |\n| --- | --- |\n| Connectors of `shape-overlays.opf.json` and `shape-overlays-rtl.opf.json`, read through PowerPoint\'s object model (PowerPoint 365) | Every glued end reads as connected to its shape at core\'s site (1-based), and moving the shape at the end moves the connector with it. |\n\n### Pagination\n\nWhen `paginate` splits a slide over pages, a shape placed by fractions is on every page (as the headings are), a shape placed `at` a block is on the page its block lands on, and a connector is on the page that holds both of its ends. A connector whose ends land on different pages is on none, and the page of its `from` end reports it in `PaginatedPage.diagnostics` as `connector-split` (with the connector\'s path). Overlay ids take their page\'s id (`stamp--2`) like payload ids, and `at.block` and the connector ends follow the ids they name.\n\n### In core\n\n`composeSlide` returns the overlay as `SlideComposition.overlayShapes`, in draw order: overlay shapes (`kind: "shape"`, a shape block item: `path` `slides.N.shapes.I`, `box`, `shape` (a `ComposedShape`), `text`, `textStyle`, `layer`, and `attachedTo` for an `at` shape) and connectors (`kind: "connector"`: `route`, `preset`, the frame `box`, `rotate`, `flipH`, `flipV`, `adjust` and `avLst`, `paths` (the route in slide coordinates, one open path with its ends for the arrowheads), `bounds`, `stroke`, and `from` and `to`, each with the `id`, the `ref` it attaches to (a composed item path, a group path or an overlay path), `target`, `site`, `point` and `angle`). `connectorRoute`, `chooseConnectorSites`, `shapeSites` and `rectSites` from `@openpresentation/opf/composition` give the same geometry to a host or an editor.\n\n## Importing shapes from PowerPoint\n\n`fromPptx` (and `opf convert deck.pptx deck.opf.json`) reads native shapes as OPF shapes. Two kinds of file arrive: a deck this export wrote, whose shapes come back as the OPF they were, and a deck PowerPoint wrote, whose shapes become overlay shapes and connectors.\n\n### A deck the export wrote\n\nThe native name says what a shape was: `OPF shape slides.N.blocks.I.shape` is a shape block and `OPF shape slides.N.shapes.I` an overlay shape (I is its entry in `slide.shapes`); `OPF connector slides.N.shapes.I` is a connector. Every property the export writes is read back from the DrawingML, so a shape block returns with its preset and `adjust`, its `path`, `fill`, `opacity`, `stroke`, `style`, effects, `rotate`, `flip`, text, `anchor`, `padding`, `textDirection`, `alt`, `decorative`, `hidden` and `link`; a lighter or darker theme color returns as `{ color, lighten }` or `{ color, darken }`; a picture\'s `stroke` returns with the picture. The slide\'s stored record (`OPF_SLIDE_V1`) puts the block back in its place and adds what no native shape can carry, while the slide is as it was exported:\n\n- the block ids and the content structure (as for every block);\n- an overlay entry\'s `id` (a connector names its ends by it) and its `at` anchor against a block (the native shape holds only the frame composition gave it);\n- which of a connector\'s `fromSite` and `toSite` the author wrote (the pair that faces each other is chosen when neither is).\n\nA slide edited in PowerPoint keeps what PowerPoint now shows: fractions for an overlay shape, and the sites it names. A value the theme style gives (an explicit `fill: "accent1"` on the default style) comes back absent, since the export writes it out and PowerPoint cannot tell it from a choice; the shape draws the same. Likewise a rotation of -20 comes back as 340, and a custom `path` comes back as path data in the 0 to 1 box (the outline is the same).\n\n### A deck PowerPoint wrote\n\n- A free-positioned shape that draws something (a fill, a line or an effect, or any shape that is not a plain rectangle) with preset or custom geometry becomes an **overlay shape**: `x`, `y`, `width` and `height` are fractions of the slide (`x` from the right edge in a right-to-left deck, as every coordinate over the layout; coordinates over a picture\'s pixels, an image\'s `focus` and `callouts`, are physical), with the preset and its `adjust`, a custom `a:custGeom` as `path`, and every property in the table below. Its z order is the array order.\n- A shape PowerPoint added with its default style (`p:style` with a theme line and fill) is OPF\'s default style, `moderate`, with nothing else stated. Another `p:style` is read as the fill and line its references give, with `style: "none"`.\n- A **connector** (`p:cxnSp`) whose two ends are connected to shapes OPF knows is a `connector` between their ids, with its route from the preset (`straightConnector1` straight, `bentConnector2` and `3` elbow, `curvedConnector2` and `3` curved), its sites from `a:stCxn` and `a:endCxn`, and, for a three-segment preset, the middle PowerPoint drew as `adjust.adj1` (a connector the export wrote states none, as it recomputes it). A longer route (`bentConnector4`, `bentConnector5`, `curvedConnector4`, `curvedConnector5`) is beyond OPF\'s connector: it stays a shape with its preset and `adjust` values, which draws it as it was, without the binding. A shape that is a connector\'s end gets an `id` made from its name (`box-a` for "Box A") where it has none. A connector with a free end is a line shape: the preset (`straightConnector1`, `bentConnector3` and so on) in its frame, with its arrowheads.\n- Shapes inside a **group** are flattened with the group\'s scale, flips and rotation applied.\n- A text box, a placeholder, and a rectangle with text that draws no fill, line or effect keep the text import (`text` blocks), as before.\n- A filled shape across the whole slide is a background, not an overlay (an overlay is drawn over the content): it is not imported and is reported as `shape-not-imported`.\n\n| DrawingML | OPF |\n| --- | --- |\n| `a:prstGeom prst` and `a:avLst` | `shape` and `adjust` (fractions and degrees, the values equal to the preset\'s defaults left out) |\n| `a:custGeom` (points, guides, `a:arcTo`) | `path`, in the 0 to 1 box (arcs become cubic B\xE9ziers) |\n| `a:noFill`, `a:solidFill`, `a:gradFill`, `a:pattFill` | `fill: "none"`, a ColorRef, `{ gradient }`, `{ pattern }`; a uniform transparency is `opacity` |\n| `a:schemeClr` (through the color map), `a:srgbClr`, `a:lumMod` and `a:lumOff` | a scheme slot name, a hex color, `{ color, lighten }` or `{ color, darken }` |\n| `a:ln` (`w`, `cap`, `cmpd`, `algn`, dashes, joins, `a:headEnd`, `a:tailEnd`, the sketch) | `stroke` (`"none"` for `a:noFill`) |\n| `p:style` (`lnRef`, `fillRef`, `effectRef`) | `style` |\n| `a:effectLst` (`a:outerShdw`, `a:innerShdw`, `a:glow`, `a:softEdge`, `a:reflection`, `a:blur`) | `shadow` (a preset name where it equals one), `innerShadow`, `glow`, `softEdge`, `reflection`, `blur`, in reference pixels |\n| `a:xfrm` (`rot`, `flipH`, `flipV`) | `rotate`, `flip` |\n| `a:bodyPr` (`anchor`, insets, `vert`) and the runs | `anchor`, `padding`, `textDirection`, `text` (emphasis, links and run colors; sizes and faces are the composition\'s) |\n| `p:cNvPr` (`descr`, the decorative extension, `hidden`, `a:hlinkClick`) | `alt`, `decorative`, `hidden`, `link` |\n\n### What is dropped\n\nEach of these is reported as a finding and dropped; the shape itself imports. The library\'s diagnostic is `shape-property-dropped` (`import/shape-property-dropped` in an `opf convert` report) with `property` naming it, and `shape` the native shape\'s name.\n\n| `property` | Native source | Why |\n| --- | --- | --- |\n| `3-D format` | `a:scene3d`, `a:sp3d` | The preview cannot match PowerPoint\'s 3-D. |\n| `preset shadow` | `a:prstShdw` | The `shadow` presets cover it. |\n| `fill overlay` | `a:fillOverlay` | Not in the format. |\n| `text wrapping`, `text columns`, `autofit` | `wrap="none"`, `numCol` above 1, `a:spAutoFit`, `a:normAutofit` | OPF fits text itself and never writes autofit. |\n| `alternative text title` | `p:cNvPr title` | `alt` is the one text alternative. |\n| `hover link` | `a:hlinkHover` | Only the click link. |\n| `locks` | `a:spLocks`, `a:cxnSpLocks` | Editing state, not content. |\n| `black-and-white mode` | `bwMode` other than `auto` | Not in the format. |\n| `custom data` | `p:custDataLst` | Not in the format. |\n| `picture fill`, `group fill`, `pattern line`, `effect graph`, `click action`, `geometry <name>` | `a:blipFill` on a shape, `a:grpFill`, `a:pattFill` on a line, `a:effectDag`, a link that is not an http, mailto or tel URL, a preset OPF does not have | No OPF form. |\n| `gradient fill`, `pattern fill`, `gradient focus`, `line transparency`, `shadow scale`, `custom geometry`, `custom path fill or stroke mode`, `arrowhead <type>` | a gradient or pattern with fewer than two stops or an unknown preset, a gradient focus off the center, a transparent line whose color is a theme color, a shadow scaled unevenly, an unreadable outline, a custom path with fill modes or hidden strokes, an arrowhead OPF does not have | The nearest OPF form is used where there is one. |\n| `color transform <name>` | a color transform other than alpha, `lumMod` and `lumOff` | Its effect is not applied. |\n\n\nA shape PowerPoint drew behind a text box, a picture, a table or a chart (below it in the z order, overlapping it, and over none of it) imports with `layer: "back"`, so it is drawn behind the content as it was. A shape between two pieces of content, over one and under another, is neither layer: it imports in front and, when it is opaque, is reported as `shape-covers-content` (`import/shape-covers-content`). A shape the export wrote takes its layer from the stored record.\n\nApproximations that are not reported: a theme style that is a gradient (`fillRef` index 2 or 3) imports as the solid color of its reference, and a rotated shape inside a group that scales its axes unevenly is scaled on the slide\'s axes.\n\n## Editing shapes\n\nThe editor edits shape blocks in the playground, the workspace and the Studio (`@openpresentation/opf-editor`; every edit is one validated, undoable change through the session, so Undo, Redo and proposals work as for any other edit):\n\n- **Shape picker.** **Insert shape** in the playground (and **Add content > Shape**) opens PowerPoint\'s gallery: Lines, Rectangles, Basic Shapes, Block Arrows, Equation Shapes, Flowchart, Stars and Banners, Callouts and Action Buttons, a tile drawn from each preset\'s own geometry. The search takes the DrawingML name (`rightArrow`) and common words (`arrow`, `callout`, `star`, `flowchart`, `speech bubble`, `cylinder`); every word must match and Enter picks the first match. **Change shape\u2026** in the Selected shape section changes a block\'s preset and keeps the adjust values the new preset also has. The groups and the search are `@openpresentation/opf/shape-catalog`; the MCP\'s `search_shapes` serves the same search with each preset\'s adjust values and a drawing.\n- **Adjust handles.** A selected preset shape shows its yellow handles on the slide, where `presetGeometry(...).handles` puts them (turned and mirrored with the shape). Dragging one writes `adjust` as fractions and degrees (four and two places), pinned to the handle\'s range, as one undo step; Escape cancels a drag; the arrow keys nudge a focused handle (Shift for more). The Adjust fields in the section take the same values by typing. A few presets report a handle range that leaves their own default out (`star24`, `star32`, `mathDivide`\'s `adj2`, `leftRightRibbon`\'s `adj2`, as PowerPoint\'s definitions do); the editor widens that range to hold the default.\n- **Every property.** The Selected shape section edits `fill` (none, color, gradient with type, angle and stops, pattern) and `opacity`, `stroke` (color or gradient, width, dash as a preset or a custom array, cap, join, miter limit, compound, alignment, start and end arrowheads, sketch), `style`, the six effects with the shadow presets, `rotate` and `flip`, `text`, `anchor`, `padding` and `textDirection`, and `alt`, `decorative`, `hidden` and `link`. Every color is a ColorRef with PowerPoint\'s Lighter and Darker tints (`{ color, lighten|darken }`).\n- **Overlay shapes and connectors.** **Insert shape** offers the gallery\'s pick **In the layout** (a block composition places) or **On the slide** (an overlay: `slide.shapes`, free `x`, `y`, `width` and `height`). A selected overlay shape shows a frame: drag its outline or the grip above it to move it, a handle to resize it (fractions of the slide, signed positions retained outside its edges, four places), arrow keys on the frame to move it (Shift resizes), Escape to cancel; **Place on the slide** takes the same numbers in percent. A shape attached to a block (`at`) keeps its anchor: dragging changes the `offset` from the block\'s edge, resizing `at.widthPx` and `at.heightPx` (reference pixels; the panel also sets `at.width` and `at.height`, fractions of the target), and **Free from block** turns it into fractions. **Stacking** (Bring to front, Bring forward, Send backward, Send to back) is the array order; **Delete** removes a shape and the connectors that end on it. **Connect** (the playground\'s toolbar on a screen wider than a phone, or `canvas.connect({ route, stroke })`; below 1,100 pixels the toolbar leaves out the route choice, which the connector\'s section holds) picks two blocks or overlay shapes on the slide (click the start, then the end; Esc cancels) and adds a connector on top, straight, elbow or curved, an arrow by default; an end with no `id` gets one in the same undo step. A selected connector\'s section has its route, start and end (a block or an overlay shape), connection sites and its line with arrowheads. Every one of these is one undoable change.\n- **Diagrams.** A slide with a [diagram](#native-diagrams) takes overlay shapes and connectors like any other slide (a connector can end on the diagram block), and the Export menu\'s PowerPoint file writes the diagram as its native group beside them.\n- **From code.** `@openpresentation/opf-editor/shape-overlays`: `insertOverlayShape`, `setOverlayFrame`, `detachOverlay`, `moveOverlayLayer`, `removeOverlay`, `connectShapes`, `setConnector`, `listConnectionEnds`, `readOverlay` (each with a `prepare...` form). `@openpresentation/opf-editor/shape-options`: `insertShape`, `setShapePreset`, `setShapeAdjust` and `setShapeProperties` (each with a `prepare...` form), `searchShapes`, `shapeGroups`, `readShape`; `@openpresentation/opf-editor/shape-picker`: `createShapePicker`, `createShapeMenu`. See the [editor README](../packages/editor/README.md).\n\n## Native diagrams\n\nA [diagram](diagrams.md) (Mermaid, DOT or PlantUML source in a `diagram` block) is drawn with the same shapes in PowerPoint. The PPTX export writes it as native shapes, connectors and text by default (`diagrams: "shapes"`; `"picture"` writes one SVG picture, `--diagrams picture` in the CLI), built from the diagram engine\'s own laid-out drawing, the geometry the preview draws:\n\n- a node whose outline is a preset is that preset (`rect`, `roundRect`, `ellipse`, `diamond`, `hexagon` and the others, checked against the [preset geometry](#preset-geometry)); any other outline is a custom geometry of its exact path, with the four connection sites of a rectangle;\n- a straight edge without arrowheads is a connector glued to the connection sites of the nodes it touches, written as an [overlay connector](#connectors) is (one `p:cxnSp` with `a:stCxn` and `a:endCxn` on the native shape ids and the sites\' indexes), so it follows a node moved in PowerPoint; every other edge is one shape of custom geometry holding its line and its arrowheads, because PowerPoint opens no connector of custom geometry and its line ends are shorter than the diagram\'s arrowheads;\n- labels are real text at the preview\'s size and baseline;\n- everything is one group named `OPF diagram N`, with the diagram\'s `alt` as its description.\n\nA family is written as shapes once PowerPoint\'s drawing of it has passed the comparison with the preview (all 32 families have; the list is core\'s `DIAGRAM_SHAPE_FAMILIES`). A diagram whose family is not in the list, or whose drawing needs what PowerPoint has no native form for (a clip path, a mask, a filter, an embedded image, text on a path, right-to-left text), stays a picture and is reported as `pptx/diagram-shapes-unavailable`.\n\nOn import an unchanged group is its diagram again (the Mermaid, DOT or PlantUML source and `alt`), and none of its members become overlay shapes or connectors. An edited group (a member moved, resized, retyped, added or removed) imports as its shapes, [as PowerPoint\'s shapes do](#a-deck-powerpoint-wrote): the nodes as overlay shapes with their presets, fills, lines and text, the glued edges as connectors between them; `invalid-diagram-provenance` reports that the source is not reconstructed. See [native shapes in PowerPoint](diagrams.md#native-shapes-in-powerpoint) for the comparison and the families.\n\n## Pyramids, matrices, chevrons and flows\n\nThe `pyramid`, `matrix`, `cycle`, `chevrons`, `flow` and `vertical-flow` layouts (a region\'s `arrangement`) draw a list as PowerPoint\'s Basic Pyramid, Basic Matrix, Basic Cycle, Basic Chevron Process, Basic Process or Vertical Process, or as OPF\'s own design of the arrangement where PowerPoint\'s does not hold the entries, and the PPTX export writes PowerPoint\'s design as live SmartArt where PowerPoint lays the SmartArt out exactly as the preview draws it, otherwise as native shapes (`trapezoid`, `roundRect`, `diamond`, a cycle\'s `ellipse`, a `chevron`, and turned `rightArrow`s) under the measured lines (`smartArt: "live" | "shapes"`, CLI `--smart-art`). Each live SmartArt is an `mc:AlternateContent` whose fallback is OPF\'s preview of the frame as an SVG picture over a PNG: PowerPoint shows the live SmartArt, an app that does not lay SmartArt out shows OPF\'s drawing, and import reads either. See [Pyramids, matrices and live SmartArt](smartart.md) for the geometry, the domain PowerPoint was compared on, what each app shows and what PowerPoint does when a node is edited or the file is saved again.\n\n## Validation\n\n| Finding | When |\n|---|---|\n| `opf/schema` | `shape` is not a preset name (the nearest names are offered as fixes), or a property has the wrong form. |\n| `opf/shape-adjust-unknown` | `adjust` names a guide the preset does not have, or sits on a custom `path`. |\n| `opf/shape-adjust-range` | An adjust value is outside its handle\'s range; the default is drawn. |\n| `opf/text-overflow` | The text does not fit inside the shape at the readable minimum size. |\n| `opf/shape-link-hidden` | A hidden shape has a link nobody can click. |\n| `opf/shape-option-unsupported-payload` | A shape-only property (`fill`, `style`, `rotate` and the others) is on a block that is not a shape. |\n| `opf/shape-anchor-missing` | An overlay\'s block, chart point or series does not resolve, or its native plot is unqualified; the shape is not drawn. |\n| `opf/shape-off-slide` | An overlay shape (or an image callout) lies wholly outside the slide, so nothing of it is drawn: usually a percent or a pixel written where a fraction belongs. A warning; a shape that straddles an edge, a hidden one, and a rotated one whose circumscribed circle reaches the slide are not reported. |\n| `opf/connector-end-missing` | A connector\'s `from` or `to` names no block or overlay shape on the slide (or names a connector); the connector is not drawn. |\n| `opf/schema` | An overlay shape has both placements or none, or only some of `x`, `y`, `width` and `height`; a connector has a shape-only key; a `fromSite` or `toSite` is an index the shape does not have. |\n\n## Loading in browsers and edge runtimes\n\nNode, Bun and Deno load the preset geometry (about 35 KB gzipped, with the sketched line) with core and draw any shape at once. A browser bundle or an edge Worker loads it the first time a deck has a shape block, an overlay shape or connector, a custom `path`, a picture masked by a preset other than the four built-in masks (`rect`, `roundRect`, `ellipse`, `hexagon`) or a sketched picture line, through the package\'s `#shape-engine` import map, as diagrams load (`#diagram-engine`); a deck without them does not carry it. The renderer\'s browser fonts handle loads it in `ensure` (its `pending` lists `shapes`), and `toPptx` loads it itself. A host that composes with `composeSlide` or `toSvg` directly calls `await ensureShapes(presentation)` (from `@openpresentation/opf` or `@openpresentation/opf/composition`) first; `shapesPending(presentation)` lists what it would load. A PPTX export with native diagrams (the default) also needs it for a deck with a diagram, which `ensureShapes(presentation, { diagrams: true })` covers; `toPptx` calls it so. Diagrams and icon sets load the same way, and one preload covers all three: see [Engines and icon sets that load on demand](how-opf-works.md#engines-and-icon-sets-that-load-on-demand). Until then a shape draws its frame and text with no outline, a mask beyond the built-in four draws as a rectangle and a sketched picture line as the plain line.\n\n## Preset geometry\n\n`@openpresentation/opf/shape-geometry` evaluates a preset at a size. It is edge-safe (no Node import) and has no\ndependency; its data is `spec/reference/preset-geometry.json`.\n\n```js\nimport { PRESET_SHAPES, presetAdjustments, presetGeometry, customGeometry, adjustToDrawingML } from "@openpresentation/opf/shape-geometry";\n\nPRESET_SHAPES.length; // 187\npresetAdjustments("rightArrow", 200, 100);\n// { adj1: { default: 0.5, min: 0, max: 1, unit: "fraction" }, adj2: { default: 0.5, min: 0, max: 2, unit: "fraction" } }\nconst arrow = presetGeometry("rightArrow", 200, 100, { adj1: 0.4 });\narrow.paths; // [{ d: "M0 30 L150 30 L150 0 L200 50 L150 100 L150 70 L0 70 Z", fill: "norm", stroke: true, commands: [...] }]\narrow.textRect; // { x: 0, y: 30, width: 180, height: 40 }\narrow.connectionSites; // [{ x: 150, y: 0, angle: 270 }, ...]\narrow.handles; // [{ kind: "xy", x: 0, y: 30, vertical: { adjust: "adj1", min: 0, max: 1 } }, ...]\nadjustToDrawingML("rightArrow", { adj1: 0.4 }); // { adj1: 40000, adj2: 50000 }: the a:avLst to write\n```\n\n| Export | What it does |\n| --- | --- |\n| `PRESET_SHAPES` | The 187 names, in the order of the standard\'s definitions file. `isPresetShape(name)` tests one. |\n| `presetAdjustments(name, width?, height?)` | Each adjust value\'s default and the range of the handle that moves it, at the size (handle ranges can depend on the size; the default is a square). `min`/`max` are `null` when the standard leaves them unbounded or no handle moves the value (the `hf`/`vf` proportion factors of the polygons and stars). |\n| `presetGeometry(name, width, height, adjust?)` | The paths as SVG path data, each with its DrawingML fill mode (`norm`, `none`, `lighten`, `lightenLess`, `darken`, `darkenLess`) and stroke flag; the text rectangle; the connection sites; the adjust handles. Every length is in the units of `width` and `height`. `commands` is the same outline as absolute `M`/`L`/`C`/`Q`/`Z` commands (arcs as cubic B\xE9ziers) for bounds, hit tests and native custom geometry. |\n| `customGeometry(path, width, height)` | An OPF custom outline: SVG path data in a 0 to 1 box (a string), or `{ d, viewBox }`. Every SVG command is accepted (arcs become cubic B\xE9ziers, so a non-uniform scale stays exact); the result has `presetGeometry`\'s shape, with the whole box as the text rectangle and the four edge midpoints as connection sites. |\n| `adjustToDrawingML(name, adjust)`, `adjustFromDrawingML(name, avLst)` | OPF adjust values to and from the integers of `a:avLst`. |\n| `evaluateGuideFormula(formula, guides)` | One guide formula, for hosts that evaluate their own `a:custGeom` guides. |\n| `flattenShapePath(commands, segments?)` | Path commands as polylines. |\n\n### Units\n\n- Adjust values are OPF units. The values the standard writes in 1/100000 are fractions: DrawingML `val 25000` is OPF\n `0.25` (which dimension it is a fraction of depends on the preset, most often the shorter side). The angle adjusts\n (the ones a polar handle moves: `arc`, `blockArc`, `chord`, `pie`, the three circular arrows and `mathNotEqual`) are\n degrees: DrawingML `val 16200000` (60000ths of a degree) is OPF `270`. `presetAdjustments` names each one\'s `unit`.\n- Angles of connection sites are degrees clockwise from the positive x axis, y pointing down, as in DrawingML.\n- A value outside its handle\'s range is pinned by the preset\'s own guides, as PowerPoint pins it.\n- `adjustToDrawingML` rounds to the integers DrawingML stores, and the preview evaluates the same integers, so the two\n engines draw the same value. Once any value is given, every `avLst` value is written, the others at their defaults,\n as PowerPoint writes them: PowerPoint refuses to open a file whose `avLst` names a hexagon\'s or star\'s `adj` without\n its `hf`/`vf` factors.\n\n### How the evaluator follows PowerPoint\n\n- The guide formula language of ECMA-376 Part 1, 20.1.9.11: `*/ +- +/ ?: abs at2 cat2 cos max min mod pin sat2 sin\n sqrt tan val`, with angles in 60000ths of a degree and the built-in guides `w h l t r b hc vc ss ls`, `wd2` to `wd32`,\n `hd2` to `hd10`, `ssd2` to `ssd32`, `cd2 cd4 cd8 3cd4 3cd8 5cd8 7cd8`. A zero divisor (a shape of zero width or\n height) gives 0, so a degenerate shape still has finite points.\n- `arcTo` starts on the ellipse at the visual angle `stAng` (the angle of the ray from the ellipse\'s center, not the\n parametric angle) and sweeps `swAng`, positive clockwise on screen, to the visual angle `stAng + swAng`.\n- A path with its own `w` and `h` is evaluated in that coordinate space, arcs included, and then scaled to the shape.\n- Fills use the nonzero rule.\n\n### Verified against PowerPoint\n\nEvery preset was written as a native `a:prstGeom` at two sizes (360 by 200 and 150 by 260 pixels) with its default\nadjust values and a second set (each handle\'s value halfway to its range end), once filled and once stroked with a\n1-pixel line, exported by PowerPoint 365 at 1280 by 720 and compared with the engine\'s SVG rendered at the same size.\nAll 187 presets match: no stroked outline differs by more than 1 pixel anywhere, and the filled outlines differ by more\nthan 1 pixel only at a few antialiased pixels of hairline tips (at most 13 pixels of a 640 by 360 cell, in `star32`,\n`rightBrace`, `leftBrace`, `star24`, `bracePair` and `flowChartOnlineStorage`).\n\nCustom outlines were checked the same way: four outlines (a circle of two arcs, a star, a heart of cubic B\xE9ziers, a callout with\nan arc and a quadratic curve), each at two sizes, written as native `a:custGeom` from `customGeometry`\'s `commands`, match\nPowerPoint with no pixel off by more than 1 pixel.\n\nThe comparison also shows that stroke joins are not geometry: with a 3-pixel line PowerPoint draws mitered joins of very\nacute tips (the spikes of `star24`, `star32` and `sun`) shorter than SVG\'s miter, and it drew `a:round` joins as miters in\nthis export. The stroke engines own that difference.\n\n### Errata\n\nTwo values of the standard\'s definitions file are corrected to what PowerPoint does (recorded in the table\'s `errata`):\n\n- `pie`: the file\'s text rectangle swaps `t` and `r` (`l=il t=ir r=it b=ib`), a rectangle of negative size; PowerPoint\n lays out pie text in the ellipse\'s text rectangle (`il it ir ib`).\n- `curvedLeftArrow`: the arrow tip\'s connection site names the undefined guide `cd3`; it faces left (`cd2`), mirroring\n `curvedRightArrow`\'s tip.\n\nSome text rectangles and connection sites of the standard lie off the drawn outline on purpose (a frame\'s opening, a\npie\'s center, the sites of `blockArc` and the gears on their construction circles); the engine keeps them as defined.\n\n### Preset geometry source and license\n\n`spec/reference/preset-geometry.json` is generated by `scripts/build-preset-geometry.mjs` from the standard\'s\n`presetShapeDefinitions.xml` (the DrawingML preset geometries of the ECMA-376 Part 1 electronic attachment), downloaded\nand never committed:\n\n- Source: Apache POI 5.5.1,\n `https://raw.githubusercontent.com/apache/poi/REL_5_5_1/poi/src/main/resources/org/apache/poi/sl/draw/geom/presetShapeDefinitions.xml`\n (tag `REL_5_5_1`, commit `6048bedcdf1de60871b4a2fb7cf7cd242752e6c9`, sha256\n `a7dad593d27bd70536b41da9b761fa16409536cc0c25ef2b6c7a61c5d9b3e738`).\n- License: Apache-2.0 (Apache POI\'s `legal/LICENSE`). Notice: "Apache POI. Copyright 2003-2025 The Apache Software\n Foundation. This product includes software developed at The Apache Software Foundation (https://www.apache.org/)."\n The table carries the source, license and notice in its `source` member.\n- The data itself is the standard\'s: Apache POI\'s license states that the Office Open XML material is part of ECMA-376,\n which section 9.4 of the Ecma bylaws makes available to all interested parties without restriction, and that\n Microsoft and Adobe granted patent licenses to it.\n- Not used: LibreOffice\'s copy of the same definitions (`oox/source/drawingml/customshapes/`), which is MPL-2.0, a\n file-level copyleft license.\n\nThe output keeps the standard\'s names and values; nothing is converted, so a rebuild from the same file is\nbyte-identical. Run `node scripts/build-preset-geometry.mjs --source <presetShapeDefinitions.xml>`; it checks that the\nfile still has 187 presets and that each erratum still applies.\n\n## Property map\n\nOPF names and the DrawingML that PowerPoint reads and writes.\n\n| What | OPF | PowerPoint (DrawingML) |\n| --- | --- | --- |\n| Preset shape | `shape: "chevron"` (a shape block) | `a:prstGeom prst` |\n| Adjust handles | `adjust: { "adj1": 0.25 }` (fractions and degrees) | `a:avLst/a:gd` |\n| Custom outline | `path` (SVG path data in a 0 to 1 box, or with a viewBox) | `a:custGeom` |\n| No fill | `fill: "none"` | `a:noFill` |\n| Solid fill | `fill: <ColorRef>` | `a:solidFill` |\n| Opacity | `opacity` 0 to 1 (fill), or 8-digit hex | `a:alpha` |\n| Gradient | `fill: { gradient: { type, angle, stops } }` | `a:gradFill` (`a:lin`, `a:path`) |\n| Pattern | `fill: { pattern: { preset, foregroundColor, backgroundColor } }` | `a:pattFill` |\n| Picture inside a shape | an image block\'s `shape` (every preset) | `a:blipFill` in `a:prstGeom` |\n| Fill rotates with shape | always on | `rotWithShape="1"` |\n| Lighter or darker color | `{ color, lighten }` / `{ color, darken }` | `a:lumMod`/`a:lumOff` |\n| Stroke | `stroke` (shapes and pictures) | `a:ln` |\n| Stroke color | `stroke.color` or `stroke.gradient` | `a:ln/a:solidFill`, `a:ln/a:gradFill` |\n| Stroke width | `stroke.width` | `a:ln w` |\n| Dash | `stroke.dash` (preset or array) | `a:prstDash`, `a:custDash` |\n| Cap | `stroke.cap` | `a:ln cap` |\n| Join | `stroke.join`, `stroke.miterLimit` | `a:miter lim`, `a:round`, `a:bevel` |\n| Compound | `stroke.compound` | `a:ln cmpd` |\n| Alignment | `stroke.align` | `a:ln algn` |\n| Arrowheads | `stroke.start`, `stroke.end` | `a:headEnd`, `a:tailEnd` |\n| Hand-drawn | `stroke.sketch` | `ask:lineSketchStyleProps` |\n| Theme style | `style` | `p:style` |\n| Outer shadow | `shadow` | `a:outerShdw` |\n| Inner shadow | `innerShadow` | `a:innerShdw` |\n| Glow | `glow` | `a:glow` |\n| Soft edges | `softEdge` | `a:softEdge` |\n| Reflection | `reflection` | `a:reflection` |\n| Blur | `blur` | `a:blur` |\n| Rotation | `rotate` | `a:xfrm rot` |\n| Flip | `flip` | `flipH`, `flipV` |\n| Overlay placement | slide-level `shapes: [...]` placed by `x`, `y`, `width`, `height` (fractions) or `at` a block | `a:xfrm a:off a:ext` |\n| Overlay layer | `layer`: front (default) or back | shape tree order: after the background, watermark and logo, or after everything |\n| Stacking | array order (within a layer) | shape tree order |\n| Text | `text` | `p:txBody` |\n| Vertical anchor | `anchor` | `a:bodyPr anchor` |\n| Margins | `padding` | `lIns`, `tIns`, `rIns`, `bIns` |\n| Vertical text | `textDirection` | `a:bodyPr vert` |\n| Alt text | `alt` | `p:cNvPr descr` |\n| Decorative | `decorative: true` | `adec:decorative` |\n| Name | from the block\'s path | `p:cNvPr name` |\n| Hidden | `hidden: true` | `p:cNvPr hidden` |\n| Click link | `link` | `a:hlinkClick` |\n| Connector | `connector: { from, to, route }` with `stroke`, among slide-level `shapes` | `p:cxnSp`, `a:stCxn`, `a:endCxn` |\n| Connection site | the nearest facing site; `fromSite`/`toSite` to override | `idx` |\n| Connector middle | `adjust: { adj1 }` on an elbow or curved connector | `a:avLst` of `bentConnector3`, `curvedConnector3` |\n| Native diagram | a `diagram` block, exported with `diagrams: "shapes"` (the default) | one `p:grpSp` of `p:sp` and `p:cxnSp` |\n\n### Excluded on purpose\n\nThese DrawingML features are left out of OPF; PPTX import reports them as findings.\n\n- 3-D (`a:scene3d`, `a:sp3d`): the preview cannot match PowerPoint\'s 3-D rendering.\n- Preset shadows (`a:prstShdw`): covered by the `shadow` presets.\n- Fill overlay (`a:fillOverlay`).\n- Text wrap off, text columns and autofit (`wrap`, `numCol`, `normAutofit`, `spAutoFit`): OPF fits text itself.\n- The alternative text title (`p:cNvPr title`): `alt` is the description.\n- Hover links (`a:hlinkHover`).\n- Locks (`a:spLocks`).\n- Black-and-white mode (`bwMode`).\n- Custom data (`p:custDataLst`).\n\n## Preset table\n\nDefault frame is the proportion a shape takes when the block sets no `aspectRatio`. Adjust values are OPF units (fractions, degrees where marked), with their handle\'s range at a square shape; "any" has no handle limit.\n\n| Preset | Default frame | Adjust values: default (range) |\n|---|---|---|\n| `accentBorderCallout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `accentBorderCallout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `accentBorderCallout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `accentCallout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `accentCallout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `accentCallout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `actionButtonBackPrevious` | 1:1 | none |\n| `actionButtonBeginning` | 1:1 | none |\n| `actionButtonBlank` | 1:1 | none |\n| `actionButtonDocument` | 1:1 | none |\n| `actionButtonEnd` | 1:1 | none |\n| `actionButtonForwardNext` | 1:1 | none |\n| `actionButtonHelp` | 1:1 | none |\n| `actionButtonHome` | 1:1 | none |\n| `actionButtonInformation` | 1:1 | none |\n| `actionButtonMovie` | 1:1 | none |\n| `actionButtonReturn` | 1:1 | none |\n| `actionButtonSound` | 1:1 | none |\n| `arc` | 1:1 | `adj1` 270\xB0 (0 to 359.99998), `adj2` 0\xB0 (0 to 359.99998) |\n| `bentArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5), `adj4` 0.4375 (0 to 0.75) |\n| `bentConnector2` | 2:1 | none |\n| `bentConnector3` | 2:1 | `adj1` 0.5 (any) |\n| `bentConnector4` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any) |\n| `bentConnector5` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any), `adj3` 0.5 (any) |\n| `bentUpArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5) |\n| `bevel` | 1:1 | `adj` 0.125 (0 to 0.5) |\n| `blockArc` | 1:1 | `adj1` 180\xB0 (0 to 359.99998), `adj2` 0\xB0 (0 to 359.99998), `adj3` 0.25 (0 to 0.5) |\n| `borderCallout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `borderCallout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `borderCallout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `bracePair` | 2:1 | `adj` 0.08333 (0 to 0.25) |\n| `bracketPair` | 2:1 | `adj` 0.16667 (0 to 0.5) |\n| `callout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `callout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `callout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `can` | 1:2 | `adj` 0.25 (0 to 0.5) |\n| `chartPlus` | 1:1 | none |\n| `chartStar` | 1:1 | none |\n| `chartX` | 1:1 | none |\n| `chevron` | 2:1 | `adj` 0.5 (0 to 1) |\n| `chord` | 1:1 | `adj1` 45\xB0 (0 to 359.99998), `adj2` 270\xB0 (0 to 359.99998) |\n| `circularArrow` | 1:1 | `adj1` 0.125 (0 to 0.25), `adj2` 19.03865\xB0 (0 to 56.44269), `adj3` 340.96135\xB0 (0 to 359.99998), `adj4` 180\xB0 (0 to 359.99998), `adj5` 0.125 (0 to 0.25) |\n| `cloud` | 1:1 | none |\n| `cloudCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any) |\n| `corner` | 1:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `cornerTabs` | 1:1 | none |\n| `cube` | 1:1 | `adj` 0.25 (0 to 1) |\n| `curvedConnector2` | 2:1 | none |\n| `curvedConnector3` | 2:1 | `adj1` 0.5 (any) |\n| `curvedConnector4` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any) |\n| `curvedConnector5` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any), `adj3` 0.5 (any) |\n| `curvedDownArrow` | 2:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `curvedLeftArrow` | 1:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `curvedRightArrow` | 1:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `curvedUpArrow` | 2:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `decagon` | 1:1 | `vf` 1.05146 (any) |\n| `diagStripe` | 1:1 | `adj` 0.5 (0 to 1) |\n| `diamond` | 1:1 | none |\n| `dodecagon` | 1:1 | none |\n| `donut` | 1:1 | `adj` 0.25 (0 to 0.5) |\n| `doubleWave` | 2:1 | `adj1` 0.0625 (0 to 0.125), `adj2` 0 (-0.1 to 0.1) |\n| `downArrow` | 1:2 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `downArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `ellipse` | 1:1 | none |\n| `ellipseRibbon` | 2:1 | `adj1` 0.25 (0 to 1), `adj2` 0.5 (0.25 to 0.75), `adj3` 0.125 (0 to 0.25) |\n| `ellipseRibbon2` | 2:1 | `adj1` 0.25 (0 to 1), `adj2` 0.5 (0.25 to 1), `adj3` 0.125 (0 to 0.25) |\n| `flowChartAlternateProcess` | 3:2 | none |\n| `flowChartCollate` | 1:1 | none |\n| `flowChartConnector` | 1:1 | none |\n| `flowChartDecision` | 1:1 | none |\n| `flowChartDelay` | 3:2 | none |\n| `flowChartDisplay` | 3:2 | none |\n| `flowChartDocument` | 3:2 | none |\n| `flowChartExtract` | 1:1 | none |\n| `flowChartInputOutput` | 3:2 | none |\n| `flowChartInternalStorage` | 3:2 | none |\n| `flowChartMagneticDisk` | 3:2 | none |\n| `flowChartMagneticDrum` | 3:2 | none |\n| `flowChartMagneticTape` | 3:2 | none |\n| `flowChartManualInput` | 3:2 | none |\n| `flowChartManualOperation` | 3:2 | none |\n| `flowChartMerge` | 1:1 | none |\n| `flowChartMultidocument` | 3:2 | none |\n| `flowChartOfflineStorage` | 1:1 | none |\n| `flowChartOffpageConnector` | 3:2 | none |\n| `flowChartOnlineStorage` | 3:2 | none |\n| `flowChartOr` | 1:1 | none |\n| `flowChartPredefinedProcess` | 3:2 | none |\n| `flowChartPreparation` | 3:2 | none |\n| `flowChartProcess` | 3:2 | none |\n| `flowChartPunchedCard` | 3:2 | none |\n| `flowChartPunchedTape` | 2:1 | none |\n| `flowChartSort` | 1:1 | none |\n| `flowChartSummingJunction` | 1:1 | none |\n| `flowChartTerminator` | 2:1 | none |\n| `foldedCorner` | 1:1 | `adj` 0.16667 (0 to 0.5) |\n| `frame` | 1:1 | `adj1` 0.125 (0 to 0.5) |\n| `funnel` | 1:1 | none |\n| `gear6` | 1:1 | `adj1` 0.15 (0 to 0.2), `adj2` 0.03526 (0 to 0.05358) |\n| `gear9` | 1:1 | `adj1` 0.1 (0 to 0.2), `adj2` 0.01763 (0 to 0.02679) |\n| `halfFrame` | 1:1 | `adj1` 0.33333 (0 to 0.66667), `adj2` 0.33333 (0 to 1) |\n| `heart` | 1:1 | none |\n| `heptagon` | 1:1 | `hf` 1.02572 (any), `vf` 1.0521 (any) |\n| `hexagon` | 1:1 | `adj` 0.25 (0 to 0.5), `vf` 1.1547 (any) |\n| `homePlate` | 2:1 | `adj` 0.5 (0 to 1) |\n| `horizontalScroll` | 2:1 | `adj` 0.125 (0 to 0.25) |\n| `irregularSeal1` | 1:1 | none |\n| `irregularSeal2` | 1:1 | none |\n| `leftArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `leftArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `leftBrace` | 1:2 | `adj1` 0.08333 (0 to 0.25), `adj2` 0.5 (0 to 1) |\n| `leftBracket` | 1:2 | `adj` 0.08333 (0 to 0.5) |\n| `leftCircularArrow` | 1:1 | `adj1` 0.125 (0 to 0.25), `adj2` -19.03865\xB0 (-56.44269 to 0), `adj3` 19.03865\xB0 (0 to 359.99998), `adj4` 180\xB0 (0 to 359.99998), `adj5` 0.125 (0 to 0.25) |\n| `leftRightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 0.5) |\n| `leftRightArrowCallout` | 2:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5), `adj4` 0.48123 (0 to 0.5) |\n| `leftRightCircularArrow` | 1:1 | `adj1` 0.125 (0 to 0.25), `adj2` 19.03865\xB0 (0 to 56.44269), `adj3` 340.96135\xB0 (0 to 359.99998), `adj4` 199.03865\xB0 (0 to 359.99998), `adj5` 0.125 (0 to 0.25) |\n| `leftRightRibbon` | 2:1 | `adj1` 0.5 (0 to 0.83333), `adj2` 0.5 (0 to 0.46875), `adj3` 0.16667 (0 to 0.33333) |\n| `leftRightUpArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.25) |\n| `leftUpArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5) |\n| `lightningBolt` | 1:1 | none |\n| `line` | 2:1 | none |\n| `lineInv` | 2:1 | none |\n| `mathDivide` | 1:1 | `adj1` 0.2352 (0.01 to 0.36745), `adj2` 0.0588 (0 to 0.0293), `adj3` 0.1176 (0.01 to 0.12493) |\n| `mathEqual` | 1:1 | `adj1` 0.2352 (0 to 0.36745), `adj2` 0.1176 (0 to 0.5296) |\n| `mathMinus` | 1:1 | `adj1` 0.2352 (0 to 1) |\n| `mathMultiply` | 1:1 | `adj1` 0.2352 (0 to 0.51965) |\n| `mathNotEqual` | 1:1 | `adj1` 0.2352 (0 to 0.5), `adj2` 110\xB0 (70 to 110), `adj3` 0.1176 (0 to 0.5296) |\n| `mathPlus` | 1:1 | `adj1` 0.2352 (0 to 0.7349) |\n| `moon` | 1:1 | `adj` 0.5 (0 to 0.875) |\n| `nonIsoscelesTrapezoid` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5) |\n| `noSmoking` | 1:1 | `adj` 0.1875 (0 to 0.5) |\n| `notchedRightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `octagon` | 1:1 | `adj` 0.29289 (0 to 0.5) |\n| `parallelogram` | 3:2 | `adj` 0.25 (0 to 1) |\n| `pentagon` | 1:1 | `hf` 1.05146 (any), `vf` 1.10557 (any) |\n| `pie` | 1:1 | `adj1` 0\xB0 (0 to 359.99998), `adj2` 270\xB0 (0 to 359.99998) |\n| `pieWedge` | 1:1 | none |\n| `plaque` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `plaqueTabs` | 1:1 | none |\n| `plus` | 1:1 | `adj` 0.25 (0 to 0.5) |\n| `quadArrow` | 1:1 | `adj1` 0.225 (0 to 0.45), `adj2` 0.225 (0 to 0.5), `adj3` 0.225 (0 to 0.275) |\n| `quadArrowCallout` | 1:1 | `adj1` 0.18515 (0 to 0.3703), `adj2` 0.18515 (0 to 0.5), `adj3` 0.18515 (0 to 0.31485), `adj4` 0.48123 (0.18515 to 0.6297) |\n| `rect` | 3:2 | none |\n| `ribbon` | 2:1 | `adj1` 0.16667 (0 to 0.33333), `adj2` 0.5 (0.25 to 0.75) |\n| `ribbon2` | 2:1 | `adj1` 0.16667 (0 to 0.33333), `adj2` 0.5 (0.25 to 0.75) |\n| `rightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `rightArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `rightBrace` | 1:2 | `adj1` 0.08333 (0 to 0.25), `adj2` 0.5 (0 to 1) |\n| `rightBracket` | 1:2 | `adj` 0.08333 (0 to 0.5) |\n| `round1Rect` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `round2DiagRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0 (0 to 0.5) |\n| `round2SameRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0 (0 to 0.5) |\n| `roundRect` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `rtTriangle` | 1:1 | none |\n| `smileyFace` | 1:1 | `adj` 0.04653 (-0.04653 to 0.04653) |\n| `snip1Rect` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `snip2DiagRect` | 3:2 | `adj1` 0 (0 to 0.5), `adj2` 0.16667 (0 to 0.5) |\n| `snip2SameRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0 (0 to 0.5) |\n| `snipRoundRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0.16667 (0 to 0.5) |\n| `squareTabs` | 1:1 | none |\n| `star10` | 1:1 | `adj` 0.42533 (0 to 0.5), `hf` 1.05146 (any) |\n| `star12` | 1:1 | `adj` 0.375 (0 to 0.5) |\n| `star16` | 1:1 | `adj` 0.375 (0 to 0.5) |\n| `star24` | 1:1 | `adj` 0.375 (0 to 0.0005) |\n| `star32` | 1:1 | `adj` 0.375 (0 to 0.0005) |\n| `star4` | 1:1 | `adj` 0.125 (0 to 0.5) |\n| `star5` | 1:1 | `adj` 0.19098 (0 to 0.5), `hf` 1.05146 (any), `vf` 1.10557 (any) |\n| `star6` | 1:1 | `adj` 0.28868 (0 to 0.5), `hf` 1.1547 (any) |\n| `star7` | 1:1 | `adj` 0.34601 (0 to 0.5), `hf` 1.02572 (any), `vf` 1.0521 (any) |\n| `star8` | 1:1 | `adj` 0.375 (0 to 0.5) |\n| `straightConnector1` | 2:1 | none |\n| `stripedRightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 0.84375) |\n| `sun` | 1:1 | `adj` 0.25 (0.125 to 0.46875) |\n| `swooshArrow` | 2:1 | `adj1` 0.25 (0.00001 to 0.75), `adj2` 0.16667 (0 to 0.7) |\n| `teardrop` | 1:1 | `adj` 1 (0 to 2) |\n| `trapezoid` | 3:2 | `adj` 0.25 (0 to 0.5) |\n| `triangle` | 1:1 | `adj` 0.5 (0 to 1) |\n| `upArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `upDownArrow` | 1:2 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 0.5) |\n| `upArrow` | 1:2 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `upDownArrowCallout` | 1:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5), `adj4` 0.48123 (0 to 0.5) |\n| `uturnArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.25), `adj3` 0.25 (0 to 0.75), `adj4` 0.4375 (0 to 0.4375), `adj5` 0.75 (0.5 to 1) |\n| `verticalScroll` | 1:2 | `adj` 0.125 (0 to 0.25) |\n| `wave` | 2:1 | `adj1` 0.125 (0 to 0.2), `adj2` 0 (-0.1 to 0.1) |\n| `wedgeEllipseCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any) |\n| `wedgeRectCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any) |\n| `wedgeRoundRectCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any), `adj3` 0.16667 (any) |\n\nOrganization charts, hierarchies and set overlap use the `org-chart`, `hierarchy` and `venn` arrangement layouts. Trees preserve one root and list-entry depths; Venn supports one to seven flat sets. Both engines share their measured connectors, paired cards, opacity and label rectangles. See [Trees and set overlap](smartart.md#trees-and-set-overlap-sh-21) for authoring and export fidelity.\n\nSigned overlay origins remain subject to representability: their scaled and rounded geometry must stay finite and its native EMU values must be exact JavaScript integers. An unrepresentable coordinate is a located error; it is never clamped or moved. This is engine number safety, not a PowerPoint coordinate maximum or a different OPF unit.\n'
357
+ "markdown": '# Shapes\n\nA shape block draws one of PowerPoint\'s 187 preset shapes, or an outline of your own, with a fill, a line and optional text inside. Both engines draw the same thing from one definition: the preview evaluates the preset\'s DrawingML geometry to SVG, and the PPTX export writes the native preset (`a:prstGeom` with its adjust values), so PowerPoint draws its own shape and the two match. The same stroke vocabulary is a picture\'s line, and every preset is a picture mask.\n\n```json\n{\n "title": "How we ship",\n "blocks": [\n { "shape": "chevron", "text": "Plan" },\n { "shape": "chevron", "text": "Build", "fill": { "color": "accent1", "lighten": 0.4 } },\n { "shape": "chevron", "text": "Ship", "style": "intense" }\n ]\n}\n```\n\nThe full reference deck is [`examples/technical/shapes.opf.json`](../examples/technical/shapes.opf.json): one slide per group of properties.\n\nThis page covers [shape blocks](#a-shape-block) and their properties, [overlay shapes and connectors](#overlay-shapes-and-connectors) drawn over a composed slide, [importing shapes](#importing-shapes-from-powerpoint) from PowerPoint, [editing shapes](#editing-shapes) in the editor, and [native diagrams](#native-diagrams), Mermaid, DOT and PlantUML diagrams written as PowerPoint shapes; then validation, loading in browsers, the preset geometry and the property map.\n\n## A shape block\n\nA block with `shape` and no `image`, or with a custom `path`, is a shape block (`type: "shape"`). It composes like any other block: automatic composition and layout regions give it a cell, and the shape takes the largest frame of its own proportions centered in that cell (the region\'s anchor places it vertically). The proportions are the block\'s `aspectRatio`, else the preset\'s: 1:1 for the round and regular shapes (`ellipse`, `star5`, `hexagon`, `heart`, the flowchart connectors), 2:1 for horizontal arrows and bands (`rightArrow`, `chevron`, `ribbon`, `wave`), 1:2 for vertical ones (`upArrow`, `can`, `leftBrace`) and 3:2 otherwise (`rect`, `roundRect`, the callouts and most flowchart shapes). A layout region that takes pictures (`image`) also takes shapes; a region can name `shape` in `accepts` too.\n\nA shape draws its own fill and outline, so it is never drawn on a card. `composeSlide` reports it as an item with `field: "shape"` and `ComposedItem.shape`: the frame, the evaluated paths in slide coordinates, the text rectangle, the effective fill, stroke and text color, and the effects.\n\n### Text inside\n\n`text` (a string or rich text runs) is drawn inside the preset\'s text rectangle (each preset defines one: a chevron\'s is its middle, an ellipse\'s the square inscribed in it), less `padding`. It is fitted by OPF\'s measured fonts, as body text is: from the body size down to the composition\'s `minFontSize` and never below it. Text that holds the body size in a large shape grows as a lone body block does: up the type scale, one step at a time, to the display size of a paragraph (43 reference pixels), while it fits and fills at most 60% of the text rectangle\'s height; it never ends below the body size. Sibling shapes (the blocks of one group, or a slide\'s overlay shapes) keep one size: each that grew is set at the smallest size they all reached. Shape text never breaks inside a word (RR-105): text whose word is wider than the text rectangle is set on one line instead, centered on the text rectangle and reaching past `padding` up to the shape\'s own edges, at the largest size from the body size down at which that line fits there (`ComposedShape.textWrap: "none"`; the export writes the shape\'s text unwrapped and centered, `a:bodyPr wrap="none" anchorCtr="1"`, which import reads as layout, not as a dropped property, so PowerPoint draws it the same way); text that cannot be one line shrinks without breaking a word. Text that does not fit at that size (a word too wide even across the shape) overflows and is reported as `opf/text-overflow` at `<block>/text`; give the shape more room (a larger cell or another `aspectRatio`), shorten the text or lower its padding. PowerPoint\'s autofit is never written: PowerPoint draws the size OPF chose.\n\nPowerPoint wraps a shape\'s text itself, in the same rectangle OPF fitted it in: the export writes the shape at its frame with its adjust values and `padding` as the body insets, so PowerPoint\'s text rectangle (the preset\'s own, less the insets) is OPF\'s for every preset, and every run names the fitted size. The text is measured in the weight it is drawn in (the `intense` style\'s text is bold). Read through PowerPoint 365 (SH-11), shape text has the same size and the same line breaks in the preview and in PowerPoint. Two exceptions remain. A line that ends within about half a point of the rectangle\'s edge can break differently, because PowerPoint\'s line widths differ from the measured faces\' by up to about \xB10.35 pt. A single word too long for its line, which only happens with text that overflows (a word too wide even across the shape), is split one letter differently. Pass `fonts` to `toPptx`: without them the export fits the text with core\'s width estimate, which is wider than the real faces, so PowerPoint shows the text smaller than the preview draws it.\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `anchor` | `top`, `middle` (default) or `bottom`: where the text sits in its rectangle. | `a:bodyPr anchor` |\n| `padding` | Insets in reference pixels: one number, or `{ top, right, bottom, left }`. Default 9.6 left and right, 4.8 top and bottom (PowerPoint\'s 0.1 and 0.05 inch). | `lIns`, `tIns`, `rIns`, `bIns` |\n| `textDirection` | `horizontal` (default), `vertical` (turned 90 degrees clockwise), `vertical270`, or `stacked` (one letter under another). | `a:bodyPr vert` (`horz`, `vert`, `vert270`, `wordArtVert`) |\n\nThe text is centered. Its color is the style\'s text color (light on the default style\'s accent fill) where that reads at 4.5:1 on the fill the shape draws, else black or white (LH-151; the fill\'s color, a gradient\'s middle stop or a pattern\'s background). A run\'s own `color` wins.\n\n## Presets\n\n`shape` takes DrawingML\'s own preset names (ECMA-376 `ST_ShapeType`), as PowerPoint writes them: `rect`, `roundRect`, `ellipse`, `triangle`, `rightArrow`, `chevron`, `wedgeRectCallout`, `flowChartDecision` and the rest. The [preset table](#preset-table) lists all 187 with their default frames and adjust values. A name that is not a preset is an `opf/schema` error with the nearest names as fixes.\n\n### Adjust values\n\n`adjust` sets the preset\'s adjust handles (the yellow handles in PowerPoint), named as DrawingML\'s guides: `adj`, or `adj1`, `adj2` and so on. Values are OPF units, never DrawingML\'s 100000ths or 60000ths: a fraction for the values DrawingML writes in 100000ths (most often a share of the shape\'s shorter side) and degrees for the angle handles of `arc`, `blockArc`, `chord`, `pie`, the circular arrows and `mathNotEqual`.\n\n```json\n{ "shape": "roundRect", "adjust": { "adj": 0.3 } }\n{ "shape": "rightArrow", "adjust": { "adj1": 0.6, "adj2": 0.35 } }\n{ "shape": "pie", "adjust": { "adj1": 0, "adj2": 270 } }\n```\n\nA name the preset does not have is `opf/shape-adjust-unknown`, and a value outside its handle\'s range `opf/shape-adjust-range` (both warnings); the preset\'s default is drawn. On an image block, `adjust` shapes the mask: a `roundRect` frame\'s corner is `{ "adj": 0.05 }`.\n\n### Custom outlines\n\n`path` draws an outline of your own (`a:custGeom` in PowerPoint): SVG path data in a 0 to 1 box (`"M0 0 L1 0 L0.5 1 Z"`, stretched to the frame), or `{ "d": ..., "viewBox": "0 0 24 24" }` for a path drawn on its own grid, such as an icon. Every SVG command is accepted (M, L, H, V, C, S, Q, T, A, Z, absolute or relative). A subpath that does not end with Z is open: it takes arrowheads at its ends. A custom path\'s text rectangle is the whole frame.\n\n## Fill\n\n| `fill` | Meaning | PowerPoint |\n|---|---|---|\n| `"none"` | No fill. | `a:noFill` |\n| a ColorRef | A solid fill: hex (eight-digit hex keeps its alpha), a scheme slot or role, `var:<id>`, or a [lighter or darker color](#lighter-and-darker-colors). | `a:solidFill` |\n| `{ "gradient": { "type", "angle", "stops" } }` | `linear` along `angle` (degrees, 0 left to right, 90 top to bottom), or `radial`, `rectangle` and `shape` from the center outwards. `stops` are `{ color, position }`, at least two. | `a:gradFill` with `a:lin` or `a:path circle`, `rect`, `shape` |\n| `{ "pattern": { "preset", "foregroundColor", "backgroundColor" } }` | A two-color pattern; `preset` is DrawingML\'s (`pct20`, `ltUpDiag`, `smGrid`, `dotDmnd`). | `a:pattFill` |\n\n`opacity` (0 to 1) is the fill\'s opacity, multiplied with an eight-digit hex alpha; the line and text keep theirs. Without a fill the shape takes its [style](#style)\'s. Fills rotate with the shape (`rotWithShape`).\n\nA shape\'s path may shade its fill: DrawingML presets such as `can`, `cube`, `bevel`, `foldedCorner` and `smileyFace` draw parts of their fill lighter or darker (`lighten`, `lightenLess`, `darken`, `darkenLess`). Both engines draw them, the preview as PowerPoint\'s 60% and 80% tints and shades of the fill.\n\nBoth engines draw every gradient as PowerPoint 365 does (measured on its export of all 187 presets):\n\n- A gradient spans the bounds of the shape\'s filled paths: the frame for most presets, the drawn quarter for `arc`, the upper half for `blockArc`.\n- `radial` is a circle from the center of those bounds through their corners, whatever their proportions.\n- `rectangle` is concentric rectangles: the bounds scaled about their center.\n- `shape` follows the outline: its contours are the outline scaled about the center of the bounds (on each ray from the center, the outline\'s farthest point). Each filled part of a preset follows its own outline, except the action buttons, `bevel` and `cube`, whose parts follow the whole shape\'s outline. PowerPoint draws the `shape` gradient of 64 presets (the arrows, ribbons, scrolls, braces, waves and the like) and of every custom `path` as its circle gradient instead, and so does the preview.\n- Colors mix as PowerPoint mixes them: a gradient of exactly two stops at 0 and 1 is eased and mixed in linear light; any other set of stops is mixed straight between neighboring stops.\n\nThe preview draws a `rectangle` or `shape` gradient as a fan of triangles from the center, each a linear gradient across it to its edge, clipped to the path. Measured against PowerPoint\'s own picture of the same PPTX, the mean difference per color channel is 2.6 levels of 255 at the median preset and at most 5 for 179 of the 187; the largest are the tiny `cornerTabs` (11) and `star4` (7).\n\n## Stroke\n\n`stroke` is the line along the outline (`a:ln`): `"none"`, or an object. On a shape without one the style\'s line is drawn; `"none"` removes it.\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `color` | Any ColorRef. Default the style\'s line color. | `a:solidFill` |\n| `gradient` | A gradient line instead of a color (the fill\'s gradient object). | `a:gradFill` |\n| `width` | Reference pixels, 0 to 64; 0 removes the line. Default 4/3 (1 point) on a shape, 2 on a picture. | `w` |\n| `dash` | `solid`, `dot`, `dash`, `longDash`, `dashDot`, `longDashDot`, `longDashDotDot`, `sysDot`, `sysDash`, `sysDashDot`, `sysDashDotDot`, or an array of dash and gap lengths in line widths (`[4, 2]`). | `a:prstDash` (`lgDash` for `longDash`), `a:custDash` |\n| `cap` | `flat` (default), `round`, `square`. | `cap` |\n| `join` | `miter` (default, as PowerPoint\'s default line), `round`, `bevel`; `miterLimit` (default 8). | `a:miter lim`, `a:round`, `a:bevel` |\n| `compound` | `single`, `double`, `thickThin`, `thinThick`, `triple`. | `cmpd` |\n| `align` | `center` (default) or `inside` (closed outlines only, as in PowerPoint). | `algn` |\n| `start`, `end` | Arrowheads on an open path: `{ type, width, length }`, `type` `triangle` (default), `stealth`, `diamond`, `oval` or `arrow`, sizes `small`, `medium` (default), `large`. | `a:headEnd`, `a:tailEnd` |\n| `sketch` | `curved`, `freehand` or `scribble`: PowerPoint\'s Sketched line. | `ask:lineSketchStyleProps` |\n\nThe preview draws every property. Arrowheads are drawn at 2, 3 or 5 line widths and the line stops under a triangle or stealth head, as PowerPoint draws them. A sketched line is drawn the same in both engines. PowerPoint does not compute a sketch when it opens a file: it draws the outline stored in `ask:lineSketchStyleProps` (an `a:custGeom`), and fills a sketched shape within that outline. OPF computes that outline itself, deterministically from the seed it writes as `sd` (from the style, the frame\'s size and the outline, so a moved shape keeps its line), and the preview strokes and fills the same outline, so PowerPoint\'s picture of the PPTX matches the preview (0.7 to 0.8 levels of 255 mean difference on the sketch evidence slides). The wobble is OPF\'s own, made to look like PowerPoint\'s three styles: `curved` bows each side gently, `freehand` wavers along it, `scribble` draws a freehand pass and a second pass of strokes that run past the corners. It is not PowerPoint\'s own randomization. When PowerPoint 365 (16.0.20527) saves the file again, it keeps the sketched outline as the shape\'s own custom geometry and drops the sketch style (observed through its object model, resized or not), so the shape still looks the same. PowerPoint versions before 2021 draw the plain line.\n\n## Style\n\n`style` is the theme shape style, as PowerPoint\'s Shape Styles gallery: it decides everything the shape does not set itself. The default is `moderate`, so a bare `{ "shape": "rect" }` looks like a new PowerPoint shape and follows the theme.\n\n| `style` | Fill | Line | Text | PowerPoint |\n|---|---|---|---|---|\n| `none` | none | none | the slide\'s text color | no `p:style` |\n| `subtle` | accent1 80% lighter | 1 pt accent1 | dark | `lnRef 2`, `fillRef 1` |\n| `moderate` (default) | accent1 | 1 pt accent1 50% darker | light | `lnRef 2` (shade), `fillRef 1` |\n| `intense` | accent1 25% darker | none | light, bold | `lnRef 0`, `fillRef 1`, `effectRef 2`, with the soft shadow |\n\nAn explicit `fill`, `stroke` or effect wins over the style\'s. The export writes the style\'s references (`p:style`: `a:lnRef`, `a:fillRef`, `a:effectRef`, `a:fontRef`), so PowerPoint shows the style as applied, and writes the drawn fill and line explicitly, so the shape looks the same whatever the theme\'s format scheme.\n\n## Lighter and darker colors\n\nEvery ColorRef (fills, strokes, gradient stops, pattern colors, overlays, recolors, backgrounds, chart and table colors, and text runs) also takes a lighter or darker form, PowerPoint\'s "Lighter 40%" and "Darker 25%":\n\n```json\n{ "color": "accent1", "lighten": 0.4 }\n{ "color": "#0F4C81", "darken": 0.25 }\n```\n\n`lighten` moves the color\'s HSL luminance that share of the way to white, `darken` that share of the way to black. Core resolves it (`resolveColorRef`); the export writes the base color with `a:lumMod` and `a:lumOff` (lighten L: `lumMod` 1 - L and `lumOff` L; darken D: `lumMod` 1 - D), as a theme color where the base is one, so re-theming the deck keeps the tint.\n\n## Rotation, flip and stacking\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `rotate` | Degrees clockwise about the frame\'s center. Composition keeps the unrotated frame; a rotated outline may reach past its cell. | `a:xfrm rot` |\n| `flip` | `horizontal`, `vertical` or `both`: mirrors the geometry. The text is not mirrored, but a vertical flip (`vertical` or `both`) turns it upside down, as `flipV` does in PowerPoint (both engines do this; `flipV` is all the export writes). To point a callout the other way and keep its text upright, set its `adjust` (a `wedgeRectCallout`\'s tail points up with `adj2` negative) instead of flipping it. | `flipH`, `flipV` |\n\nShapes stack in the order the blocks compose (the shape tree order in PowerPoint); [overlay shapes and connectors](#overlay-shapes-and-connectors) stack over everything, in the order of the slide\'s `shapes`.\n\n## Accessibility and links\n\n| Property | Meaning | PowerPoint |\n|---|---|---|\n| `alt` | Alternative text. Without it, a shape\'s text is what is read. | `p:cNvPr descr` |\n| `decorative` | `true`: screen readers skip the shape. | the decorative extension (`adec:decorative`, "Mark as decorative") |\n| `hidden` | `true`: kept in the file but not drawn; it keeps its room. | `p:cNvPr hidden` |\n| `link` | An http(s), `mailto:` or `tel:` URL opened when the shape is clicked in a slide show. A link on a hidden shape is `opf/shape-link-hidden`. | `a:hlinkClick` |\n\nThe shape\'s name in PowerPoint is `OPF shape <path>`, from the block\'s place in the deck.\n\n## Effects\n\n`shadow` (a preset `soft`, `hard` or `perspective`, or `{ color, opacity, blur, distance, angle, size }`), `innerShadow`, `glow` (`{ color, opacity, radius }`), `softEdge` (a radius), `reflection` (`{ opacity, size, distance, blur }`) and `blur` (a radius) are part of the format; lengths are reference pixels and angles degrees. Both engines draw them: the export writes `a:effectLst` in the shape\'s `p:spPr` right after its line, and the preview draws SVG filters around the outline and its text (the outer shadow and the reflection include the text, as PowerPoint\'s do). Colors are ColorRefs, `{ color, lighten }` and `{ color, darken }` included; lengths scale with the slide\'s shorter side. See [shape effects](shape-effects.md) for the defaults, the presets and how each effect is measured against PowerPoint, and `examples/technical/shape-effects.opf.json` for every effect on shape blocks. The `intense` style adds the `soft` shadow unless the block sets its own.\n\n## Pictures\n\nAn image block\'s line is `stroke` (renamed from `border` in 0.33, with no alias) and takes every stroke property above. Its `shape` takes every preset (`rectangle`, `rounded` and `circle` became `rect`, `roundRect` and `ellipse`), and `adjust` replaces `cornerRadius`. See [image treatments](image-treatments.md).\n\n## Overlay shapes and connectors\n\nA slide\'s `shapes` array is drawn over the composed slide: above the content, the furniture and everything else, in array order (later entries on top); an overlay shape with `layer: "back"` is drawn behind the content instead (see [layers](#layers)). It never moves content: composition places the slide first and the overlay on the result. Use it for what sits on top of a layout: a callout pointing at a figure, a badge on a picture, a stamp in a corner, and connector lines between blocks.\n\n```json\n{\n "title": "How we ship",\n "blocks": [\n { "id": "plan", "shape": "roundRect", "text": "Plan" },\n { "id": "ship", "shape": "roundRect", "text": "Ship" }\n ],\n "shapes": [\n { "shape": "wedgeRectCallout", "text": "New this quarter", "x": 0.68, "y": 0.06, "width": 0.24, "height": 0.12, "style": "subtle" },\n { "shape": "ellipse", "text": "1", "at": { "block": "plan", "edge": "top", "offset": -24 } },\n { "connector": { "from": "plan", "to": "ship", "route": "elbow" }, "stroke": { "width": 2, "end": { "type": "triangle" } } }\n ]\n}\n```\n\nThe reference decks are [`examples/technical/shape-overlays.opf.json`](../examples/technical/shape-overlays.opf.json) and its right-to-left slide [`shape-overlays-rtl.opf.json`](../examples/technical/shape-overlays-rtl.opf.json).\n\n### Overlay shapes\n\nAn entry without `connector` is an overlay shape. It has the whole [shape block](#a-shape-block) vocabulary: `shape` or `path`, `adjust`, `fill`, `opacity`, `stroke`, `style`, the [effects](#effects), `rotate`, `flip`, `text` with `anchor`, `padding` and `textDirection`, `alt`, `decorative`, `hidden` and `link`, plus an optional `id` (a connector names it). Its text is fitted as a shape block\'s is, by OPF\'s measured fonts, never below the readability floor (`opf/text-overflow` at `slides.N.shapes.I.text` otherwise). It has exactly one placement:\n\n| Placement | Meaning |\n| --- | --- |\n| `x`, `y`, `width`, `height` | `x` and `y` are signed fractions of the slide from its top-left corner; they may be negative or greater than 1. For example, `y: -0.1` places the top 10% of the slide height above the slide, preserving the whole shape while the slide viewport crops what is outside. In a right-to-left deck `x` counts from the right edge, as the layout mirrors start and end; only the position mirrors, never the geometry (an arrow keeps the way it points; [#1256](https://github.com/OpenPresentation/opf/issues/1256) tracks whether it should flip). `width` and `height` are fractions from 0 (a line) to 8: above 1 the shape is larger than the slide, for a circle or band that bleeds off it. A PowerPoint shape larger than 8 slides imports at 8 with a `shape-property-dropped` diagnostic, and the editor\'s frame changes stop at 8. All four go together. Moving, resizing, detaching an anchor and PPTX import preserve the signed position. |\n| `at: { block, edge, offset, width, height, widthPx, heightPx }` | Against the composed box of the block with that `id` (a payload or a group, at any depth), so the shape follows the block wherever composition puts it. `edge` is `top`, `bottom`, `start` or `end` (outside that edge, centered along it; `start` is the left in a left-to-right deck and the right in a right-to-left one) or `center` (on the block\'s center). `offset` is the gap in reference pixels (negative overlaps the block). `width` and `height` are fractions of the block\'s width and height (1 is the block\'s own size, 1.08 a frame 8% larger, at most 8); `widthPx` and `heightPx` are reference pixels, for a badge of a fixed size; one of the two for each side. By default the shape has its preset\'s proportions with its shorter side at 15% of the block\'s shorter side. |\n\nA picture\'s box is its frame; a block on a card is its card. A shape with both placements or none is an `opf/schema` error, and one whose `at.block` is not on the slide is `opf/shape-anchor-missing`; neither is drawn.\n\nThe PPTX export writes an overlay shape as a shape block, a native `p:sp` named `OPF shape slides.N.shapes.I`.\n\n### Chart point anchors\n\nAdd `point` to `at` to follow a chart mark instead of the whole block. For example:\n\n```json\n{"shape":"ellipse","fill":"none","stroke":{"color":"accent2","width":3},"at":{"block":"costs","series":"Cost ($B)","point":"United States","edge":"end","widthPx":80,"heightPx":80}}\n```\n\n`point` is an exact unique category name or a zero-based plotted-row index. `series` is an exact unique value-column name or a zero-based plotted-series index; omission selects the first series. Indexes disambiguate repeated or empty labels. Scatter X columns are not series. References resolve against the data the chart draws, including its maintained draw plan.\n\nThe **center** of the shape sits on the chosen point. For bars and columns, `start` and `end` mean the segment baseline and value end, including signed and stacked values; `top`, `bottom` and `center` use the mark bounds. Line/area/scatter anchors use the plotted marker; their edge supplies the offset direction. On a slice, `end` is the outer arc midpoint, `start` the inner arc midpoint (the pie center), `center` the middle of its radial band, and `top`/`bottom` the sector bounds. Slice offsets are radial, and other mark offsets follow the chosen edge\'s outward direction. A zero offset centers the ring exactly on its target. `edge` therefore never moves the shape clear of the point by itself, whatever the shape: a text callout at `edge: "top"` and no `offset` is centered on the top of the bar and covers it and its label. To put a shape beside a point, give an `offset` that clears it: at least half the shape\'s extent along the edge\'s direction (half of `heightPx` for `top` and `bottom`, half of `widthPx` for `start` and `end`) plus the gap you want, and more again to clear the data label. A callout\'s tail follows the preset\'s `adjust`, not `flip`: `wedgeRectCallout` points down by default; `"adjust": { "adj1": -0.2, "adj2": -0.9 }` points it up, and the text stays upright.\n\n`width` and `height` are fractions of the mark\'s bounds (1 is the mark\'s own size) and `widthPx` and `heightPx` reference pixels at a 720-pixel short edge, one of the two for each side. A ring of a fixed size around a point is `"widthPx": 80, "heightPx": 80`. The default retains the preset\'s proportions and uses 15% of the mark\'s shorter side, with a 12 reference-pixel floor. Whole-block anchor sizing and outside-edge placement are unchanged. Physical bar value ends do not reverse in RTL; vertical category positions follow the chart\'s category order.\n\nThe classic two-dimensional category, scatter, pie and doughnut planners share a pinned native inner plot with SVG. Unsupported 3-D, combo, radar, chartex and table-aligned-row plots are explicit `opf/shape-anchor-missing` findings and draw no attached shape. Missing/ambiguous series or categories and null/unplotted values produce the same located finding. Qualification against actual native point coordinates is required before release; source agreement alone does not prove native placement. See [the portable example](../examples/technical/chart-point-overlays.opf.json).\n\nThe editor\'s `setOverlayAnchor(editor, path, at)` and `prepareOverlayAnchor(presentation, path, at)` replace the placement atomically. `listChartPointTargets` supplies indexed choices. The selected-shape controls expose chart, point, series and edge; every change supports Undo/Redo. A native scatter chart does not carry source category names: use a numeric point index when that attachment must survive native import. Native import restores an attachment only when its current chart point still resolves; otherwise it keeps the current native shape position and reports the lost attachment.\n\n### Layers\n\n`layer` puts an overlay shape in front of the slide (the default) or behind it:\n\n| `layer` | Drawn | PowerPoint |\n| --- | --- | --- |\n| `front` | Over the slide: after its content and furniture. | After every other shape of the slide in the shape tree. |\n| `back` | Behind the slide: above the background, the watermark and the deck logo, below the content and the furniture (a panel or a band behind a block). | After the background, watermark and logo and before the content shapes in the shape tree. |\n\nArray order stacks the shapes within each layer. Connectors are always in front, also when an end is a back-layer shape: the connector is glued to it and drawn over the content between them. Mark a back panel `decorative` when it carries no meaning.\n\n### Connectors\n\nAn entry with `connector` is a connector line between two blocks or overlay shapes of the slide:\n\n| Key | Meaning |\n| --- | --- |\n| `connector.from`, `connector.to` | The `id` of a block (a payload or a group) or an overlay shape. An id that names nothing on the slide, or names a connector, is `opf/connector-end-missing`, and the connector is not drawn. |\n| `connector.route` | `straight` (default), `elbow` or `curved`. |\n| `connector.fromSite`, `connector.toSite` | The connection site index at each end, instead of the automatic choice. An index the shape does not have is an `opf/schema` error. |\n| `stroke` | The line, with every [stroke](#stroke) property: color, width, dash, compound, sketch and arrowheads (`start` at `from`, `end` at `to`). Default a 2-pixel line in the slide\'s text color with no arrowheads. |\n| `adjust` | The connector preset\'s adjust values in OPF units: `adj1` of an elbow or a curve between sites on one axis (`bentConnector3`, `curvedConnector3`), the middle line as a fraction of the frame\'s width (0.5 halfway; below 0 or above 1 runs past a site). It replaces the automatic middle, so a route drawn in PowerPoint is kept exactly; the sites are still chosen as below. The two-segment routes and a straight line have none. A name the route\'s preset does not have is `opf/shape-adjust-unknown`. |\n| `alt`, `decorative`, `hidden`, `id` | As on a shape. A connector takes no other key. |\n\n**Connection sites.** Each end attaches to a connection site of its shape: a preset\'s own sites (`presetGeometry(...).connectionSites`, turned and flipped with the shape; a picture masked by a preset has its mask\'s) or, for every other block, the four edge midpoints of its box, numbered as DrawingML numbers a rectangle\'s: 0 top, 1 left, 2 bottom, 3 right. Without `fromSite` and `toSite` core chooses the pair of sites that face each other (opposite directions) whose route leaves each site outward and is shortest; then any route that leaves both outward; then the shortest. An elbow or curve considers only the sites along an axis (directions of 0, 90, 180 or 270 degrees) when the shape has some.\n\n**Routes.** Core routes each connector once, as PowerPoint\'s own connector presets, and both engines draw that route: the preview strokes the preset\'s path evaluated in the connector\'s frame, and the PPTX writes the same preset in the same frame, so PowerPoint draws the same line.\n\n| `route` | Sites | Preset | The route |\n| --- | --- | --- | --- |\n| `straight` | any | `straightConnector1` | One segment from site to site. |\n| `elbow` | on one axis (both horizontal or both vertical) | `bentConnector3` | Out of the first site, along the middle line, into the second. Facing sites put the middle halfway (`adj1` 0.5); sites that face the same way run 24 reference pixels past the farther one and back (a U, `adj1` beyond 0 to 1). |\n| `elbow` | perpendicular | `bentConnector2` | An L through the corner. |\n| `curved` | on one axis | `curvedConnector3` | The curve through the elbow\'s middle line, tangent to both sites\' axes. |\n| `curved` | perpendicular | `curvedConnector2` | One curve tangent to both sites\' axes. |\n\nThe frame is PowerPoint\'s: the box of the two sites (`a:off`, `a:ext`), flipped for a route that runs left or up, and turned 90 or 270 degrees for one that leaves its first site vertically, as PowerPoint writes its connectors.\n\n**PowerPoint.** The export writes a connector as a native `p:cxnSp` named `OPF connector slides.N.shapes.I`, with `a:prstGeom`, core\'s `a:avLst` and the line, and glues each end to the native shape it attaches to (`a:stCxn` and `a:endCxn`: the shape\'s id and the site index). PowerPoint then reads the connector as connected (`ConnectorFormat.BeginConnectedShape`, `EndConnectedShape` and the site indexes, 1-based in its object model) and moves it with a shape that the user moves. An end glues where one native shape is the block: a shape block or overlay shape, a picture, or a block drawn on a card. A text block without a card is drawn as one text box per line, so its end is not glued: the connector still runs to the block\'s site but stays put when the line boxes move. Give the text a card, or write it as a shape with text, to glue to it.\n\n| PowerPoint and the SH-04 check | Result |\n| --- | --- |\n| Connectors of `shape-overlays.opf.json` and `shape-overlays-rtl.opf.json`, read through PowerPoint\'s object model (PowerPoint 365) | Every glued end reads as connected to its shape at core\'s site (1-based), and moving the shape at the end moves the connector with it. |\n\n### Pagination\n\nWhen `paginate` splits a slide over pages, a shape placed by fractions is on every page (as the headings are), a shape placed `at` a block is on the page its block lands on, and a connector is on the page that holds both of its ends. A connector whose ends land on different pages is on none, and the page of its `from` end reports it in `PaginatedPage.diagnostics` as `connector-split` (with the connector\'s path). Overlay ids take their page\'s id (`stamp--2`) like payload ids, and `at.block` and the connector ends follow the ids they name.\n\n### In core\n\n`composeSlide` returns the overlay as `SlideComposition.overlayShapes`, in draw order: overlay shapes (`kind: "shape"`, a shape block item: `path` `slides.N.shapes.I`, `box`, `shape` (a `ComposedShape`), `text`, `textStyle`, `layer`, and `attachedTo` for an `at` shape) and connectors (`kind: "connector"`: `route`, `preset`, the frame `box`, `rotate`, `flipH`, `flipV`, `adjust` and `avLst`, `paths` (the route in slide coordinates, one open path with its ends for the arrowheads), `bounds`, `stroke`, and `from` and `to`, each with the `id`, the `ref` it attaches to (a composed item path, a group path or an overlay path), `target`, `site`, `point` and `angle`). `connectorRoute`, `chooseConnectorSites`, `shapeSites` and `rectSites` from `@openpresentation/opf/composition` give the same geometry to a host or an editor.\n\n## Importing shapes from PowerPoint\n\n`fromPptx` (and `opf convert deck.pptx deck.opf.json`) reads native shapes as OPF shapes. Two kinds of file arrive: a deck this export wrote, whose shapes come back as the OPF they were, and a deck PowerPoint wrote, whose shapes become overlay shapes and connectors.\n\n### A deck the export wrote\n\nThe native name says what a shape was: `OPF shape slides.N.blocks.I.shape` is a shape block and `OPF shape slides.N.shapes.I` an overlay shape (I is its entry in `slide.shapes`); `OPF connector slides.N.shapes.I` is a connector. Every property the export writes is read back from the DrawingML, so a shape block returns with its preset and `adjust`, its `path`, `fill`, `opacity`, `stroke`, `style`, effects, `rotate`, `flip`, text, `anchor`, `padding`, `textDirection`, `alt`, `decorative`, `hidden` and `link`; a lighter or darker theme color returns as `{ color, lighten }` or `{ color, darken }`; a picture\'s `stroke` returns with the picture. The slide\'s stored record (`OPF_SLIDE_V1`) puts the block back in its place and adds what no native shape can carry, while the slide is as it was exported:\n\n- the block ids and the content structure (as for every block);\n- an overlay entry\'s `id` (a connector names its ends by it) and its `at` anchor against a block (the native shape holds only the frame composition gave it);\n- which of a connector\'s `fromSite` and `toSite` the author wrote (the pair that faces each other is chosen when neither is).\n\nA slide edited in PowerPoint keeps what PowerPoint now shows: fractions for an overlay shape, and the sites it names. A value the theme style gives (an explicit `fill: "accent1"` on the default style) comes back absent, since the export writes it out and PowerPoint cannot tell it from a choice; the shape draws the same. Likewise a rotation of -20 comes back as 340, and a custom `path` comes back as path data in the 0 to 1 box (the outline is the same).\n\n### A deck PowerPoint wrote\n\n- A free-positioned shape that draws something (a fill, a line or an effect, or any shape that is not a plain rectangle) with preset or custom geometry becomes an **overlay shape**: `x`, `y`, `width` and `height` are fractions of the slide (`x` from the right edge in a right-to-left deck, as every coordinate over the layout; coordinates over a picture\'s pixels, an image\'s `focus` and `callouts`, are physical), with the preset and its `adjust`, a custom `a:custGeom` as `path`, and every property in the table below. Its z order is the array order.\n- A shape PowerPoint added with its default style (`p:style` with a theme line and fill) is OPF\'s default style, `moderate`, with nothing else stated. Another `p:style` is read as the fill and line its references give, with `style: "none"`.\n- A **connector** (`p:cxnSp`) whose two ends are connected to shapes OPF knows is a `connector` between their ids, with its route from the preset (`straightConnector1` straight, `bentConnector2` and `3` elbow, `curvedConnector2` and `3` curved), its sites from `a:stCxn` and `a:endCxn`, and, for a three-segment preset, the middle PowerPoint drew as `adjust.adj1` (a connector the export wrote states none, as it recomputes it). A longer route (`bentConnector4`, `bentConnector5`, `curvedConnector4`, `curvedConnector5`) is beyond OPF\'s connector: it stays a shape with its preset and `adjust` values, which draws it as it was, without the binding. A shape that is a connector\'s end gets an `id` made from its name (`box-a` for "Box A") where it has none. A connector with a free end is a line shape: the preset (`straightConnector1`, `bentConnector3` and so on) in its frame, with its arrowheads.\n- Shapes inside a **group** are flattened with the group\'s scale, flips and rotation applied.\n- A text box, a placeholder, and a rectangle with text that draws no fill, line or effect keep the text import (`text` blocks), as before.\n- A filled shape across the whole slide is a background, not an overlay (an overlay is drawn over the content): it is not imported and is reported as `shape-not-imported`.\n\n| DrawingML | OPF |\n| --- | --- |\n| `a:prstGeom prst` and `a:avLst` | `shape` and `adjust` (fractions and degrees, the values equal to the preset\'s defaults left out) |\n| `a:custGeom` (points, guides, `a:arcTo`) | `path`, in the 0 to 1 box (arcs become cubic B\xE9ziers) |\n| `a:noFill`, `a:solidFill`, `a:gradFill`, `a:pattFill` | `fill: "none"`, a ColorRef, `{ gradient }`, `{ pattern }`; a uniform transparency is `opacity` |\n| `a:schemeClr` (through the color map), `a:srgbClr`, `a:lumMod` and `a:lumOff` | a scheme slot name, a hex color, `{ color, lighten }` or `{ color, darken }` |\n| `a:ln` (`w`, `cap`, `cmpd`, `algn`, dashes, joins, `a:headEnd`, `a:tailEnd`, the sketch) | `stroke` (`"none"` for `a:noFill`) |\n| `p:style` (`lnRef`, `fillRef`, `effectRef`) | `style` |\n| `a:effectLst` (`a:outerShdw`, `a:innerShdw`, `a:glow`, `a:softEdge`, `a:reflection`, `a:blur`) | `shadow` (a preset name where it equals one), `innerShadow`, `glow`, `softEdge`, `reflection`, `blur`, in reference pixels |\n| `a:xfrm` (`rot`, `flipH`, `flipV`) | `rotate`, `flip` |\n| `a:bodyPr` (`anchor`, insets, `vert`) and the runs | `anchor`, `padding`, `textDirection`, `text` (emphasis, links and run colors; sizes and faces are the composition\'s) |\n| `p:cNvPr` (`descr`, the decorative extension, `hidden`, `a:hlinkClick`) | `alt`, `decorative`, `hidden`, `link` |\n\n### What is dropped\n\nEach of these is reported as a finding and dropped; the shape itself imports. The library\'s diagnostic is `shape-property-dropped` (`import/shape-property-dropped` in an `opf convert` report) with `property` naming it, and `shape` the native shape\'s name.\n\n| `property` | Native source | Why |\n| --- | --- | --- |\n| `3-D format` | `a:scene3d`, `a:sp3d` | The preview cannot match PowerPoint\'s 3-D. |\n| `preset shadow` | `a:prstShdw` | The `shadow` presets cover it. |\n| `fill overlay` | `a:fillOverlay` | Not in the format. |\n| `text wrapping`, `text columns`, `autofit` | `wrap="none"`, `numCol` above 1, `a:spAutoFit`, `a:normAutofit` | OPF fits text itself and never writes autofit. |\n| `alternative text title` | `p:cNvPr title` | `alt` is the one text alternative. |\n| `hover link` | `a:hlinkHover` | Only the click link. |\n| `locks` | `a:spLocks`, `a:cxnSpLocks` | Editing state, not content. |\n| `black-and-white mode` | `bwMode` other than `auto` | Not in the format. |\n| `custom data` | `p:custDataLst` | Not in the format. |\n| `picture fill`, `group fill`, `pattern line`, `effect graph`, `click action`, `geometry <name>` | `a:blipFill` on a shape, `a:grpFill`, `a:pattFill` on a line, `a:effectDag`, a link that is not an http, mailto or tel URL, a preset OPF does not have | No OPF form. |\n| `gradient fill`, `pattern fill`, `gradient focus`, `line transparency`, `shadow scale`, `custom geometry`, `custom path fill or stroke mode`, `arrowhead <type>` | a gradient or pattern with fewer than two stops or an unknown preset, a gradient focus off the center, a transparent line whose color is a theme color, a shadow scaled unevenly, an unreadable outline, a custom path with fill modes or hidden strokes, an arrowhead OPF does not have | The nearest OPF form is used where there is one. |\n| `color transform <name>` | a color transform other than alpha, `lumMod` and `lumOff` | Its effect is not applied. |\n\n\nA shape PowerPoint drew behind a text box, a picture, a table or a chart (below it in the z order, overlapping it, and over none of it) imports with `layer: "back"`, so it is drawn behind the content as it was. A shape between two pieces of content, over one and under another, is neither layer: it imports in front and, when it is opaque, is reported as `shape-covers-content` (`import/shape-covers-content`). A shape the export wrote takes its layer from the stored record.\n\nApproximations that are not reported: a theme style that is a gradient (`fillRef` index 2 or 3) imports as the solid color of its reference, and a rotated shape inside a group that scales its axes unevenly is scaled on the slide\'s axes.\n\n## Editing shapes\n\nThe editor edits shape blocks in the playground, the workspace and the Studio (`@openpresentation/opf-editor`; every edit is one validated, undoable change through the session, so Undo, Redo and proposals work as for any other edit):\n\n- **Shape picker.** **Insert shape** in the playground (and **Add content > Shape**) opens PowerPoint\'s gallery: Lines, Rectangles, Basic Shapes, Block Arrows, Equation Shapes, Flowchart, Stars and Banners, Callouts and Action Buttons, a tile drawn from each preset\'s own geometry. The search takes the DrawingML name (`rightArrow`) and common words (`arrow`, `callout`, `star`, `flowchart`, `speech bubble`, `cylinder`); every word must match and Enter picks the first match. **Change shape\u2026** in the Selected shape section changes a block\'s preset and keeps the adjust values the new preset also has. The groups and the search are `@openpresentation/opf/shape-catalog`; the MCP\'s `search_shapes` serves the same search with each preset\'s adjust values and a drawing.\n- **Adjust handles.** A selected preset shape shows its yellow handles on the slide, where `presetGeometry(...).handles` puts them (turned and mirrored with the shape). Dragging one writes `adjust` as fractions and degrees (four and two places), pinned to the handle\'s range, as one undo step; Escape cancels a drag; the arrow keys nudge a focused handle (Shift for more). The Adjust fields in the section take the same values by typing. A few presets report a handle range that leaves their own default out (`star24`, `star32`, `mathDivide`\'s `adj2`, `leftRightRibbon`\'s `adj2`, as PowerPoint\'s definitions do); the editor widens that range to hold the default.\n- **Every property.** The Selected shape section edits `fill` (none, color, gradient with type, angle and stops, pattern) and `opacity`, `stroke` (color or gradient, width, dash as a preset or a custom array, cap, join, miter limit, compound, alignment, start and end arrowheads, sketch), `style`, the six effects with the shadow presets, `rotate` and `flip`, `text`, `anchor`, `padding` and `textDirection`, and `alt`, `decorative`, `hidden` and `link`. Every color is a ColorRef with PowerPoint\'s Lighter and Darker tints (`{ color, lighten|darken }`).\n- **Overlay shapes and connectors.** **Insert shape** offers the gallery\'s pick **In the layout** (a block composition places) or **On the slide** (an overlay: `slide.shapes`, free `x`, `y`, `width` and `height`). A selected overlay shape shows a frame: drag its outline or the grip above it to move it, a handle to resize it (fractions of the slide, signed positions retained outside its edges, four places), arrow keys on the frame to move it (Shift resizes), Escape to cancel; **Place on the slide** takes the same numbers in percent. A shape attached to a block (`at`) keeps its anchor: dragging changes the `offset` from the block\'s edge, resizing `at.widthPx` and `at.heightPx` (reference pixels; the panel also sets `at.width` and `at.height`, fractions of the target), and **Free from block** turns it into fractions. **Stacking** (Bring to front, Bring forward, Send backward, Send to back) is the array order; **Delete** removes a shape and the connectors that end on it. **Connect** (the playground\'s toolbar on a screen wider than a phone, or `canvas.connect({ route, stroke })`; below 1,100 pixels the toolbar leaves out the route choice, which the connector\'s section holds) picks two blocks or overlay shapes on the slide (click the start, then the end; Esc cancels) and adds a connector on top, straight, elbow or curved, an arrow by default; an end with no `id` gets one in the same undo step. A selected connector\'s section has its route, start and end (a block or an overlay shape), connection sites and its line with arrowheads. Every one of these is one undoable change.\n- **Diagrams.** A slide with a [diagram](#native-diagrams) takes overlay shapes and connectors like any other slide (a connector can end on the diagram block), and the Export menu\'s PowerPoint file writes the diagram as its native group beside them.\n- **From code.** `@openpresentation/opf-editor/shape-overlays`: `insertOverlayShape`, `setOverlayFrame`, `detachOverlay`, `moveOverlayLayer`, `removeOverlay`, `connectShapes`, `setConnector`, `listConnectionEnds`, `readOverlay` (each with a `prepare...` form). `@openpresentation/opf-editor/shape-options`: `insertShape`, `setShapePreset`, `setShapeAdjust` and `setShapeProperties` (each with a `prepare...` form), `searchShapes`, `shapeGroups`, `readShape`; `@openpresentation/opf-editor/shape-picker`: `createShapePicker`, `createShapeMenu`. See the [editor README](../packages/editor/README.md).\n\n## Native diagrams\n\nA [diagram](diagrams.md) (Mermaid, DOT or PlantUML source in a `diagram` block) is drawn with the same shapes in PowerPoint. The PPTX export writes it as native shapes, connectors and text by default (`diagrams: "shapes"`; `"picture"` writes one SVG picture, `--diagrams picture` in the CLI), built from the diagram engine\'s own laid-out drawing, the geometry the preview draws:\n\n- a node whose outline is a preset is that preset (`rect`, `roundRect`, `ellipse`, `diamond`, `hexagon` and the others, checked against the [preset geometry](#preset-geometry)); any other outline is a custom geometry of its exact path, with the four connection sites of a rectangle;\n- a straight edge without arrowheads is a connector glued to the connection sites of the nodes it touches, written as an [overlay connector](#connectors) is (one `p:cxnSp` with `a:stCxn` and `a:endCxn` on the native shape ids and the sites\' indexes), so it follows a node moved in PowerPoint; every other edge is one shape of custom geometry holding its line and its arrowheads, because PowerPoint opens no connector of custom geometry and its line ends are shorter than the diagram\'s arrowheads;\n- labels are real text at the preview\'s size and baseline;\n- everything is one group named `OPF diagram N`, with the diagram\'s `alt` as its description.\n\nA family is written as shapes once PowerPoint\'s drawing of it has passed the comparison with the preview (all 32 families have; the list is core\'s `DIAGRAM_SHAPE_FAMILIES`). A diagram whose family is not in the list, or whose drawing needs what PowerPoint has no native form for (a clip path, a mask, a filter, an embedded image, text on a path, right-to-left text), stays a picture and is reported as `pptx/diagram-shapes-unavailable`.\n\nOn import an unchanged group is its diagram again (the Mermaid, DOT or PlantUML source and `alt`), and none of its members become overlay shapes or connectors. An edited group (a member moved, resized, retyped, added or removed) imports as its shapes, [as PowerPoint\'s shapes do](#a-deck-powerpoint-wrote): the nodes as overlay shapes with their presets, fills, lines and text, the glued edges as connectors between them; `invalid-diagram-provenance` reports that the source is not reconstructed. See [native shapes in PowerPoint](diagrams.md#native-shapes-in-powerpoint) for the comparison and the families.\n\n## Pyramids, matrices, chevrons and flows\n\nThe `pyramid`, `matrix`, `cycle`, `chevrons`, `flow` and `vertical-flow` layouts (a region\'s `arrangement`) draw a list as PowerPoint\'s Basic Pyramid, Basic Matrix, Basic Cycle, Basic Chevron Process, Basic Process or Vertical Process, or as OPF\'s own design of the arrangement where PowerPoint\'s does not hold the entries, and the PPTX export writes PowerPoint\'s design as live SmartArt where PowerPoint lays the SmartArt out exactly as the preview draws it, otherwise as native shapes (`trapezoid`, `roundRect`, `diamond`, a cycle\'s `ellipse`, a `chevron`, and turned `rightArrow`s) under the measured lines (`smartArt: "live" | "shapes"`, CLI `--smart-art`). Each live SmartArt is an `mc:AlternateContent` whose fallback is OPF\'s preview of the frame as an SVG picture over a PNG: PowerPoint shows the live SmartArt, an app that does not lay SmartArt out shows OPF\'s drawing, and import reads either. See [Pyramids, matrices and live SmartArt](smartart.md) for the geometry, the domain PowerPoint was compared on, what each app shows and what PowerPoint does when a node is edited or the file is saved again.\n\n## Validation\n\n| Finding | When |\n|---|---|\n| `opf/schema` | `shape` is not a preset name (the nearest names are offered as fixes), or a property has the wrong form. |\n| `opf/shape-adjust-unknown` | `adjust` names a guide the preset does not have, or sits on a custom `path`. |\n| `opf/shape-adjust-range` | An adjust value is outside its handle\'s range; the default is drawn. |\n| `opf/text-overflow` | The text does not fit inside the shape at the readable minimum size. |\n| `opf/shape-link-hidden` | A hidden shape has a link nobody can click. |\n| `opf/shape-option-unsupported-payload` | A shape-only property (`fill`, `style`, `rotate` and the others) is on a block that is not a shape. |\n| `opf/shape-anchor-missing` | An overlay\'s block, chart point or series does not resolve, or its native plot is unqualified; the shape is not drawn. |\n| `opf/shape-off-slide` | An overlay shape (or an image callout) lies wholly outside the slide, so nothing of it is drawn: usually a percent or a pixel written where a fraction belongs. A warning; a shape that straddles an edge, a hidden one, and a rotated one whose circumscribed circle reaches the slide are not reported. |\n| `opf/connector-end-missing` | A connector\'s `from` or `to` names no block or overlay shape on the slide (or names a connector); the connector is not drawn. |\n| `opf/schema` | An overlay shape has both placements or none, or only some of `x`, `y`, `width` and `height`; a connector has a shape-only key; a `fromSite` or `toSite` is an index the shape does not have. |\n\n## Loading in browsers and edge runtimes\n\nNode, Bun and Deno load the preset geometry (about 35 KB gzipped, with the sketched line) with core and draw any shape at once. A browser bundle or an edge Worker loads it the first time a deck has a shape block, an overlay shape or connector, a custom `path`, a picture masked by a preset other than the four built-in masks (`rect`, `roundRect`, `ellipse`, `hexagon`) or a sketched picture line, through the package\'s `#shape-engine` import map, as diagrams load (`#diagram-engine`); a deck without them does not carry it. The renderer\'s browser fonts handle loads it in `ensure` (its `pending` lists `shapes`), and `toPptx` loads it itself. A host that composes with `composeSlide` or `toSvg` directly calls `await ensureShapes(presentation)` (from `@openpresentation/opf` or `@openpresentation/opf/composition`) first; `shapesPending(presentation)` lists what it would load. A PPTX export with native diagrams (the default) also needs it for a deck with a diagram, which `ensureShapes(presentation, { diagrams: true })` covers; `toPptx` calls it so. Diagrams and icon sets load the same way, and one preload covers all three: see [Engines and icon sets that load on demand](how-opf-works.md#engines-and-icon-sets-that-load-on-demand). Until then a shape draws its frame and text with no outline, a mask beyond the built-in four draws as a rectangle and a sketched picture line as the plain line.\n\n## Preset geometry\n\n`@openpresentation/opf/shape-geometry` evaluates a preset at a size. It is edge-safe (no Node import) and has no\ndependency; its data is `spec/reference/preset-geometry.json`.\n\n```js\nimport { PRESET_SHAPES, presetAdjustments, presetGeometry, customGeometry, adjustToDrawingML } from "@openpresentation/opf/shape-geometry";\n\nPRESET_SHAPES.length; // 187\npresetAdjustments("rightArrow", 200, 100);\n// { adj1: { default: 0.5, min: 0, max: 1, unit: "fraction" }, adj2: { default: 0.5, min: 0, max: 2, unit: "fraction" } }\nconst arrow = presetGeometry("rightArrow", 200, 100, { adj1: 0.4 });\narrow.paths; // [{ d: "M0 30 L150 30 L150 0 L200 50 L150 100 L150 70 L0 70 Z", fill: "norm", stroke: true, commands: [...] }]\narrow.textRect; // { x: 0, y: 30, width: 180, height: 40 }\narrow.connectionSites; // [{ x: 150, y: 0, angle: 270 }, ...]\narrow.handles; // [{ kind: "xy", x: 0, y: 30, vertical: { adjust: "adj1", min: 0, max: 1 } }, ...]\nadjustToDrawingML("rightArrow", { adj1: 0.4 }); // { adj1: 40000, adj2: 50000 }: the a:avLst to write\n```\n\n| Export | What it does |\n| --- | --- |\n| `PRESET_SHAPES` | The 187 names, in the order of the standard\'s definitions file. `isPresetShape(name)` tests one. |\n| `presetAdjustments(name, width?, height?)` | Each adjust value\'s default and the range of the handle that moves it, at the size (handle ranges can depend on the size; the default is a square). `min`/`max` are `null` when the standard leaves them unbounded or no handle moves the value (the `hf`/`vf` proportion factors of the polygons and stars). |\n| `presetGeometry(name, width, height, adjust?)` | The paths as SVG path data, each with its DrawingML fill mode (`norm`, `none`, `lighten`, `lightenLess`, `darken`, `darkenLess`) and stroke flag; the text rectangle; the connection sites; the adjust handles. Every length is in the units of `width` and `height`. `commands` is the same outline as absolute `M`/`L`/`C`/`Q`/`Z` commands (arcs as cubic B\xE9ziers) for bounds, hit tests and native custom geometry. |\n| `customGeometry(path, width, height)` | An OPF custom outline: SVG path data in a 0 to 1 box (a string), or `{ d, viewBox }`. Every SVG command is accepted (arcs become cubic B\xE9ziers, so a non-uniform scale stays exact); the result has `presetGeometry`\'s shape, with the whole box as the text rectangle and the four edge midpoints as connection sites. |\n| `adjustToDrawingML(name, adjust)`, `adjustFromDrawingML(name, avLst)` | OPF adjust values to and from the integers of `a:avLst`. |\n| `evaluateGuideFormula(formula, guides)` | One guide formula, for hosts that evaluate their own `a:custGeom` guides. |\n| `flattenShapePath(commands, segments?)` | Path commands as polylines. |\n\n### Units\n\n- Adjust values are OPF units. The values the standard writes in 1/100000 are fractions: DrawingML `val 25000` is OPF\n `0.25` (which dimension it is a fraction of depends on the preset, most often the shorter side). The angle adjusts\n (the ones a polar handle moves: `arc`, `blockArc`, `chord`, `pie`, the three circular arrows and `mathNotEqual`) are\n degrees: DrawingML `val 16200000` (60000ths of a degree) is OPF `270`. `presetAdjustments` names each one\'s `unit`.\n- Angles of connection sites are degrees clockwise from the positive x axis, y pointing down, as in DrawingML.\n- A value outside its handle\'s range is pinned by the preset\'s own guides, as PowerPoint pins it.\n- `adjustToDrawingML` rounds to the integers DrawingML stores, and the preview evaluates the same integers, so the two\n engines draw the same value. Once any value is given, every `avLst` value is written, the others at their defaults,\n as PowerPoint writes them: PowerPoint refuses to open a file whose `avLst` names a hexagon\'s or star\'s `adj` without\n its `hf`/`vf` factors.\n\n### How the evaluator follows PowerPoint\n\n- The guide formula language of ECMA-376 Part 1, 20.1.9.11: `*/ +- +/ ?: abs at2 cat2 cos max min mod pin sat2 sin\n sqrt tan val`, with angles in 60000ths of a degree and the built-in guides `w h l t r b hc vc ss ls`, `wd2` to `wd32`,\n `hd2` to `hd10`, `ssd2` to `ssd32`, `cd2 cd4 cd8 3cd4 3cd8 5cd8 7cd8`. A zero divisor (a shape of zero width or\n height) gives 0, so a degenerate shape still has finite points.\n- `arcTo` starts on the ellipse at the visual angle `stAng` (the angle of the ray from the ellipse\'s center, not the\n parametric angle) and sweeps `swAng`, positive clockwise on screen, to the visual angle `stAng + swAng`.\n- A path with its own `w` and `h` is evaluated in that coordinate space, arcs included, and then scaled to the shape.\n- Fills use the nonzero rule.\n\n### Verified against PowerPoint\n\nEvery preset was written as a native `a:prstGeom` at two sizes (360 by 200 and 150 by 260 pixels) with its default\nadjust values and a second set (each handle\'s value halfway to its range end), once filled and once stroked with a\n1-pixel line, exported by PowerPoint 365 at 1280 by 720 and compared with the engine\'s SVG rendered at the same size.\nAll 187 presets match: no stroked outline differs by more than 1 pixel anywhere, and the filled outlines differ by more\nthan 1 pixel only at a few antialiased pixels of hairline tips (at most 13 pixels of a 640 by 360 cell, in `star32`,\n`rightBrace`, `leftBrace`, `star24`, `bracePair` and `flowChartOnlineStorage`).\n\nCustom outlines were checked the same way: four outlines (a circle of two arcs, a star, a heart of cubic B\xE9ziers, a callout with\nan arc and a quadratic curve), each at two sizes, written as native `a:custGeom` from `customGeometry`\'s `commands`, match\nPowerPoint with no pixel off by more than 1 pixel.\n\nThe comparison also shows that stroke joins are not geometry: with a 3-pixel line PowerPoint draws mitered joins of very\nacute tips (the spikes of `star24`, `star32` and `sun`) shorter than SVG\'s miter, and it drew `a:round` joins as miters in\nthis export. The stroke engines own that difference.\n\n### Errata\n\nTwo values of the standard\'s definitions file are corrected to what PowerPoint does (recorded in the table\'s `errata`):\n\n- `pie`: the file\'s text rectangle swaps `t` and `r` (`l=il t=ir r=it b=ib`), a rectangle of negative size; PowerPoint\n lays out pie text in the ellipse\'s text rectangle (`il it ir ib`).\n- `curvedLeftArrow`: the arrow tip\'s connection site names the undefined guide `cd3`; it faces left (`cd2`), mirroring\n `curvedRightArrow`\'s tip.\n\nSome text rectangles and connection sites of the standard lie off the drawn outline on purpose (a frame\'s opening, a\npie\'s center, the sites of `blockArc` and the gears on their construction circles); the engine keeps them as defined.\n\n### Preset geometry source and license\n\n`spec/reference/preset-geometry.json` is generated by `scripts/build-preset-geometry.mjs` from the standard\'s\n`presetShapeDefinitions.xml` (the DrawingML preset geometries of the ECMA-376 Part 1 electronic attachment), downloaded\nand never committed:\n\n- Source: Apache POI 5.5.1,\n `https://raw.githubusercontent.com/apache/poi/REL_5_5_1/poi/src/main/resources/org/apache/poi/sl/draw/geom/presetShapeDefinitions.xml`\n (tag `REL_5_5_1`, commit `6048bedcdf1de60871b4a2fb7cf7cd242752e6c9`, sha256\n `a7dad593d27bd70536b41da9b761fa16409536cc0c25ef2b6c7a61c5d9b3e738`).\n- License: Apache-2.0 (Apache POI\'s `legal/LICENSE`). Notice: "Apache POI. Copyright 2003-2025 The Apache Software\n Foundation. This product includes software developed at The Apache Software Foundation (https://www.apache.org/)."\n The table carries the source, license and notice in its `source` member.\n- The data itself is the standard\'s: Apache POI\'s license states that the Office Open XML material is part of ECMA-376,\n which section 9.4 of the Ecma bylaws makes available to all interested parties without restriction, and that\n Microsoft and Adobe granted patent licenses to it.\n- Not used: LibreOffice\'s copy of the same definitions (`oox/source/drawingml/customshapes/`), which is MPL-2.0, a\n file-level copyleft license.\n\nThe output keeps the standard\'s names and values; nothing is converted, so a rebuild from the same file is\nbyte-identical. Run `node scripts/build-preset-geometry.mjs --source <presetShapeDefinitions.xml>`; it checks that the\nfile still has 187 presets and that each erratum still applies.\n\n## Property map\n\nOPF names and the DrawingML that PowerPoint reads and writes.\n\n| What | OPF | PowerPoint (DrawingML) |\n| --- | --- | --- |\n| Preset shape | `shape: "chevron"` (a shape block) | `a:prstGeom prst` |\n| Adjust handles | `adjust: { "adj1": 0.25 }` (fractions and degrees) | `a:avLst/a:gd` |\n| Custom outline | `path` (SVG path data in a 0 to 1 box, or with a viewBox) | `a:custGeom` |\n| No fill | `fill: "none"` | `a:noFill` |\n| Solid fill | `fill: <ColorRef>` | `a:solidFill` |\n| Opacity | `opacity` 0 to 1 (fill), or 8-digit hex | `a:alpha` |\n| Gradient | `fill: { gradient: { type, angle, stops } }` | `a:gradFill` (`a:lin`, `a:path`) |\n| Pattern | `fill: { pattern: { preset, foregroundColor, backgroundColor } }` | `a:pattFill` |\n| Picture inside a shape | an image block\'s `shape` (every preset) | `a:blipFill` in `a:prstGeom` |\n| Fill rotates with shape | always on | `rotWithShape="1"` |\n| Lighter or darker color | `{ color, lighten }` / `{ color, darken }` | `a:lumMod`/`a:lumOff` |\n| Stroke | `stroke` (shapes and pictures) | `a:ln` |\n| Stroke color | `stroke.color` or `stroke.gradient` | `a:ln/a:solidFill`, `a:ln/a:gradFill` |\n| Stroke width | `stroke.width` | `a:ln w` |\n| Dash | `stroke.dash` (preset or array) | `a:prstDash`, `a:custDash` |\n| Cap | `stroke.cap` | `a:ln cap` |\n| Join | `stroke.join`, `stroke.miterLimit` | `a:miter lim`, `a:round`, `a:bevel` |\n| Compound | `stroke.compound` | `a:ln cmpd` |\n| Alignment | `stroke.align` | `a:ln algn` |\n| Arrowheads | `stroke.start`, `stroke.end` | `a:headEnd`, `a:tailEnd` |\n| Hand-drawn | `stroke.sketch` | `ask:lineSketchStyleProps` |\n| Theme style | `style` | `p:style` |\n| Outer shadow | `shadow` | `a:outerShdw` |\n| Inner shadow | `innerShadow` | `a:innerShdw` |\n| Glow | `glow` | `a:glow` |\n| Soft edges | `softEdge` | `a:softEdge` |\n| Reflection | `reflection` | `a:reflection` |\n| Blur | `blur` | `a:blur` |\n| Rotation | `rotate` | `a:xfrm rot` |\n| Flip | `flip` | `flipH`, `flipV` |\n| Overlay placement | slide-level `shapes: [...]` placed by `x`, `y`, `width`, `height` (fractions) or `at` a block | `a:xfrm a:off a:ext` |\n| Overlay layer | `layer`: front (default) or back | shape tree order: after the background, watermark and logo, or after everything |\n| Stacking | array order (within a layer) | shape tree order |\n| Text | `text` | `p:txBody` |\n| Vertical anchor | `anchor` | `a:bodyPr anchor` |\n| Margins | `padding` | `lIns`, `tIns`, `rIns`, `bIns` |\n| Vertical text | `textDirection` | `a:bodyPr vert` |\n| Alt text | `alt` | `p:cNvPr descr` |\n| Decorative | `decorative: true` | `adec:decorative` |\n| Name | from the block\'s path | `p:cNvPr name` |\n| Hidden | `hidden: true` | `p:cNvPr hidden` |\n| Click link | `link` | `a:hlinkClick` |\n| Connector | `connector: { from, to, route }` with `stroke`, among slide-level `shapes` | `p:cxnSp`, `a:stCxn`, `a:endCxn` |\n| Connection site | the nearest facing site; `fromSite`/`toSite` to override | `idx` |\n| Connector middle | `adjust: { adj1 }` on an elbow or curved connector | `a:avLst` of `bentConnector3`, `curvedConnector3` |\n| Native diagram | a `diagram` block, exported with `diagrams: "shapes"` (the default) | one `p:grpSp` of `p:sp` and `p:cxnSp` |\n\n### Excluded on purpose\n\nThese DrawingML features are left out of OPF; PPTX import reports them as findings.\n\n- 3-D (`a:scene3d`, `a:sp3d`): the preview cannot match PowerPoint\'s 3-D rendering.\n- Preset shadows (`a:prstShdw`): covered by the `shadow` presets.\n- Fill overlay (`a:fillOverlay`).\n- Text wrap off, text columns and autofit (`wrap`, `numCol`, `normAutofit`, `spAutoFit`): OPF fits text itself.\n- The alternative text title (`p:cNvPr title`): `alt` is the description.\n- Hover links (`a:hlinkHover`).\n- Locks (`a:spLocks`).\n- Black-and-white mode (`bwMode`).\n- Custom data (`p:custDataLst`).\n\n## Preset table\n\nDefault frame is the proportion a shape takes when the block sets no `aspectRatio`. Adjust values are OPF units (fractions, degrees where marked), with their handle\'s range at a square shape; "any" has no handle limit.\n\n| Preset | Default frame | Adjust values: default (range) |\n|---|---|---|\n| `accentBorderCallout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `accentBorderCallout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `accentBorderCallout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `accentCallout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `accentCallout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `accentCallout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `actionButtonBackPrevious` | 1:1 | none |\n| `actionButtonBeginning` | 1:1 | none |\n| `actionButtonBlank` | 1:1 | none |\n| `actionButtonDocument` | 1:1 | none |\n| `actionButtonEnd` | 1:1 | none |\n| `actionButtonForwardNext` | 1:1 | none |\n| `actionButtonHelp` | 1:1 | none |\n| `actionButtonHome` | 1:1 | none |\n| `actionButtonInformation` | 1:1 | none |\n| `actionButtonMovie` | 1:1 | none |\n| `actionButtonReturn` | 1:1 | none |\n| `actionButtonSound` | 1:1 | none |\n| `arc` | 1:1 | `adj1` 270\xB0 (0 to 359.99998), `adj2` 0\xB0 (0 to 359.99998) |\n| `bentArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5), `adj4` 0.4375 (0 to 0.75) |\n| `bentConnector2` | 2:1 | none |\n| `bentConnector3` | 2:1 | `adj1` 0.5 (any) |\n| `bentConnector4` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any) |\n| `bentConnector5` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any), `adj3` 0.5 (any) |\n| `bentUpArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5) |\n| `bevel` | 1:1 | `adj` 0.125 (0 to 0.5) |\n| `blockArc` | 1:1 | `adj1` 180\xB0 (0 to 359.99998), `adj2` 0\xB0 (0 to 359.99998), `adj3` 0.25 (0 to 0.5) |\n| `borderCallout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `borderCallout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `borderCallout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `bracePair` | 2:1 | `adj` 0.08333 (0 to 0.25) |\n| `bracketPair` | 2:1 | `adj` 0.16667 (0 to 0.5) |\n| `callout1` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 1.125 (any), `adj4` -0.38333 (any) |\n| `callout2` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1.125 (any), `adj6` -0.46667 (any) |\n| `callout3` | 3:2 | `adj1` 0.1875 (any), `adj2` -0.08333 (any), `adj3` 0.1875 (any), `adj4` -0.16667 (any), `adj5` 1 (any), `adj6` -0.16667 (any), `adj7` 1.12963 (any), `adj8` -0.08333 (any) |\n| `can` | 1:2 | `adj` 0.25 (0 to 0.5) |\n| `chartPlus` | 1:1 | none |\n| `chartStar` | 1:1 | none |\n| `chartX` | 1:1 | none |\n| `chevron` | 2:1 | `adj` 0.5 (0 to 1) |\n| `chord` | 1:1 | `adj1` 45\xB0 (0 to 359.99998), `adj2` 270\xB0 (0 to 359.99998) |\n| `circularArrow` | 1:1 | `adj1` 0.125 (0 to 0.25), `adj2` 19.03865\xB0 (0 to 56.44269), `adj3` 340.96135\xB0 (0 to 359.99998), `adj4` 180\xB0 (0 to 359.99998), `adj5` 0.125 (0 to 0.25) |\n| `cloud` | 1:1 | none |\n| `cloudCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any) |\n| `corner` | 1:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `cornerTabs` | 1:1 | none |\n| `cube` | 1:1 | `adj` 0.25 (0 to 1) |\n| `curvedConnector2` | 2:1 | none |\n| `curvedConnector3` | 2:1 | `adj1` 0.5 (any) |\n| `curvedConnector4` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any) |\n| `curvedConnector5` | 2:1 | `adj1` 0.5 (any), `adj2` 0.5 (any), `adj3` 0.5 (any) |\n| `curvedDownArrow` | 2:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `curvedLeftArrow` | 1:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `curvedRightArrow` | 1:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `curvedUpArrow` | 2:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.5 (0 to 0.5), `adj3` 0.25 (0 to 0.91652) |\n| `decagon` | 1:1 | `vf` 1.05146 (any) |\n| `diagStripe` | 1:1 | `adj` 0.5 (0 to 1) |\n| `diamond` | 1:1 | none |\n| `dodecagon` | 1:1 | none |\n| `donut` | 1:1 | `adj` 0.25 (0 to 0.5) |\n| `doubleWave` | 2:1 | `adj1` 0.0625 (0 to 0.125), `adj2` 0 (-0.1 to 0.1) |\n| `downArrow` | 1:2 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `downArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `ellipse` | 1:1 | none |\n| `ellipseRibbon` | 2:1 | `adj1` 0.25 (0 to 1), `adj2` 0.5 (0.25 to 0.75), `adj3` 0.125 (0 to 0.25) |\n| `ellipseRibbon2` | 2:1 | `adj1` 0.25 (0 to 1), `adj2` 0.5 (0.25 to 1), `adj3` 0.125 (0 to 0.25) |\n| `flowChartAlternateProcess` | 3:2 | none |\n| `flowChartCollate` | 1:1 | none |\n| `flowChartConnector` | 1:1 | none |\n| `flowChartDecision` | 1:1 | none |\n| `flowChartDelay` | 3:2 | none |\n| `flowChartDisplay` | 3:2 | none |\n| `flowChartDocument` | 3:2 | none |\n| `flowChartExtract` | 1:1 | none |\n| `flowChartInputOutput` | 3:2 | none |\n| `flowChartInternalStorage` | 3:2 | none |\n| `flowChartMagneticDisk` | 3:2 | none |\n| `flowChartMagneticDrum` | 3:2 | none |\n| `flowChartMagneticTape` | 3:2 | none |\n| `flowChartManualInput` | 3:2 | none |\n| `flowChartManualOperation` | 3:2 | none |\n| `flowChartMerge` | 1:1 | none |\n| `flowChartMultidocument` | 3:2 | none |\n| `flowChartOfflineStorage` | 1:1 | none |\n| `flowChartOffpageConnector` | 3:2 | none |\n| `flowChartOnlineStorage` | 3:2 | none |\n| `flowChartOr` | 1:1 | none |\n| `flowChartPredefinedProcess` | 3:2 | none |\n| `flowChartPreparation` | 3:2 | none |\n| `flowChartProcess` | 3:2 | none |\n| `flowChartPunchedCard` | 3:2 | none |\n| `flowChartPunchedTape` | 2:1 | none |\n| `flowChartSort` | 1:1 | none |\n| `flowChartSummingJunction` | 1:1 | none |\n| `flowChartTerminator` | 2:1 | none |\n| `foldedCorner` | 1:1 | `adj` 0.16667 (0 to 0.5) |\n| `frame` | 1:1 | `adj1` 0.125 (0 to 0.5) |\n| `funnel` | 1:1 | none |\n| `gear6` | 1:1 | `adj1` 0.15 (0 to 0.2), `adj2` 0.03526 (0 to 0.05358) |\n| `gear9` | 1:1 | `adj1` 0.1 (0 to 0.2), `adj2` 0.01763 (0 to 0.02679) |\n| `halfFrame` | 1:1 | `adj1` 0.33333 (0 to 0.66667), `adj2` 0.33333 (0 to 1) |\n| `heart` | 1:1 | none |\n| `heptagon` | 1:1 | `hf` 1.02572 (any), `vf` 1.0521 (any) |\n| `hexagon` | 1:1 | `adj` 0.25 (0 to 0.5), `vf` 1.1547 (any) |\n| `homePlate` | 2:1 | `adj` 0.5 (0 to 1) |\n| `horizontalScroll` | 2:1 | `adj` 0.125 (0 to 0.25) |\n| `irregularSeal1` | 1:1 | none |\n| `irregularSeal2` | 1:1 | none |\n| `leftArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `leftArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `leftBrace` | 1:2 | `adj1` 0.08333 (0 to 0.25), `adj2` 0.5 (0 to 1) |\n| `leftBracket` | 1:2 | `adj` 0.08333 (0 to 0.5) |\n| `leftCircularArrow` | 1:1 | `adj1` 0.125 (0 to 0.25), `adj2` -19.03865\xB0 (-56.44269 to 0), `adj3` 19.03865\xB0 (0 to 359.99998), `adj4` 180\xB0 (0 to 359.99998), `adj5` 0.125 (0 to 0.25) |\n| `leftRightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 0.5) |\n| `leftRightArrowCallout` | 2:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5), `adj4` 0.48123 (0 to 0.5) |\n| `leftRightCircularArrow` | 1:1 | `adj1` 0.125 (0 to 0.25), `adj2` 19.03865\xB0 (0 to 56.44269), `adj3` 340.96135\xB0 (0 to 359.99998), `adj4` 199.03865\xB0 (0 to 359.99998), `adj5` 0.125 (0 to 0.25) |\n| `leftRightRibbon` | 2:1 | `adj1` 0.5 (0 to 0.83333), `adj2` 0.5 (0 to 0.46875), `adj3` 0.16667 (0 to 0.33333) |\n| `leftRightUpArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.25) |\n| `leftUpArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5) |\n| `lightningBolt` | 1:1 | none |\n| `line` | 2:1 | none |\n| `lineInv` | 2:1 | none |\n| `mathDivide` | 1:1 | `adj1` 0.2352 (0.01 to 0.36745), `adj2` 0.0588 (0 to 0.0293), `adj3` 0.1176 (0.01 to 0.12493) |\n| `mathEqual` | 1:1 | `adj1` 0.2352 (0 to 0.36745), `adj2` 0.1176 (0 to 0.5296) |\n| `mathMinus` | 1:1 | `adj1` 0.2352 (0 to 1) |\n| `mathMultiply` | 1:1 | `adj1` 0.2352 (0 to 0.51965) |\n| `mathNotEqual` | 1:1 | `adj1` 0.2352 (0 to 0.5), `adj2` 110\xB0 (70 to 110), `adj3` 0.1176 (0 to 0.5296) |\n| `mathPlus` | 1:1 | `adj1` 0.2352 (0 to 0.7349) |\n| `moon` | 1:1 | `adj` 0.5 (0 to 0.875) |\n| `nonIsoscelesTrapezoid` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5) |\n| `noSmoking` | 1:1 | `adj` 0.1875 (0 to 0.5) |\n| `notchedRightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `octagon` | 1:1 | `adj` 0.29289 (0 to 0.5) |\n| `parallelogram` | 3:2 | `adj` 0.25 (0 to 1) |\n| `pentagon` | 1:1 | `hf` 1.05146 (any), `vf` 1.10557 (any) |\n| `pie` | 1:1 | `adj1` 0\xB0 (0 to 359.99998), `adj2` 270\xB0 (0 to 359.99998) |\n| `pieWedge` | 1:1 | none |\n| `plaque` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `plaqueTabs` | 1:1 | none |\n| `plus` | 1:1 | `adj` 0.25 (0 to 0.5) |\n| `quadArrow` | 1:1 | `adj1` 0.225 (0 to 0.45), `adj2` 0.225 (0 to 0.5), `adj3` 0.225 (0 to 0.275) |\n| `quadArrowCallout` | 1:1 | `adj1` 0.18515 (0 to 0.3703), `adj2` 0.18515 (0 to 0.5), `adj3` 0.18515 (0 to 0.31485), `adj4` 0.48123 (0.18515 to 0.6297) |\n| `rect` | 3:2 | none |\n| `ribbon` | 2:1 | `adj1` 0.16667 (0 to 0.33333), `adj2` 0.5 (0.25 to 0.75) |\n| `ribbon2` | 2:1 | `adj1` 0.16667 (0 to 0.33333), `adj2` 0.5 (0.25 to 0.75) |\n| `rightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `rightArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `rightBrace` | 1:2 | `adj1` 0.08333 (0 to 0.25), `adj2` 0.5 (0 to 1) |\n| `rightBracket` | 1:2 | `adj` 0.08333 (0 to 0.5) |\n| `round1Rect` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `round2DiagRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0 (0 to 0.5) |\n| `round2SameRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0 (0 to 0.5) |\n| `roundRect` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `rtTriangle` | 1:1 | none |\n| `smileyFace` | 1:1 | `adj` 0.04653 (-0.04653 to 0.04653) |\n| `snip1Rect` | 3:2 | `adj` 0.16667 (0 to 0.5) |\n| `snip2DiagRect` | 3:2 | `adj1` 0 (0 to 0.5), `adj2` 0.16667 (0 to 0.5) |\n| `snip2SameRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0 (0 to 0.5) |\n| `snipRoundRect` | 3:2 | `adj1` 0.16667 (0 to 0.5), `adj2` 0.16667 (0 to 0.5) |\n| `squareTabs` | 1:1 | none |\n| `star10` | 1:1 | `adj` 0.42533 (0 to 0.5), `hf` 1.05146 (any) |\n| `star12` | 1:1 | `adj` 0.375 (0 to 0.5) |\n| `star16` | 1:1 | `adj` 0.375 (0 to 0.5) |\n| `star24` | 1:1 | `adj` 0.375 (0 to 0.0005) |\n| `star32` | 1:1 | `adj` 0.375 (0 to 0.0005) |\n| `star4` | 1:1 | `adj` 0.125 (0 to 0.5) |\n| `star5` | 1:1 | `adj` 0.19098 (0 to 0.5), `hf` 1.05146 (any), `vf` 1.10557 (any) |\n| `star6` | 1:1 | `adj` 0.28868 (0 to 0.5), `hf` 1.1547 (any) |\n| `star7` | 1:1 | `adj` 0.34601 (0 to 0.5), `hf` 1.02572 (any), `vf` 1.0521 (any) |\n| `star8` | 1:1 | `adj` 0.375 (0 to 0.5) |\n| `straightConnector1` | 2:1 | none |\n| `stripedRightArrow` | 2:1 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 0.84375) |\n| `sun` | 1:1 | `adj` 0.25 (0.125 to 0.46875) |\n| `swooshArrow` | 2:1 | `adj1` 0.25 (0.00001 to 0.75), `adj2` 0.16667 (0 to 0.7) |\n| `teardrop` | 1:1 | `adj` 1 (0 to 2) |\n| `trapezoid` | 3:2 | `adj` 0.25 (0 to 0.5) |\n| `triangle` | 1:1 | `adj` 0.5 (0 to 1) |\n| `upArrowCallout` | 3:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 1), `adj4` 0.64977 (0 to 0.75) |\n| `upDownArrow` | 1:2 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 0.5) |\n| `upArrow` | 1:2 | `adj1` 0.5 (0 to 1), `adj2` 0.5 (0 to 1) |\n| `upDownArrowCallout` | 1:2 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.5), `adj3` 0.25 (0 to 0.5), `adj4` 0.48123 (0 to 0.5) |\n| `uturnArrow` | 1:1 | `adj1` 0.25 (0 to 0.5), `adj2` 0.25 (0 to 0.25), `adj3` 0.25 (0 to 0.75), `adj4` 0.4375 (0 to 0.4375), `adj5` 0.75 (0.5 to 1) |\n| `verticalScroll` | 1:2 | `adj` 0.125 (0 to 0.25) |\n| `wave` | 2:1 | `adj1` 0.125 (0 to 0.2), `adj2` 0 (-0.1 to 0.1) |\n| `wedgeEllipseCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any) |\n| `wedgeRectCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any) |\n| `wedgeRoundRectCallout` | 3:2 | `adj1` -0.20833 (any), `adj2` 0.625 (any), `adj3` 0.16667 (any) |\n\nOrganization charts, hierarchies and set overlap use the `org-chart`, `hierarchy` and `venn` arrangement layouts. Trees preserve one root and list-entry depths; Venn supports one to seven flat sets. Both engines share their measured connectors, paired cards, opacity and label rectangles. See [Trees and set overlap](smartart.md#trees-and-set-overlap-sh-21) for authoring and export fidelity.\n\nSigned overlay origins remain subject to representability: their scaled and rounded geometry must stay finite and its native EMU values must be exact JavaScript integers. An unrepresentable coordinate is a located error; it is never clamped or moved. This is engine number safety, not a PowerPoint coordinate maximum or a different OPF unit.\n'
358
358
  },
359
359
  {
360
360
  "slug": "slide-design-principles",
@@ -372,7 +372,7 @@ var docsData = Object.freeze([
372
372
  "slug": "smartart",
373
373
  "file": "docs/smartart.md",
374
374
  "title": "Pyramids, matrices and live SmartArt",
375
- "markdown": "# Pyramids, matrices and live SmartArt\n\nSeveral layouts of the default catalog draw a list as a diagram: `pyramid` (levels that build on each other, the first entry at the top),\n`matrix` (four parts of a whole, or the four cases of two choices, as quadrants), `cycle` (steps that repeat, as a loop; see\n[Cycles](#cycles-sh-18)) and [`chevrons`, `flow` and `vertical-flow`](#chevrons-and-flows) (stages or steps in order). The PowerPoint export writes them as **live\nSmartArt** where PowerPoint lays the SmartArt out exactly as the preview draws it (PowerPoint's designs on its built-in layouts, OPF's\nown designs on [OPF's own layout definitions](#opfs-own-layouts-sh-19)), and as the same drawing in native shapes everywhere else. A slide on either layout never turns into a stray bullet list: the arrangement has a second design of its own, drawn when\nPowerPoint's does not hold the entries.\n\n```json\n{ \"layout\": \"pyramid\", \"title\": \"Our strategy\", \"items\": [\"Vision\", \"Goals\", \"Programs\", \"Teams\"] }\n```\n\n```json\n{ \"layout\": \"matrix\", \"title\": \"Four markets\", \"items\": [\"Enterprise\", \"Mid-market\", \"Consumer\", \"Public sector\"] }\n```\n\n## The arrangement of a region\n\nA layout record's region takes `arrangement: \"pyramid\"` or `\"matrix\"` ([layout templates](layout-templates.md)). When the region holds\none list of one level (no nested entries, no descriptions, no icons, no `numbering`), composition draws it as that diagram\n(`SlideComposition.arrangements`, core `arrangements.ts`), in the first of these designs that holds every entry:\n\n| Design (`design`) | Pyramid (1 to 8 entries) | Matrix |\n| --- | --- | --- |\n| PowerPoint's (`smartart`), where the PPTX export can write it as live SmartArt (the [domain](#the-domain)) | Basic Pyramid: level i of n is H/n tall and W\xB7i/n wide, the apex a triangle, the entries centered on their levels | Basic Matrix, for exactly four entries: four rounded squares in a centered square over a diamond, the entries centered |\n| OPF's own (`opf`), where PowerPoint's does not hold the entries at the list's size or lies outside the domain | a stepped pyramid of rounded bars at the start of the region (level i is i/n of the steps' width), each entry beside its level in one column, start-aligned | four rounded quadrants filling the region two by two (rectangular where the region is), the entries centered |\n| A grid of cards (`cards`), for a matrix of other than four entries | \u2014 | one card per entry in the card neutral, in the grid that holds the text largest (one column of wide cards, or a balanced grid), start-aligned; reported as `opf/arrangement-adapted` (info): a matrix needs four entries |\n\nWhen none of them holds the entries, or the list has a shape the arrangement does not draw (nested entries, descriptions, icons,\nnumbering, more than 8 levels or 8 cards), the list draws as a list and `opf/arrangement-adapted` (info) says why. A list that no design\nholds still fills the region (SH-18 review, for every arrangement): its text takes the largest size from 1.5 times the role size down to\nthe size it has at which the whole list fits the region, and it sits in the middle of the region's height (LH-48's body growth leaves a\nlist alone once it covers half the body).\n\n**List blocks as entries (SH-18 review).** A region whose arrangement holds two or more list blocks draws each block as an entry, its\nlist inside, the same way for every count: a cycle's blocks on cards on OPF's ring or loop (whichever holds them larger) with an arrow\nfrom each to the next, a matrix's on a grid of cards, a pyramid's beside the levels of OPF's stepped pyramid. Every list keeps its\nmarkers, is start-aligned and vertically centered in its card, and all are set at one size, the largest from 1.5 times the role size\ndown to the lists' own size at which every block fits without a broken word. Where a pyramid's levels or a cycle's ring and loops do not\nhold the lists, the blocks are a grid of cards, with `opf/arrangement-adapted`; lists that overflow their region keep its composition,\nwhich pagination splits. The cards are native shapes (a SmartArt node does not hold a list), and a region with an arrangement keeps its\nwhole cell when LH-48 centers an under-filled body, so the diagram fills it. A matrix never draws\nan empty quadrant.\n\nPowerPoint's geometry was measured through COM for its Basic Pyramid (`pyramid1`) and Basic Matrix (`matrix3`) layouts:\n\n| | Pyramid | Matrix |\n| --- | --- | --- |\n| Frame | the region's cell, at most 2.5 times as wide as tall (a wider cell centers such a frame) | the region's cell |\n| Nodes | level i of n (from the top) is H/n tall and W\xB7i/n wide, centered; the sides continue one slope, so the top level is a triangle and every other a trapezoid (DrawingML `trapezoid`, `adj` = W/(2n) over the smaller side) | a square of side min(W, H) centered in the frame holds a diamond and four rounded squares (`roundRect` at its default corner) 0.39 of its side, 0.095 in from its edges and 0.03 apart, in the order top left, top right, bottom left, bottom right |\n| Text rectangle | the top level's whole box; 0.65 of a lower level's width, centered, at its full height | the rounded square's own text rectangle |\n| Text margin | 0.1 of the font size on every side | 0.3 of the font size on every side |\n| Look | every level in the primary color (`accent1`) with a 1.5 pt outline in the background color (`bg1`) | the quadrants as the levels, over a diamond in the primary lightened 80% (`lumMod 20000`, `lumOff 80000`) |\n\nOPF's designs use the same paint (the cards use the card neutral and its border, as every OPF card); text on a node is in whichever of\nthe background and the text color reads better on the primary, text beside a level or on a card in the slide's text color.\n\nThe text of every node is one size, in every design: the largest from 1.5 times the list's role size (36 pt on a 16:9 slide) down to the\nrole size (24 pt) at which every entry fits its rectangle without breaking a word, and the ink of every line stays inside its node's\noutline (the top of a pyramid level is narrower than its base). The list's own size counts when it is smaller (a crowded slide), never a\nsize below it. The arrangement fills its region, so the growth a lone list takes when it fills too little of the body (LH-48) is not the\nsize it keeps. Centered lines are centered without the space they broke at, as PowerPoint wraps them.\n\n## Trees and set overlap (SH-21)\n\nUse `org-chart` for reporting lines, `hierarchy` for a classification or work breakdown, and `venn` for overlapping sets. Their geometry is shared between the preview and editable native PowerPoint shapes. Tree connectors follow the authored parents. Hierarchy uses paired rounded cards with a 90% opaque foreground; Venn uses 50% opaque circles so overlaps remain visible.\n\nA tree is one list of up to eight short entries in preorder. The first entry has level zero (explicitly or by default); each child supplies its zero-based `level`. A node may return to any earlier parent depth, but may not skip a depth or introduce another level-zero root. For example:\n\n```json\n{ \"layout\": \"org-chart\", \"title\": \"Give each team a clear owner\", \"items\": [\n { \"text\": \"Lead\", \"level\": 0 },\n { \"text\": \"Build\", \"level\": 1 },\n { \"text\": \"Web\", \"level\": 2 },\n { \"text\": \"App\", \"level\": 2 },\n { \"text\": \"Ship\", \"level\": 1 }\n] }\n```\n\nUse `venn` with one flat list of one to seven set labels. One to four circles hold their labels inside. Five to seven sets use enlarged editable circles with outside labels fitted from the actual font measurements. This OPF adaptation preserves circle overlaps and set order while filling more of the body at the previous type size or larger. Basic Venn native measurements remain a separate, unqualified live reference. When the overlap cannot keep every label readable, the complete set labels use opaque cards or a list with `opf/arrangement-adapted`. Venn fallback lists try a bounded whole-word reading measure of70characters at the retained type size. If the complete list cannot fit that measure in the body, `opf/text-overflow` reports the refusal; strict composition rejects it. Explicit pagination or shorter labels resolves that limit. Entry order identifies the sets; the diagram implies no numeric overlap values.\n\n```json\n{ \"layout\": \"venn\", \"title\": \"Three conditions for a useful pilot\", \"items\": [\"Clear scope\", \"Evidence\", \"Shared goal\"] }\n```\n\nThe arrangement keeps the previous fitted list size or grows. A malformed tree, unsupported forest, nested Venn, descriptions, icons, numbering, too many entries or labels that do not fit keeps the complete list with `opf/arrangement-adapted`; no entry is dropped or silently reparented. Use a diagram for assistants or relationships outside the single-root model. These three layouts currently export as editable native shapes; live SmartArt remains outside their qualified domain. Import recognizes native Organization Chart (orgChart1), Hierarchy (hierarchy1) and Basic Venn (venn1), preserving tree depths. Native assistants, forests or labeled edges use the reported Mermaid hierarchy adaptation instead. A drawing with additional labels beyond the data entries keeps its overlay drawing and reports the adaptation, preserving that extra text.\n\n[The trees and sets example](../examples/technical/trees-and-sets.opf.json) contains the three layouts.\n\n## Chevrons and flows\n\nThree more layouts draw a list of stages or steps in order (SH-17): `chevrons` (a row of chevrons, each leading into the next), `flow`\n(boxes joined by arrows in one row) and `vertical-flow` (the same as a column, beside the title). Each is a region's `arrangement` of the\nsame name, with the same rules as a pyramid's: one list of one level, 1 to 8 short entries, one size for every node, never below the\nlist's role size.\n\n```json\n{ \"layout\": \"chevrons\", \"title\": \"How we work\", \"items\": [\"Plan\", \"Build\", \"Test\", \"Ship\"] }\n```\n\n| | Chevrons (Basic Chevron Process, `chevron1`) | Flow (Basic Process, `process1`) | Vertical flow (Vertical Process, `process2`) |\n| --- | --- | --- | --- |\n| Frame | the region's cell | the region's cell | the region's cell |\n| Nodes | n chevrons of width w = s(n) W, height min(0.4 w, H), each 0.9 w after the last (the point of one in the notch of the next), the row centered | n boxes of width w = s(n) W, height min(0.6 w, H), each 1.4 w after the last, centered | n boxes of height h = s(n) H, width min(1.8 h, W), each 1.5 h below the last, centered |\n| Shape | DrawingML `chevron` at its default adjustment (the point half the height deep) | `roundRect` at adjustment 10000 | the same |\n| Arrows | none | a `rightArrow` (stem 0.6 of its height, the default head) 0.212 w long and 0.248 w tall, 0.1 w after the box before it, on the frame's middle | a `rightArrow` turned 90 degrees, 0.45 h wide and 0.375 h long, in the middle of the gap |\n| Text rectangle | the chevron's own, between its notch and its point | the rounded rectangle's own | the same |\n| Text margin | 0.315 of the font size at the start, 0.105 on the other sides | 0.3 of the font size on every side | the same |\n| Look | every chevron in the primary with a 1.5 pt outline in the background color | the boxes as the chevrons; the arrows in the primary lightened 40% (`lumMod 60000`, `lumOff 40000`), without an outline | the same |\n\nPowerPoint fits these layouts with a binary search on one scale and keeps the last step that fits, so a node is not the closed form\nW / (0.9 n + 0.1) wide but a multiple of 1/8192 of the frame that depends only on the node count: s(n) (core `SMART_ART_SCALES`) is, in\n1024ths of the frame, 1024, 538, 365.5, 276.5, 222.5, 186, 160 and 140.25 for 1 to 8 chevrons, 1024, 426.5, 269, 196.75, 155, 128,\n108.875 and 94.75 for boxes in a row, and 1024, 409.5, 256, 186, 146.25, 120.375, 102.375 and 89 (of the frame's height) for boxes in a\ncolumn. Two chevrons at 800 pt are 420.31 pt wide where the closed form gives 421.05. One node squeezed by the other side of the frame\n(a chevron in a frame less than 0.4 times as tall as wide) is 1023/1024 of the frame and as tall as it. The COM sweep measured 1 to 10\nnodes of each in 20 frames from 250 x 120 to 800 x 540 pt; core places every node and arrow within 0.0001 pt of PowerPoint in all of them\nbut those where PowerPoint's 8 pt test letter did not fit a node (a node a few points tall), whose text made the node grow.\n\nPowerPoint's design is drawn where it holds the entries at the list's size and lies in the [domain](#the-domain); else OPF's own design\nof the arrangement, filling the region:\n\nOPF's design keeps PowerPoint's proportions, so the two read as one family: a chevron 0.9 widths after the last (its point at\nmost 0.2 of its width deep), a box 0.4 widths after the last with PowerPoint's arrow (0.212 x 0.248 of a box's width) in the room, a\nvertical box half its height below the last with a down arrow 0.45 x 0.375 of its height. The entries go into one to four rows (a\nvertical flow: columns), whichever holds the text largest (one line on a tie), as evenly as possible, the longer lines first. The text\nis one size for every node, the largest from 1.5 times the list's role size down to the role size at which every node holds its entry;\nthen every node takes the height that text needs with its margins (0.15 em above and below a box's text; PowerPoint's proportion at\nleast: a chevron 0.4 of its width, a box 0.6, a vertical box 1/1.8), and the whole is centered in the region. Only where none of these\nholds the entries at the list's size does OPF draw a compact form of the same design (rooms of two gaps, the arrow 0.6 of the\nroom, a chevron's point 0.12 of its width deep, no least height), so a list is left a list only when no design holds it. Every row spans the region: a row of fewer entries widens them (a\ncolumn of fewer lengthens them).\n\n- **chevrons**: each row a run of chevrons, left to right; a wrapped row breaks after a chevron's point and the next row starts again\n at the left, full width, so the points carry the order;\n- **flow**: the rows snake: the second runs right to left under the first, joined by a down arrow under the end where the first stops,\n the third runs left to right again, and so on;\n- **vertical flow**: the columns snake the same way: the second runs bottom to top, joined by a right arrow at the bottom.\n\nA right-to-left deck mirrors the designs: the first chevron or box is at the right, the chevrons point left (`flipH`) and the arrows\nturn.\n\nTwo or more list blocks in the region are the entries themselves, as SH-18 draws them for a cycle: each block on a card of OPF's\nchevrons or boxes (the card neutral and its border), with the arrows between them, its list kept with its markers, start-aligned and\nat one size for all, the largest from 1.5 times the role size at which every card holds its list without breaking a word; the cards\nthen take the height of the tallest list. Where no row or column holds them, a grid of cards does (`opf/arrangement-adapted`), and\nwhere nothing does, the blocks keep the region's composition, which pagination splits. A SmartArt node holds no list, so these are\nnative shapes, with `pptx/smartart-unavailable` saying so.\n\n## In PowerPoint\n\n`toPptx(deck, { smartArt })` (CLI `--smart-art <live|shapes>`) takes the first that fits, as the owner decided for SmartArt:\n\n1. **Live SmartArt** (`\"live\"`, the default), for PowerPoint's design where the instance lies in the domain below. The slide holds a `p:graphicFrame` of the\n diagram (`dgm:relIds`) inside an `mc:AlternateContent` whose `mc:Fallback` is OPF's picture of it ([in other apps](#in-other-apps)), and the package:\n - the data model (`ppt/diagrams/dataN.xml`): the `doc` point names the layout (`loTypeId` pyramid1, matrix3, chevron1, process1 or process2) and OPF's own quick\n style and colors (`qsTypeId` `urn:openpresentation.org/opf/smartart/quickstyle/flat`, `csTypeId`\n `urn:openpresentation.org/opf/smartart/colors/primary`); one point per entry, marked `custT=\"1\"` so PowerPoint keeps the run size\n (and sets the text margins from it) instead of fitting the text again; runs with OPF's size, typeface and language; each paragraph\n centered at OPF's line pitch with no space before or after; one `cxn` per entry from the doc point, in entry order;\n - OPF's colors and quick style parts, whose style labels cover every label the five layouts use (`node0`, `node1`, `bgShp`, `revTx`\n and the transition labels: a label a part leaves out renders black; `sibTrans2D1`, a flow's arrows, is the primary lightened 40%\n without a line), in the theme's scheme colors, so a theme change in PowerPoint\n recolors the SmartArt;\n - a drawing part built from OPF's geometry (`ppt/diagrams/drawingN.xml`), for readers that show the cached shapes;\n - **no layout part** for PowerPoint's design: OPF never writes Microsoft's layout definitions. `r:lo` is empty, and PowerPoint resolves\n its built-in layout from `loTypeId` (see [the layout relationship](#the-layout-relationship)). OPF's own designs are live on [OPF's own\n layout definitions](#opfs-own-layouts-sh-19), which the package carries;\n - the fallback picture: an SVG (`asvg:svgBlip`) over its PNG raster, the picture path SH-07's diagrams use.\n\n Live SmartArt needs that picture, so it needs opf-render (an optional peer) to draw the slide and an SVG rasterizer for the PNG (the\n default in Node is opf-render's; a browser passes `svgRasterizer`). Without either the arrangement is written as native shapes and\n `smartart-unavailable` says so.\n SH-19: OPF's own design of an arrangement, and a matrix's card grid, is live SmartArt on OPF's own layout definition of that design\n where [its domain](#the-domain-of-opfs-layouts) holds ([OPF's own layouts](#opfs-own-layouts-sh-19)).\n2. **Native shapes**: OPF's design and a card grid outside the domain of OPF's layouts, PowerPoint's design outside its domain, and\n everything with `\"shapes\"`. The diamond and\n the nodes are presets (`diamond`, `trapezoid` with core's adjustment, `roundRect`; SH-17: `chevron` with core's adjustment, mirrored\n with `flipH` in a right-to-left deck, and a flow's arrows as `rightArrow` with core's two adjustments, turned with `rot`) at core's boxes, under the list's measured lines,\n tagged `OPF_ARRANGEMENT_V1`. OPF's design and PowerPoint's outside the domain report the info finding `pptx/smartart-unavailable`\n with the reason (`reason` in the diagnostic); a card grid reports core's `arrangement-adapted`.\n\nBoth look the same as the preview: the shapes are exact, and the text is where OPF's native text export puts any text.\n\n### In other apps\n\nMany apps that open PPTX files do not lay SmartArt out. Each live SmartArt is therefore written as an `mc:AlternateContent` (ECMA-376\nPart 3, markup compatibility): the `mc:Choice` holds the SmartArt frame and requires the namespace\n`http://schemas.microsoft.com/office/drawing/2016/12/diagram` (prefix `dgm1612`, Office 2016's SmartArt extensions), and the\n`mc:Fallback` holds a picture with the same id and name, at the same frame grown by its bleed on every side. **PowerPoint** understands the namespace and shows the live SmartArt.\n**Every other app**, one that does not claim the namespace, takes the fallback and shows OPF's own drawing: the preview of that frame\n(opf-render's SVG of the slide, cut to the arrangement and its entries, the text as glyph outlines in the deck's fonts when the export\nhas the fonts handle), transparent around the drawing, as an SVG with a PNG raster at 192 dpi of the frame for apps without SVG. The\nbleed is how far the preview draws outside the frame: half of the nodes' outline, and further at a pyramid level's miter-joined corners\n(its base corners reach 2.6 px past a 16:9 frame), plus a pixel of antialiasing, so the picture draws everything the preview draws. With\n`typefaces: \"safe\"` the picture is laid out and drawn in the Office-safe families the export writes and lays the nodes out with (Arial\nfor the default Aptos), not the preview's. Its\nalt text is the outline, one entry a line in entry order (`Pyramid of 4 levels, top to bottom:` then each level). SH-09's drawing part\nstays in the package for readers that draw the cached SmartArt shapes.\n\nThe namespace was chosen through COM (PowerPoint for Microsoft 365 on Windows 11, 2026-11-06), on a pyramid and a matrix whose\n`mc:Choice` required each candidate in turn: `dgm1612` (2016/12 diagram), `dgm1611` (2016/11 diagram), `dgm14` (2010 diagram),\n`dsp` (2008 diagram drawing), `dgm` (the ECMA diagram namespace) and `p14` (PowerPoint 2010) all opened as live SmartArt\n(`HasSmartArt`, Basic Pyramid or Basic Matrix, every entry a node, the slide exported as the SmartArt); a namespace PowerPoint does not\nknow took the fallback, which PowerPoint drew as the preview does (mean pixel difference 1.27 and 1.14 of 255 over the slide). The\nchosen namespace is the narrowest of those: only Office's SmartArt uses it, whereas an app that reads the ECMA diagram markup or the\ncached drawing, or claims the PowerPoint 2010 extensions, could claim the others without laying SmartArt out. No third-party app was\nrun (LibreOffice and the Open XML SDK were not installed); the pptx tests check the markup with a markup-compatibility reader that does\nnot know the namespace, which takes the fallback picture and finds a well-formed SVG and a PNG.\n\n**Saved again in PowerPoint**, the file keeps the live SmartArt (COM: `SaveCopyAs`, reopened, `HasSmartArt` and every node) but not\nthe wrapper: PowerPoint writes the bare SmartArt frame and its own drawing and layout parts, and drops the fallback picture and its\nmedia. Other apps then see what any PowerPoint-saved SmartArt gives them, typically its cached drawing. Import reads the file as\nbefore.\n\n### What PowerPoint does on edit\n\nPowerPoint lays a SmartArt out again from its data model whenever it opens or changes it; it never shows the cached drawing. A\nSmartArt OPF wrote opens as live SmartArt (COM: `HasSmartArt`, the layout, one node per entry in `AllNodes`), and Change Layout\nswitches it to another SmartArt layout. When a node's text is edited, PowerPoint keeps OPF's explicit size for every node (it does not\nshrink the text to fit), keeps the node rectangles, and wraps the text in the node with its own line breaker.\n\n### The domain\n\nThe PPTX export writes live SmartArt only for the instances the PowerPoint comparison passed (core `SMART_ART_DOMAIN`,\n`smartArtUnavailable`):\n\n| | Pyramid | Matrix |\n| --- | --- | --- |\n| Entries | 1 to 5 (6 to 8 levels never fitted the list's role size in the compared frames) | 1 to 4 |\n| Frame proportions (width over height) | 1.1 to 2.3 (the 16:9, 4:3 and 1:1 slides gave 2.26, 1.64 and 1.17) | 0.8 to 1.2 (16:9 and 4:3 gave 1.13 and 0.83; the 1:1 slide's 0.58 is outside) |\n| Lines | at most 2 for an entry and 6 for all of them, each break holding when the width changes by 4% (core fits every entry at both widths) | the same |\n| Text | Latin script, left to right; runs bold, italic, underlined or struck through only (no links, citations, code or sizes of their own); no line breaks or tabs | the same |\n| Line width (SH-19) | no line wider than 500 px: PowerPoint measures a line up to about 0.6% wider or narrower than OPF, and a centered line moves by half the difference (the SH-19 sweep: a one-level pyramid's 537 px line sat 1.74 px from OPF's native text, outside SH-07's 1.5 px; every line of 440 px or less was within it); it applies to every arrangement and to OPF's own layouts, and such an instance draws OPF's design | the same |\n\nEverything else (Arabic, Hebrew and Japanese text, longer or tighter entries, other proportions) is written as native shapes, which look\nthe same as the live SmartArt; the finding names the first reason.\n\n### The gate\n\nThe domain comes from a PowerPoint sweep through COM (PowerPoint for Microsoft 365 on Windows 11, read-only, visible and minimized, quit\nafter each batch): a pyramid of 1 to 8 entries and a matrix of 1 to 4, with short, medium and long entries, on 16:9, 4:3 and 1:1 slides,\nand an Arabic and a Japanese deck of each, 112 decks. The Latin decks use Source Sans 3, which OPF bundles and the comparison machine has\ninstalled, so the preview and PowerPoint draw one font. Each deck was exported twice, live (`smartArt: \"live\"`) and as native shapes\n(`\"shapes\"`), and both files were drawn by PowerPoint at the canvas's pixel size. An instance passes when:\n\n1. PowerPoint opens it as live SmartArt of the right layout with every entry as a node;\n2. every node rectangle PowerPoint lays out (`GroupItems`) is within 0.1 pt of core's;\n3. every node's font size in PowerPoint equals OPF's;\n4. the shapes show no visible difference from the preview (no 16 px block of the shapes' area outside the text whose mean differs by more\n than 24/255);\n5. PowerPoint draws the live SmartArt as it draws OPF's native export of the same slide, within SH-07's native gate (mean absolute\n difference at most 1 at a quarter size and 2 at full size, at most 0.5% of blocks visibly different, the text's ink within 1.5 px).\n\nThe domain was set from a first pass, in which 38 decks drew PowerPoint's design live: in all 38 PowerPoint laid every node out where\ncore does (largest difference 0.000 pt) at core's size, with no visible difference in the shapes, and 33 passed every check. The five that\ndid not are the two Arabic decks (their text 6 px from where the native export draws it), the Japanese matrix (10 px) and two\nfour-quadrant matrices whose entries wrap (mean differences 1.1 and 1.22), which is why the domain leaves out right-to-left and Chinese or\nJapanese text, entries of more than two lines and more than six lines in all.\n\nWith the domain and OPF's designs in place, the same 112 decks draw: PowerPoint's design as live SmartArt in 20 (every one passes: node\nrectangles within 0.000 pt, sizes equal, no visible shape difference, the SmartArt within SH-07's gate of the native export), OPF's\ndesign in 60, a card grid in 27 (the matrices of 1 to 3 entries) and a list in 5 (pyramids of 6 to 8 long levels on 4:3 and 1:1\nslides, which no design holds at 24 pt; `opf/arrangement-adapted` says so). In every native-shape instance PowerPoint draws the shapes as\nthe preview does (mean difference at most 1.15 inside the shapes and outside the text, no visibly different block).\n\nThe text of a live SmartArt sits where OPF's native export puts any text, within a pixel. Both sit higher in PowerPoint than in the preview,\nby about 0.15 em in Source Sans 3 and 0.07 em in Aptos (4 to 7 px at the 24 to 36 pt of these nodes): OPF's text model sets every\nbaseline one em below its line's top, and PowerPoint at a height that depends on the face. That difference is the same for every OPF text\nbox and is not SmartArt's; at the sizes of SH-07's diagram labels it is under the 1.5 px gate, at these sizes it is not, so the gate\ncompares the SmartArt with the native export, and the preview offset is recorded in the gate table. The evidence (the gate table, the\npreview | PowerPoint | native export sheets and the COM records) is in the SH-09 build folder of the shapes program.\n\n### The domain and the gate of chevrons and flows\n\nThe SH-17 sweep measured PowerPoint's own layout first (`AddSmartArt` through COM, 1 to 10 nodes in 20 frames per layout, the fitted\nmodel above), then ran the gate above on OPF's exports: chevrons, a flow and a vertical flow of 1 to 8 entries, short, medium and long,\non 16:9, 4:3 and 1:1 slides, and an Arabic and a Japanese deck of each, 222 decks, each exported live and as native shapes and drawn by\nPowerPoint. The domain (core `SMART_ART_DOMAIN`) is what passed:\n\n| | Chevrons | Flow | Vertical flow |\n| --- | --- | --- | --- |\n| Entries | 1 to 6 (7 and 8 never fitted the list's size in PowerPoint's design) | 1 to 6 | 1 to 4 |\n| Frame proportions | 1.1 to 2.3 (the 16:9, 4:3 and 1:1 slides gave 2.26, 1.64 and 1.17) | the same | 0.55 to 1.2 (the region beside the title: 1.13, 0.81 and 0.58) |\n| Fill | no entry's lines more than 95% of its node's text height (less margins): PowerPoint lays a box nearly full of text out again, in the first pass at 0.969 and 0.996 of the height (node rectangles 0.22 and 5.3 pt off), while every box at 0.95 or less matched | the same | the same |\n| Ink | the entries' text (each line's width times the size) at most 8% of the frame: PowerPoint sets a SmartArt's lines up to a pixel from where it sets OPF's native text (the same text in both), which in a frame dense with large text passes SH-07's mean-difference gate no longer (every first-pass failure of that check was at 0.082 or more) | the same | the same |\n| Lines, text | as the pyramid's: at most 2 lines an entry and 6 in all, breaks that hold within 4% of the width, Latin left-to-right text with bold, italic, underline or strike only | the same | the same |\n\nIn the first pass, before the fill and ink limits, 88 decks drew PowerPoint's design live; every node lay exactly where core lays it\n(0.000 pt) at core's size in 81, and 74 passed every check. The seven laid out again had nearly full text (the fill limit), and the\nseven others that drew the SmartArt more than a mean of 1 from the native export were dense with large text (the ink limit). With the domain in\nplace: 63 decks draw live SmartArt, every one passing (node rectangles and arrows within 0.000 pt of core, sizes equal, no visible\ndifference in the shapes, within SH-07's gate of the native export), 151 draw OPF's own design and 8 stay a list (7 or 8 long chevrons and 8 long boxes on the 1:1 slide, and vertical flows of 6 to 8 long entries on the 4:3 and\n1:1 slides, which no design holds at the list's size; `opf/arrangement-adapted` says so). Every native-shape instance PowerPoint draws as the preview\ndoes: no visibly different block in the shapes, a mean difference of at most 2.7 outside the text (the outlines' antialiasing). The\nArabic and Japanese decks are OPF's design, as for the pyramid and matrix.\n\nCOM also showed, on two live instances of each (short and medium entries): `HasSmartArt`, the layout's name, every entry a node of\n`AllNodes`; a node's text edited in PowerPoint keeps OPF's size in every node and every node rectangle; Change Layout to Basic Block List\nkeeps the nodes. With its `mc:Choice` requiring an unknown namespace, PowerPoint draws SH-16's fallback picture of each (mean difference\n1.3 from the preview over the slide, about what it is for the live SmartArt). Import reads a Basic Chevron Process, Basic Process or\nVertical Process that PowerPoint itself wrote back to the `chevrons`, `flow` or `vertical-flow` layout and its list, from the data model.\n\n### The layout relationship\n\nThe SH-09 spike found that PowerPoint resolves its built-in layout from the data model's `loTypeId` only when the package has no layout\npart; a stub layout part with the built-in `uniqueId` is not resolved. The frame's `dgm:relIds` still names four relationships, and\nthere are three ways to point `r:lo` at nothing. All three open as live SmartArt in PowerPoint with the layout resolved, a node edit and\nChange Layout working (the build checked each on a pyramid and a matrix):\n\n| Form | What a validator sees | Chosen |\n| --- | --- | --- |\n| `r:lo=\"\"` | the attribute the schema requires is present (`ST_RelationshipId` is a string), and an empty id can name no relationship (relationship ids are non-empty) | yes |\n| `r:lo=\"rId99\"`, no such relationship | a reference to a relationship the part does not have: a broken package reference | no |\n| no `r:lo` attribute | the schema's required attribute is missing | no |\n\nThe empty id is the only form that is both schema-valid and names nothing that is missing. The Open XML SDK validator and LibreOffice were\nnot installed on the comparison machine, so neither was run.\n\n## Cycles (SH-18)\n\nThe `cycle` layout (a region's `arrangement: \"cycle\"`) draws its lone list of one level as the steps of a loop: each entry a node on a\nring, the first at the top and the rest clockwise, with an arrow from each to the next and from the last back to the first. It draws\n1 to 8 entries (two make a pair with an arrow each way; more than 8 stay a list, with `opf/arrangement-adapted`).\n\n```json\n{ \"layout\": \"cycle\", \"title\": \"How each round feeds the next\", \"items\": [\"Plan\", \"Pilot\", \"Measure\", \"Adjust\"] }\n```\n\nThe designs are tried in order, each at one text size for every node, from 1.5 times the list's role size down to the role size, never\nbelow it:\n\n| Design (`design`) | Drawing |\n| --- | --- |\n| PowerPoint's (`smartart`), written as live SmartArt inside the [domain](#the-cycle-domain) | Basic Cycle (`cycle2`): circles on a ring with an arrow after each, in a frame of the cycle's own proportion centered in the region |\n| OPF's (`opf`), where the circles do not hold the entries at the list's size or the instance lies outside the domain | the larger-text of two designs that fill the region: rounded rectangles on an ellipse (two entries side by side, or one above the other in a tall region), or a loop of two or three rows (columns in a tall region), clockwise from the top left, with a node on every place of its edge: two rows hold ceil(n/2) nodes on top and the rest below, three rows a node at each end of the middle row too, and a row of fewer nodes widens them so every row spans the region (no place is ever empty); the arrows on the lines between the nodes' centers, all one size |\n\nEvery node is filled in the primary color with the 1.5 pt background-colored outline of the other arrangements; the arrows are the\nprimary lightened 40% (`lumMod 60000`, `lumOff 40000`), without an outline; the entries are centered on their nodes in the color that\nreads on the primary. A right-to-left deck mirrors the cycle, so its steps run counterclockwise.\n\n### PowerPoint's Basic Cycle\n\nPowerPoint lays Basic Cycle out from its frame alone: through COM (PowerPoint for Microsoft 365 on Windows 11, 2026-11-06) the circles and\narrows were the same for short, medium and long text and at every font size, and exactly proportional to the frame at a fixed width over\nheight (the largest difference across frames 230 to 920 pt wide was 0.0004 pt). At other proportions the result is not a closed form:\nPowerPoint searches the circle size as a ten-bit binary fraction of the frame's width and fits the ring in a second step, so the circles\nmove by up to 0.4 pt between frames a few points apart. OPF therefore gives the SmartArt frame one proportion per count, **1.8 : 1 for two\nentries and 1.15 : 1 otherwise** (the cycle's own proportion, a little wider so its height decides the size), the largest such frame\ncentered in the region, and reproduces PowerPoint's geometry from the frame's width W (core `cycleFrame`, `cycleNodes`):\n\n| | Basic Cycle |\n| --- | --- |\n| Circles | DrawingML `ellipse`, diameter `CYCLE_DIAMETER[n]`\xB7W: 890/1024, 818/2048, 774/2048, 570/2048, 538/2048, 890/4096, 830/4096 and 723/4096 for 1 to 8 entries |\n| Ring | the centers at radius `CYCLE_RADIUS[n]`\xB7W (0.3002, 0.32775, 0.29552, 0.33524, 0.32594, 0.3506 and 0.34595 for 2 to 8), the first at the top and the rest clockwise 360/n degrees apart; two entries left and right; the ring centered in the frame, an odd count's moved down by half of r\xB7(1 \u2212 cos(180\xB0/n)) so the circles' bounds are centered |\n| Arrows | after each circle a DrawingML `rightArrow` (`adj1` 60000, `adj2` 50000) 0.3375 of a diameter thick, on the line between two centers, 0.53 of the gap between the circles long and starting 0.22 of it after the first circle, turned to point along the line; two entries: one over and one under the gap, 0.2491\xB7W long, their centers 0.1888\xB7W off the line and 0.4883 of the way along it |\n| Text rectangle | the ellipse's own (the inscribed square, as PowerPoint's `txXfrm`), inset by 0.1 of the font size |\n| Stacking | each arrow after its circle (two entries: an arrow's head runs under the next circle) |\n\nThe model matches every circle and arrow PowerPoint drew within 0.0001 pt in the frames measured. In the live SmartArt, the arrows are the\ndata model's transition points (`sibTrans`, one after each entry, the last closing the loop), styled by OPF's `sibTrans2D1` label.\n\nIn PowerPoint (COM), a cycle OPF wrote opens as live SmartArt (`HasSmartArt`, Basic Cycle, one node per entry); a node edit keeps OPF's\nsize on every node and the circles where they were, Change Layout switches it to another layout with every entry, and a file saved again\nby PowerPoint (which writes its own layout part) imports back as the same list on the `cycle` layout, as does a Basic Cycle PowerPoint\nauthored. With the `mc:Choice` requiring a namespace PowerPoint does not know, PowerPoint draws the fallback picture as the preview does\n(mean difference 0.94 to 1.05 of 255 over the slide, two, four and six entries).\n\n### The cycle domain\n\n| | Cycle |\n| --- | --- |\n| Entries | 1 to 8 |\n| Frame proportions | exactly cycleAspect's (1.8 : 1 for two entries, 1.15 : 1 otherwise), which OPF always gives it |\n| Lines | at most 2 for an entry, each break holding when the width changes by 4%; no limit in all (each circle holds its own entry: eight entries of one line and four of two matched) |\n| Text | Latin script, left to right, with the run formatting of the other arrangements |\n\nRight-to-left decks stay native shapes: PowerPoint draws Basic Cycle clockwise from the data model whatever the deck's direction, so\nits circles are not where OPF's mirrored cycle draws them. Japanese text sat 11 px off in the comparison. Entries of three lines or more\ndrew within the shapes but outside SH-07's native gate (mean difference 1.03 to 1.62).\n\n### The cycle gate\n\nThe same comparison as SH-09's, plus every arrow's rotation: a cycle of 1 to 8 entries with short, medium and long entries on 16:9,\n4:3 and 1:1 slides, and an Arabic and a Japanese deck of 3, 4 and 5 entries, 78 decks, each exported live and as native shapes and drawn\nby PowerPoint. A first pass with the domain open to every count, line count and script drew 35 decks live: PowerPoint laid every circle\nand arrow out where core does (largest difference 0.000 pt, rotations equal) at core's size in all of them, and 26 passed every check; the\nnine that did not are the three right-to-left decks (PowerPoint's clockwise layout), the three Japanese decks (text 11 px off) and the\nthree entries of three or four lines. With the domain above the 78 decks draw: PowerPoint's design as live SmartArt in 25 (every one passes: circles and arrows within 0.000 pt, rotations equal, sizes equal, no visible shape difference, the SmartArt within SH-07's gate of the native export: mean difference at most 0.84 at a quarter size and 1.29 at full size, no visibly different block, the text's ink within 1.03 px), OPF's design in 44 (PowerPoint draws the shapes as the preview does: mean difference at most 1.04 inside the shapes and outside the text, no visibly different block) and a list in 9, filling the region (five to eight long entries on 1:1 slides, six to eight on 4:3, eight on 16:9, and eight medium entries on a 1:1 slide; `opf/arrangement-adapted` says so). In each of the nine, every design breaks one of the two rules that keep text readable at the list's role size: a word wider than its node (OPF never breaks a word: \"Customers\" is 143 px at 32 px, a node of the 4 + 4 loop on 16:9 109 px wide) or entries taller than their node (OPF never sets an arrangement's text below the list's role size, or below the list's fitted size when the list itself fits smaller: the 3 + 1 + 1 + 3 loop on 16:9 is 16 px short). The evidence is in the SH-18 folder of the\nshapes program.\n\n## OPF's own layouts (SH-19)\n\nPowerPoint's built-in layouts draw PowerPoint's designs. OPF's own designs (the [second design](#the-arrangement-of-a-region) of each\narrangement: the stepped pyramid with the entries beside it, the four quadrants, the card grid of a matrix, the ring and the two- and\nthree-row loops of a cycle, the wrapped and snaking rows of chevrons and flows, the snaking columns of a vertical flow, and their compact\nforms) have a SmartArt layout definition of their own, which OPF writes (ECMA-376 Part 1, \xA721.4, `dgm:layoutDef`) from the specification\nand OPF's design, never from PowerPoint's parts. Where the instance lies in [the domain](#the-domain-of-opfs-layouts) the export writes the\ndesign as live SmartArt on that definition, so it is editable SmartArt in PowerPoint, with SH-16's fallback picture as every live SmartArt\nhas. Elsewhere it stays native shapes, with `pptx/smartart-unavailable` and the reason.\n\nA design inside a built-in layout's domain keeps PowerPoint's built-in layout, which is better for the user (it is PowerPoint's own).\n\n### What OPF writes\n\nThe definition is a table of explicit constraints, the one form PowerPoint lays out with no algorithm of its own (the SH-19 spike,\nthrough COM):\n\n- a `composite` root with one `if` branch per entry count, 1 to 12 (`func=\"cnt\"`; SH-23); each branch places every node with `l`, `t`, `w` and `h`\n constraints as shares of the frame's width and height, so the design scales with the frame when it is resized in PowerPoint;\n- a hidden full-frame child (`shape type=\"rect\" hideGeom=\"1\"`) in every branch: without one, PowerPoint moves a drawing whose shapes do\n not reach the frame's edges to the frame's center;\n- every entry a `forEach axis=\"ch\" ptType=\"node\" st=\"i\" cnt=\"1\"` with its node: a `tx` node in the design's preset (`roundRect` with the\n design's corner, `chevron` with its point, `ellipse`), or, where the text is not in the preset's own text rectangle (beside a stepped\n pyramid's level), a shape and a text-only node (`revTx`, no fill or line) at the entry's text rectangle;\n- every arrow the transition after its node (`forEach axis=\"followSib\" ptType=\"sibTrans\" cnt=\"1\"`, `hideLastTrans=\"0\"` for a loop's\n closing arrow): an axis-aligned arrow a `rightArrow` turned by `rot` (0, 90, 180 or 270 degrees, which PowerPoint keeps); any other arrow\n a `conn` connector between the two node centers (`begPts`/`endPts` `ctr`) with its pads and thickness in millimeters;\n- every entry's text at OPF's size: the data model's run `sz` (with `custT=\"1\"`, so PowerPoint never fits it again) and a `primFontSz`\n constraint at the same size for an entry added in PowerPoint; the margins as shares of the size (`lMarg` and the others,\n `refType=\"primFontSz\"`); the composed count's entries anchored at the top (`txAnchorVert` `t`) with the top margin where OPF's\n composition starts the entry's first line, so PowerPoint sets the lines where OPF's native text export does (centering the block,\n PowerPoint's line metrics put it up to a pixel off);\n- the tables of every other count, from the same design at the same frame (core `opfLayoutGeometry`), so a node added or deleted in\n PowerPoint keeps OPF's design. OPF draws at most 8 entries, but the definition carries tables up to 12 (`OPF_LAYOUT_TABLES`, SH-23),\n so a ninth to twelfth entry a PowerPoint user adds is drawn in OPF's design at the same frame; more than 12 take the 12-entry table under\n names of their own (`x...`, the entries past 12 not drawn until one is removed). A design whose larger tables do not hold (a node outside\n the frame) keeps tables up to 8.\n\nEvery name of a layout node or `forEach` is unique in the definition: PowerPoint rejects a definition that repeats one (it opens the\nSmartArt on Basic Block List instead). The identity is OPF's: the `uniqueId` is `urn:openpresentation.org/smartart/layout/<design>/<digest>`\n(the design's name, `-compact` for a compact form, and a 64-bit digest of the definition's body), the title and description are the\ndesign's (`OPF Stepped Pyramid`, `OPF Card Grid`, `OPF Snaking Flow`, `OPF Chevron Rows`, `OPF Snaking Vertical Flow`, `OPF Cycle Ring`,\n`OPF Cycle Loop`, `OPF Cycle Loop of Three Rows`, `OPF Quadrants`), in the category of the arrangement (`pyramid`, `list`, `process`,\n`cycle`, `matrix`). The digest is there because PowerPoint keeps the first definition it loads for a `uniqueId` for the rest of its\nsession: in the sweep, a deck opened after another with the same `uniqueId` and other tables was drawn with the first deck's tables. Two\nexports of one design at one frame share a `uniqueId`; within one file, two frames with one `uniqueId` and different content each use\ntheir own part. The data model's `loTypeId` names the definition, and the frame's `r:lo` names the layout part. The style labels are\nOPF's colors part's: the nodes `node1` (a card `alignNode1`, the card neutral with its border, the outline's width on each entry's\n`spPr`), the text-only nodes `revTx` (the slide's text color) and `fgAcc1` (the color that reads on the primary), the arrows\n`sibTrans2D1`.\n\nThe export evaluates the definition with OPF's interpreter (core `evaluateLayoutDefinition`, `layoutArrangement`) and writes it only\nwhen the result is the composed design within 0.1 pt: the preview, the definition and PowerPoint then draw the same nodes.\n\n### OPF's interpreter\n\nCore's `smart-art-layout.ts` evaluates the subset of \xA721.4 OPF writes, as PowerPoint does: the layout node tree, `forEach` over the\nentries and their transitions (`st`, `cnt`, `hideLastTrans`), `choose`/`if` on the entry count, `composite` with `l`/`t`/`w`/`h`\nconstraints (shares of the root's `w` and `h`, or millimeters), PowerPoint's centering of a drawing that does not reach its frame's\nedges, `sp`, `tx` and `conn` (between centers), and shapes with their presets, adjustments and turns. A turned shape is PowerPoint's: the\nlargest-area rectangle at that angle inside its constraint box (at 45 degrees always a square), which is why OPF writes turned arrows as\nconnectors. It returns nodes and arrows in the shape of a composed arrangement (with the preset's text rectangle, or a text-only node's\nbox), so render and pptx have no second geometry path. It runs on the edge runtimes (no Node built-ins). Its unit test replays what\nPowerPoint drew through COM for OPF-written definitions (177 shapes: composite placement with and without the full-frame child, shapes\nturned by `rot`, connectors, the closing transition) within 0.001 pt.\n\nThe spike measured the other algorithms in OPF-written definitions too. Each evaluates, but none is a closed form: `lin` scales each axis\non its own and centers with a 0.1 to 0.4 pt offset; `snake` picks its own grid (up to 343 pt from the best-grid form); `cycle` searches\nthe node size (215 pt from the form its parameters describe); `pyra` keeps the levels to 0.67 of the width. OPF's definitions use none of\nthem.\n\n### In PowerPoint\n\nThrough COM (PowerPoint for Microsoft 365 on Windows 11): PowerPoint opens the SmartArt live on OPF's layout (`HasSmartArt`, the\nlayout's name and description, category as written, every entry a node of `AllNodes`); `Application.SmartArtLayouts` does not list it\n(the Change Layout gallery itself was not inspected: COM only). A node's text edited keeps OPF's size in every node and every node\nrectangle; an added node takes the next count's table and OPF's size (`primFontSz`; without it PowerPoint's 36 pt), deleted nodes the\nsmaller count's; Change Layout to Basic Block List and back (to the layout object read before) restores OPF's layout with every node\nwhere it was. A file saved again by PowerPoint keeps the layout part, rewritten but the same definition (PowerPoint adds empty sample,\nstyle and color data with `useDef`, leaves out attributes at their schema defaults, reorders attributes and writes the constraint factors\nto four decimals, a change of at most 0.00005 of the frame; normalized, the part equals OPF's), the same `uniqueId` and the same node\nrectangles on reopening (five designs checked); it drops SH-16's wrapper as for every SmartArt. OPF imports such a file back to the same\narrangement and list. With the `mc:Choice` requiring a namespace PowerPoint does not know, PowerPoint draws SH-16's fallback picture\n(mean difference 1.3 to 1.6 from the preview over the slide, as for the other live SmartArt). A definition PowerPoint\ncannot evaluate (a connector to a node of another name, in a build of this item) made PowerPoint take the `mc:Fallback` picture.\n\n### The domain of OPF's layouts\n\nThe export writes OPF's layout only for the instances the PowerPoint comparison passed (core `SMART_ART_OPF_DOMAIN`,\n`opfSmartArtUnavailable`):\n\n| | Passed |\n| --- | --- |\n| Designs and entries | the stepped pyramid 1 to 8, the card grid 1 to 6, chevron rows 6 to 8, the snaking flow 6 to 8, the snaking vertical flow 5 to 6 |\n| Text density | the entries' text (each line's width times the size) at most 7.5% of the frame |\n| Lines | at most 2 an entry, each break holding when the width changes by 4% (core fits every entry at both widths, as for PowerPoint's designs) |\n| Text | Latin script, left to right, with the run formatting of the other arrangements |\n| Line width | no line wider than 500 px, as for PowerPoint's designs |\n\nEverything else is native shapes, which look the same: OPF's cycles and quadrants (every instance of the sweep held its entries only\nabove the text density), the compact forms, right-to-left and Chinese or Japanese text, a row of chevrons pointing left (a layout\ndefinition has no mirrored shape), and list blocks (a SmartArt node holds no list).\n\n### The gate\n\nThe sweep of SH-09, SH-17 and SH-18 for all six arrangements: 1 to 8 entries, short, medium and long, on 16:9, 4:3 and 1:1 slides, an\nArabic and a Japanese deck of 3, 4 and 6 entries and decks of 2 and 4 list blocks of each, 468 decks, each exported live and as native\nshapes and drawn by PowerPoint; an instance passes on SH-09's checks (every node rectangle within 0.1 pt, arrows turned the same, equal\nsizes, no visible shape difference from the preview, within SH-07's native gate of the native export).\n\nWith the domain open (every OPF design live), 310 decks drew OPF's layout live. In the first pass PowerPoint laid 261 of them out where\nOPF's interpreter does; the other 49 were drawn with the tables of an earlier deck of the same `uniqueId` (the session's cache, hence the\ndigest). With the digest every one of the 310 laid out within 0.1 pt of the interpreter (largest difference 0.000 pt, arrows turned\nthe same) at OPF's size. The pixel checks then found what the domain keeps out: with the text centered in its node, PowerPoint set the\nlines up to a pixel off (mean difference from the native export up to 6 in dense frames); anchoring the text at OPF's first line halved\nthat, and of the 292 Latin instances every one at a text density of 7.5% or less with stable breaks passed (30), while above it some did\nnot (a mean difference of 1.01 at 8%, up to 3.3 in the densest), and every Japanese instance did not (text 11 px off). With the domain (and the 500 px line limit, which moved five built-in decks with a single long entry to OPF's design), 30\ndecks draw OPF's layout live and every one passes (node rectangles within 0.000 pt of the interpreter, sizes equal, no visible shape\ndifference, within SH-07's gate of the native export: a mean difference of at most 0.8 at a quarter size and 0.94 at full size, the\ntext's ink within 1.08 px); PowerPoint's built-in layouts draw 102 live decks, every one passing; OPF's design draws 271 decks and a card\ngrid 43 as native shapes, and 32 stay a list. The gate's shapes-versus-preview check leaves out each node's text rectangle grown by\n0.2 em up and down, so the preview's known text offset is not counted as a shape difference. The evidence (the gate table, sheets of preview, PowerPoint live and PowerPoint's drawing of the native export, labelled with\nthe design and the layout that drew it, and the COM records) is in the SH-19 folder of the shapes program.\n\n## Import\n\nA SmartArt OPF wrote (in `full` provenance it carries `OPF_SMARTART_V1`: the slide, the list path, the arrangement, the authored list\nand the text of every node) imports as its list on its layout again when its node texts are unchanged. An edited one, and a Basic\nPyramid, Basic Matrix, Basic Cycle, Basic Chevron Process, Basic Process or Vertical Process that PowerPoint wrote, import their data model's nodes: the points in `cxn` order (nested\nentries keep their `level`, SH-08), their text and run properties (bold, italic, underline, strike), as a list on the\n`pyramid`, `matrix`, `cycle`, `chevrons`, `flow` or `vertical-flow` layout (the one of the same arrangement; SH-19: a SmartArt on one of\nOPF's own layouts by its `uniqueId`, `urn:openpresentation.org/smartart/layout/<design>/...`, also after PowerPoint saved it again), with `smartart-edited` for an edited OPF SmartArt. The diagram's place on the slide is its frame's;\nthe nodes' geometry is the layout's again, as OPF draws it, so nothing of PowerPoint's layout is kept. Import never reads or stores a\nSmartArt layout part. A wrapped frame is read from its `mc:Choice`. A file in which only the fallback picture survived (an app without\nSmartArt saved it) imports the same way in `full` provenance: the picture carries `OPF_SMARTART_V1` too, with the media keys of its\nSVG and PNG, so a picture still named for its list whose SVG or PNG is the one written is that list on its layout again; a replaced\npicture reports `invalid-smartart-provenance` and imports as a picture, as does any fallback without the record. Native-shape arrangements (`OPF_ARRANGEMENT_V1` on every node) are the layout's\ndrawing: import consumes them and reads the measured lines as the list. Every other SmartArt imports as the next section says.\n\n### SmartArt PowerPoint users made (SH-08)\n\nAny SmartArt PowerPoint wrote imports with its text (`src/smart-art-import.js` in opf-pptx). Import reads the data model, not the\nlayout part:\n\n- **The outline**: the `parOf` connections from the doc point, in `srcOrd` order, as a tree of entries (nodes and an organization\n chart's assistants, `type=\"asst\"`). An entry left as a placeholder (no text and no explicit authored-text marker) gives its place to its children; an explicitly authored blank parent retains its children and level. A run's bold, italic,\n underline and strike are kept, a line break (`a:br`) is a newline and a field is its text. The paragraphs of one node are one entry,\n except on the `list` and `process` layouts, where each is an item of its own at the node's level: PowerPoint holds a Vertical Bullet\n List's or an Accent Process's bullets as the paragraphs of one child node (its object model adds no second child there).\n A node's title box is its entry's `description`: in a Name and Title Organization Chart PowerPoint stores the title on the sibling\n transition of the node's connection and presents it (`presOf`); a presentation point with text of its own (`custT`) is read the same way.\n- **The layout**: the doc point's `loTypeId`, then its category (`loCatId`).\n\nThen the first form that fits:\n\n| Layout | OPF |\n| --- | --- |\n| The known arrangement IDs (`pyramid1`, `matrix3`, `cycle2`, `chevron1`, `process1`, `process2`, `orgChart1`, `hierarchy1`, `venn1`) and OPF's own layouts | The list on that arrangement's layout, as above |\n| Inverted Pyramid (`pyramid3`), widest entry first | The list on the `inverted-pyramid` layout, retaining its order (the widest first), with `smartart-adapted`. The inverted arrangement exports as editable native shapes; it has no qualified live SmartArt domain. |\n| Another layout of those families: `pyramidN`, `matrixN`, `cycleN` (Text Cycle, Block Cycle...), any chevron layout (`chevron2`, `hChevron3`...); a layout of category `pyramid`, `matrix` or `cycle` | The list on the `pyramid`, `matrix`, `cycle` or `chevrons` layout, with `smartart-adapted` (info) |\n| The list family (category `list`: Basic Block List `default`, Vertical Bullet List `vList2`...) | The list on the `list` layout, with `smartart-adapted` |\n| The process family (category `process`, other than the arrangements above: Accent Process, Step Up Process...) | The list on the `process` layout, with `smartart-adapted` |\n| Other hierarchies and organization charts, or the known trees with assistants, separate roots or labeled edges (`orgChartN`, `hierarchyN`, the 2008 and 2009 organization charts; category `hierarchy`) | A Mermaid flowchart (`flowchart TD`, `flowchart LR` for a horizontal hierarchy): a node per entry, its description on a second line, an edge from each parent, dotted (`-.->`) to an assistant, the connection's own text as the edge's label; the outline as the diagram's `alt`; `smartart-adapted` |\n| Every other layout (other Venn, radial, target, funnel, gear, picture layouts...) | The drawing (`dsp:drawing`, which PowerPoint saves with every SmartArt) as overlay shapes, with `smartart-adapted`; without a drawing, the list on the `list` layout |\n\nNested entries keep their `level` in every list. Organization charts and hierarchies use those depths as parent links; the other arrangements draw one level, so a pyramid of nested entries draws as a list\n(`opf/arrangement-adapted` says so) with all of its text.\n\n**The drawing as overlay shapes.** The drawing's shapes are read by SH-05's reader ([shapes](shapes.md)), in a group that places the\ndrawing's space on the SmartArt's frame, so each is an overlay shape with its preset, fill, line, effects and text, in PowerPoint's\nz order at the frame's place. PowerPoint sets a SmartArt shape's text in a rectangle of its own (`dsp:txXfrm`): where it lies inside\nthe shape's own text rectangle, the difference is the shape's `padding`; where it does not (a Venn circle's text across the overlap,\ntext beside a shape), the shape is drawn without text and a text-only overlay (no fill, no line, style `none`) holds the text at\nPowerPoint's rectangle. Text in another color than the slide's text color keeps it (the style's `fontRef`). The first shape carries the\noutline as its alt text (`SmartArt (venn1):` and an entry a line, indented a level by two spaces). The no-op color transforms and empty\n3-D element PowerPoint writes on every SmartArt shape are not reported as dropped properties; anything else SH-05 does not keep is\n(`shape-property-dropped`).\n\n**Nothing dropped silently.** What the OPF form does not keep is a finding naming it:\n\n| Finding | When |\n| --- | --- |\n| `smartart-text-dropped` (with `text`) | Text on a transition (a connection's own text, other than an organization chart's edge label or a presented title box), text on a presentation point that belongs to no entry, or an entry no connection reaches |\n| `smartart-picture-dropped` | An entry's picture fill (a picture layout), in every form but the drawing |\n| `smartart-formatting-dropped` | Bold, italic, underlined or struck-through text in a hierarchy (Mermaid labels carry none); the text is kept |\n| `smartart-adapted` (with `form`: an arrangement, `list`, `process`, `diagram` or `shapes`) | A layout imported as anything other than the arrangement OPF writes for it |\n| `smartart-connection-dropped` | Connections to an entry that already has a parent (or to its own ancestor): each entry is imported once, under the first parent that reaches it |\n| `smartart-limited` (with `limit`: `depth` or `entries`) | An outline more than 64 points deep or longer than 10,000 entries: the drawing, or without one the entries as a flat list (the first 10,000) |\n| `smartart-unreadable` | A data model or drawing that cannot be read: the frame imports as any other graphic frame, or the drawing adds no shapes |\n\nEvery finding has the layout (`layout`, the last segment of `loTypeId`) and the slide's path. A SmartArt with no text and no drawing\n(only placeholders) imports as nothing.\n\n**Evidence.** `packages/pptx/test/fixtures/powerpoint-smartart.pptx` is PowerPoint-made (COM, PowerPoint for Microsoft 365 on Windows 11,\n2026-11-07): 17 layouts (Basic and Inverted Pyramid, Basic Matrix, Basic and Text Cycle, Basic Chevron Process, Basic, Vertical and\nAccent Process, Basic Block List, Vertical Bullet List, Basic Venn, Basic Radial, Organization Chart, Hierarchy, Horizontal Hierarchy and\nName and Title Organization Chart), each added from a seed deck OPF writes (`make-smartart-seeds.mjs`: this PowerPoint build gives\nscripts no `SmartArtLayouts` list, so each layout is a seed graphic's `SmartArt.Layout`) and filled through `SmartArt.Nodes`;\n`powerpoint-smartart.json` is PowerPoint's own reading of every node. Every node's text imports, with no `smartart-text-dropped`.\nA slide whose SmartArt became overlay shapes has only its title besides them. Overlay shapes whose bounds cover at least a fifth of the\nslide (core `overlaysDrawBody`, `OVERLAY_BODY_SHARE`; front layer, placed by fractions) are the slide's body, so its title is a content\nslide's, on top, not a cover's centered over the shapes; a badge on a cover leaves the cover as it was. This holds for any slide, authored\nor imported (`examples/technical/shape-overlays.opf.json` slide 5's title moves to the top).\n\nSH-23: custom layout text algorithms set their LTR/RTL paragraph alignment defaults, so newly added nodes keep the design's alignment without a script changing their formatting after the edit.\n\nSH-23 qualification: five in-domain OPF designs retain an added ninth node and a text edit through SaveCopyAs/reopen, with unchanged font sizes, correct paragraph/first-line alignment and maximum geometry error0.0000876pt. The native text algorithms explicitly preserve start or center alignment for newly added nodes, which have no authored paragraph properties. [Raw qualification and limits](programs/shapes/sh23-2026-11-07/README.md) retain the initial visual failure and all corrected witnesses.\n\n## Inverted pyramids\n\nUse the `inverted-pyramid` layout to narrow from a broad starting pool to a final choice. A custom pyramid region sets `pyramidDirection: \"down\"`; `\"up\"` is the existing default. The first entry stays at the top, so a downward pyramid starts wide and ends at the tip. Both the continuous outline and the stepped design use core geometry; neither reverses the text order or reduces the text size. PowerPoint export uses editable native shapes with a located `smartart-unavailable` finding. Live `pyramid3` and downward OPF layout definitions remain unqualified. Import maps an Inverted Pyramid to this layout while reporting its adapted styling. See [the example](../examples/technical/inverted-pyramids.opf.json).\n\n### Completed domain audit for 0.34 (SH20/22)\n\nThe expanded diagnostic sweep contains 516 instances, including 465 forced-live observations. Replaying the unchanged gate on the original sealed PPTX, PNG and native probes with the current core interpreter reproduces every original metric and result: 201 full passes and 264 failures. All 465 node rectangles, rotations and font sizes agree; every failure includes native pixels/text, and three dense cases also wrap an extra line outside the node. Current shipped predicates admit 132 of these cases (102 built-in and 30 OPF-layout instances), all passing. These diagnostic measurements do not make every isolated passing case a safe domain.\n\nThere is no additional safe live domain under the current text-density, stable-wrap, two-line and 500 px line-width limits. Ignoring only design/count/compact restrictions still leaves exactly the same 30 OPF-layout candidates. Ring/loop cycles, quadrants and compact forms therefore retain editable native-shape output and `pptx/smartart-unavailable`; the live domain does not expand in 0.34.\n\nChinese/Japanese and Arabic/Hebrew remain outside live eligibility. Their complete measured live scopes are 18 Japanese, 18 Chinese, 15 Arabic and 15 Hebrew cases; the few passing Arabic/Hebrew instances do not qualify their other frames or text densities. Measured font slots agree, but visible baseline/horizontal offsets remain. Single-spacing and paragraph-marker experiments did not fix them and were rejected. The export preserves editable shapes/text at OPF's composed size with the explicit native-SmartArt refusal. No per-language coordinate adjustment, font-policy change or relaxed gate hides the remaining live limitation."
375
+ "markdown": "# Pyramids, matrices and live SmartArt\n\nSeveral layouts of the default catalog draw a list as a diagram: `pyramid` (levels that build on each other, the first entry at the top),\n`matrix` (four parts of a whole, or the four cases of two choices, as quadrants), `cycle` (steps that repeat, as a loop; see\n[Cycles](#cycles-sh-18)) and [`chevrons`, `flow` and `vertical-flow`](#chevrons-and-flows) (stages or steps in order). The PowerPoint export writes them as **live\nSmartArt** where PowerPoint lays the SmartArt out exactly as the preview draws it (PowerPoint's designs on its built-in layouts, OPF's\nown designs on [OPF's own layout definitions](#opfs-own-layouts-sh-19)), and as the same drawing in native shapes everywhere else. A slide on either layout never turns into a stray bullet list: the arrangement has a second design of its own, drawn when\nPowerPoint's does not hold the entries.\n\n```json\n{ \"layout\": \"pyramid\", \"title\": \"Our strategy\", \"items\": [\"Vision\", \"Goals\", \"Programs\", \"Teams\"] }\n```\n\n```json\n{ \"layout\": \"matrix\", \"title\": \"Four markets\", \"items\": [\"Enterprise\", \"Mid-market\", \"Consumer\", \"Public sector\"] }\n```\n\n## The arrangement of a region\n\nA layout record's region takes `arrangement: \"pyramid\"` or `\"matrix\"` ([layout templates](layout-templates.md)). When the region holds\none list of one level (no nested entries, no descriptions, no icons, no `numbering`), composition draws it as that diagram\n(`SlideComposition.arrangements`, core `arrangements.ts`), in the first of these designs that holds every entry:\n\n| Design (`design`) | Pyramid (1 to 8 entries) | Matrix |\n| --- | --- | --- |\n| PowerPoint's (`smartart`), where the PPTX export can write it as live SmartArt (the [domain](#the-domain)) | Basic Pyramid: level i of n is H/n tall and W\xB7i/n wide, the apex a triangle, the entries centered on their levels | Basic Matrix, for exactly four entries: four rounded squares in a centered square over a diamond, the entries centered |\n| OPF's own (`opf`), where PowerPoint's does not hold the entries at the list's size or lies outside the domain | a stepped pyramid of rounded bars at the start of the region (level i is i/n of the steps' width), each entry beside its level in one column, start-aligned | four rounded quadrants filling the region two by two (rectangular where the region is), the entries centered |\n| A grid of cards (`cards`), for a matrix of other than four entries | \u2014 | one card per entry in the card neutral, in the grid that holds the text largest (one column of wide cards, or a balanced grid), start-aligned; reported as `opf/arrangement-adapted` (info): a matrix needs four entries |\n\nWhen none of them holds the entries, or the list has a shape the arrangement does not draw (nested entries, descriptions, icons,\nnumbering, more than 8 levels or 8 cards), the list draws as a list and `opf/arrangement-adapted` (info) says why. A list that no design\nholds still fills the region (SH-18 review, for every arrangement): its text takes the largest size from 1.5 times the role size down to\nthe size it has at which the whole list fits the region, and it sits in the middle of the region's height (LH-48's body growth leaves a\nlist alone once it covers half the body).\n\n**List blocks as entries (SH-18 review).** A region whose arrangement holds two or more list blocks draws each block as an entry, its\nlist inside, the same way for every count: a cycle's blocks on cards on OPF's ring or loop (whichever holds them larger) with an arrow\nfrom each to the next, a matrix's on a grid of cards, a pyramid's beside the levels of OPF's stepped pyramid. Every list keeps its\nmarkers, is start-aligned and vertically centered in its card, and all are set at one size, the largest from 1.5 times the role size\ndown to the lists' own size at which every block fits without a broken word. Where a pyramid's levels or a cycle's ring and loops do not\nhold the lists, the blocks are a grid of cards, with `opf/arrangement-adapted`; lists that overflow their region keep its composition,\nwhich pagination splits. The cards are native shapes (a SmartArt node does not hold a list), and a region with an arrangement keeps its\nwhole cell when LH-48 centers an under-filled body, so the diagram fills it. A matrix never draws\nan empty quadrant.\n\nPowerPoint's geometry was measured through COM for its Basic Pyramid (`pyramid1`) and Basic Matrix (`matrix3`) layouts:\n\n| | Pyramid | Matrix |\n| --- | --- | --- |\n| Frame | the region's cell, at most 2.5 times as wide as tall (a wider cell centers such a frame) | the region's cell |\n| Nodes | level i of n (from the top) is H/n tall and W\xB7i/n wide, centered; the sides continue one slope, so the top level is a triangle and every other a trapezoid (DrawingML `trapezoid`, `adj` = W/(2n) over the smaller side) | a square of side min(W, H) centered in the frame holds a diamond and four rounded squares (`roundRect` at its default corner) 0.39 of its side, 0.095 in from its edges and 0.03 apart, in the order top left, top right, bottom left, bottom right |\n| Text rectangle | the top level's whole box; 0.65 of a lower level's width, centered, at its full height | the rounded square's own text rectangle |\n| Text margin | 0.1 of the font size on every side | 0.3 of the font size on every side |\n| Look | every level in the primary color (`accent1`) with a 1.5 pt outline in the background color (`bg1`) | the quadrants as the levels, over a diamond in the primary lightened 80% (`lumMod 20000`, `lumOff 80000`) |\n\nOPF's designs use the same paint (the cards use the card neutral and its border, as every OPF card); text on a node is in whichever of\nthe background and the text color reads better on the primary, text beside a level or on a card in the slide's text color.\n\nThe text of every node is one size, in every design: the largest from 1.5 times the list's role size (36 pt on a 16:9 slide) down to the\nrole size (24 pt) at which every entry fits its rectangle without breaking a word, and the ink of every line stays inside its node's\noutline (the top of a pyramid level is narrower than its base). The list's own size counts when it is smaller (a crowded slide), never a\nsize below it. The arrangement fills its region, so the growth a lone list takes when it fills too little of the body (LH-48) is not the\nsize it keeps. Centered lines are centered without the space they broke at, as PowerPoint wraps them.\n\n## Trees and set overlap (SH-21)\n\nUse `org-chart` for reporting lines, `hierarchy` for a classification or work breakdown, and `venn` for overlapping sets. Their geometry is shared between the preview and editable native PowerPoint shapes. Tree connectors follow the authored parents. Hierarchy uses paired rounded cards with a 90% opaque foreground; Venn uses 50% opaque circles so overlaps remain visible.\n\nA tree is one list of up to eight short entries in preorder. The first entry has level zero (explicitly or by default); each child supplies its zero-based `level`. A node may return to any earlier parent depth, but may not skip a depth or introduce another level-zero root. For example:\n\n```json\n{ \"layout\": \"org-chart\", \"title\": \"Give each team a clear owner\", \"items\": [\n { \"text\": \"Lead\", \"level\": 0 },\n { \"text\": \"Build\", \"level\": 1 },\n { \"text\": \"Web\", \"level\": 2 },\n { \"text\": \"App\", \"level\": 2 },\n { \"text\": \"Ship\", \"level\": 1 }\n] }\n```\n\nAn org chart's assistant (a chief of staff, an executive assistant) is an entry with `\"assistant\": true`, written among its manager's reports at their level. As in PowerPoint's organization chart, it hangs off the line below its manager, one row down and to the right of that line, joined to it by a short elbow; the reports start a row lower, so an assistant costs the height of one more level. A manager may have several assistants, one a row. An assistant has no reports of its own, the root is never one, and it counts toward the eight nodes. `hierarchy` has no assistant position: a hierarchy, or any other arrangement, with an assistant keeps the complete list with `opf/arrangement-adapted`.\n\n```json\n{ \"layout\": \"org-chart\", \"title\": \"Give the pilot lead a chief of staff\", \"items\": [\n { \"text\": \"Pilot lead\", \"level\": 0 },\n { \"text\": \"Chief of staff\", \"level\": 1, \"assistant\": true },\n { \"text\": \"Delivery\", \"level\": 1 },\n { \"text\": \"Evidence\", \"level\": 1 }\n] }\n```\n\nUse `venn` with one flat list of one to seven set labels. One to four circles hold their labels inside. Five to seven sets use enlarged editable circles with outside labels fitted from the actual font measurements. This OPF adaptation preserves circle overlaps and set order while filling more of the body at the previous type size or larger. Basic Venn native measurements remain a separate, unqualified live reference. When the overlap cannot keep every label readable, the complete set labels use opaque cards or a list with `opf/arrangement-adapted`. Venn fallback lists try a bounded whole-word reading measure of70characters at the retained type size. If the complete list cannot fit that measure in the body, `opf/text-overflow` reports the refusal; strict composition rejects it. Explicit pagination or shorter labels resolves that limit. Entry order identifies the sets; the diagram implies no numeric overlap values.\n\n```json\n{ \"layout\": \"venn\", \"title\": \"Three conditions for a useful pilot\", \"items\": [\"Clear scope\", \"Evidence\", \"Shared goal\"] }\n```\n\nTo name where all the sets meet, which is usually the point of the slide, add one last entry with `\"overlap\": true`. It labels the common overlap of two to seven sets and is not a set itself: it is drawn on an opaque pill in the slide's background color with the primary outline, over the circles, at the size of the set labels. The pill sits on the center of the common overlap; where a set label is in the way, it moves up or down the shortest distance that clears every set label while it still reaches into the overlap, and its text wraps onto more lines if that is what keeps it clear. When no position holds it at the list's size or larger, the complete list is kept with `opf/arrangement-adapted`; a Venn of five to seven sets with an overlap label never falls back to cards, since a card holds a set, not their overlap. More than one overlap label, one that is not last, one with fewer than two sets, or one in another arrangement keeps the complete list with `opf/arrangement-adapted` too.\n\n```json\n{ \"layout\": \"venn\", \"title\": \"Where the pilot earns its keep\", \"items\": [\n \"Clear scope\", \"Evidence\", \"Shared goal\",\n { \"text\": \"Ready to scale\", \"overlap\": true }\n] }\n```\n\nThe arrangement keeps the previous fitted list size or grows. A malformed tree, unsupported forest, nested Venn, descriptions, icons, numbering, too many entries or labels that do not fit keeps the complete list with `opf/arrangement-adapted`; no entry is dropped or silently reparented. Use a diagram for relationships outside the single-root model. These three layouts currently export as editable native shapes; live SmartArt remains outside their qualified domain. An assistant is a rectangle like the other nodes and its elbow two line segments; the overlap label is a rounded rectangle (`roundRect`, fully rounded) with its text in a text box over it. Each node's tag records `assistant` or `overlap`, so `fromPptx` puts the field back on its entry. Import recognizes native Organization Chart (orgChart1), Hierarchy (hierarchy1) and Basic Venn (venn1), preserving tree depths. Native assistants, forests or labeled edges use the reported Mermaid hierarchy adaptation instead. A drawing with additional labels beyond the data entries keeps its overlay drawing and reports the adaptation, preserving that extra text.\n\n[The trees and sets example](../examples/technical/trees-and-sets.opf.json) contains the three layouts, an org chart with an assistant and a Venn with an overlap label.\n\n## Chevrons and flows\n\nThree more layouts draw a list of stages or steps in order (SH-17): `chevrons` (a row of chevrons, each leading into the next), `flow`\n(boxes joined by arrows in one row) and `vertical-flow` (the same as a column, beside the title). Each is a region's `arrangement` of the\nsame name, with the same rules as a pyramid's: one list of one level, 1 to 8 short entries, one size for every node, never below the\nlist's role size.\n\n```json\n{ \"layout\": \"chevrons\", \"title\": \"How we work\", \"items\": [\"Plan\", \"Build\", \"Test\", \"Ship\"] }\n```\n\n| | Chevrons (Basic Chevron Process, `chevron1`) | Flow (Basic Process, `process1`) | Vertical flow (Vertical Process, `process2`) |\n| --- | --- | --- | --- |\n| Frame | the region's cell | the region's cell | the region's cell |\n| Nodes | n chevrons of width w = s(n) W, height min(0.4 w, H), each 0.9 w after the last (the point of one in the notch of the next), the row centered | n boxes of width w = s(n) W, height min(0.6 w, H), each 1.4 w after the last, centered | n boxes of height h = s(n) H, width min(1.8 h, W), each 1.5 h below the last, centered |\n| Shape | DrawingML `chevron` at its default adjustment (the point half the height deep) | `roundRect` at adjustment 10000 | the same |\n| Arrows | none | a `rightArrow` (stem 0.6 of its height, the default head) 0.212 w long and 0.248 w tall, 0.1 w after the box before it, on the frame's middle | a `rightArrow` turned 90 degrees, 0.45 h wide and 0.375 h long, in the middle of the gap |\n| Text rectangle | the chevron's own, between its notch and its point | the rounded rectangle's own | the same |\n| Text margin | 0.315 of the font size at the start, 0.105 on the other sides | 0.3 of the font size on every side | the same |\n| Look | every chevron in the primary with a 1.5 pt outline in the background color | the boxes as the chevrons; the arrows in the primary lightened 40% (`lumMod 60000`, `lumOff 40000`), without an outline | the same |\n\nPowerPoint fits these layouts with a binary search on one scale and keeps the last step that fits, so a node is not the closed form\nW / (0.9 n + 0.1) wide but a multiple of 1/8192 of the frame that depends only on the node count: s(n) (core `SMART_ART_SCALES`) is, in\n1024ths of the frame, 1024, 538, 365.5, 276.5, 222.5, 186, 160 and 140.25 for 1 to 8 chevrons, 1024, 426.5, 269, 196.75, 155, 128,\n108.875 and 94.75 for boxes in a row, and 1024, 409.5, 256, 186, 146.25, 120.375, 102.375 and 89 (of the frame's height) for boxes in a\ncolumn. Two chevrons at 800 pt are 420.31 pt wide where the closed form gives 421.05. One node squeezed by the other side of the frame\n(a chevron in a frame less than 0.4 times as tall as wide) is 1023/1024 of the frame and as tall as it. The COM sweep measured 1 to 10\nnodes of each in 20 frames from 250 x 120 to 800 x 540 pt; core places every node and arrow within 0.0001 pt of PowerPoint in all of them\nbut those where PowerPoint's 8 pt test letter did not fit a node (a node a few points tall), whose text made the node grow.\n\nPowerPoint's design is drawn where it holds the entries at the list's size and lies in the [domain](#the-domain); else OPF's own design\nof the arrangement, filling the region:\n\nOPF's design keeps PowerPoint's proportions, so the two read as one family: a chevron 0.9 widths after the last (its point at\nmost 0.2 of its width deep), a box 0.4 widths after the last with PowerPoint's arrow (0.212 x 0.248 of a box's width) in the room, a\nvertical box half its height below the last with a down arrow 0.45 x 0.375 of its height. The entries go into one to four rows (a\nvertical flow: columns), whichever holds the text largest (one line on a tie), as evenly as possible, the longer lines first. The text\nis one size for every node, the largest from 1.5 times the list's role size down to the role size at which every node holds its entry;\nthen every node takes the height that text needs with its margins (0.15 em above and below a box's text; PowerPoint's proportion at\nleast: a chevron 0.4 of its width, a box 0.6, a vertical box 1/1.8), and the whole is centered in the region. Only where none of these\nholds the entries at the list's size does OPF draw a compact form of the same design (rooms of two gaps, the arrow 0.6 of the\nroom, a chevron's point 0.12 of its width deep, no least height), so a list is left a list only when no design holds it. Every row spans the region: a row of fewer entries widens them (a\ncolumn of fewer lengthens them).\n\n- **chevrons**: each row a run of chevrons, left to right; a wrapped row breaks after a chevron's point and the next row starts again\n at the left, full width, so the points carry the order;\n- **flow**: the rows snake: the second runs right to left under the first, joined by a down arrow under the end where the first stops,\n the third runs left to right again, and so on;\n- **vertical flow**: the columns snake the same way: the second runs bottom to top, joined by a right arrow at the bottom.\n\nA right-to-left deck mirrors the designs: the first chevron or box is at the right, the chevrons point left (`flipH`) and the arrows\nturn.\n\nTwo or more list blocks in the region are the entries themselves, as SH-18 draws them for a cycle: each block on a card of OPF's\nchevrons or boxes (the card neutral and its border), with the arrows between them, its list kept with its markers, start-aligned and\nat one size for all, the largest from 1.5 times the role size at which every card holds its list without breaking a word; the cards\nthen take the height of the tallest list. Where no row or column holds them, a grid of cards does (`opf/arrangement-adapted`), and\nwhere nothing does, the blocks keep the region's composition, which pagination splits. A SmartArt node holds no list, so these are\nnative shapes, with `pptx/smartart-unavailable` saying so.\n\n## In PowerPoint\n\n`toPptx(deck, { smartArt })` (CLI `--smart-art <live|shapes>`) takes the first that fits, as the owner decided for SmartArt:\n\n1. **Live SmartArt** (`\"live\"`, the default), for PowerPoint's design where the instance lies in the domain below. The slide holds a `p:graphicFrame` of the\n diagram (`dgm:relIds`) inside an `mc:AlternateContent` whose `mc:Fallback` is OPF's picture of it ([in other apps](#in-other-apps)), and the package:\n - the data model (`ppt/diagrams/dataN.xml`): the `doc` point names the layout (`loTypeId` pyramid1, matrix3, chevron1, process1 or process2) and OPF's own quick\n style and colors (`qsTypeId` `urn:openpresentation.org/opf/smartart/quickstyle/flat`, `csTypeId`\n `urn:openpresentation.org/opf/smartart/colors/primary`); one point per entry, marked `custT=\"1\"` so PowerPoint keeps the run size\n (and sets the text margins from it) instead of fitting the text again; runs with OPF's size, typeface and language; each paragraph\n centered at OPF's line pitch with no space before or after; one `cxn` per entry from the doc point, in entry order;\n - OPF's colors and quick style parts, whose style labels cover every label the five layouts use (`node0`, `node1`, `bgShp`, `revTx`\n and the transition labels: a label a part leaves out renders black; `sibTrans2D1`, a flow's arrows, is the primary lightened 40%\n without a line), in the theme's scheme colors, so a theme change in PowerPoint\n recolors the SmartArt;\n - a drawing part built from OPF's geometry (`ppt/diagrams/drawingN.xml`), for readers that show the cached shapes;\n - **no layout part** for PowerPoint's design: OPF never writes Microsoft's layout definitions. `r:lo` is empty, and PowerPoint resolves\n its built-in layout from `loTypeId` (see [the layout relationship](#the-layout-relationship)). OPF's own designs are live on [OPF's own\n layout definitions](#opfs-own-layouts-sh-19), which the package carries;\n - the fallback picture: an SVG (`asvg:svgBlip`) over its PNG raster, the picture path SH-07's diagrams use.\n\n Live SmartArt needs that picture, so it needs opf-render (an optional peer) to draw the slide and an SVG rasterizer for the PNG (the\n default in Node is opf-render's; a browser passes `svgRasterizer`). Without either the arrangement is written as native shapes and\n `smartart-unavailable` says so.\n SH-19: OPF's own design of an arrangement, and a matrix's card grid, is live SmartArt on OPF's own layout definition of that design\n where [its domain](#the-domain-of-opfs-layouts) holds ([OPF's own layouts](#opfs-own-layouts-sh-19)).\n2. **Native shapes**: OPF's design and a card grid outside the domain of OPF's layouts, PowerPoint's design outside its domain, and\n everything with `\"shapes\"`. The diamond and\n the nodes are presets (`diamond`, `trapezoid` with core's adjustment, `roundRect`; SH-17: `chevron` with core's adjustment, mirrored\n with `flipH` in a right-to-left deck, and a flow's arrows as `rightArrow` with core's two adjustments, turned with `rot`) at core's boxes, under the list's measured lines,\n tagged `OPF_ARRANGEMENT_V1`. OPF's design and PowerPoint's outside the domain report the info finding `pptx/smartart-unavailable`\n with the reason (`reason` in the diagnostic); a card grid reports core's `arrangement-adapted`.\n\nBoth look the same as the preview: the shapes are exact, and the text is where OPF's native text export puts any text.\n\n### In other apps\n\nMany apps that open PPTX files do not lay SmartArt out. Each live SmartArt is therefore written as an `mc:AlternateContent` (ECMA-376\nPart 3, markup compatibility): the `mc:Choice` holds the SmartArt frame and requires the namespace\n`http://schemas.microsoft.com/office/drawing/2016/12/diagram` (prefix `dgm1612`, Office 2016's SmartArt extensions), and the\n`mc:Fallback` holds a picture with the same id and name, at the same frame grown by its bleed on every side. **PowerPoint** understands the namespace and shows the live SmartArt.\n**Every other app**, one that does not claim the namespace, takes the fallback and shows OPF's own drawing: the preview of that frame\n(opf-render's SVG of the slide, cut to the arrangement and its entries, the text as glyph outlines in the deck's fonts when the export\nhas the fonts handle), transparent around the drawing, as an SVG with a PNG raster at 192 dpi of the frame for apps without SVG. The\nbleed is how far the preview draws outside the frame: half of the nodes' outline, and further at a pyramid level's miter-joined corners\n(its base corners reach 2.6 px past a 16:9 frame), plus a pixel of antialiasing, so the picture draws everything the preview draws. With\n`typefaces: \"safe\"` the picture is laid out and drawn in the Office-safe families the export writes and lays the nodes out with (Arial\nfor the default Aptos), not the preview's. Its\nalt text is the outline, one entry a line in entry order (`Pyramid of 4 levels, top to bottom:` then each level). SH-09's drawing part\nstays in the package for readers that draw the cached SmartArt shapes.\n\nThe namespace was chosen through COM (PowerPoint for Microsoft 365 on Windows 11, 2026-11-06), on a pyramid and a matrix whose\n`mc:Choice` required each candidate in turn: `dgm1612` (2016/12 diagram), `dgm1611` (2016/11 diagram), `dgm14` (2010 diagram),\n`dsp` (2008 diagram drawing), `dgm` (the ECMA diagram namespace) and `p14` (PowerPoint 2010) all opened as live SmartArt\n(`HasSmartArt`, Basic Pyramid or Basic Matrix, every entry a node, the slide exported as the SmartArt); a namespace PowerPoint does not\nknow took the fallback, which PowerPoint drew as the preview does (mean pixel difference 1.27 and 1.14 of 255 over the slide). The\nchosen namespace is the narrowest of those: only Office's SmartArt uses it, whereas an app that reads the ECMA diagram markup or the\ncached drawing, or claims the PowerPoint 2010 extensions, could claim the others without laying SmartArt out. No third-party app was\nrun (LibreOffice and the Open XML SDK were not installed); the pptx tests check the markup with a markup-compatibility reader that does\nnot know the namespace, which takes the fallback picture and finds a well-formed SVG and a PNG.\n\n**Saved again in PowerPoint**, the file keeps the live SmartArt (COM: `SaveCopyAs`, reopened, `HasSmartArt` and every node) but not\nthe wrapper: PowerPoint writes the bare SmartArt frame and its own drawing and layout parts, and drops the fallback picture and its\nmedia. Other apps then see what any PowerPoint-saved SmartArt gives them, typically its cached drawing. Import reads the file as\nbefore.\n\n### What PowerPoint does on edit\n\nPowerPoint lays a SmartArt out again from its data model whenever it opens or changes it; it never shows the cached drawing. A\nSmartArt OPF wrote opens as live SmartArt (COM: `HasSmartArt`, the layout, one node per entry in `AllNodes`), and Change Layout\nswitches it to another SmartArt layout. When a node's text is edited, PowerPoint keeps OPF's explicit size for every node (it does not\nshrink the text to fit), keeps the node rectangles, and wraps the text in the node with its own line breaker.\n\n### The domain\n\nThe PPTX export writes live SmartArt only for the instances the PowerPoint comparison passed (core `SMART_ART_DOMAIN`,\n`smartArtUnavailable`):\n\n| | Pyramid | Matrix |\n| --- | --- | --- |\n| Entries | 1 to 5 (6 to 8 levels never fitted the list's role size in the compared frames) | 1 to 4 |\n| Frame proportions (width over height) | 1.1 to 2.3 (the 16:9, 4:3 and 1:1 slides gave 2.26, 1.64 and 1.17) | 0.8 to 1.2 (16:9 and 4:3 gave 1.13 and 0.83; the 1:1 slide's 0.58 is outside) |\n| Lines | at most 2 for an entry and 6 for all of them, each break holding when the width changes by 4% (core fits every entry at both widths) | the same |\n| Text | Latin script, left to right; runs bold, italic, underlined or struck through only (no links, citations, code or sizes of their own); no line breaks or tabs | the same |\n| Line width (SH-19) | no line wider than 500 px: PowerPoint measures a line up to about 0.6% wider or narrower than OPF, and a centered line moves by half the difference (the SH-19 sweep: a one-level pyramid's 537 px line sat 1.74 px from OPF's native text, outside SH-07's 1.5 px; every line of 440 px or less was within it); it applies to every arrangement and to OPF's own layouts, and such an instance draws OPF's design | the same |\n\nEverything else (Arabic, Hebrew and Japanese text, longer or tighter entries, other proportions) is written as native shapes, which look\nthe same as the live SmartArt; the finding names the first reason.\n\n### The gate\n\nThe domain comes from a PowerPoint sweep through COM (PowerPoint for Microsoft 365 on Windows 11, read-only, visible and minimized, quit\nafter each batch): a pyramid of 1 to 8 entries and a matrix of 1 to 4, with short, medium and long entries, on 16:9, 4:3 and 1:1 slides,\nand an Arabic and a Japanese deck of each, 112 decks. The Latin decks use Source Sans 3, which OPF bundles and the comparison machine has\ninstalled, so the preview and PowerPoint draw one font. Each deck was exported twice, live (`smartArt: \"live\"`) and as native shapes\n(`\"shapes\"`), and both files were drawn by PowerPoint at the canvas's pixel size. An instance passes when:\n\n1. PowerPoint opens it as live SmartArt of the right layout with every entry as a node;\n2. every node rectangle PowerPoint lays out (`GroupItems`) is within 0.1 pt of core's;\n3. every node's font size in PowerPoint equals OPF's;\n4. the shapes show no visible difference from the preview (no 16 px block of the shapes' area outside the text whose mean differs by more\n than 24/255);\n5. PowerPoint draws the live SmartArt as it draws OPF's native export of the same slide, within SH-07's native gate (mean absolute\n difference at most 1 at a quarter size and 2 at full size, at most 0.5% of blocks visibly different, the text's ink within 1.5 px).\n\nThe domain was set from a first pass, in which 38 decks drew PowerPoint's design live: in all 38 PowerPoint laid every node out where\ncore does (largest difference 0.000 pt) at core's size, with no visible difference in the shapes, and 33 passed every check. The five that\ndid not are the two Arabic decks (their text 6 px from where the native export draws it), the Japanese matrix (10 px) and two\nfour-quadrant matrices whose entries wrap (mean differences 1.1 and 1.22), which is why the domain leaves out right-to-left and Chinese or\nJapanese text, entries of more than two lines and more than six lines in all.\n\nWith the domain and OPF's designs in place, the same 112 decks draw: PowerPoint's design as live SmartArt in 20 (every one passes: node\nrectangles within 0.000 pt, sizes equal, no visible shape difference, the SmartArt within SH-07's gate of the native export), OPF's\ndesign in 60, a card grid in 27 (the matrices of 1 to 3 entries) and a list in 5 (pyramids of 6 to 8 long levels on 4:3 and 1:1\nslides, which no design holds at 24 pt; `opf/arrangement-adapted` says so). In every native-shape instance PowerPoint draws the shapes as\nthe preview does (mean difference at most 1.15 inside the shapes and outside the text, no visibly different block).\n\nThe text of a live SmartArt sits where OPF's native export puts any text, within a pixel. Both sit higher in PowerPoint than in the preview,\nby about 0.15 em in Source Sans 3 and 0.07 em in Aptos (4 to 7 px at the 24 to 36 pt of these nodes): OPF's text model sets every\nbaseline one em below its line's top, and PowerPoint at a height that depends on the face. That difference is the same for every OPF text\nbox and is not SmartArt's; at the sizes of SH-07's diagram labels it is under the 1.5 px gate, at these sizes it is not, so the gate\ncompares the SmartArt with the native export, and the preview offset is recorded in the gate table. The evidence (the gate table, the\npreview | PowerPoint | native export sheets and the COM records) is in the SH-09 build folder of the shapes program.\n\n### The domain and the gate of chevrons and flows\n\nThe SH-17 sweep measured PowerPoint's own layout first (`AddSmartArt` through COM, 1 to 10 nodes in 20 frames per layout, the fitted\nmodel above), then ran the gate above on OPF's exports: chevrons, a flow and a vertical flow of 1 to 8 entries, short, medium and long,\non 16:9, 4:3 and 1:1 slides, and an Arabic and a Japanese deck of each, 222 decks, each exported live and as native shapes and drawn by\nPowerPoint. The domain (core `SMART_ART_DOMAIN`) is what passed:\n\n| | Chevrons | Flow | Vertical flow |\n| --- | --- | --- | --- |\n| Entries | 1 to 6 (7 and 8 never fitted the list's size in PowerPoint's design) | 1 to 6 | 1 to 4 |\n| Frame proportions | 1.1 to 2.3 (the 16:9, 4:3 and 1:1 slides gave 2.26, 1.64 and 1.17) | the same | 0.55 to 1.2 (the region beside the title: 1.13, 0.81 and 0.58) |\n| Fill | no entry's lines more than 95% of its node's text height (less margins): PowerPoint lays a box nearly full of text out again, in the first pass at 0.969 and 0.996 of the height (node rectangles 0.22 and 5.3 pt off), while every box at 0.95 or less matched | the same | the same |\n| Ink | the entries' text (each line's width times the size) at most 8% of the frame: PowerPoint sets a SmartArt's lines up to a pixel from where it sets OPF's native text (the same text in both), which in a frame dense with large text passes SH-07's mean-difference gate no longer (every first-pass failure of that check was at 0.082 or more) | the same | the same |\n| Lines, text | as the pyramid's: at most 2 lines an entry and 6 in all, breaks that hold within 4% of the width, Latin left-to-right text with bold, italic, underline or strike only | the same | the same |\n\nIn the first pass, before the fill and ink limits, 88 decks drew PowerPoint's design live; every node lay exactly where core lays it\n(0.000 pt) at core's size in 81, and 74 passed every check. The seven laid out again had nearly full text (the fill limit), and the\nseven others that drew the SmartArt more than a mean of 1 from the native export were dense with large text (the ink limit). With the domain in\nplace: 63 decks draw live SmartArt, every one passing (node rectangles and arrows within 0.000 pt of core, sizes equal, no visible\ndifference in the shapes, within SH-07's gate of the native export), 151 draw OPF's own design and 8 stay a list (7 or 8 long chevrons and 8 long boxes on the 1:1 slide, and vertical flows of 6 to 8 long entries on the 4:3 and\n1:1 slides, which no design holds at the list's size; `opf/arrangement-adapted` says so). Every native-shape instance PowerPoint draws as the preview\ndoes: no visibly different block in the shapes, a mean difference of at most 2.7 outside the text (the outlines' antialiasing). The\nArabic and Japanese decks are OPF's design, as for the pyramid and matrix.\n\nCOM also showed, on two live instances of each (short and medium entries): `HasSmartArt`, the layout's name, every entry a node of\n`AllNodes`; a node's text edited in PowerPoint keeps OPF's size in every node and every node rectangle; Change Layout to Basic Block List\nkeeps the nodes. With its `mc:Choice` requiring an unknown namespace, PowerPoint draws SH-16's fallback picture of each (mean difference\n1.3 from the preview over the slide, about what it is for the live SmartArt). Import reads a Basic Chevron Process, Basic Process or\nVertical Process that PowerPoint itself wrote back to the `chevrons`, `flow` or `vertical-flow` layout and its list, from the data model.\n\n### The layout relationship\n\nThe SH-09 spike found that PowerPoint resolves its built-in layout from the data model's `loTypeId` only when the package has no layout\npart; a stub layout part with the built-in `uniqueId` is not resolved. The frame's `dgm:relIds` still names four relationships, and\nthere are three ways to point `r:lo` at nothing. All three open as live SmartArt in PowerPoint with the layout resolved, a node edit and\nChange Layout working (the build checked each on a pyramid and a matrix):\n\n| Form | What a validator sees | Chosen |\n| --- | --- | --- |\n| `r:lo=\"\"` | the attribute the schema requires is present (`ST_RelationshipId` is a string), and an empty id can name no relationship (relationship ids are non-empty) | yes |\n| `r:lo=\"rId99\"`, no such relationship | a reference to a relationship the part does not have: a broken package reference | no |\n| no `r:lo` attribute | the schema's required attribute is missing | no |\n\nThe empty id is the only form that is both schema-valid and names nothing that is missing. The Open XML SDK validator and LibreOffice were\nnot installed on the comparison machine, so neither was run.\n\n## Cycles (SH-18)\n\nThe `cycle` layout (a region's `arrangement: \"cycle\"`) draws its lone list of one level as the steps of a loop: each entry a node on a\nring, the first at the top and the rest clockwise, with an arrow from each to the next and from the last back to the first. It draws\n1 to 8 entries (two make a pair with an arrow each way; more than 8 stay a list, with `opf/arrangement-adapted`).\n\n```json\n{ \"layout\": \"cycle\", \"title\": \"How each round feeds the next\", \"items\": [\"Plan\", \"Pilot\", \"Measure\", \"Adjust\"] }\n```\n\nThe designs are tried in order, each at one text size for every node, from 1.5 times the list's role size down to the role size, never\nbelow it:\n\n| Design (`design`) | Drawing |\n| --- | --- |\n| PowerPoint's (`smartart`), written as live SmartArt inside the [domain](#the-cycle-domain) | Basic Cycle (`cycle2`): circles on a ring with an arrow after each, in a frame of the cycle's own proportion centered in the region |\n| OPF's (`opf`), where the circles do not hold the entries at the list's size or the instance lies outside the domain | the larger-text of two designs that fill the region: rounded rectangles on an ellipse (two entries side by side, or one above the other in a tall region), or a loop of two or three rows (columns in a tall region), clockwise from the top left, with a node on every place of its edge: two rows hold ceil(n/2) nodes on top and the rest below, three rows a node at each end of the middle row too, and a row of fewer nodes widens them so every row spans the region (no place is ever empty); the arrows on the lines between the nodes' centers, all one size |\n\nEvery node is filled in the primary color with the 1.5 pt background-colored outline of the other arrangements; the arrows are the\nprimary lightened 40% (`lumMod 60000`, `lumOff 40000`), without an outline; the entries are centered on their nodes in the color that\nreads on the primary. A right-to-left deck mirrors the cycle, so its steps run counterclockwise.\n\n### PowerPoint's Basic Cycle\n\nPowerPoint lays Basic Cycle out from its frame alone: through COM (PowerPoint for Microsoft 365 on Windows 11, 2026-11-06) the circles and\narrows were the same for short, medium and long text and at every font size, and exactly proportional to the frame at a fixed width over\nheight (the largest difference across frames 230 to 920 pt wide was 0.0004 pt). At other proportions the result is not a closed form:\nPowerPoint searches the circle size as a ten-bit binary fraction of the frame's width and fits the ring in a second step, so the circles\nmove by up to 0.4 pt between frames a few points apart. OPF therefore gives the SmartArt frame one proportion per count, **1.8 : 1 for two\nentries and 1.15 : 1 otherwise** (the cycle's own proportion, a little wider so its height decides the size), the largest such frame\ncentered in the region, and reproduces PowerPoint's geometry from the frame's width W (core `cycleFrame`, `cycleNodes`):\n\n| | Basic Cycle |\n| --- | --- |\n| Circles | DrawingML `ellipse`, diameter `CYCLE_DIAMETER[n]`\xB7W: 890/1024, 818/2048, 774/2048, 570/2048, 538/2048, 890/4096, 830/4096 and 723/4096 for 1 to 8 entries |\n| Ring | the centers at radius `CYCLE_RADIUS[n]`\xB7W (0.3002, 0.32775, 0.29552, 0.33524, 0.32594, 0.3506 and 0.34595 for 2 to 8), the first at the top and the rest clockwise 360/n degrees apart; two entries left and right; the ring centered in the frame, an odd count's moved down by half of r\xB7(1 \u2212 cos(180\xB0/n)) so the circles' bounds are centered |\n| Arrows | after each circle a DrawingML `rightArrow` (`adj1` 60000, `adj2` 50000) 0.3375 of a diameter thick, on the line between two centers, 0.53 of the gap between the circles long and starting 0.22 of it after the first circle, turned to point along the line; two entries: one over and one under the gap, 0.2491\xB7W long, their centers 0.1888\xB7W off the line and 0.4883 of the way along it |\n| Text rectangle | the ellipse's own (the inscribed square, as PowerPoint's `txXfrm`), inset by 0.1 of the font size |\n| Stacking | each arrow after its circle (two entries: an arrow's head runs under the next circle) |\n\nThe model matches every circle and arrow PowerPoint drew within 0.0001 pt in the frames measured. In the live SmartArt, the arrows are the\ndata model's transition points (`sibTrans`, one after each entry, the last closing the loop), styled by OPF's `sibTrans2D1` label.\n\nIn PowerPoint (COM), a cycle OPF wrote opens as live SmartArt (`HasSmartArt`, Basic Cycle, one node per entry); a node edit keeps OPF's\nsize on every node and the circles where they were, Change Layout switches it to another layout with every entry, and a file saved again\nby PowerPoint (which writes its own layout part) imports back as the same list on the `cycle` layout, as does a Basic Cycle PowerPoint\nauthored. With the `mc:Choice` requiring a namespace PowerPoint does not know, PowerPoint draws the fallback picture as the preview does\n(mean difference 0.94 to 1.05 of 255 over the slide, two, four and six entries).\n\n### The cycle domain\n\n| | Cycle |\n| --- | --- |\n| Entries | 1 to 8 |\n| Frame proportions | exactly cycleAspect's (1.8 : 1 for two entries, 1.15 : 1 otherwise), which OPF always gives it |\n| Lines | at most 2 for an entry, each break holding when the width changes by 4%; no limit in all (each circle holds its own entry: eight entries of one line and four of two matched) |\n| Text | Latin script, left to right, with the run formatting of the other arrangements |\n\nRight-to-left decks stay native shapes: PowerPoint draws Basic Cycle clockwise from the data model whatever the deck's direction, so\nits circles are not where OPF's mirrored cycle draws them. Japanese text sat 11 px off in the comparison. Entries of three lines or more\ndrew within the shapes but outside SH-07's native gate (mean difference 1.03 to 1.62).\n\n### The cycle gate\n\nThe same comparison as SH-09's, plus every arrow's rotation: a cycle of 1 to 8 entries with short, medium and long entries on 16:9,\n4:3 and 1:1 slides, and an Arabic and a Japanese deck of 3, 4 and 5 entries, 78 decks, each exported live and as native shapes and drawn\nby PowerPoint. A first pass with the domain open to every count, line count and script drew 35 decks live: PowerPoint laid every circle\nand arrow out where core does (largest difference 0.000 pt, rotations equal) at core's size in all of them, and 26 passed every check; the\nnine that did not are the three right-to-left decks (PowerPoint's clockwise layout), the three Japanese decks (text 11 px off) and the\nthree entries of three or four lines. With the domain above the 78 decks draw: PowerPoint's design as live SmartArt in 25 (every one passes: circles and arrows within 0.000 pt, rotations equal, sizes equal, no visible shape difference, the SmartArt within SH-07's gate of the native export: mean difference at most 0.84 at a quarter size and 1.29 at full size, no visibly different block, the text's ink within 1.03 px), OPF's design in 44 (PowerPoint draws the shapes as the preview does: mean difference at most 1.04 inside the shapes and outside the text, no visibly different block) and a list in 9, filling the region (five to eight long entries on 1:1 slides, six to eight on 4:3, eight on 16:9, and eight medium entries on a 1:1 slide; `opf/arrangement-adapted` says so). In each of the nine, every design breaks one of the two rules that keep text readable at the list's role size: a word wider than its node (OPF never breaks a word: \"Customers\" is 143 px at 32 px, a node of the 4 + 4 loop on 16:9 109 px wide) or entries taller than their node (OPF never sets an arrangement's text below the list's role size, or below the list's fitted size when the list itself fits smaller: the 3 + 1 + 1 + 3 loop on 16:9 is 16 px short). The evidence is in the SH-18 folder of the\nshapes program.\n\n## OPF's own layouts (SH-19)\n\nPowerPoint's built-in layouts draw PowerPoint's designs. OPF's own designs (the [second design](#the-arrangement-of-a-region) of each\narrangement: the stepped pyramid with the entries beside it, the four quadrants, the card grid of a matrix, the ring and the two- and\nthree-row loops of a cycle, the wrapped and snaking rows of chevrons and flows, the snaking columns of a vertical flow, and their compact\nforms) have a SmartArt layout definition of their own, which OPF writes (ECMA-376 Part 1, \xA721.4, `dgm:layoutDef`) from the specification\nand OPF's design, never from PowerPoint's parts. Where the instance lies in [the domain](#the-domain-of-opfs-layouts) the export writes the\ndesign as live SmartArt on that definition, so it is editable SmartArt in PowerPoint, with SH-16's fallback picture as every live SmartArt\nhas. Elsewhere it stays native shapes, with `pptx/smartart-unavailable` and the reason.\n\nA design inside a built-in layout's domain keeps PowerPoint's built-in layout, which is better for the user (it is PowerPoint's own).\n\n### What OPF writes\n\nThe definition is a table of explicit constraints, the one form PowerPoint lays out with no algorithm of its own (the SH-19 spike,\nthrough COM):\n\n- a `composite` root with one `if` branch per entry count, 1 to 12 (`func=\"cnt\"`; SH-23); each branch places every node with `l`, `t`, `w` and `h`\n constraints as shares of the frame's width and height, so the design scales with the frame when it is resized in PowerPoint;\n- a hidden full-frame child (`shape type=\"rect\" hideGeom=\"1\"`) in every branch: without one, PowerPoint moves a drawing whose shapes do\n not reach the frame's edges to the frame's center;\n- every entry a `forEach axis=\"ch\" ptType=\"node\" st=\"i\" cnt=\"1\"` with its node: a `tx` node in the design's preset (`roundRect` with the\n design's corner, `chevron` with its point, `ellipse`), or, where the text is not in the preset's own text rectangle (beside a stepped\n pyramid's level), a shape and a text-only node (`revTx`, no fill or line) at the entry's text rectangle;\n- every arrow the transition after its node (`forEach axis=\"followSib\" ptType=\"sibTrans\" cnt=\"1\"`, `hideLastTrans=\"0\"` for a loop's\n closing arrow): an axis-aligned arrow a `rightArrow` turned by `rot` (0, 90, 180 or 270 degrees, which PowerPoint keeps); any other arrow\n a `conn` connector between the two node centers (`begPts`/`endPts` `ctr`) with its pads and thickness in millimeters;\n- every entry's text at OPF's size: the data model's run `sz` (with `custT=\"1\"`, so PowerPoint never fits it again) and a `primFontSz`\n constraint at the same size for an entry added in PowerPoint; the margins as shares of the size (`lMarg` and the others,\n `refType=\"primFontSz\"`); the composed count's entries anchored at the top (`txAnchorVert` `t`) with the top margin where OPF's\n composition starts the entry's first line, so PowerPoint sets the lines where OPF's native text export does (centering the block,\n PowerPoint's line metrics put it up to a pixel off);\n- the tables of every other count, from the same design at the same frame (core `opfLayoutGeometry`), so a node added or deleted in\n PowerPoint keeps OPF's design. OPF draws at most 8 entries, but the definition carries tables up to 12 (`OPF_LAYOUT_TABLES`, SH-23),\n so a ninth to twelfth entry a PowerPoint user adds is drawn in OPF's design at the same frame; more than 12 take the 12-entry table under\n names of their own (`x...`, the entries past 12 not drawn until one is removed). A design whose larger tables do not hold (a node outside\n the frame) keeps tables up to 8.\n\nEvery name of a layout node or `forEach` is unique in the definition: PowerPoint rejects a definition that repeats one (it opens the\nSmartArt on Basic Block List instead). The identity is OPF's: the `uniqueId` is `urn:openpresentation.org/smartart/layout/<design>/<digest>`\n(the design's name, `-compact` for a compact form, and a 64-bit digest of the definition's body), the title and description are the\ndesign's (`OPF Stepped Pyramid`, `OPF Card Grid`, `OPF Snaking Flow`, `OPF Chevron Rows`, `OPF Snaking Vertical Flow`, `OPF Cycle Ring`,\n`OPF Cycle Loop`, `OPF Cycle Loop of Three Rows`, `OPF Quadrants`), in the category of the arrangement (`pyramid`, `list`, `process`,\n`cycle`, `matrix`). The digest is there because PowerPoint keeps the first definition it loads for a `uniqueId` for the rest of its\nsession: in the sweep, a deck opened after another with the same `uniqueId` and other tables was drawn with the first deck's tables. Two\nexports of one design at one frame share a `uniqueId`; within one file, two frames with one `uniqueId` and different content each use\ntheir own part. The data model's `loTypeId` names the definition, and the frame's `r:lo` names the layout part. The style labels are\nOPF's colors part's: the nodes `node1` (a card `alignNode1`, the card neutral with its border, the outline's width on each entry's\n`spPr`), the text-only nodes `revTx` (the slide's text color) and `fgAcc1` (the color that reads on the primary), the arrows\n`sibTrans2D1`.\n\nThe export evaluates the definition with OPF's interpreter (core `evaluateLayoutDefinition`, `layoutArrangement`) and writes it only\nwhen the result is the composed design within 0.1 pt: the preview, the definition and PowerPoint then draw the same nodes.\n\n### OPF's interpreter\n\nCore's `smart-art-layout.ts` evaluates the subset of \xA721.4 OPF writes, as PowerPoint does: the layout node tree, `forEach` over the\nentries and their transitions (`st`, `cnt`, `hideLastTrans`), `choose`/`if` on the entry count, `composite` with `l`/`t`/`w`/`h`\nconstraints (shares of the root's `w` and `h`, or millimeters), PowerPoint's centering of a drawing that does not reach its frame's\nedges, `sp`, `tx` and `conn` (between centers), and shapes with their presets, adjustments and turns. A turned shape is PowerPoint's: the\nlargest-area rectangle at that angle inside its constraint box (at 45 degrees always a square), which is why OPF writes turned arrows as\nconnectors. It returns nodes and arrows in the shape of a composed arrangement (with the preset's text rectangle, or a text-only node's\nbox), so render and pptx have no second geometry path. It runs on the edge runtimes (no Node built-ins). Its unit test replays what\nPowerPoint drew through COM for OPF-written definitions (177 shapes: composite placement with and without the full-frame child, shapes\nturned by `rot`, connectors, the closing transition) within 0.001 pt.\n\nThe spike measured the other algorithms in OPF-written definitions too. Each evaluates, but none is a closed form: `lin` scales each axis\non its own and centers with a 0.1 to 0.4 pt offset; `snake` picks its own grid (up to 343 pt from the best-grid form); `cycle` searches\nthe node size (215 pt from the form its parameters describe); `pyra` keeps the levels to 0.67 of the width. OPF's definitions use none of\nthem.\n\n### In PowerPoint\n\nThrough COM (PowerPoint for Microsoft 365 on Windows 11): PowerPoint opens the SmartArt live on OPF's layout (`HasSmartArt`, the\nlayout's name and description, category as written, every entry a node of `AllNodes`); `Application.SmartArtLayouts` does not list it\n(the Change Layout gallery itself was not inspected: COM only). A node's text edited keeps OPF's size in every node and every node\nrectangle; an added node takes the next count's table and OPF's size (`primFontSz`; without it PowerPoint's 36 pt), deleted nodes the\nsmaller count's; Change Layout to Basic Block List and back (to the layout object read before) restores OPF's layout with every node\nwhere it was. A file saved again by PowerPoint keeps the layout part, rewritten but the same definition (PowerPoint adds empty sample,\nstyle and color data with `useDef`, leaves out attributes at their schema defaults, reorders attributes and writes the constraint factors\nto four decimals, a change of at most 0.00005 of the frame; normalized, the part equals OPF's), the same `uniqueId` and the same node\nrectangles on reopening (five designs checked); it drops SH-16's wrapper as for every SmartArt. OPF imports such a file back to the same\narrangement and list. With the `mc:Choice` requiring a namespace PowerPoint does not know, PowerPoint draws SH-16's fallback picture\n(mean difference 1.3 to 1.6 from the preview over the slide, as for the other live SmartArt). A definition PowerPoint\ncannot evaluate (a connector to a node of another name, in a build of this item) made PowerPoint take the `mc:Fallback` picture.\n\n### The domain of OPF's layouts\n\nThe export writes OPF's layout only for the instances the PowerPoint comparison passed (core `SMART_ART_OPF_DOMAIN`,\n`opfSmartArtUnavailable`):\n\n| | Passed |\n| --- | --- |\n| Designs and entries | the stepped pyramid 1 to 8, the card grid 1 to 6, chevron rows 6 to 8, the snaking flow 6 to 8, the snaking vertical flow 5 to 6 |\n| Text density | the entries' text (each line's width times the size) at most 7.5% of the frame |\n| Lines | at most 2 an entry, each break holding when the width changes by 4% (core fits every entry at both widths, as for PowerPoint's designs) |\n| Text | Latin script, left to right, with the run formatting of the other arrangements |\n| Line width | no line wider than 500 px, as for PowerPoint's designs |\n\nEverything else is native shapes, which look the same: OPF's cycles and quadrants (every instance of the sweep held its entries only\nabove the text density), the compact forms, right-to-left and Chinese or Japanese text, a row of chevrons pointing left (a layout\ndefinition has no mirrored shape), and list blocks (a SmartArt node holds no list).\n\n### The gate\n\nThe sweep of SH-09, SH-17 and SH-18 for all six arrangements: 1 to 8 entries, short, medium and long, on 16:9, 4:3 and 1:1 slides, an\nArabic and a Japanese deck of 3, 4 and 6 entries and decks of 2 and 4 list blocks of each, 468 decks, each exported live and as native\nshapes and drawn by PowerPoint; an instance passes on SH-09's checks (every node rectangle within 0.1 pt, arrows turned the same, equal\nsizes, no visible shape difference from the preview, within SH-07's native gate of the native export).\n\nWith the domain open (every OPF design live), 310 decks drew OPF's layout live. In the first pass PowerPoint laid 261 of them out where\nOPF's interpreter does; the other 49 were drawn with the tables of an earlier deck of the same `uniqueId` (the session's cache, hence the\ndigest). With the digest every one of the 310 laid out within 0.1 pt of the interpreter (largest difference 0.000 pt, arrows turned\nthe same) at OPF's size. The pixel checks then found what the domain keeps out: with the text centered in its node, PowerPoint set the\nlines up to a pixel off (mean difference from the native export up to 6 in dense frames); anchoring the text at OPF's first line halved\nthat, and of the 292 Latin instances every one at a text density of 7.5% or less with stable breaks passed (30), while above it some did\nnot (a mean difference of 1.01 at 8%, up to 3.3 in the densest), and every Japanese instance did not (text 11 px off). With the domain (and the 500 px line limit, which moved five built-in decks with a single long entry to OPF's design), 30\ndecks draw OPF's layout live and every one passes (node rectangles within 0.000 pt of the interpreter, sizes equal, no visible shape\ndifference, within SH-07's gate of the native export: a mean difference of at most 0.8 at a quarter size and 0.94 at full size, the\ntext's ink within 1.08 px); PowerPoint's built-in layouts draw 102 live decks, every one passing; OPF's design draws 271 decks and a card\ngrid 43 as native shapes, and 32 stay a list. The gate's shapes-versus-preview check leaves out each node's text rectangle grown by\n0.2 em up and down, so the preview's known text offset is not counted as a shape difference. The evidence (the gate table, sheets of preview, PowerPoint live and PowerPoint's drawing of the native export, labelled with\nthe design and the layout that drew it, and the COM records) is in the SH-19 folder of the shapes program.\n\n## Import\n\nA SmartArt OPF wrote (in `full` provenance it carries `OPF_SMARTART_V1`: the slide, the list path, the arrangement, the authored list\nand the text of every node) imports as its list on its layout again when its node texts are unchanged. An edited one, and a Basic\nPyramid, Basic Matrix, Basic Cycle, Basic Chevron Process, Basic Process or Vertical Process that PowerPoint wrote, import their data model's nodes: the points in `cxn` order (nested\nentries keep their `level`, SH-08), their text and run properties (bold, italic, underline, strike), as a list on the\n`pyramid`, `matrix`, `cycle`, `chevrons`, `flow` or `vertical-flow` layout (the one of the same arrangement; SH-19: a SmartArt on one of\nOPF's own layouts by its `uniqueId`, `urn:openpresentation.org/smartart/layout/<design>/...`, also after PowerPoint saved it again), with `smartart-edited` for an edited OPF SmartArt. The diagram's place on the slide is its frame's;\nthe nodes' geometry is the layout's again, as OPF draws it, so nothing of PowerPoint's layout is kept. Import never reads or stores a\nSmartArt layout part. A wrapped frame is read from its `mc:Choice`. A file in which only the fallback picture survived (an app without\nSmartArt saved it) imports the same way in `full` provenance: the picture carries `OPF_SMARTART_V1` too, with the media keys of its\nSVG and PNG, so a picture still named for its list whose SVG or PNG is the one written is that list on its layout again; a replaced\npicture reports `invalid-smartart-provenance` and imports as a picture, as does any fallback without the record. Native-shape arrangements (`OPF_ARRANGEMENT_V1` on every node) are the layout's\ndrawing: import consumes them and reads the measured lines as the list. Every other SmartArt imports as the next section says.\n\n### SmartArt PowerPoint users made (SH-08)\n\nAny SmartArt PowerPoint wrote imports with its text (`src/smart-art-import.js` in opf-pptx). Import reads the data model, not the\nlayout part:\n\n- **The outline**: the `parOf` connections from the doc point, in `srcOrd` order, as a tree of entries (nodes and an organization\n chart's assistants, `type=\"asst\"`). An entry left as a placeholder (no text and no explicit authored-text marker) gives its place to its children; an explicitly authored blank parent retains its children and level. A run's bold, italic,\n underline and strike are kept, a line break (`a:br`) is a newline and a field is its text. The paragraphs of one node are one entry,\n except on the `list` and `process` layouts, where each is an item of its own at the node's level: PowerPoint holds a Vertical Bullet\n List's or an Accent Process's bullets as the paragraphs of one child node (its object model adds no second child there).\n A node's title box is its entry's `description`: in a Name and Title Organization Chart PowerPoint stores the title on the sibling\n transition of the node's connection and presents it (`presOf`); a presentation point with text of its own (`custT`) is read the same way.\n- **The layout**: the doc point's `loTypeId`, then its category (`loCatId`).\n\nThen the first form that fits:\n\n| Layout | OPF |\n| --- | --- |\n| The known arrangement IDs (`pyramid1`, `matrix3`, `cycle2`, `chevron1`, `process1`, `process2`, `orgChart1`, `hierarchy1`, `venn1`) and OPF's own layouts | The list on that arrangement's layout, as above |\n| Inverted Pyramid (`pyramid3`), widest entry first | The list on the `inverted-pyramid` layout, retaining its order (the widest first), with `smartart-adapted`. The inverted arrangement exports as editable native shapes; it has no qualified live SmartArt domain. |\n| Another layout of those families: `pyramidN`, `matrixN`, `cycleN` (Text Cycle, Block Cycle...), any chevron layout (`chevron2`, `hChevron3`...); a layout of category `pyramid`, `matrix` or `cycle` | The list on the `pyramid`, `matrix`, `cycle` or `chevrons` layout, with `smartart-adapted` (info) |\n| The list family (category `list`: Basic Block List `default`, Vertical Bullet List `vList2`...) | The list on the `list` layout, with `smartart-adapted` |\n| The process family (category `process`, other than the arrangements above: Accent Process, Step Up Process...) | The list on the `process` layout, with `smartart-adapted` |\n| Other hierarchies and organization charts, or the known trees with assistants, separate roots or labeled edges (`orgChartN`, `hierarchyN`, the 2008 and 2009 organization charts; category `hierarchy`) | A Mermaid flowchart (`flowchart TD`, `flowchart LR` for a horizontal hierarchy): a node per entry, its description on a second line, an edge from each parent, dotted (`-.->`) to an assistant, the connection's own text as the edge's label; the outline as the diagram's `alt`; `smartart-adapted` |\n| Every other layout (other Venn, radial, target, funnel, gear, picture layouts...) | The drawing (`dsp:drawing`, which PowerPoint saves with every SmartArt) as overlay shapes, with `smartart-adapted`; without a drawing, the list on the `list` layout |\n\nNested entries keep their `level` in every list. Organization charts and hierarchies use those depths as parent links; the other arrangements draw one level, so a pyramid of nested entries draws as a list\n(`opf/arrangement-adapted` says so) with all of its text.\n\n**The drawing as overlay shapes.** The drawing's shapes are read by SH-05's reader ([shapes](shapes.md)), in a group that places the\ndrawing's space on the SmartArt's frame, so each is an overlay shape with its preset, fill, line, effects and text, in PowerPoint's\nz order at the frame's place. PowerPoint sets a SmartArt shape's text in a rectangle of its own (`dsp:txXfrm`): where it lies inside\nthe shape's own text rectangle, the difference is the shape's `padding`; where it does not (a Venn circle's text across the overlap,\ntext beside a shape), the shape is drawn without text and a text-only overlay (no fill, no line, style `none`) holds the text at\nPowerPoint's rectangle. Text in another color than the slide's text color keeps it (the style's `fontRef`). The first shape carries the\noutline as its alt text (`SmartArt (venn1):` and an entry a line, indented a level by two spaces). The no-op color transforms and empty\n3-D element PowerPoint writes on every SmartArt shape are not reported as dropped properties; anything else SH-05 does not keep is\n(`shape-property-dropped`).\n\n**Nothing dropped silently.** What the OPF form does not keep is a finding naming it:\n\n| Finding | When |\n| --- | --- |\n| `smartart-text-dropped` (with `text`) | Text on a transition (a connection's own text, other than an organization chart's edge label or a presented title box), text on a presentation point that belongs to no entry, or an entry no connection reaches |\n| `smartart-picture-dropped` | An entry's picture fill (a picture layout), in every form but the drawing |\n| `smartart-formatting-dropped` | Bold, italic, underlined or struck-through text in a hierarchy (Mermaid labels carry none); the text is kept |\n| `smartart-adapted` (with `form`: an arrangement, `list`, `process`, `diagram` or `shapes`) | A layout imported as anything other than the arrangement OPF writes for it |\n| `smartart-connection-dropped` | Connections to an entry that already has a parent (or to its own ancestor): each entry is imported once, under the first parent that reaches it |\n| `smartart-limited` (with `limit`: `depth` or `entries`) | An outline more than 64 points deep or longer than 10,000 entries: the drawing, or without one the entries as a flat list (the first 10,000) |\n| `smartart-unreadable` | A data model or drawing that cannot be read: the frame imports as any other graphic frame, or the drawing adds no shapes |\n\nEvery finding has the layout (`layout`, the last segment of `loTypeId`) and the slide's path. A SmartArt with no text and no drawing\n(only placeholders) imports as nothing.\n\n**Evidence.** `packages/pptx/test/fixtures/powerpoint-smartart.pptx` is PowerPoint-made (COM, PowerPoint for Microsoft 365 on Windows 11,\n2026-11-07): 17 layouts (Basic and Inverted Pyramid, Basic Matrix, Basic and Text Cycle, Basic Chevron Process, Basic, Vertical and\nAccent Process, Basic Block List, Vertical Bullet List, Basic Venn, Basic Radial, Organization Chart, Hierarchy, Horizontal Hierarchy and\nName and Title Organization Chart), each added from a seed deck OPF writes (`make-smartart-seeds.mjs`: this PowerPoint build gives\nscripts no `SmartArtLayouts` list, so each layout is a seed graphic's `SmartArt.Layout`) and filled through `SmartArt.Nodes`;\n`powerpoint-smartart.json` is PowerPoint's own reading of every node. Every node's text imports, with no `smartart-text-dropped`.\nA slide whose SmartArt became overlay shapes has only its title besides them. Overlay shapes whose bounds cover at least a fifth of the\nslide (core `overlaysDrawBody`, `OVERLAY_BODY_SHARE`; front layer, placed by fractions) are the slide's body, so its title is a content\nslide's, on top, not a cover's centered over the shapes; a badge on a cover leaves the cover as it was. This holds for any slide, authored\nor imported (`examples/technical/shape-overlays.opf.json` slide 5's title moves to the top).\n\nSH-23: custom layout text algorithms set their LTR/RTL paragraph alignment defaults, so newly added nodes keep the design's alignment without a script changing their formatting after the edit.\n\nSH-23 qualification: five in-domain OPF designs retain an added ninth node and a text edit through SaveCopyAs/reopen, with unchanged font sizes, correct paragraph/first-line alignment and maximum geometry error0.0000876pt. The native text algorithms explicitly preserve start or center alignment for newly added nodes, which have no authored paragraph properties. [Raw qualification and limits](programs/shapes/sh23-2026-11-07/README.md) retain the initial visual failure and all corrected witnesses.\n\n## Inverted pyramids\n\nUse the `inverted-pyramid` layout to narrow from a broad starting pool to a final choice. A custom pyramid region sets `pyramidDirection: \"down\"`; `\"up\"` is the existing default. The first entry stays at the top, so a downward pyramid starts wide and ends at the tip. Both the continuous outline and the stepped design use core geometry; neither reverses the text order or reduces the text size. PowerPoint export uses editable native shapes with a located `smartart-unavailable` finding. Live `pyramid3` and downward OPF layout definitions remain unqualified. Import maps an Inverted Pyramid to this layout while reporting its adapted styling. See [the example](../examples/technical/inverted-pyramids.opf.json).\n\n### Completed domain audit for 0.34 (SH20/22)\n\nThe expanded diagnostic sweep contains 516 instances, including 465 forced-live observations. Replaying the unchanged gate on the original sealed PPTX, PNG and native probes with the current core interpreter reproduces every original metric and result: 201 full passes and 264 failures. All 465 node rectangles, rotations and font sizes agree; every failure includes native pixels/text, and three dense cases also wrap an extra line outside the node. Current shipped predicates admit 132 of these cases (102 built-in and 30 OPF-layout instances), all passing. These diagnostic measurements do not make every isolated passing case a safe domain.\n\nThere is no additional safe live domain under the current text-density, stable-wrap, two-line and 500 px line-width limits. Ignoring only design/count/compact restrictions still leaves exactly the same 30 OPF-layout candidates. Ring/loop cycles, quadrants and compact forms therefore retain editable native-shape output and `pptx/smartart-unavailable`; the live domain does not expand in 0.34.\n\nChinese/Japanese and Arabic/Hebrew remain outside live eligibility. Their complete measured live scopes are 18 Japanese, 18 Chinese, 15 Arabic and 15 Hebrew cases; the few passing Arabic/Hebrew instances do not qualify their other frames or text densities. Measured font slots agree, but visible baseline/horizontal offsets remain. Single-spacing and paragraph-marker experiments did not fix them and were rejected. The export preserves editable shapes/text at OPF's composed size with the explicit native-SmartArt refusal. No per-language coordinate adjustment, font-policy change or relaxed gate hides the remaining live limitation."
376
376
  },
377
377
  {
378
378
  "slug": "stats",