@openpresentation/opf 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +7 -1
  2. package/dist/{catalogs-BnnkUX9O.d.ts → catalogs-DoVmvDr7.d.ts} +6 -6
  3. package/dist/catalogs.d.ts +2 -2
  4. package/dist/catalogs.js +1 -1
  5. package/dist/{chunk-GQSK3T7X.js → chunk-D3GQIREP.js} +13 -4
  6. package/dist/chunk-EWJNRHXA.js +595 -0
  7. package/dist/{chunk-3GPZMY2W.js → chunk-FHGJX5QK.js} +24 -12
  8. package/dist/{chunk-JA5W5TVA.js → chunk-PQJRDNA6.js} +624 -73
  9. package/dist/{chunk-OZULJBSG.js → chunk-RS5GZ5RW.js} +14 -0
  10. package/dist/{chunk-TWMRZ43O.js → chunk-TU7I3KSB.js} +59 -21
  11. package/dist/{chunk-ZGV6I23P.js → chunk-ZIL7MGZU.js} +50 -5
  12. package/dist/composition.d.ts +257 -10
  13. package/dist/composition.js +1 -1
  14. package/dist/docs.js +58 -10
  15. package/dist/examples.js +2284 -1417
  16. package/dist/index.d.ts +4 -3
  17. package/dist/index.js +7 -6
  18. package/dist/lint.d.ts +70 -0
  19. package/dist/lint.js +5 -0
  20. package/dist/pagination.d.ts +4 -0
  21. package/dist/pagination.js +5 -5
  22. package/dist/{schemas--QRVBhU1.d.ts → schemas-BYe5y8-i.d.ts} +1 -1
  23. package/dist/schemas.d.ts +1 -1
  24. package/dist/schemas.js +1 -1
  25. package/dist/spec/catalogs/layouts/extract/canonical.json +45 -21
  26. package/dist/spec/catalogs/layouts/index.json +10 -0
  27. package/dist/spec/catalogs/layouts/number-1x.json +1 -1
  28. package/dist/spec/catalogs/layouts/number-2x.json +2 -2
  29. package/dist/spec/catalogs/layouts/number-3x.json +3 -3
  30. package/dist/spec/catalogs/layouts/number-4x.json +4 -4
  31. package/dist/spec/catalogs/layouts/number-5x.json +5 -5
  32. package/dist/spec/catalogs/layouts/number-6x.json +6 -6
  33. package/dist/spec/catalogs/layouts/quote-1x.json +13 -0
  34. package/dist/spec/catalogs/layouts/timeline-1x.json +13 -0
  35. package/dist/spec/schemas/layout.schema.json +12 -3
  36. package/dist/spec/schemas/narrative.schema.json +1 -1
  37. package/dist/spec-files.d.ts +1 -1
  38. package/dist/spec-files.js +1 -1
  39. package/dist/types.d.ts +2 -2
  40. package/dist/validator.d.ts +2 -2
  41. package/dist/validator.js +4 -4
  42. package/package.json +11 -6
package/README.md CHANGED
@@ -22,7 +22,7 @@ pnpm add @openpresentation/opf
22
22
  # or: yarn add @openpresentation/opf
