@openpresentation/gallery 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,4 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.0.0 (2026-10-11)
6
+
7
+ - **Breaking: replace the 278 placeholder layouts of 1.x with 28 OPF 0.19 intent layouts.** Records now use `opf-layout/v2` grid templates with `areas`, `columns`, `rows` and typed content regions; `CATALOG_SCHEMA` and `opf.catalogSchema` are `2`. Consumers require `@openpresentation/opf` 0.19 or later. There are no v1 aliases or migration APIs. Six old ids remain with new template semantics: `agenda`, `comparison`, `dashboard`, `faq`, `timeline` and `two-column`. Other old ids no longer resolve in this catalog. Boxed treatment, direction, alignment, image fit and item images are design settings rather than layout variants.
8
+ - The six intent groups are openers and closers (`cover`, `section`, `agenda`, `statement`, `closing`); text (`text`, `list`, `quote`, `two-column`); groups of items (`pillars`, `comparison`, `process`, `timeline`, `faq`); numbers (`metrics`, `scorecard`); visuals (`image`, `image-beside`, `gallery`, `chart`, `chart-beside`, `table`, `table-beside`, `code`); mixed (`hero`, `dashboard`, `team`, `logos`). Gallery owns these layout records directly. Each has an authored usage description and SVG preview link; layout index entries include `summary` and `group`. The `image` and `image-beside` templates preserve whole-picture `imageFit: contain`.
9
+ - **Breaking preview contract:** `@openpresentation/gallery/previews` provides one SVG per layout id instead of the 70 HTML slide-archetype thumbnails. `npm run previews` generates them and `npm run check:previews` checks them. Schema 2 establishes a new major-version pixel-stability baseline, with filled and empty region cases retained.
10
+ - Narrative beats now name existing v2 intent layouts, preserving narrative prose and the other beat fields. Themes, colour schemes, font schemes, audiences, purposes and tones remain unchanged. The published package remains dependency-free and registers through `catalogs: [gallery]`; OPF 0.19 obtains the default catalog from this package instead of a core-owned snapshot.
11
+ - Build tooling for this first schema-2 release can validate and draw the catalog using exact merged core/renderer sources before their registry releases. It stages development tarballs with original versions and unchanged runtime bytes, records original/staged manifests and integrity, and verifies a shared core/gallery installation. Bootstrap leaves the release package metadata and built catalog bytes intact; merged-source, preview, stability and trusted-publication gates still apply. This bootstrap is build tooling, not native acceptance or publication of the engine packages.
12
+
13
+ ## 1.0.0 (2026-10-10)
14
+
15
+ Released from `3458f50`; the original tagged changelog kept this entry under Unreleased.
16
+
5
17
  - First release of `@openpresentation/gallery` from OpenPresentation/gallery: the pptx.gallery catalog on its own version line. `import { gallery } from "@openpresentation/gallery"` and register it with `catalogs: [gallery]`. It holds the records that `@openpresentation/opf/catalog`'s `defaultCatalog` held up to OPF 0.18: 278 layouts, 4 themes, 14 colour schemes, 89 font schemes, 48 narratives, 16 audiences, 9 purposes and 7 tones. The package also exports `GALLERY_SOURCE`, `CATALOG_SCHEMA` (`1`, also `opf.catalogSchema` in `package.json`), `catalogDisplay`, `catalogIndexes` and `catalogManifest`; `@openpresentation/gallery/previews` exports the layout previews. It has no dependency, not even for its types: `GalleryCatalog` has the shape of core's `Catalog`. New records are a minor release; a removed or renamed id or a changed drawing is a major release, which CI enforces by drawing every existing layout, theme, colour scheme and font scheme against the previous published release. Replaces the 0.0.1 placeholder.
