@openpresentation/opf 0.2.2 → 0.4.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.
Files changed (90) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +74 -3
  3. package/dist/catalogs-x1oFFQnd.d.ts +1198 -0
  4. package/dist/catalogs.d.ts +2 -32413
  5. package/dist/catalogs.js +1 -18505
  6. package/dist/chunk-75N5I6M4.js +229 -0
  7. package/dist/chunk-EMTMQRX4.js +1007 -0
  8. package/dist/chunk-GCXOU5MZ.js +6515 -0
  9. package/dist/chunk-HJNJHB5H.js +454 -0
  10. package/dist/chunk-OZULJBSG.js +3368 -0
  11. package/dist/chunk-PIQXLBBJ.js +445 -0
  12. package/dist/chunk-SOSOBKQ2.js +145 -0
  13. package/dist/chunk-TWMRZ43O.js +18576 -0
  14. package/dist/composition.d.ts +190 -0
  15. package/dist/composition.js +1 -0
  16. package/dist/data.d.ts +32 -0
  17. package/dist/data.js +1 -0
  18. package/dist/docs.d.ts +17 -0
  19. package/dist/docs.js +120 -0
  20. package/dist/examples.d.ts +43 -0
  21. package/dist/examples.js +44828 -0
  22. package/dist/index.d.ts +7 -4
  23. package/dist/index.js +8 -29015
  24. package/dist/pagination.d.ts +52 -0
  25. package/dist/pagination.js +5 -0
  26. package/dist/{validator-MwlR2F56.d.ts → presentation-BjP4yTQ1.d.ts} +87 -40
  27. package/dist/previews.js +1 -447
  28. package/dist/repo-readme.d.ts +4 -0
  29. package/dist/repo-readme.js +7 -0
  30. package/dist/schemas-C1DxapX2.d.ts +206 -0
  31. package/dist/schemas.d.ts +1 -12373
  32. package/dist/schemas.js +1 -6275
  33. package/dist/spec/README.md +57 -0
  34. package/dist/spec/catalogs/audiences/engineering-team.json +1 -1
  35. package/dist/spec/catalogs/audiences/index.json +1 -1
  36. package/dist/spec/catalogs/chart-types/index.json +1 -1
  37. package/dist/spec/catalogs/color-schemes/index.json +1 -1
  38. package/dist/spec/catalogs/font-schemes/index.json +1 -1
  39. package/dist/spec/catalogs/languages/index.json +1 -1
  40. package/dist/spec/catalogs/layouts/chart-1x.json +4 -1
  41. package/dist/spec/catalogs/layouts/chart-2x.json +5 -1
  42. package/dist/spec/catalogs/layouts/chart-3x.json +5 -1
  43. package/dist/spec/catalogs/layouts/code-1x.json +4 -1
  44. package/dist/spec/catalogs/layouts/extract/canonical.json +94 -21
  45. package/dist/spec/catalogs/layouts/image-1x.json +4 -1
  46. package/dist/spec/catalogs/layouts/image-2x.json +5 -1
  47. package/dist/spec/catalogs/layouts/image-3x.json +5 -1
  48. package/dist/spec/catalogs/layouts/index.json +1 -1
  49. package/dist/spec/catalogs/layouts/list-2x.json +4 -1
  50. package/dist/spec/catalogs/layouts/list-3x.json +4 -1
  51. package/dist/spec/catalogs/layouts/list-4x.json +5 -1
  52. package/dist/spec/catalogs/layouts/list-5x.json +5 -1
  53. package/dist/spec/catalogs/layouts/list-6x.json +5 -1
  54. package/dist/spec/catalogs/layouts/media-1x.json +4 -1
  55. package/dist/spec/catalogs/layouts/number-2x.json +4 -1
  56. package/dist/spec/catalogs/layouts/number-3x.json +4 -1
  57. package/dist/spec/catalogs/layouts/number-4x.json +5 -1
  58. package/dist/spec/catalogs/layouts/number-5x.json +5 -1
  59. package/dist/spec/catalogs/layouts/number-6x.json +5 -1
  60. package/dist/spec/catalogs/layouts/table-1x.json +4 -1
  61. package/dist/spec/catalogs/layouts/text-2x.json +4 -1
  62. package/dist/spec/catalogs/layouts/text-3x.json +4 -1
  63. package/dist/spec/catalogs/narratives/index.json +2 -2
  64. package/dist/spec/catalogs/purposes/index.json +1 -1
  65. package/dist/spec/catalogs/social-platforms/index.json +1 -1
  66. package/dist/spec/catalogs/themes/index.json +1 -1
  67. package/dist/spec/catalogs/tones/casual.json +1 -1
  68. package/dist/spec/catalogs/tones/conversational.json +1 -1
  69. package/dist/spec/catalogs/tones/index.json +1 -1
  70. package/dist/spec/catalogs/tones/technical.json +1 -1
  71. package/dist/spec/openapi.yaml +66 -26
  72. package/dist/spec/previews/layouts/index.json +71 -71
  73. package/dist/spec/schemas/catalog-index.schema.json +53 -0
  74. package/dist/spec/schemas/layout-preview-index.schema.json +54 -0
  75. package/dist/spec/schemas/layout.schema.json +63 -0
  76. package/dist/spec/schemas/opf.schema.json +182 -3
  77. package/dist/spec-files.d.ts +14 -2386
  78. package/dist/spec-files.js +1 -3349
  79. package/dist/types.d.ts +4 -1102
  80. package/dist/types.js +0 -2
  81. package/dist/validator.d.ts +33 -3
  82. package/dist/validator.js +4 -6712
  83. package/package.json +29 -4
  84. package/dist/catalogs.js.map +0 -1
  85. package/dist/index.js.map +0 -1
  86. package/dist/previews.js.map +0 -1
  87. package/dist/schemas.js.map +0 -1
  88. package/dist/spec-files.js.map +0 -1
  89. package/dist/types.js.map +0 -1
  90. package/dist/validator.js.map +0 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Data-Advantage
