@openpresentation/opf 0.32.0 → 0.33.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 (95) hide show
  1. package/README.md +9 -0
  2. package/dist/browser.js +20 -20
  3. package/dist/{catalog-refs-kAefsZWT.d.ts → catalog-refs-B_0_vZg0.d.ts} +5 -0
  4. package/dist/{catalog-schemas-LdqOPebq.d.ts → catalog-schemas-CQTM-G8p.d.ts} +10 -4
  5. package/dist/{chunk-CLRYHWQN.js → chunk-ABWEUXLV.js} +72 -6
  6. package/dist/{chunk-XFHXQCXL.js → chunk-BI4ERFAA.js} +52 -1
  7. package/dist/{chunk-56J345KE.js → chunk-DAS75LGR.js} +3 -3
  8. package/dist/{chunk-F7DN33UL.js → chunk-E7WQHMCL.js} +6 -6
  9. package/dist/chunk-IJXKVM4W.js +221 -0
  10. package/dist/{chunk-AQEAZDL2.js → chunk-INIMUBSE.js} +2 -1
  11. package/dist/{chunk-NEJ32O7X.js → chunk-KVHNDHVS.js} +1 -1
  12. package/dist/{chunk-NVAJASOD.js → chunk-OPVJLL7H.js} +6867 -1862
  13. package/dist/{chunk-GM7WFPGG.js → chunk-PRXZD2II.js} +6 -1
  14. package/dist/{chunk-BBVW5ZC2.js → chunk-QD6DPS7X.js} +2 -2
  15. package/dist/{chunk-LEF4X4KI.js → chunk-QF5RSRXU.js} +1797 -170
  16. package/dist/{chunk-HKUV7NEN.js → chunk-R6C6BQOG.js} +1 -1
  17. package/dist/{chunk-IT7FQKED.js → chunk-S5QRGMUQ.js} +6 -6
  18. package/dist/{chunk-OXLA4HXQ.js → chunk-UK3J6FSU.js} +346 -53
  19. package/dist/{chunk-XQO2CT6Q.js → chunk-VKEYV3ZK.js} +1 -1
  20. package/dist/{chunk-7U3TJBXE.js → chunk-VMBLNCX2.js} +31 -13
  21. package/dist/{chunk-YFJIIIOL.js → chunk-VSBZC2PR.js} +2 -2
  22. package/dist/{chunk-UJSAR6GF.js → chunk-W4DYDRV2.js} +21 -0
  23. package/dist/{chunk-J63CIRIV.js → chunk-XANW7MB7.js} +4 -4
  24. package/dist/{chunk-PB7ME64J.js → chunk-XIOC6N5P.js} +1 -1
  25. package/dist/{chunk-2E6CDYL2.js → chunk-Y557TYML.js} +5 -5
  26. package/dist/{chunk-SW676APJ.js → chunk-YS333HLA.js} +2 -2
  27. package/dist/chunk-YYT6N7AI.js +642 -0
  28. package/dist/chunk-ZXOIGUHX.js +1 -0
  29. package/dist/{composition-DRqNGHJV.d.ts → composition-zMiIgzip.d.ts} +2353 -272
  30. package/dist/composition.d.ts +3 -2
  31. package/dist/composition.js +2 -2
  32. package/dist/conversion-POHRAMSN.js +24 -0
  33. package/dist/{conversion-Cadul8Mu.d.ts → conversion-mNth9XKm.d.ts} +20 -9
  34. package/dist/convert.d.ts +3 -2
  35. package/dist/convert.js +9 -9
  36. package/dist/data.d.ts +1 -1
  37. package/dist/data.js +3 -3
  38. package/dist/{deck-report-BA3IPJAV.d.ts → deck-report-BSlRiR0_.d.ts} +3 -3
  39. package/dist/deck.d.ts +6 -5
  40. package/dist/deck.js +12 -12
  41. package/dist/diagram-engine-eager.js +1 -1
  42. package/dist/diagram-engine-lazy.js +1 -1
  43. package/dist/diff.js +5 -5
  44. package/dist/docs.js +48 -24
  45. package/dist/examples.js +7507 -142
  46. package/dist/font-policy.js +1 -1
  47. package/dist/format.js +3 -3
  48. package/dist/ids.js +5 -5
  49. package/dist/index.d.ts +13 -12
  50. package/dist/index.js +24 -24
  51. package/dist/markdown.d.ts +2 -1
  52. package/dist/markdown.js +9 -9
  53. package/dist/node-engine.d.ts +7 -6
  54. package/dist/node-engine.js +24 -24
  55. package/dist/{pagination-DwEkdJ6s.d.ts → pagination-CYzNMazO.d.ts} +20 -3
  56. package/dist/pagination.d.ts +4 -3
  57. package/dist/pagination.js +5 -5
  58. package/dist/patch.js +4 -4
  59. package/dist/precompiled.js +3 -3
  60. package/dist/{presentation-DnD7mfmf.d.ts → presentation-CXhfpB_z.d.ts} +876 -39
  61. package/dist/repo-readme.js +2 -2
  62. package/dist/schema-engine-ajv.js +2 -2
  63. package/dist/schema-engine-precompiled.js +3 -3
  64. package/dist/schema.d.ts +2 -2
  65. package/dist/schema.js +4 -4
  66. package/dist/schemas.d.ts +40 -4
  67. package/dist/schemas.js +2 -2
  68. package/dist/shape-catalog.d.ts +98 -0
  69. package/dist/shape-catalog.js +302 -0
  70. package/dist/shape-engine-eager.js +9 -0
  71. package/dist/shape-engine-lazy.js +12 -0
  72. package/dist/shape-engine-module-BK7JNEUV.js +3 -0
  73. package/dist/shape-geometry.d.ts +126 -0
  74. package/dist/shape-geometry.js +2 -0
  75. package/dist/source.js +11 -11
  76. package/dist/spec/README.md +1 -1
  77. package/dist/spec/reference/preset-geometry.json +10699 -0
  78. package/dist/spec/reference/preset-geometry.schema.json +126 -0
  79. package/dist/spec/schemas/catalog-index.schema.json +1 -0
  80. package/dist/spec/schemas/chart-type.schema.json +4 -4
  81. package/dist/spec/schemas/icon-set.schema.json +75 -0
  82. package/dist/spec/schemas/layout.schema.json +14 -1
  83. package/dist/spec/schemas/opf.schema.json +1144 -196
  84. package/dist/spec-files.d.ts +1 -1
  85. package/dist/spec-files.js +2 -2
  86. package/dist/symbol-font-encodings.js +1 -1
  87. package/dist/types.d.ts +10 -6
  88. package/dist/{validation-types-vVah_PEv.d.ts → validation-types-COwTel3H.d.ts} +2 -2
  89. package/dist/validator.d.ts +5 -4
  90. package/dist/validator.js +4 -4
  91. package/dist/yaml.d.ts +2 -1
  92. package/dist/yaml.js +8 -8
  93. package/package.json +24 -8
  94. package/dist/chunk-DGS47ONG.js +0 -1
  95. package/dist/conversion-J3YPDS7C.js +0 -24
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openpresentation.org/schema/opf-preset-geometry/v1",
4
+ "title": "OPF preset shape geometry",
5
+ "description": "Schema for spec/reference/preset-geometry.json (shapes SH-01): the 187 DrawingML preset shapes of ECMA-376 Part 1 (ST_ShapeType) in the standard's own names and units, generated by scripts/build-preset-geometry.mjs from the standard's presetShapeDefinitions.xml. Reference data for engines, not part of the OPF document contract.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["description", "version", "source", "errata", "shapes"],
9
+ "properties": {
10
+ "$schema": { "type": "string" },
11
+ "description": { "type": "string", "minLength": 1 },
12
+ "version": { "type": "integer", "minimum": 1 },
13
+ "source": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["name", "distribution", "url", "commit", "license", "licenseUrl", "notice", "standard", "sha256"],
17
+ "properties": {
18
+ "name": { "type": "string" },
19
+ "distribution": { "type": "string" },
20
+ "url": { "type": "string", "format": "uri" },
21
+ "commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
22
+ "license": { "const": "Apache-2.0" },
23
+ "licenseUrl": { "type": "string", "format": "uri" },
24
+ "notice": { "type": "string" },
25
+ "standard": { "type": "string" },
26
+ "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
27
+ }
28
+ },
29
+ "errata": {
30
+ "description": "Corrections of the standard's file to what PowerPoint draws, each with the value it replaces.",
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["shape", "field", "from", "to", "note"],
36
+ "properties": {
37
+ "shape": { "type": "string" },
38
+ "field": { "enum": ["avLst", "gdLst", "ahLst", "cxnLst", "rect", "pathLst"] },
39
+ "index": { "type": "integer", "minimum": 0 },
40
+ "from": {},
41
+ "to": {},
42
+ "note": { "type": "string" }
43
+ }
44
+ }
45
+ },
46
+ "shapes": {
47
+ "type": "object",
48
+ "minProperties": 187,
49
+ "maxProperties": 187,
50
+ "propertyNames": { "pattern": "^[a-zA-Z0-9]+$" },
51
+ "additionalProperties": { "$ref": "#/$defs/shape" }
52
+ }
53
+ },
54
+ "$defs": {
55
+ "value": {
56
+ "description": "A guide name (built-in or defined earlier) or an integer literal, as the standard writes it.",
57
+ "type": "string",
58
+ "pattern": "^(-?[0-9]+|[a-zA-Z0-9]+)$"
59
+ },
60
+ "guide": {
61
+ "description": "[name, formula]: the formula's operator and its operands, space separated.",
62
+ "type": "array",
63
+ "prefixItems": [{ "type": "string" }, { "type": "string", "pattern": "^(\\*/|\\+-|\\+/|\\?:|abs|at2|cat2|cos|max|min|mod|pin|sat2|sin|sqrt|tan|val) " }],
64
+ "minItems": 2,
65
+ "maxItems": 2
66
+ },
67
+ "point": { "type": "array", "items": { "$ref": "#/$defs/value" }, "minItems": 2, "maxItems": 2 },
68
+ "handle": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["type", "pos"],
72
+ "properties": {
73
+ "type": { "enum": ["xy", "polar"] },
74
+ "gdRefX": { "type": "string" },
75
+ "minX": { "$ref": "#/$defs/value" },
76
+ "maxX": { "$ref": "#/$defs/value" },
77
+ "gdRefY": { "type": "string" },
78
+ "minY": { "$ref": "#/$defs/value" },
79
+ "maxY": { "$ref": "#/$defs/value" },
80
+ "gdRefR": { "type": "string" },
81
+ "minR": { "$ref": "#/$defs/value" },
82
+ "maxR": { "$ref": "#/$defs/value" },
83
+ "gdRefAng": { "type": "string" },
84
+ "minAng": { "$ref": "#/$defs/value" },
85
+ "maxAng": { "$ref": "#/$defs/value" },
86
+ "pos": { "$ref": "#/$defs/point" }
87
+ }
88
+ },
89
+ "command": {
90
+ "type": "array",
91
+ "prefixItems": [{ "enum": ["moveTo", "lnTo", "arcTo", "quadBezTo", "cubicBezTo", "close"] }],
92
+ "items": { "$ref": "#/$defs/value" },
93
+ "minItems": 1,
94
+ "maxItems": 7
95
+ },
96
+ "path": {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "required": ["commands"],
100
+ "properties": {
101
+ "w": { "type": "integer", "minimum": 0 },
102
+ "h": { "type": "integer", "minimum": 0 },
103
+ "fill": { "enum": ["norm", "none", "lighten", "lightenLess", "darken", "darkenLess"] },
104
+ "stroke": { "type": "boolean" },
105
+ "extrusionOk": { "type": "boolean" },
106
+ "commands": { "type": "array", "items": { "$ref": "#/$defs/command" }, "minItems": 1 }
107
+ }
108
+ },
109
+ "shape": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["pathLst"],
113
+ "properties": {
114
+ "avLst": { "type": "array", "items": { "$ref": "#/$defs/guide" } },
115
+ "gdLst": { "type": "array", "items": { "$ref": "#/$defs/guide" } },
116
+ "ahLst": { "type": "array", "items": { "$ref": "#/$defs/handle" } },
117
+ "cxnLst": {
118
+ "type": "array",
119
+ "items": { "type": "array", "items": { "$ref": "#/$defs/value" }, "minItems": 3, "maxItems": 3 }
120
+ },
121
+ "rect": { "type": "array", "items": { "$ref": "#/$defs/value" }, "minItems": 4, "maxItems": 4 },
122
+ "pathLst": { "type": "array", "items": { "$ref": "#/$defs/path" }, "minItems": 1 }
123
+ }
124
+ }
125
+ }
126
+ }
@@ -25,6 +25,7 @@
25
25
  "chart-types",
