@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
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openpresentation.org/schema/opf-layout-preview-index/v1",
4
+ "title": "Layout Preview Index",
5
+ "description": "Shape of `spec/previews/layouts/index.json`, the manifest for the vendored slide-archetype preview gallery under `spec/previews/layouts/`. Each record names a preview id, its self-contained HTML file, and the file's exact UTF-8 byte length. These preview ids are an archetype taxonomy (e.g. 'swot-analysis', 'org-chart') distinct from the structural layout catalog at spec/catalogs/layouts/ (e.g. 'title', 'chart-2x') — see spec/README.md. This schema describes a repo-internal index file, not an OPF document or a catalog record; it is intentionally excluded from the package's published/typed schema surface.",
6
+ "type": "object",
7
+ "required": ["$schema", "version", "description", "records"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string",
12
+ "const": "https://openpresentation.org/schema/opf-layout-preview-index/v1"
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "description": "Index format version, as a string.",
17
+ "examples": ["1"]
18
+ },
19
+ "description": {
20
+ "type": "string",
21
+ "description": "Human-readable description of the preview gallery and its rendering conventions."
22
+ },
23
+ "records": {
24
+ "type": "array",
25
+ "description": "One entry per vendored preview HTML file.",
26
+ "items": { "$ref": "#/$defs/PreviewRecord" }
27
+ }
28
+ },
29
+ "$defs": {
30
+ "PreviewRecord": {
31
+ "type": "object",
32
+ "description": "Summary of one vendored preview HTML file.",
33
+ "required": ["id", "file", "bytes"],
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "id": {
37
+ "type": "string",
38
+ "description": "Slide-archetype preview id (e.g. 'swot-analysis', 'agenda', 'org-chart'). Does not correspond to a spec/catalogs/layouts/ record id.",
39
+ "pattern": "^[a-z][a-z0-9-]*$"
40
+ },
41
+ "file": {
42
+ "type": "string",
43
+ "description": "HTML filename, relative to this index file's directory.",
44
+ "pattern": "^[^/]+\\.html$"
45
+ },
46
+ "bytes": {
47
+ "type": "integer",
48
+ "minimum": 0,
49
+ "description": "Exact UTF-8 byte length of the referenced HTML file's contents."
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -247,6 +247,9 @@
247
247
  ]
248
248
  }
249
249
  }
250
+ },
251
+ "composition": {
252
+ "$ref": "#/$defs/Composition"
250
253
  }
251
254
  },
252
255
  "$defs": {
@@ -275,6 +278,66 @@
275
278
  "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."
276
279
  }
277
280
  }
281
+ },
282
+ "Composition": {
283
+ "type": "object",
284
+ "additionalProperties": false,
285
+ "description": "Portable dynamic composition. Slide fields override the resolved layout. Nested groups arrange their children independently, inheriting only minFontSize and overflow. Explicit promoted regions retain their positions.",
286
+ "properties": {
287
+ "mode": {
288
+ "type": "string",
289
+ "enum": [
290
+ "auto",
291
+ "grid",
292
+ "row",
293
+ "column"
294
+ ],
295
+ "description": "auto chooses a grid from available space and content; grid uses columns; row and column use one horizontal or vertical track."
296
+ },
297
+ "columns": {
298
+ "type": "integer",
299
+ "minimum": 1,
300
+ "maximum": 12,
301
+ "description": "Column count for grid. In auto mode this caps the number of columns."
302
+ },
303
+ "gap": {
304
+ "type": "number",
305
+ "minimum": 0,
306
+ "maximum": 0.1,
307
+ "description": "Space between cells as a fraction of the container short edge (canvas at slide root). Default 0.03333333333333333."
308
+ },
309
+ "padding": {
310
+ "type": "number",
311
+ "minimum": 0,
312
+ "maximum": 0.2,
313
+ "description": "Inset as a fraction of the container short edge. Default 0.08 on a slide, 0 inside a group."
314
+ },
315
+ "weights": {
316
+ "type": "array",
317
+ "minItems": 1,
318
+ "maxItems": 12,
319
+ "items": {
320
+ "type": "number",
321
+ "exclusiveMinimum": 0,
322
+ "maximum": 100
323
+ },
324
+ "description": "Relative track sizes: columns for row/grid/auto, rows for column. Omitted tracks have weight 1; extra weights are ignored."
325
+ },
326
+ "minFontSize": {
327
+ "type": "number",
328
+ "minimum": 8,
329
+ "maximum": 32,
330
+ "description": "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."
331
+ },
332
+ "overflow": {
333
+ "type": "string",
334
+ "enum": [
335
+ "warn",
336
+ "error"
337
+ ],
338
+ "description": "warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn."
339
+ }
340
+ }
278
341
  }