package/README.md CHANGED
@@ -5,10 +5,14 @@ The default catalog for Open Presentation: layouts, themes, colour schemes and f
5
5
  [pptx.gallery](https://www.pptx.gallery).
6
6
 
7
7
  It holds every layout, theme, colour scheme, font scheme, narrative, audience, purpose and tone that
8
- [OPF](https://openpresentation.org) decks name by id (`layout: "two-column"`, `design: { theme: "minimal" }`). Engines
8
+ [OPF](https://openpresentation.org) decks name by id (`layout: "pillars"`, `design: { theme: "minimal" }`). Engines
9
9
  never fetch records: a host registers the catalogs it trusts, and this package is the catalog every OPF host registers by
10
10
  default.
11
11
 
12
+ **2.x is the catalog of OPF 0.19 and later.** Its layouts are the 28 OPF 0.19 layouts named by intent, written as grid
13
+ templates (`opf-layout/v2`); they need `@openpresentation/opf` 0.19 or later. 1.x holds the 278 OPF 0.18 layouts. 2.0.0
14
+ changed the layouts with no migration path: see [Layouts](#layouts) and the [changelog](CHANGELOG.md).
15
+
12
16
  ## Use
13
17
 
14
18
  ```sh
@@ -33,14 +37,65 @@ registers later.
33
37
  | --- | --- |
34
38
  | `gallery` | The content records by kind and then by id, without `$schema`, `id` or `x-*` members, with `source: "https://www.pptx.gallery"` |
35
39
  | `GALLERY_SOURCE` | `https://www.pptx.gallery`, the `source` of a document's `catalogs.default` |
36
- | `CATALOG_SCHEMA` | The version of core's catalog record schemas these records target (also `opf.catalogSchema` in `package.json`) |
40
+ | `CATALOG_SCHEMA` | The version of core's catalog record schemas these records target (also `opf.catalogSchema` in `package.json`): `2`, the layouts are `opf-layout/v2` grid templates |
37
41
  | `catalogDisplay` | Display metadata for pickers: `chartTypes`, `languages` and `socialPlatforms` by id |
38
- | `catalogIndexes` | Each kind's `index.json`: the record summaries and their content hash |
39
- | `catalogManifest` | The pptx.gallery commit the records were taken from, and a content hash per kind |
42
+ | `catalogIndexes` | Each kind's `index.json`: the record summaries and their content hash (a layout's entry also has its `summary` and `group`) |
43
+ | `catalogManifest` | The pptx.gallery commit the 1.x records were taken from, and a content hash per kind |
44
+
45
+ `@openpresentation/gallery/previews` exports one SVG preview per layout, keyed by the layout id (`layoutPreviews`,
46
+ `layoutPreviewIndex`, `layoutPreviewSlugs`, `getLayoutPreview`, `hasLayoutPreview`): the layout drawn with sample
47
+ content in every region by the pinned `@openpresentation/opf-render`, a self-contained `<svg>` with a 16:9 viewBox. The
48
+ package has no dependency, not even for its types: `GalleryCatalog` has the shape of core's `Catalog`, so `gallery` is
49
+ assignable to it.
40
50
 
41
- `@openpresentation/gallery/previews` exports static HTML layout previews (`layoutPreviews`, `layoutPreviewIndex`,
42
- `layoutPreviewSlugs`, `getLayoutPreview`, `hasLayoutPreview`). The package has no dependency, not even for its types:
43
- `GalleryCatalog` has the shape of core's `Catalog`, so `gallery` is assignable to it.
51
+ ## Layouts
52
+
53
+ A slide names a layout by intent; its content flows into the layout's regions, so no layout fixes a block count.
54
+ Variants are design settings on the slide or the deck, not layout ids: cards (`design.contentBox`), one row or one
55
+ column (`contentDirection`), title and content alignment (`titleAlignment`, `contentAlignment`), picture fit
56
+ (`imageFit`) and image bullets (`listBullet`), which a theme can also set, and a mirrored side (`mirror`). A slide with no layout composes
57
+ automatically. A deck's own layouts are records of the same schema under `catalogs.custom.layouts`.
58
+
59
+ | Layout | When to use it |
60
+ | --- | --- |
61
+ | **Openers and closers** | |
62
+ | `cover` | The opening slide: title, subtitle and an optional picture. |
63
+ | `section` | A divider between parts: the section title and an optional subtitle. |
64
+ | `agenda` | What the talk covers: the parts, as one list that flows into columns when long. |
65
+ | `statement` | One message, large and alone. |
66
+ | `closing` | The last slide: thanks, the call to action and contact details. |
67
+ | **Text** | |
68
+ | `text` | Prose. Several blocks sit side by side when short and stack when long. |
69
+ | `list` | Bulleted or numbered points; one long list flows into columns. |
70
+ | `quote` | One or more quotations with attribution and photo. |
71
+ | `two-column` | Two independent columns of any content. |
72
+ | **Groups of items** | |
73
+ | `pillars` | Two to six ideas of equal weight, as cards. |
74
+ | `comparison` | Two options side by side (before and after, pros and cons, us and them), with an optional verdict. |
75
+ | `process` | Steps in order, in one row. |
76
+ | `timeline` | Dated events or a roadmap along one axis, with optional notes. |
77
+ | `faq` | Questions with their answers. |
78
+ | **Numbers** | |
79
+ | `metrics` | One to six headline numbers, with an optional note. |
80
+ | `scorecard` | Metrics with commentary or status, as cards. |
81
+ | **Visuals** | |
82
+ | `image` | One picture edge to edge under an optional title. |
83
+ | `image-beside` | A picture or video beside text. |
84
+ | `gallery` | One to six framed pictures: a screenshot, a diagram, a photo set. |
85
+ | `chart` | One to six charts, with an optional note. |
86
+ | `chart-beside` | A chart with the takeaway beside it. |
87
+ | `table` | A table across the slide, with an optional note. |
88
+ | `table-beside` | A table with commentary beside it. |
89
+ | `code` | Source code with the explanation beside it. |
90
+ | **Mixed** | |
91
+ | `hero` | A lead message with a picture and supporting points. |
92
+ | `dashboard` | Headline numbers over charts. |
93
+ | `team` | People: photo, name and role cards. |
94
+ | `logos` | Customer, partner or sponsor logos in a grid of up to 12. |
95
+
96
+ The 1.x ids `agenda`, `comparison`, `dashboard`, `faq`, `timeline` and `two-column` are 2.x layouts of the same id. Every
97
+ other 1.x layout id is gone, with no alias: a deck that names one finds no layout (`opf/unresolved-reference`) and its
98
+ slides compose automatically, unless the deck embeds the old record.
44
99
 
45
100
  ## Versions
46
101
 
@@ -55,37 +110,33 @@ The gallery has its own version line, independent of the OPF engine packages. Re
55
110
  The pixel-stability check enforces the rule (`npm run check:stability`, `scripts/stability.mjs`). It runs on every pull
56
111
  request and before every publish. It takes the highest published version at or below the candidate's, and for every
57
112
  layout, theme, colour scheme and font scheme both releases have, it draws a fixture deck with the pinned published
58
- `@openpresentation/opf` and `@openpresentation/opf-render`, once per release: a slide with sample content in every
59
- region of a layout, a six-slide sample deck for a design record. SVG bytes are compared first; a mismatch is rasterized
60
- to count the pixels that differ. A changed drawing or a removed id fails unless the major version goes up. New ids pass.
113
+ `@openpresentation/opf` and `@openpresentation/opf-render`, once per release: for a layout, a slide with sample content
114
+ in every region (three blocks in a flowing region, one in a `none` region) and a slide with every region empty, which
115
+ exercises collapse; for a design record, a six-slide sample deck. SVG bytes are compared first; a mismatch is rasterized
116
+ to count the pixels that differ. A changed drawing, a removed id or a new `CATALOG_SCHEMA` fails unless the major version
117
+ goes up. New ids pass. 2.0.0 is a new baseline: it is compared with 1.x for the record only, and every 2.x minor and
118
+ patch is held to the 2.x release below it.
61
119
 
62
120
  ## Where the records come from
63
121
 
64
- In 1.x the records are a pinned snapshot of the catalog pptx.gallery publishes at
65
- `https://www.pptx.gallery/<kind>/index.json`; `catalog/manifest.json` names the pptx.gallery commit.
66
-
67
- - Records are written in [Data-Advantage/pptx-gallery](https://github.com/Data-Advantage/pptx-gallery): its `data/`,
68
- then `pnpm build:opf-catalog`, which publishes `public/<kind>/`.
69
- - When pptx.gallery's main changes a published record, its `sync-gallery-package.yml` workflow opens or updates one
70
- pull request here, from the branch `sync/pptx-gallery`, with the records, the version bump and the `CHANGELOG.md`
71
- entry. A person reviews and merges it, then tags the release. See CONTRIBUTING.md, "Records from pptx.gallery".
72
- - The records are taken by this repository's `scripts/sync-gallery-catalog.mjs --gallery <pptx-gallery checkout>`
73
- (`npm run sync` with the checkout at `../pptx-gallery`). The sync validates every published index and record
74
- against the published `@openpresentation/opf`, checks the published content hashes, drops `x-*` members, refuses a
75
- publisher that stopped serving an id the snapshot holds (unless `--allow-removed <kind>:<id>` names it), and pins the
76
- gallery commit.
77
-
78
- The planned 2.0.0 release, with the OPF 0.19 layout redesign, makes this repository the place records are written, and
79
- pptx.gallery then reads them from the package.
122
+ - **Layouts** are written here, in `catalog/layouts/`: one short `opf-layout/v2` record per layout, reviewed as code.
123
+ - **The other kinds** (themes, colour and font schemes, narratives, audiences, purposes, tones and the display kinds) are
124
+ unchanged from 1.x: the pinned snapshot of the catalog pptx.gallery published at
125
+ `https://www.pptx.gallery/<kind>/index.json`, with the pptx.gallery commit in `catalog/manifest.json`.
126
+ - `scripts/sync-gallery-catalog.mjs` took the 1.x records from a pptx.gallery checkout (`npm run sync`). pptx.gallery
127
+ publishes the 1.x layouts, so a sync now refuses to run: it would remove the 28 layouts. pptx.gallery reads its records
128
+ from this package from 2.0.0, and the sync is retired with that change.
80
129
 
81
130
  ## Contributing a layout
82
131
 
83
- 1. Add the layout on pptx.gallery: its page data in `data/layouts.json` (placeholders, composition, design and display
84
- fields) and its preview, then `pnpm build:opf-catalog` there. pptx.gallery's CI validates the record against OPF's
85
- companion schema. A new layout gets a new id; an existing id never changes meaning.
86
- 2. Sync it here (`npm run sync`), then run `npm test` and `npm run check:stability`. A new layout is a minor release;
87
- if the check reports a changed record, restore it or make the release a major one.
88
- 3. Open a pull request here with the synced files and a `CHANGELOG.md` entry under `## Unreleased`.
132
+ 1. Write the record in `catalog/layouts/<id>.json` (`$schema` `https://openpresentation.org/schema/opf-layout/v2`,
133
+ `id`, `name`, `summary`, `tags` with its group, `areas`, `columns`, `rows`, `regions` and any `design`) and add its
134
+ entry (`id`, `name`, `summary`, `group`, `file`) to `catalog/layouts/index.json` in picker order. A new layout gets a
135
+ new id; an existing id never changes meaning.
136
+ 2. `npm run rehash` (the index and manifest hashes), then `npm run previews` (its SVG preview).
137
+ 3. Run `npm test` and `npm run check:stability`. A new layout is a minor release; if the check reports a changed record,
138
+ restore it or make the release a major one.
139
+ 4. Open a pull request here with a `CHANGELOG.md` entry under `## Unreleased`.
89
140
 
90
141
  See [CONTRIBUTING.md](CONTRIBUTING.md) for the checks, releases and the license.
91
142
 
package/dist/index.d.ts CHANGED
@@ -10,8 +10,11 @@
10
10
  /** The source the gallery is registered under, and the `source` of a document's `catalogs.default`. */
11
11
  export declare const GALLERY_SOURCE: "https://www.pptx.gallery";
12
12
 
13
- /** The version of core's catalog record schemas these records target (package.json `opf.catalogSchema`). */
14
- export declare const CATALOG_SCHEMA: 1;
13
+ /**
14
+ * The version of core's catalog record schemas these records target (package.json `opf.catalogSchema`). 2: the layouts
15
+ * are OPF 0.19 grid templates (`opf-layout/v2`); every other kind is unchanged from 1.
16
+ */
17
+ export declare const CATALOG_SCHEMA: 2;
15
18
 
16
19
  /** Records of one kind, keyed by id (core's `CatalogRecordMap`). */
17
20
  export type GalleryRecords = Readonly<Record<string, Readonly<Record<string, unknown>>>>;