26
26
  "color-schemes",
27
27
  "font-schemes",
28
+ "icon-sets",
28
29
  "languages",
29
30
  "layouts",
30
31
  "narratives",
@@ -3,7 +3,7 @@
3
3
  "$id": "https://openpresentation.org/schema/opf-chart-type/v1",
4
4
  "$comment": "The v1 in the $id is the pre-1.0 line, not a frozen contract: this schema may change in any 0.x minor release. The release that produced this copy is the version of the @openpresentation/opf package it came from (opf --version; opf schemas lists it next to each id). See docs/schema-versioning.md.",
5
5
  "title": "Chart Type",
6
- "description": "Schema for chart-type records: display metadata for chart pickers (name, group, expected series, complexity) and the Open XML mapping a picker can describe. One record per chart type that Aspose.Slides officially supports (see mappings.renderers[\"aspose-slides\"].chartType), plus the column-and-line combination 'combo'. A document's chart.type is an engine vocabulary validated directly; engines never look a chart-type record up. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.chartTypes.",
6
+ "description": "Schema for chart-type records: display metadata for chart pickers (name, group, expected series, complexity) and the Open XML mapping a picker can describe. One record per chart type that OPF supports natively in its preview and PPTX export, plus the column-and-line combination 'combo'. A document's chart.type is an engine vocabulary validated directly; engines never look a chart-type record up. pptx.gallery publishes these records and @openpresentation/gallery ships them as catalogDisplay.chartTypes.",
7
7
  "type": "object",