279
342
  }
280
343
  }
@@ -1808,17 +1808,21 @@
1808
1808
  "hidden": {
1809
1809
  "type": "boolean",
1810
1810
  "description": "Whether the slide is hidden from the presented sequence."
1811
+ },
1812
+ "composition": {
1813
+ "$ref": "#/$defs/Composition"
1811
1814
  }
1812
1815
  }
1813
1816
  },
1814
1817
  "ContentPayload": {
1815
1818
  "type": "object",
1816
- "description": "A single content payload. The optional 'type' discriminator can make intent explicit, but validators and engines infer it from fields such as text, bullets, items, image, video, chart, table, code, metric, quote, or timeline.",
1819
+ "description": "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.",
1817
1820
  "additionalProperties": false,
1818
1821
  "properties": {
1819
1822
  "type": {
1820
1823
  "type": "string",
1821
- "enum": ["text", "list", "image", "chart", "table", "video", "code", "metric", "quote", "timeline"],
1824
+ "enum": ["text", "list", "image", "chart", "table", "video", "code", "metric", "quote", "timeline",
1825
+ "group"],
1822
1826
  "description": "Optional content kind. When omitted, engines infer the kind from the fields present."
1823
1827
  },
1824
1828
  "text": {
@@ -1950,6 +1954,18 @@
1950
1954
  ]
1951
1955
  }
1952
1956
  ]
1957
+ },
1958
+ "blocks": {
1959
+ "type": "array",
1960
+ "minItems": 1,
1961
+ "items": {
1962
+ "$ref": "#/$defs/ContentPayload"
1963
+ },
1964
+ "description": "Ordered children of a group. Each child is a leaf or another group."
1965
+ },
1966
+ "composition": {
1967
+ "$ref": "#/$defs/Composition",
1968
+ "description": "Arrangement within this group. Only minFontSize and overflow inherit from the parent; strict overflow cannot be weakened."
1953
1969
  }
1954
1970
  },
1955
1971
  "allOf": [
@@ -2033,6 +2049,108 @@
2033
2049
  "then": {
2034
2050
  "required": ["timeline"]
2035
2051
  }
2052
+ },
2053
+ {
2054
+ "if": {
2055
+ "required": [
2056
+ "type"
2057
+ ],
2058
+ "properties": {
2059
+ "type": {
2060
+ "const": "group"
2061
+ }
2062
+ }
2063
+ },
2064
+ "then": {
2065
+ "required": [
2066
+ "blocks"
2067
+ ]
2068
+ }
2069
+ },
2070
+ {
2071
+ "if": {
2072
+ "required": [
2073
+ "composition"
2074
+ ]
2075
+ },
2076
+ "then": {
2077
+ "required": [
2078
+ "blocks"
2079
+ ]
2080
+ }
2081
+ },
2082
+ {
2083
+ "if": {
2084
+ "required": [
2085
+ "blocks"
2086
+ ]
2087
+ },
2088
+ "then": {
2089
+ "properties": {
2090
+ "type": {
2091
+ "const": "group"
2092
+ }
2093
+ },
2094
+ "not": {
2095
+ "anyOf": [
2096
+ {
2097
+ "required": [
2098
+ "text"
2099
+ ]
2100
+ },
2101
+ {
2102
+ "required": [
2103
+ "items"
2104
+ ]
2105
+ },
2106
+ {
2107
+ "required": [
2108
+ "bullets"
2109
+ ]
2110
+ },
2111
+ {
2112
+ "required": [
2113
+ "image"
2114
+ ]
2115
+ },
2116
+ {
2117
+ "required": [
2118
+ "video"
2119
+ ]
2120
+ },
2121
+ {
2122
+ "required": [
2123
+ "chart"
2124
+ ]
2125
+ },
2126
+ {
2127
+ "required": [
2128
+ "table"
2129
+ ]
2130
+ },
2131
+ {
2132
+ "required": [
2133
+ "code"
2134
+ ]
2135
+ },
2136
+ {
2137
+ "required": [
2138
+ "metric"
2139
+ ]
2140
+ },
2141
+ {
2142
+ "required": [
2143
+ "quote"
2144
+ ]
2145
+ },
2146
+ {
2147
+ "required": [
2148
+ "timeline"
2149
+ ]
2150
+ }
2151
+ ]
2152
+ }
2153
+ }
2036
2154
  }