23
23
  ```
24
24
 
25
- Requires Node 20 or later.
25
+ Requires Node 24 starting with version 0.10.0. Earlier published versions retain their recorded runtime requirements.
26
26
 
27
27
  ## Usage
28
28
 
@@ -69,6 +69,12 @@ import type { Presentation, Audience, Tone } from "@openpresentation/opf/types";
69
69
 
70
70
  The root entry exports every schema, catalog, and validation helper for convenience. Prefer the focused subpaths above when a package consumer only needs one surface, so the root bundle's full catalog/schema payload is not loaded unnecessarily.
71
71
 
72
+ ### Contextual lint (0.10.0)
73
+
74
+ Version 0.10.0 adds `lintSource(source, options)` and `lintPresentation(document, options)` from `@openpresentation/opf/lint` and the root API. They report strict JSON syntax, duplicate keys, schema constraints, local catalog alternatives, asset registry errors, and explicit host contracts. Source diagnostics retain original UTF-16 ranges without rewriting the document. Options accept already loaded `catalogs` and `contracts`; no remote resources are fetched.
75
+
76
+ Earlier versions do not include these APIs. See the [lint guide](../../docs/lint.md) for configuration and the source CLI. Passing lint does not certify layout, fonts, or native export fidelity.
77
+
72
78
  ### Layout previews
73
79
 
74
80
  `@openpresentation/opf/previews` ships pre-rendered HTML thumbnails for the
@@ -1,4 +1,4 @@
1
- import { a as SchemaName } from './schemas--QRVBhU1.js';
1
+ import { a as SchemaName } from './schemas-BYe5y8-i.js';
2
2
 
3
3
  /**
4
4
  * Schema for audience records in the pptx.gallery library. Each record names an audience archetype (e.g. 'executives', 'engineering-team', 'investors') and carries seniority, technical-fluency, decision-power, and attention-budget hints used by AI-driven generation. Audiences are referenced from OPF documents via audience; the engine resolves the reference against catalogs.audiences (inline) → catalogs.audiences.source → the default catalog at https://www.pptx.gallery/audiences. The audience field also accepts free-form strings; this catalog is for engine-aware audience archetypes that carry generation hints.
@@ -311,9 +311,9 @@ interface Layout {
311
311
  */
312
312
  description?: string;
313
313
  /**
314
- * Primary kind of content the layout holds. Drives pickers and AI placement decisions.
314
+ * Primary kind of content the layout holds. Drives pickers and AI placement decisions. Metric is the canonical numeric/KPI category; Number remains an accepted legacy label.
315
315
  */
316
- contentType?: ("Title" | "Text" | "List" | "Image" | "Number" | "Chart");
316
+ contentType?: ("Title" | "Text" | "List" | "Image" | "Number" | "Metric" | "Chart" | "Table" | "Code" | "Video" | "Quote" | "Timeline");
317
317
  /**
318
318
  * How many parallel content blocks the layout exposes ('2x' = two-column, '3x' = three-up, etc.).
319
319
  */
@@ -407,9 +407,9 @@ interface Layout {
407
407
  */
408
408
  interface Placeholder {
409
409
  /**
410
- * OPF placeholder kind. 'text' and 'list' are flexible textual content regions. The named kinds describe a specific content role used by pickers, AI generation, and engine defaulting.
410
+ * OPF placeholder kind. 'text' and 'list' are flexible textual content regions. 'metric' is a numeric/KPI content region filled by a metric payload, including its optional label, description, unit, delta, and trend. The named kinds describe a specific content role used by pickers, AI generation, and engine defaulting. 'picture' and legacy 'diagram' use image payloads; 'media' uses video. Quote and timeline use their corresponding payload fields.
411
411
  */
412
- type: ("title" | "subtitle" | "tag" | "text" | "list" | "chart" | "picture" | "table" | "media" | "diagram" | "code");
412
+ type: ("title" | "subtitle" | "tag" | "text" | "metric" | "quote" | "timeline" | "list" | "chart" | "picture" | "table" | "media" | "diagram" | "code");
413
413
  [k: string]: unknown;
414
414
  }
415
415
  /**
@@ -789,7 +789,7 @@ interface Beat {
789
789
  */
790
790
  slideCount?: number;
791
791
  /**
792
- * Default content kind for the beat's slide. Mirrors ContentPayload.type and helps engines choose a sensible layout when only the beat is specified.
792
+ * Default content kind for the beat's slide. Uses ContentPayload.type names to help engines choose a layout. The legacy shape value is retained for compatibility and requests an image representation; it is not a native ContentPayload type.
793
793
  */
794
794
  slideType?: ("text" | "list" | "image" | "shape" | "chart" | "table" | "video" | "code" | "metric" | "quote" | "timeline");
795
795
  /**
@@ -1,2 +1,2 @@
1
- export { C as CatalogEntry, a as CatalogIndex, b as CatalogIndexRecord, c as CatalogKind, d as CatalogRecord, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-BnnkUX9O.js';
2
- import './schemas--QRVBhU1.js';
1
+ export { C as CatalogEntry, a as CatalogIndex, b as CatalogIndexRecord, c as CatalogKind, d as CatalogRecord, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-DoVmvDr7.js';
2
+ import './schemas-BYe5y8-i.js';
package/dist/catalogs.js CHANGED
@@ -1 +1 @@
1
- export { audiences, catalogEntries, catalogIndexes, catalogKinds, catalogSchemaNames, catalogs, chartTypes, colorSchemes, fontSchemes, languages, layouts, narratives, purposes, socialPlatforms, themes, tones } from './chunk-TWMRZ43O.js';
1
+ export { audiences, catalogEntries, catalogIndexes, catalogKinds, catalogSchemaNames, catalogs, chartTypes, colorSchemes, fontSchemes, languages, layouts, narratives, purposes, socialPlatforms, themes, tones } from './chunk-TU7I3KSB.js';
@@ -4873,9 +4873,15 @@ var layout = {
4873
4873
  "List",
4874
4874
  "Image",
4875
4875
  "Number",
4876
- "Chart"
4876
+ "Metric",
4877
+ "Chart",
4878
+ "Table",
4879
+ "Code",
4880
+ "Video",
4881
+ "Quote",
4882
+ "Timeline"
4877
4883
  ],
4878
- "description": "Primary kind of content the layout holds. Drives pickers and AI placement decisions."
4884
+ "description": "Primary kind of content the layout holds. Drives pickers and AI placement decisions. Metric is the canonical numeric/KPI category; Number remains an accepted legacy label."
4879
4885
  },
4880
4886
  "contentMultiple": {
4881
4887
  "type": "string",
@@ -5083,6 +5089,9 @@ var layout = {
5083
5089
  "subtitle",
5084
5090
  "tag",
5085
5091
  "text",
5092
+ "metric",
5093
+ "quote",
5094
+ "timeline",
5086
5095
  "list",
5087
5096
  "chart",
5088
5097
  "picture",
@@ -5091,7 +5100,7 @@ var layout = {
5091
5100
  "diagram",
5092
5101
  "code"
5093
5102
  ],
5094
- "description": "OPF placeholder kind. 'text' and 'list' are flexible textual content regions. The named kinds describe a specific content role used by pickers, AI generation, and engine defaulting."
5103
+ "description": "OPF placeholder kind. 'text' and 'list' are flexible textual content regions. 'metric' is a numeric/KPI content region filled by a metric payload, including its optional label, description, unit, delta, and trend. The named kinds describe a specific content role used by pickers, AI generation, and engine defaulting. 'picture' and legacy 'diagram' use image payloads; 'media' uses video. Quote and timeline use their corresponding payload fields."
5095
5104
  }
5096
5105
  }
5097
5106
  },
@@ -5871,7 +5880,7 @@ var narrative = {
5871
5880
  "quote",
5872
5881
  "timeline"
5873
5882
  ],
5874
- "description": "Default content kind for the beat's slide. Mirrors ContentPayload.type and helps engines choose a sensible layout when only the beat is specified."
5883
+ "description": "Default content kind for the beat's slide. Uses ContentPayload.type names to help engines choose a layout. The legacy shape value is retained for compatibility and requests an image representation; it is not a native ContentPayload type."
5875
5884
  },
5876
5885
  "layoutHint": {
5877
5886
  "type": "string",