8
8
  "additionalProperties": false,
9
9
  "patternProperties": {
@@ -175,15 +175,15 @@
175
175
  },
176
176
  "renderers": {
177
177
  "type": "object",
178
- "description": "Optional renderer-specific mappings. Keys are renderer ids; values are intentionally opaque to OPF. The bundled catalog records the matching Aspose.Slides ChartType enumeration member under the \"aspose-slides\" key, e.g. {\"aspose-slides\": {\"chartType\": \"StackedColumn\"}}; a mixed composition names the ChartType it starts from and the series type it switches series to, e.g. {\"chartType\": \"ClusteredColumn\", \"lineSeriesType\": \"LineWithMarkers\"}.",
178
+ "description": "Optional renderer-specific mappings. Keys are renderer ids; values are intentionally opaque to OPF. The bundled catalog records carry none.",
179
179
  "additionalProperties": {
180
180
  "type": "object",
181
181
  "additionalProperties": true
182
182
  },
183
183
  "examples": [
184
184
  {
185
- "aspose-slides": {
186
- "chartType": "ClusteredColumn"
185
+ "example-renderer": {
186
+ "chartType": "StackedColumn"
187
187
  }
188
188
  }
189
189
  ]
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openpresentation.org/schema/opf-icon-set/v1",
4
+ "$comment": "The v1 in the $id is the pre-1.0 line, not a frozen contract: this schema may change in any 0.x minor release. The release that produced this copy is the version of the @openpresentation/opf package it came from (opf --version; opf schemas lists it next to each id). See docs/schema-versioning.md.",
5
+ "title": "Icon Set",
6
+ "description": "Schema for icon-set records (LH-14): one set of icons that share a viewBox and a style, each icon as SVG path data. An OPF `icon` names one as `<set>:<name>` (docs/icons.md). @openpresentation/gallery ships Lucide and Tabler outline, generated from their npm packages; a host registers them as `galleryIconSets` of `@openpresentation/gallery/icon-sets` and loads a set only when a deck uses it, and a document embeds only the icons it uses under `catalogs.<group>.iconSets.<id>` (a record without `$schema`, `id`, `licenseText` or `tags`).",
7
+ "type": "object",
8
+ "required": ["$schema", "id", "name", "license", "copyright", "viewBox", "style", "icons"],
9
+ "additionalProperties": false,
10
+ "patternProperties": {
11
+ "^x-": { "description": "Publisher extension member, ignored by engines and stripped when a record is embedded." }
12
+ },
13
+ "properties": {
14
+ "$schema": {
15
+ "type": "string",
16
+ "const": "https://openpresentation.org/schema/opf-icon-set/v1",
17
+ "description": "Identifies this record as an icon set."
18
+ },
19
+ "id": {
20
+ "type": "string",
21
+ "pattern": "^[a-z][a-z0-9-]*$",
22
+ "description": "The set's id, the part of an icon reference before the colon. `asset` is not a set id: `asset:<id>` is an asset reference.",
23
+ "not": { "const": "asset" },
24
+ "examples": ["lucide", "tabler"]
25
+ },
26
+ "name": { "type": "string", "description": "Human-readable set name shown in pickers.", "examples": ["Lucide", "Tabler outline"] },
27
+ "summary": { "type": "string", "description": "One line on what the set looks like." },
28
+ "version": { "type": "string", "description": "The version of the source the icons were taken from, such as the npm package version.", "examples": ["1.68.0"] },
29
+ "package": { "type": "string", "description": "The npm package the icons were generated from.", "examples": ["lucide-static", "@tabler/icons"] },
30
+ "homepage": { "type": "string", "format": "uri", "description": "Where the set is published." },
31
+ "license": { "type": "string", "description": "The SPDX license id of the icons.", "examples": ["ISC", "MIT"] },
32
+ "copyright": { "type": "string", "description": "The copyright notice the license asks every copy to keep." },
33
+ "licenseText": { "type": "string", "description": "The full license text, as the source package ships it." },
34
+ "viewBox": {
35
+ "type": "array",
36
+ "description": "The one viewBox every icon of the set is drawn in: min-x, min-y, width, height.",
37
+ "prefixItems": [{ "type": "number" }, { "type": "number" }, { "type": "number", "exclusiveMinimum": 0 }, { "type": "number", "exclusiveMinimum": 0 }],
38
+ "items": false,
39
+ "minItems": 4,
40
+ "examples": [[0, 0, 24, 24]]
41
+ },
42
+ "style": {
43
+ "type": "string",
44
+ "enum": ["stroke", "fill"],
45
+ "description": "How a string icon draws: `stroke` strokes its path at `strokeWidth` with no fill, `fill` fills it (nonzero rule)."
46
+ },
47
+ "strokeWidth": { "type": "number", "exclusiveMinimum": 0, "description": "The stroke width in viewBox units (stroke sets). Default 2." },
48
+ "strokeLinecap": { "type": "string", "enum": ["butt", "round", "square"], "description": "The stroke's line caps. Default round." },
49
+ "strokeLinejoin": { "type": "string", "enum": ["miter", "round", "bevel"], "description": "The stroke's line joins. Default round." },
50
+ "icons": {
51
+ "type": "object",
52
+ "description": "The icons by name. A string is the icon's path data, drawn as `style` says; an object separates the parts a stroke set strokes (`stroke`) from those it fills (`fill`). Every icon is one color: the engines draw it in the accent.",
53
+ "propertyNames": { "pattern": "^[a-z0-9][a-z0-9-]*$" },
54
+ "additionalProperties": {
55
+ "oneOf": [
56
+ { "type": "string", "minLength": 1 },
57
+ {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "minProperties": 1,
61
+ "properties": {
62
+ "stroke": { "type": "string", "minLength": 1 },
63
+ "fill": { "type": "string", "minLength": 1 }
64
+ }
65
+ }
66
+ ]
67
+ }
68
+ },
69
+ "tags": {
70
+ "type": "object",
71
+ "description": "Search keywords by icon name, from the source package: what an icon search (the MCP's search_icons, pptx.gallery) matches besides the name.",
72
+ "additionalProperties": { "type": "array", "items": { "type": "string" } }
73
+ }
74
+ }
75
+ }
@@ -344,10 +344,11 @@
344
344
  "quote",
345
345
  "timeline",
346
346
  "diagram",
347
+ "shape",
347
348
  "group"
348
349
  ]