3
+ Copyright (c) 2026 OpenPresentation contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Canonical Open Presentation Format package for JavaScript and TypeScript.
4
4
 
5
- Publishes the OPF schemas, catalog presets, raw spec files, generated TypeScript types, and local validation helpers. The schema is pre-stable (0.x — expect breaking changes between minor versions until 1.0). This package does not render PowerPoint files, parse `.pptx`, fetch remote catalogs, or use AI.
5
+ Publishes the OPF schemas, catalog presets, raw spec files, generated TypeScript types, examples, docs, and local validation helpers. The schema is pre-stable (0.x — expect breaking changes between minor versions until 1.0). This package does not render PowerPoint files, parse `.pptx`, fetch remote catalogs, call hosted APIs, provide telemetry, or use AI.
6
6
 
7
- The canonical npm package remains `@openpresentation/opf`; a separate `@openpresentation/opf-spec` package is not used for v0.2.0 so existing downstream imports stay stable. The packed npm artifact includes package-addressable OPF schemas, catalogs, reference files, and `openapi.yaml` under `spec/`.
7
+ The canonical npm package remains `@openpresentation/opf`; a separate `@openpresentation/opf-spec` package is not used for v0.2.0 so existing downstream imports stay stable. The packed npm artifact includes package-addressable OPF schemas, catalogs, reference files, and an optional downstream-service reference `openapi.yaml` under `spec/`.
8
8
 
9
9
  Repository: https://github.com/OpenPresentation/opf
10
10
 
