@openpresentation/gallery 0.0.0-stage → 0.26.0-rc.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 +36 -0
- package/LICENSE +21 -0
- package/README.md +200 -2
- package/dist/index.d.ts +101 -0
- package/dist/index.js +23 -0
- package/dist/previews.d.ts +35 -0
- package/dist/previews.js +16 -0
- package/package.json +72 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 5.0.0 (2026-10-21)
|
|
4
|
+
|
|
5
|
+
- **Breaking: layout records are one ordered list of regions; `areas`, `columns`, `rows` and the `regions` map are removed (FA-33).** A record is now `direction` (`"row"` or `"column"`, default `"column"`) and an ordered `regions` array of regions and splits. A region is `{ "name", "size"?, ...rules }` with the rules unchanged (`accepts`, `role`, `flow`, `max`, `bleed`, `listColumns`, `anchor`, `empty`); a split is `{ "direction", "regions", "size"?, "anchor"? }` and nests up to three levels. `size` is a weight (default 1) or `"auto"` (the height the content needs, in a column only), `title` and `subtitle` stay heading regions that take only `size`, `accepts` may be left out for every content kind, and an `anchor` on the record or a split applies to every region under it. All 28 layouts are converted, and each compiles to exactly the grid it had in 4.0.0 (areas, column and row weights, `auto` rows and every region rule, proven in `test/layout-equivalence.test.mjs` against a fixture of the 4.0.0 records), so no layout draws differently and the previews are unchanged. `quote` and `statement` write their `anchor: "middle"` once on the record. There is no old-format alias and no migration API: a custom layout in a deck must be rewritten. `CATALOG_SCHEMA` and `opf.catalogSchema` advance to `4`; the per-kind layout schema version stays `2` (`opf-layout/v2`). Records are validated by a core that reads this form, so this release needs the core release that accepts it.
|
|
6
|
+
|
|
7
|
+
- Build tooling: the one-release merged-engine bootstrap (`.github/bootstrap-engines.json`, `scripts/bootstrap-engines.mjs`) is generalized from "3.0.0" to the release the file names, with its catalog schema, and is set to 5.0.0 over the merged core (OpenPresentation/opf#756, `d223fc00`) and opf-render (opf-render#278, `e5838837`) commits, because core 0.25.0 cannot publish before it depends on gallery 5. The ancestry, digest and unchanged-manifest checks are as before. The layout-equivalence test compiles with core's own `layoutTemplate` (`@openpresentation/opf/composition`) instead of a test-local copy. The published package is unchanged by this tooling and stays dependency-free.
|
|
8
|
+
|
|
9
|
+
## 4.0.0 (2026-10-19)
|
|
10
|
+
|
|
11
|
+
- **Breaking: the `dark` theme is removed; dark is a variant of every theme.** Core 0.23.0 adds `design.variant`, a map over a deck's one color scheme (light1, light2, dark1, dark2, with an optional accent order). The `minimal`, `classic` and `bold` themes gain `variants` (`light`, `light-alt`, `dark`, `dark-alt`, each the value of `design.variant`), and the separate `dark` theme (the `boost` colors with the `seaford` fonts on `dark1`) is gone: a document that names `design.theme: "dark"` is an unknown theme (`opf/unresolved-reference`). Replace it with a theme and its dark variant, plus `colorScheme: "boost"` and `fontScheme: "seaford"` if the boost look is wanted. A removed id is a major release, so this is 4.0.0. No other record or drawing changes; `CATALOG_SCHEMA` stays 3.
|
|
12
|
+
- Development and CI use the published engines: `@openpresentation/opf` and `@openpresentation/opf-render` 0.23.0 replace the 0.19 pins and the one-release 3.0.0 bootstrap, which does nothing for any other gallery version. Core 0.23.0 derives borders, gridlines, axis lines, chart text and code colors from the color scheme, so seven layout previews are redrawn with `npm run previews` (this major release is where a redraw is allowed): chart, chart-beside, code, dashboard, table, table-beside and timeline. `previews/layouts/index.json` records their new sizes. No other record's drawing changes.
|
|
13
|
+
- The tests validate every theme's `variants[].variant` with core 0.23.0's `normalizeColorVariant` and `isColorVariant` (`@openpresentation/opf/composition`) instead of a hand-written shape check.
|
|
14
|
+
|
|
15
|
+
## 3.0.0 (2026-10-13)
|
|
16
|
+
|
|
17
|
+
- Canonicalize the bootstrap temporary root on macOS before strict artifact checks, so the system `/var` alias does not reject valid merged-source builds. Source-child symlinks remain rejected; release metadata and runtime bytes are unchanged.
|
|
18
|
+
|
|
19
|
+
- **Breaking catalog contract:** layout `areas` now use arrays of cells instead of whitespace-delimited row strings. `CATALOG_SCHEMA` and `opf.catalogSchema` advance to `3`; consumers must support array-row areas. Layout IDs, per-layout schema version `2` and `opf-layout/v2` remain unchanged.
|
|
20
|
+
- Gallery 3 build tooling requires exact core and renderer commits that are ancestors of their actual remote default branches. The one-release bootstrap stages development tarballs, verifies shared core/catalog resolution and unchanged release manifests, and retains artifact identities; its commands also run portably on Windows. Qualification uses the actual merged core and renderer commits. This tooling does not qualify published engine metadata or establish native acceptance.
|
|
21
|
+
- **Breaking visual defaults:** center compact quote and headline-metric regions and image-side explanations; keep dense text, lists, charts and tables top-aligned. FAQ, process, dashboard, pillars, comparison and scorecard layouts no longer add decorative content boxes by default. Existing layout IDs are preserved. These appearance changes require gallery 3 under the pixel-stability policy; record schema remains v2.
|
|
22
|
+
- Picker previews now use authored, explicitly illustrative examples with distinct measures and units, number formats, actual questions and answers, ordered process steps and named responsibilities. Exhaustive stability fixtures remain separate and unchanged.
|
|
23
|
+
|
|
24
|
+
## 2.0.0 (2026-10-11)
|
|
25
|
+
|
|
26
|
+
- **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.
|
|
27
|
+
- 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`.
|
|
28
|
+
- **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.
|
|
29
|
+
- 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.
|
|
30
|
+
- 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.
|
|
31
|
+
|
|
32
|
+
## 1.0.0 (2026-10-10)
|
|
33
|
+
|
|
34
|
+
Released from `3458f50`; the original tagged changelog kept this entry under Unreleased.
|
|
35
|
+
|
|
36
|
+
- 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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenPresentation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,201 @@
|
|
|
1
|
-
#
|
|
1
|
+
# gallery
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The default catalog for Open Presentation: layouts, themes, colour schemes and font schemes for OPF decks, published as
|
|
4
|
+
[`@openpresentation/gallery`](https://www.npmjs.com/package/@openpresentation/gallery) and previewed at
|
|
5
|
+
[pptx.gallery](https://www.pptx.gallery).
|
|
6
|
+
|
|
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: "pillars"`, `design: { theme: "minimal" }`). Engines
|
|
9
|
+
never fetch records: a host registers the catalogs it trusts, and this package is the catalog every OPF host registers by
|
|
10
|
+
default.
|
|
11
|
+
|
|
12
|
+
**2.x is the catalog of OPF 0.19.** Its layouts are the 28 OPF 0.19 layouts named by intent, written as templates
|
|
13
|
+
(`opf-layout/v2`). 1.x holds the 278 OPF 0.18 layouts. 2.0.0 changed the layouts with no migration path: see
|
|
14
|
+
[Layouts](#layouts) and the [changelog](CHANGELOG.md).
|
|
15
|
+
|
|
16
|
+
Gallery 5.x advances the overall catalog compatibility contract to `4`: a layout record is `direction` and one ordered
|
|
17
|
+
list of `regions`, nested for two dimensions, and `areas`, `columns`, `rows` and the `regions` map are gone (FA-33, no
|
|
18
|
+
migration path). The engine packages follow their separate release process. The per-kind layout schema version remains
|
|
19
|
+
`2` and its URI remains `opf-layout/v2`; those identifiers are distinct from the overall catalog contract.
|
|
20
|
+
|
|
21
|
+
## Use
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install @openpresentation/gallery
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { validate } from "@openpresentation/opf";
|
|
29
|
+
import { gallery } from "@openpresentation/gallery";
|
|
30
|
+
|
|
31
|
+
validate(deck, { catalogs: [gallery] });
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Pass `catalogs: [gallery]` to every entry point that resolves references: core's `validate`, `paginate`, `embed` and
|
|
35
|
+
`resolveSlideContext`, and opf-render, opf-pptx and opf-editor, which pass the option through to core. The first
|
|
36
|
+
registered catalog is the default for bare ids. From OPF 0.19, `@openpresentation/opf` depends on this package and its
|
|
37
|
+
Node functions (and the `opf` command) register `gallery` when a call names no catalogs; a browser host registers it
|
|
38
|
+
itself. Save decks with their records embedded (`embed`), so they draw the same whichever gallery version a host
|
|
39
|
+
registers later.
|
|
40
|
+
|
|
41
|
+
| Export | What it is |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `gallery` | The content records by kind and then by id, without `$schema`, `id` or `x-*` members, with `source: "https://www.pptx.gallery"` |
|
|
44
|
+
| `GALLERY_SOURCE` | `https://www.pptx.gallery`, the `source` of a document's `catalogs.default` |
|
|
45
|
+
| `CATALOG_SCHEMA` | The overall catalog compatibility contract (also `opf.catalogSchema` in `package.json`): `4` requires layouts written as `direction` and an ordered `regions` list; layouts retain per-kind schema version `2` and `opf-layout/v2` |
|
|
46
|
+
| `catalogDisplay` | Display metadata for pickers: `chartTypes`, `languages` and `socialPlatforms` by id |
|
|
47
|
+
| `catalogIndexes` | Each kind's `index.json`: the record summaries and their content hash (a layout's entry also has its `summary` and `group`) |
|
|
48
|
+
| `catalogManifest` | The pptx.gallery commit the 1.x records were taken from, and a content hash per kind |
|
|
49
|
+
|
|
50
|
+
`@openpresentation/gallery/previews` exports one SVG preview per layout, keyed by the layout id (`layoutPreviews`,
|
|
51
|
+
`layoutPreviewIndex`, `layoutPreviewSlugs`, `getLayoutPreview`, `hasLayoutPreview`): the layout drawn with sample
|
|
52
|
+
content in every region by the pinned `@openpresentation/opf-render`, a self-contained `<svg>` with a 16:9 viewBox. The
|
|
53
|
+
package has no dependency, not even for its types: `GalleryCatalog` has the shape of core's `Catalog`, so `gallery` is
|
|
54
|
+
assignable to it.
|
|
55
|
+
|
|
56
|
+
## Layouts
|
|
57
|
+
|
|
58
|
+
A slide names a layout by intent; its content flows into the layout's regions, so no layout fixes a block count.
|
|
59
|
+
Variants are design settings on the slide or the deck, not layout ids: cards (`design.contentBox`), one row or one
|
|
60
|
+
column (`contentDirection`), title and content alignment (`titleAlignment`, `contentAlignment`), picture fit
|
|
61
|
+
(`imageFit`) and image bullets (`listBullet`), which a theme can also set, and a mirrored side (`mirror`). A slide with no layout composes
|
|
62
|
+
automatically. A deck's own layouts are records of the same schema under `catalogs.custom.layouts`.
|
|
63
|
+
|
|
64
|
+
| Layout | When to use it |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| **Openers and closers** | |
|
|
67
|
+
| `cover` | The opening slide: title, subtitle and an optional picture. |
|
|
68
|
+
| `section` | A divider between parts: the section title and an optional subtitle. |
|
|
69
|
+
| `agenda` | What the talk covers: the parts, as one list that flows into columns when long. |
|
|
70
|
+
| `statement` | One message, large and alone. |
|
|
71
|
+
| `closing` | The last slide: thanks, the call to action and contact details. |
|
|
72
|
+
| **Text** | |
|
|
73
|
+
| `text` | Prose. Several blocks sit side by side when short and stack when long. |
|
|
74
|
+
| `list` | Bulleted or numbered points; one long list flows into columns. |
|
|
75
|
+
| `quote` | One or more quotations with attribution and photo. |
|
|
76
|
+
| `two-column` | Two independent columns of any content. |
|
|
77
|
+
| **Groups of items** | |
|
|
78
|
+
| `pillars` | Two to six ideas of equal weight, as cards. |
|
|
79
|
+
| `comparison` | Two options side by side (before and after, pros and cons, us and them), with an optional verdict. |
|
|
80
|
+
| `process` | Steps in order, in one row. |
|
|
81
|
+
| `timeline` | Dated events or a roadmap along one axis, with optional notes. |
|
|
82
|
+
| `faq` | Questions with their answers. |
|
|
83
|
+
| **Numbers** | |
|
|
84
|
+
| `metrics` | One to six headline numbers, with an optional note. |
|
|
85
|
+
| `scorecard` | Metrics with commentary or status, as cards. |
|
|
86
|
+
| **Visuals** | |
|
|
87
|
+
| `image` | One picture edge to edge under an optional title. |
|
|
88
|
+
| `image-beside` | A picture or video beside text. |
|
|
89
|
+
| `gallery` | One to six framed pictures: a screenshot, a diagram, a photo set. |
|
|
90
|
+
| `chart` | One to six charts, with an optional note. |
|
|
91
|
+
| `chart-beside` | A chart with the takeaway beside it. |
|
|
92
|
+
| `table` | A table across the slide, with an optional note. |
|
|
93
|
+
| `table-beside` | A table with commentary beside it. |
|
|
94
|
+
| `code` | Source code with the explanation beside it. |
|
|
95
|
+
| **Mixed** | |
|
|
96
|
+
| `hero` | A lead message with a picture and supporting points. |
|
|
97
|
+
| `dashboard` | Headline numbers over charts. |
|
|
98
|
+
| `team` | People: photo, name and role cards. |
|
|
99
|
+
| `logos` | Customer, partner or sponsor logos in a grid of up to 12. |
|
|
100
|
+
|
|
101
|
+
The 1.x ids `agenda`, `comparison`, `dashboard`, `faq`, `timeline` and `two-column` are 2.x layouts of the same id. Every
|
|
102
|
+
other 1.x layout id is gone, with no alias: a deck that names one finds no layout (`opf/unresolved-reference`) and its
|
|
103
|
+
slides compose automatically, unless the deck embeds the old record.
|
|
104
|
+
|
|
105
|
+
### The record
|
|
106
|
+
|
|
107
|
+
A layout record lays its content out with `direction` and an ordered `regions` list. `direction` (`"row"` or `"column"`,
|
|
108
|
+
default `"column"`) says whether the list runs side by side or top to bottom. Each entry is a **region** (`name`, an
|
|
109
|
+
optional `size`, and the rules `accepts`, `role`, `flow`, `max`, `bleed`, `listColumns`, `anchor`, `empty`) or a **split**
|
|
110
|
+
(`direction`, `regions`, an optional `size`) that nests another list, up to three levels. `size` is a weight (default 1):
|
|
111
|
+
siblings share their parent's length in proportion; `"auto"` is the height the content needs and is allowed only in a
|
|
112
|
+
column. `title` and `subtitle` are the heading regions and take only `size`. An `anchor` on the record or on a split
|
|
113
|
+
applies to every region under it unless the region sets its own, and an omitted `accepts` means every content kind.
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"$schema": "https://openpresentation.org/schema/opf-layout/v2",
|
|
118
|
+
"id": "hero",
|
|
119
|
+
"name": "Hero",
|
|
120
|
+
"direction": "column",
|
|
121
|
+
"regions": [
|
|
122
|
+
{ "name": "title" },
|
|
123
|
+
{
|
|
124
|
+
"direction": "row",
|
|
125
|
+
"size": 2,
|
|
126
|
+
"regions": [
|
|
127
|
+
{ "name": "lead", "accepts": ["text", "quote", "metric"], "role": "primary", "flow": "none" },
|
|
128
|
+
{ "name": "media", "accepts": ["image", "video"], "role": "media", "flow": "none" }
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{ "name": "support", "size": 1, "accepts": ["text", "list", "metric", "group"], "role": "supporting", "flow": "grid" }
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Core compiles the list to the grid its engine uses, so the same layout draws the same way it did as a grid.
|
|
137
|
+
|
|
138
|
+
## Versions
|
|
139
|
+
|
|
140
|
+
The gallery is released with the other OPF packages under one shared version (core, the CLI, the renderer, the PPTX exporter,
|
|
141
|
+
the editor and this package; from 0.26.0). The gallery's earlier line (1.0.0 to 5.0.0) is not continued: those versions stay
|
|
142
|
+
on npm, and `latest` points at the shared line, so `^5` consumers keep 5.0.0 and get no further catalog fixes. While the
|
|
143
|
+
shared version is 0.x, a breaking change is a minor bump.
|
|
144
|
+
|
|
145
|
+
- **New records** are allowed in any release. Every existing record draws exactly as before.
|
|
146
|
+
- **A drawing change, a removed or renamed id, or a new record schema (`CATALOG_SCHEMA`)** is declared in the changelog
|
|
147
|
+
fragment for the gallery (`drawing: ["layouts:hero"]`) and makes the release a minor version, never a patch.
|
|
148
|
+
- **Text a drawing never shows** (a name, a summary, a tag), the package code and the declarations change no drawing and
|
|
149
|
+
may ship in a patch.
|
|
150
|
+
|
|
151
|
+
The stability check enforces the rule (`pnpm check:stability`, `scripts/gallery-stability.mjs` at the repository root). It runs
|
|
152
|
+
on every pull request that touches the records or the engines. The baseline is the `latest` published release. For every
|
|
153
|
+
layout, theme, color scheme and font scheme both releases have, it draws a fixture deck with the workspace
|
|
154
|
+
`@openpresentation/opf-render`, once per release: for a layout, a slide with sample content in every region (three blocks in a
|
|
155
|
+
flowing region, one in a `none` region) and a slide with every region empty, which exercises collapse; for a design record, a
|
|
156
|
+
sample deck. SVG bytes are compared first; a mismatch is rasterized to count the pixels that differ. A changed drawing or a
|
|
157
|
+
removed id that no fragment declares fails; a declared id that did not change warns. New ids pass.
|
|
158
|
+
|
|
159
|
+
## Where the records come from
|
|
160
|
+
|
|
161
|
+
All records are written here, in `catalog/`, and reviewed as code:
|
|
162
|
+
|
|
163
|
+
- **Layouts** (`catalog/layouts/`): one short `opf-layout/v2` record per layout (`direction` and an ordered `regions` list).
|
|
164
|
+
- **Themes** carry `variants` (below), written with the theme records.
|
|
165
|
+
- **The other kinds** (color and font schemes, narratives, audiences, purposes, tones and the display kinds) began as a
|
|
166
|
+
snapshot of the catalog pptx.gallery published at `https://www.pptx.gallery/<kind>/index.json`; the pptx.gallery commit is
|
|
167
|
+
recorded in `catalog/manifest.json` as history. The one-way sync from pptx.gallery was retired with 2.0.0 and its script is
|
|
168
|
+
gone; pptx.gallery consumes the published package.
|
|
169
|
+
|
|
170
|
+
## Theme variants
|
|
171
|
+
|
|
172
|
+
A theme record has a `variants` list: `{ "id", "name", "variant" }`, where `variant` is the value of `design.variant` (from
|
|
173
|
+
OPF core 0.23.0): a background slot (`"light1"`, `"light2"`, `"dark1"`, `"dark2"`) or `{ "background", "accents" }` with a
|
|
174
|
+
permutation of `accent1` to `accent6` to reorder the accents. A variant is a map over the theme's one color scheme, as
|
|
175
|
+
PowerPoint's color map is, never a second scheme: dark is the same twelve slots with the text and background roles swapped.
|
|
176
|
+
Every theme offers `light`, `light-alt`, `dark` and `dark-alt`; the variant whose background is the theme's own `background`
|
|
177
|
+
is the theme's look (Minimal's own is `dark2`, so its `dark` is `dark2`). A host applies a variant by writing its `variant`
|
|
178
|
+
value to `design.variant`. There is no separate dark theme: the `dark` theme of 3.x is the `dark` variant of any theme.
|
|
179
|
+
|
|
180
|
+
## Contributing a layout
|
|
181
|
+
|
|
182
|
+
1. Write the record in `catalog/layouts/<id>.json` (`$schema` `https://openpresentation.org/schema/opf-layout/v2`,
|
|
183
|
+
`id`, `name`, `summary`, `tags` with its group, `direction`, `regions` and any `design`; see [The record](#the-record)) and add its
|
|
184
|
+
entry (`id`, `name`, `summary`, `group`, `file`) to `catalog/layouts/index.json` in picker order. A new layout gets a
|
|
185
|
+
new id; an existing id never changes meaning.
|
|
186
|
+
2. `pnpm rehash` (the index and manifest hashes), then `pnpm previews` (its SVG preview).
|
|
187
|
+
3. Run `pnpm test` and `pnpm check:stability`. A new layout passes; if the check reports a changed record, restore it or
|
|
188
|
+
declare it in the changelog fragment (a minor release).
|
|
189
|
+
4. Open a pull request with a `changes/<slug>.md` fragment (`packages: [gallery]`).
|
|
190
|
+
|
|
191
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the checks, the version rule and the license.
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
[MIT](LICENSE). The records, the previews and the code are all under it; `pnpm check:license` checks it.
|
|
196
|
+
|
|
197
|
+
### Editorial layout defaults
|
|
198
|
+
|
|
199
|
+
Compact quote, headline-metric and image-side explanation regions opt into `anchor: "middle"`. Long text, lists and analytical views retain top alignment. A pin still selects a named region; its anchor governs content placement within that region. Centering needs a core engine that measures the content kind; older engines may keep unsupported kinds at the top. Explicit deck and slide design continues to override catalog defaults.
|
|
200
|
+
|
|
201
|
+
Picker examples in `scripts/editorial-previews.mjs` use fictional content and are separate from the unchanged filled/empty stability fixtures. Numeric examples supply units and explicit precision; FAQ previews pair questions with answers, and process previews show ordered actions.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// @openpresentation/gallery: the pptx.gallery catalog for OPF (RR-78).
|
|
2
|
+
//
|
|
3
|
+
// import { gallery } from "@openpresentation/gallery";
|
|
4
|
+
// validate(deck, { catalogs: [gallery] });
|
|
5
|
+
//
|
|
6
|
+
// The package has no dependency, not even for its types: core depends on it, so its declarations are self-contained.
|
|
7
|
+
// `GalleryCatalog` has the shape of core's `Catalog` (@openpresentation/opf), so `gallery` is assignable to it; the
|
|
8
|
+
// package's type test (test/types.ts) checks that against core's own declarations.
|
|
9
|
+
|
|
10
|
+
/** The source the gallery is registered under, and the `source` of a document's `catalogs.default`. */
|
|
11
|
+
export declare const GALLERY_SOURCE: "https://www.pptx.gallery";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The version of core's catalog record compatibility contract these records target (package.json `opf.catalogSchema`). 4 requires
|
|
15
|
+
* layout records written as `direction` and one ordered `regions` list (FA-33); `areas`, `columns`, `rows` and the `regions` map
|
|
16
|
+
* are gone. Per-kind layout schemaVersion 2 and `opf-layout/v2` are unchanged.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CATALOG_SCHEMA: 4;
|
|
19
|
+
|
|
20
|
+
/** Records of one kind, keyed by id (core's `CatalogRecordMap`). */
|
|
21
|
+
export type GalleryRecords = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
22
|
+
|
|
23
|
+
/** The gallery as a registered catalog: core's `Catalog` shape, `source` and the eight content kinds. */
|
|
24
|
+
export interface GalleryCatalog {
|
|
25
|
+
readonly source: typeof GALLERY_SOURCE;
|
|
26
|
+
readonly layouts: GalleryRecords;
|
|
27
|
+
readonly themes: GalleryRecords;
|
|
28
|
+
readonly colorSchemes: GalleryRecords;
|
|
29
|
+
readonly fontSchemes: GalleryRecords;
|
|
30
|
+
readonly narratives: GalleryRecords;
|
|
31
|
+
readonly audiences: GalleryRecords;
|
|
32
|
+
readonly purposes: GalleryRecords;
|
|
33
|
+
readonly tones: GalleryRecords;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The pptx.gallery catalog: every content record by kind and then by id, with no `$schema` or `id` (the key is the id)
|
|
38
|
+
* and no `x-*` display metadata. Register it with every entry point that resolves references: `{ catalogs: [gallery] }`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const gallery: GalleryCatalog;
|
|
41
|
+
|
|
42
|
+
/** Records of one display kind, keyed by id. */
|
|
43
|
+
export type CatalogDisplayRecords = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Display metadata for pickers: chart types, languages and social platforms by id. Documents never reference these
|
|
47
|
+
* records; `chart.type`, the language tag and the `socials` keys are engine vocabularies.
|
|
48
|
+
*/
|
|
49
|
+
export declare const catalogDisplay: {
|
|
50
|
+
readonly chartTypes: CatalogDisplayRecords;
|
|
51
|
+
readonly languages: CatalogDisplayRecords;
|
|
52
|
+
readonly socialPlatforms: CatalogDisplayRecords;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** A summary entry of a kind's `index.json`. */
|
|
56
|
+
export interface CatalogIndexRecord {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly name?: string;
|
|
59
|
+
readonly summary?: string;
|
|
60
|
+
readonly file: string;
|
|
61
|
+
readonly [key: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** A kind's `index.json` (schema https://openpresentation.org/schema/opf-catalog-index/v1). */
|
|
65
|
+
export interface CatalogIndex {
|
|
66
|
+
readonly $schema?: string;
|
|
67
|
+
/** The kind as its URL segment, such as `color-schemes`. */
|
|
68
|
+
readonly kind: string;
|
|
69
|
+
readonly version: string;
|
|
70
|
+
readonly description?: string;
|
|
71
|
+
/** SHA-256 of the canonical JSON of the index-ordered records, `x-*` members removed. */
|
|
72
|
+
readonly contentSha256: string;
|
|
73
|
+
readonly records: readonly CatalogIndexRecord[];
|
|
74
|
+
readonly [key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The kinds the gallery publishes, keyed as in a document's `catalogs` group. */
|
|
78
|
+
export type GalleryKind =
|
|
79
|
+
| "layouts"
|
|
80
|
+
| "themes"
|
|
81
|
+
| "colorSchemes"
|
|
82
|
+
| "fontSchemes"
|
|
83
|
+
| "narratives"
|
|
84
|
+
| "audiences"
|
|
85
|
+
| "purposes"
|
|
86
|
+
| "tones"
|
|
87
|
+
| "chartTypes"
|
|
88
|
+
| "languages"
|
|
89
|
+
| "socialPlatforms";
|
|
90
|
+
|
|
91
|
+
/** Each kind's `index.json`. */
|
|
92
|
+
export declare const catalogIndexes: Readonly<Record<GalleryKind, CatalogIndex>>;
|
|
93
|
+
|
|
94
|
+
/** Where the records came from: the pptx.gallery commit and a content hash per kind (schema opf-catalog-manifest/v1). */
|
|
95
|
+
export declare const catalogManifest: {
|
|
96
|
+
readonly $schema: string;
|
|
97
|
+
readonly publisher: string;
|
|
98
|
+
readonly source: { readonly repository: string; readonly commit: string; readonly path: string };
|
|
99
|
+
readonly kinds: Readonly<Record<string, { readonly mode: string; readonly records: number; readonly contentSha256: string }>>;
|
|
100
|
+
readonly [key: string]: unknown;
|
|
101
|
+
};
|