349
350
  },
350
- "description": "Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A group is also accepted where every one of its leaf kinds is. Omitted: every body content kind and 'group'.",
351
+ "description": "Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A region that takes 'image' also takes a shape block (SH-02). A group is also accepted where every one of its leaf kinds is. Omitted: every body content kind and 'group'.",
351
352
  "examples": [
352
353
  [
353
354
  "text",
@@ -416,6 +417,18 @@
416
417
  ],
417
418
  "description": "The region lists the steps of a sequence (LH-07). 'steps': two or more text or list blocks are the steps, each under a numbered badge (an accent circle with its numeral; a one-entry numbered list gives the badge its number and draws as a heading over its description) on one connector line through the badge centers; a lone list's entries are the steps, each beside its badge on a connector down the badge column; a lone list of 3 to 6 entries of one or two words is a flow of chips joined by arrows. 'numbered' (an agenda, ordered by nature): every list of two or more entries of one level draws its entries beside badges, numbered or not; an unnumbered list is counted in arabic, continuing from the region's previous unnumbered list, as drawing only (the document keeps no numbering). Steps keep the text size they have without the badges: a slide whose blocks would get smaller draws them as before. Absent: the region's content draws as any other."
418
419
  },
420
+ "arrangement": {
421
+ "type": "string",
422
+ "enum": [
423
+ "pyramid",
424
+ "matrix",
425
+ "cycle",
426
+ "chevrons",
427
+ "flow",
428
+ "vertical-flow"
429
+ ],
430
+ "description": "SH-09: the region draws its lone list of one level as a diagram (docs/smartart.md), in the first design that holds every entry at one size, the list's role size or larger (up to 1.5 times), never smaller: PowerPoint's own geometry (Basic Pyramid: 1 to 8 entries as stacked levels, the first at the apex; Basic Matrix: exactly four entries as the quadrants of a centered square over a diamond; SH-18, Basic Cycle: 1 to 8 entries as circles on a ring, the first at the top and the rest clockwise, with an arrow from each to the next, in a frame of the cycle's own proportion centered in the region), which the PPTX export writes as live SmartArt where PowerPoint lays it out as the preview draws it; else OPF's own design (a stepped pyramid with each entry beside its level, four quadrants filling the region, or rounded rectangles on a ring filling the region with an arrow from each to the next). A matrix of other than four entries draws a grid of cards. SH-17: 'chevrons' (Basic Chevron Process: 1 to 8 entries as a row of chevrons), 'flow' (Basic Process: a row of boxes with arrows between them) and 'vertical-flow' (Vertical Process: a column of boxes with arrows between them), in PowerPoint's geometry where it holds the entries, else OPF's own row or column filling the region. Nodes are filled in the primary color with a 1.5 pt outline in the background color (cards in the card neutral). A cycle's arrows are the primary lightened 40%. A list with nested entries, descriptions, icons or numbering, more than 8 levels or steps, or one no design holds, draws as a list; opf/arrangement-adapted (info) reports the cards and the lists. Absent: the region's content draws as any other."
431
+ },
419
432
  "anchor": {
420
433
  "type": "string",
421
434
  "enum": [