@@ -67,6 +67,8 @@ import {
67
67
  import type { Presentation, Audience, Tone } from "@openpresentation/opf/types";
68
68
  ```
69
69
 
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
+
70
72
  ### Layout previews
71
73
 
72
74
  `@openpresentation/opf/previews` ships pre-rendered HTML thumbnails for the
@@ -93,6 +95,75 @@ export function LayoutThumbnail({ slug }: { slug: string }) {
93
95
  Raw HTML source-of-truth lives under `spec/previews/layouts/<slug>.html` and is
94
96
  also addressable via `@openpresentation/opf/spec/previews/layouts/<slug>.html`.
95
97
 
98
+ ### Example decks
99
+
100
+ `@openpresentation/opf/examples` ships every `.opf.json` file from `examples/`
101
+ in the upstream repo, already parsed and validated against the presentation
102
+ schema at build time.
103
+
104
+ ```ts
105
+ import {
106
+ examples,
107
+ galleries,
108
+ getExample,
109
+ getExamplesByGallery,
110
+ } from "@openpresentation/opf/examples";
111
+
112
+ const compliance = getExample("compliance-readiness-review");
113
+ const businessDecks = getExamplesByGallery("business-functions");
114
+
115
+ console.log(`${examples.length} example decks across ${galleries.length} galleries`);
116
+ ```
117
+
118
+ Each `ExampleRecord` includes the parsed `Presentation` object plus its
119
+ repo-relative path, top-level category (`gallery`, `technical`, …), and
120
+ gallery slug when applicable.
121
+
122
+ ### Documentation pages
123
+
124
+ `@openpresentation/opf/docs` ships the top-level `docs/*.md` reference pages
125
+ (`schema-reference`, `catalog-schema-reference`, `content-payloads`,
126
+ `content-item-design-overrides`, `examples`). Subdirectories like
127
+ `docs/migrations` and `docs/plans` are intentionally excluded — those move too
128
+ quickly to ship inside a pinned npm release.
129
+
130
+ ```ts
131
+ import { docs, getDoc } from "@openpresentation/opf/docs";
132
+
133
+ for (const doc of docs) {
134
+ console.log(`${doc.title} — ${doc.file}`);
135
+ }
136
+
137
+ const schemaRef = getDoc("schema-reference");
138
+ console.log(schemaRef?.markdown.slice(0, 200));
139
+ ```
140
+
141
+ ### Upstream README
142
+
143
+ `@openpresentation/opf/repo-readme` exposes the raw markdown of the upstream
144
+ `OpenPresentation/opf` README.md at the version pinned by this release. Use it
145
+ when you want to mirror the canonical README inside another site or app
146
+ without doing a network fetch.
147
+
148
+ ```ts
149
+ import { repoReadme } from "@openpresentation/opf/repo-readme";
150
+
151
+ console.log(repoReadme.split("\n").slice(0, 3).join("\n"));
152
+ ```
153
+
154
+ Validation results carry `errors` (structural problems that make `valid`
155
+ false) and `warnings` (advisory issues such as unknown catalog ids in
156
+ `narrative`, `design`, or chart `type` references — these never affect
157
+ `valid`). Documents that declare matching inline `catalogs.<kind>.records[]`
158
+ or a custom `catalogs.<kind>.source` are exempt from unknown-id warnings for
159
+ that kind.
160
+
161
+ ```ts
162
+ const result = validatePresentation(deck);
163
+ if (!result.valid) console.error(result.errors);
164
+ for (const warning of result.warnings) console.warn(warning.path, warning.message);
165
+ ```
166
+
96
167
  Validate catalog records locally:
97
168
 
98
169
  ```ts
@@ -114,7 +185,7 @@ import presentationSchema from "@openpresentation/opf/spec/schemas/opf.schema.js
114
185
  };
115
186
  ```
116
187
 
117
- The raw spec manifest exposes typed package paths for files that should be resolved from npm instead of GitHub:
188
+ The raw spec manifest exposes typed package paths for files that should be resolved from npm instead of GitHub. `openapi.yaml` is a reference contract for downstream services that choose to expose OPF over HTTP; OpenPresentation does not host that API.
118
189
 
119
190
  ```ts
120
191
  import { specFileEntries } from "@openpresentation/opf/spec-files";