2037
2155
  ]
2038
2156
  },
@@ -2314,7 +2432,8 @@
2314
2432
  },
2315
2433
  "fontSize": {
2316
2434
  "type": "number",
2317
- "description": "Run font size in points."
2435
+ "exclusiveMinimum": 0,
2436
+ "description": "Requested run font size in points."
2318
2437
  },
2319
2438
  "fontFamily": {
2320
2439
  "type": "string",
@@ -2538,6 +2657,66 @@
2538
2657
  "pkg:@acme/decks/narratives",
2539
2658
  "pkg:pptx-gallery"
2540
2659
  ]
2660
+ },
2661
+ "Composition": {
2662
+ "type": "object",
2663
+ "additionalProperties": false,
2664
+ "description": "Portable dynamic composition. Slide fields override the resolved layout. Nested groups arrange their children independently, inheriting only minFontSize and overflow. Explicit promoted regions retain their positions.",
2665
+ "properties": {
2666
+ "mode": {
2667
+ "type": "string",
2668
+ "enum": [
2669
+ "auto",
2670
+ "grid",
2671
+ "row",
2672
+ "column"
2673
+ ],
2674
+ "description": "auto chooses a grid from available space and content; grid uses columns; row and column use one horizontal or vertical track."
2675
+ },
2676
+ "columns": {
2677
+ "type": "integer",
2678
+ "minimum": 1,
2679
+ "maximum": 12,
2680
+ "description": "Column count for grid. In auto mode this caps the number of columns."
2681
+ },
2682
+ "gap": {
2683
+ "type": "number",
2684
+ "minimum": 0,
2685
+ "maximum": 0.1,
2686
+ "description": "Space between cells as a fraction of the container short edge (canvas at slide root). Default 0.03333333333333333."
2687
+ },
2688
+ "padding": {
2689
+ "type": "number",
2690
+ "minimum": 0,
2691
+ "maximum": 0.2,
2692
+ "description": "Inset as a fraction of the container short edge. Default 0.08 on a slide, 0 inside a group."
2693
+ },
2694
+ "weights": {
2695
+ "type": "array",
2696
+ "minItems": 1,
2697
+ "maxItems": 12,
2698
+ "items": {
2699
+ "type": "number",
2700
+ "exclusiveMinimum": 0,
2701
+ "maximum": 100
2702
+ },
2703
+ "description": "Relative track sizes: columns for row/grid/auto, rows for column. Omitted tracks have weight 1; extra weights are ignored."
2704
+ },
2705
+ "minFontSize": {
2706
+ "type": "number",
2707
+ "minimum": 8,
2708
+ "maximum": 32,
2709
+ "description": "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."
2710
+ },
2711
+ "overflow": {
2712
+ "type": "string",
2713
+ "enum": [
2714
+ "warn",
2715
+ "error"
2716
+ ],
2717
+ "description": "warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn."
2718
+ }
2719
+ }
2541
2720
  }
2542
2721
  }
2543
2722
  }