@openpresentation/opf 0.33.0 → 0.34.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/README.md +3 -3
- package/dist/browser.js +20 -19
- package/dist/catalog-refs-CoIrOdAw.d.ts +937 -0
- package/dist/{catalog-schemas-CQTM-G8p.d.ts → catalog-schemas-FjLRPtjB.d.ts} +1 -1
- package/dist/{chart-data-oIZQlFGi.d.ts → chart-data-B_k-WTex.d.ts} +7 -4
- package/dist/{chunk-XIOC6N5P.js → chunk-244OPLAV.js} +1 -1
- package/dist/{chunk-S5QRGMUQ.js → chunk-2HX4BGAS.js} +6 -6
- package/dist/{chunk-Y557TYML.js → chunk-36DLVJGW.js} +19 -16
- package/dist/{chunk-VKEYV3ZK.js → chunk-3THGTDL2.js} +2 -2
- package/dist/{chunk-ABWEUXLV.js → chunk-42JBXJKW.js} +117 -21
- package/dist/chunk-BLCDUM7B.js +7 -0
- package/dist/{chunk-OPVJLL7H.js → chunk-CJVKOJ6B.js} +11841 -8687
- package/dist/{chunk-BI4ERFAA.js → chunk-DQ7QYOUV.js} +48 -13
- package/dist/{chunk-KVHNDHVS.js → chunk-F6BXO4AI.js} +1 -1
- package/dist/{chunk-UK3J6FSU.js → chunk-FAXO3SUE.js} +858 -268
- package/dist/{chunk-XANW7MB7.js → chunk-FIQMAIZV.js} +4 -4
- package/dist/{chunk-PJSPHHRK.js → chunk-FK5XG742.js} +3 -16
- package/dist/{chunk-R6C6BQOG.js → chunk-HHVQ2SDT.js} +1 -1
- package/dist/{chunk-DAS75LGR.js → chunk-HUGVYHZ2.js} +4 -4
- package/dist/{chunk-QF5RSRXU.js → chunk-LCT5ZV3Q.js} +750 -199
- package/dist/chunk-NLJFNCZ4.js +1560 -0
- package/dist/{chunk-VSBZC2PR.js → chunk-QGJVOPLG.js} +3 -3
- package/dist/{chunk-E7WQHMCL.js → chunk-QGTJF7HV.js} +16 -14
- package/dist/{chunk-VMBLNCX2.js → chunk-RUV7CCE6.js} +117 -30
- package/dist/{chunk-YS333HLA.js → chunk-U7TYSPYM.js} +2 -2
- package/dist/chunk-UJZN2ZH6.js +1 -0
- package/dist/{chunk-IJXKVM4W.js → chunk-VDZXNNZF.js} +1 -1
- package/dist/{chunk-YYT6N7AI.js → chunk-WCPDN7AY.js} +1 -1
- package/dist/{chunk-QD6DPS7X.js → chunk-WMFT5R7I.js} +2 -2
- package/dist/{chunk-INIMUBSE.js → chunk-XJUMFH33.js} +1 -1
- package/dist/{composition-zMiIgzip.d.ts → composition-CvtvgBDE.d.ts} +1360 -1531
- package/dist/composition.d.ts +3 -3
- package/dist/composition.js +2 -1
- package/dist/{conversion-mNth9XKm.d.ts → conversion-B_5AKTYQ.d.ts} +25 -7
- package/dist/conversion-CMBGOTAC.js +25 -0
- package/dist/convert.d.ts +4 -4
- package/dist/convert.js +15 -11
- package/dist/data.d.ts +2 -2
- package/dist/data.js +3 -2
- package/dist/{deck-report-BSlRiR0_.d.ts → deck-report-BVlQZ42f.d.ts} +3 -3
- package/dist/deck.d.ts +6 -6
- package/dist/deck.js +12 -11
- package/dist/diagram-engine-eager.js +5 -1
- package/dist/diagram-engine-lazy.js +13 -0
- package/dist/diagram-plantuml-XRZ6VAOL.js +3 -0
- package/dist/diff.js +5 -4
- package/dist/docs.js +64 -52
- package/dist/examples.js +4070 -1083
- package/dist/font-policy.js +1 -1
- package/dist/format.js +2 -2
- package/dist/ids.js +5 -4
- package/dist/index.d.ts +18 -16
- package/dist/index.js +35 -24
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +9 -8
- package/dist/node-engine.d.ts +43 -11
- package/dist/node-engine.js +45 -26
- package/dist/{pagination-CYzNMazO.d.ts → pagination-CZQQYk7L.d.ts} +4 -3
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +5 -4
- package/dist/patch.js +4 -3
- package/dist/precompiled.js +2 -2
- package/dist/{presentation-CXhfpB_z.d.ts → presentation-s9262acV.d.ts} +357 -230
- package/dist/repo-readme.js +1 -1
- package/dist/schema-engine-ajv.js +1 -1
- package/dist/schema-engine-precompiled.js +2 -2
- package/dist/schema.d.ts +3 -3
- package/dist/schema.js +4 -3
- package/dist/schemas.d.ts +16 -0
- package/dist/schemas.js +1 -1
- package/dist/shape-engine-eager.js +2 -2
- package/dist/shape-engine-lazy.js +1 -1
- package/dist/{shape-engine-module-BK7JNEUV.js → shape-engine-module-N74FCHGY.js} +2 -2
- package/dist/shape-geometry.js +1 -1
- package/dist/source.d.ts +10 -5
- package/dist/source.js +11 -10
- package/dist/spec/reference/engine-vocabularies.json +135 -0
- package/dist/spec/reference/font-policy.json +3 -16
- package/dist/spec/reference/preset-geometry.json +3 -3
- package/dist/spec/schemas/icon-set.schema.json +1 -1
- package/dist/spec/schemas/layout.schema.json +71 -25
- package/dist/spec/schemas/opf.schema.json +540 -168
- package/dist/spec/schemas/theme.schema.json +11 -5
- package/dist/types.d.ts +81 -73
- package/dist/{validation-types-COwTel3H.d.ts → validation-types-CYbsUuZ9.d.ts} +8 -5
- package/dist/validator.d.ts +34 -7
- package/dist/validator.js +4 -3
- package/dist/yaml.d.ts +2 -2
- package/dist/yaml.js +8 -7
- package/package.json +6 -6
- package/dist/catalog-refs-B_0_vZg0.d.ts +0 -134
- package/dist/chunk-ZXOIGUHX.js +0 -1
- package/dist/conversion-POHRAMSN.js +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SOURCE_EXPLAIN, ruleDocumentation, findValidationRule, us } from './chunk-
|
|
1
|
+
import { SOURCE_EXPLAIN, ruleDocumentation, findValidationRule, us } from './chunk-FAXO3SUE.js';
|
|
2
2
|
|
|
3
3
|
// src/finding-text-explain-util.ts
|
|
4
4
|
var ex = (fix, problem, fixed) => ({ fix, problem, fixed });
|
|
@@ -9,7 +9,6 @@ var CHART = { type: "column", alt: "Revenue by quarter", data: { columns: ["Quar
|
|
|
9
9
|
var WHITE = { background: { type: "solid", color: "#FFFFFF" } };
|
|
10
10
|
var ROADMAP = { name: "Roadmap", regions: [{ name: "title" }, { direction: "row", regions: [{ name: "timeline", accepts: ["timeline"], max: 1 }, { name: "notes", accepts: ["text", "list"], flow: "column" }] }] };
|
|
11
11
|
var TIMELINE = { timeline: { events: [{ when: "Q1", what: "Pilot" }, { when: "Q2", what: "Launch" }] } };
|
|
12
|
-
var PERSON = (n) => ({ blocks: [{ image: { src: `https://example.com/${n}.png`, alt: `Person ${n}` } }, { text: `Person ${n}` }], composition: { mode: "column" } });
|
|
13
12
|
var SERIES = (count) => ({ columns: ["Quarter", ...Array.from({ length: count }, (_, i) => `S${i + 1}`)], rows: [["Q1", ...Array.from({ length: count }, (_, i) => i + 1)]] });
|
|
14
13
|
var LONG_ITEMS = [
|
|
15
14
|
"Enterprise renewals slipped by three weeks in the northern region after the pricing change",
|
|
@@ -50,10 +49,11 @@ var AUDIT_EXPLAIN = {
|
|
|
50
49
|
{ slides: [{ title: "Results", text: "Q1" }, { title: "Results", text: "Q2" }] },
|
|
51
50
|
{ slides: [{ title: "Results: Q1", text: "Q1" }, { title: "Results: Q2", text: "Q2" }] }
|
|
52
51
|
),
|
|
52
|
+
// RR-105: cards side by side (a picture over a name) read card by card, so the example is a layout that draws the body above the title.
|
|
53
53
|
"opf/reading-order": ex(
|
|
54
54
|
"Reorder or regroup the blocks so the order they are read in follows the order they appear in, or choose a layout that puts the title first.",
|
|
55
|
-
{
|
|
56
|
-
{
|
|
55
|
+
{ catalogs: { custom: { layouts: { upside: { name: "Upside", direction: "column", regions: [{ name: "body", accepts: ["text"], role: "primary" }, { name: "title" }] } } } }, slides: [{ layout: "upside", title: "Results", text: "Revenue grew in every region." }] },
|
|
56
|
+
{ catalogs: { custom: { layouts: { upside: { name: "Upside", direction: "column", regions: [{ name: "title" }, { name: "body", accepts: ["text"], role: "primary" }] } } } }, slides: [{ layout: "upside", title: "Results", text: "Revenue grew in every region." }] }
|
|
57
57
|
),
|
|
58
58
|
"opf/link-text": ex(
|
|
59
59
|
"Make the link text say where the link goes, for example the name of the page or file.",
|
|
@@ -120,6 +120,21 @@ var AUDIT_EXPLAIN = {
|
|
|
120
120
|
{ catalogs: { custom: { iconSets: { brand: { name: "Brand", license: "MIT", copyright: "Copyright (c) 2026 Example", viewBox: [0, 0, 24, 24], style: "stroke", icons: { star: "M12 3l3 6 6 1-4.5 4 1 6-5.5-3-5.5 3 1-6L3 10l6-1z" } } } } }, slides: [{ title: "Steps", items: [{ text: "Sign up", icon: "brand:star" }, { text: "Invite the team" }], numbering: "arabic" }] },
|
|
121
121
|
{ catalogs: { custom: { iconSets: { brand: { name: "Brand", license: "MIT", copyright: "Copyright (c) 2026 Example", viewBox: [0, 0, 24, 24], style: "stroke", icons: { star: "M12 3l3 6 6 1-4.5 4 1 6-5.5-3-5.5 3 1-6L3 10l6-1z" } } } } }, slides: [{ title: "Steps", items: [{ text: "Sign up", icon: "brand:star" }, { text: "Invite the team" }] }] }
|
|
122
122
|
),
|
|
123
|
+
"opf/shape-off-slide": ex(
|
|
124
|
+
"Write `x` and `y` as fractions of the slide (0.7 for 70%), so at least part of the shape is on it; a shape may hang over an edge.",
|
|
125
|
+
{ title: "Plan", text: "Three regions go live in March.", shapes: [{ shape: "rect", text: "Draft", x: 70, y: 10, width: 0.2, height: 0.1 }] },
|
|
126
|
+
{ title: "Plan", text: "Three regions go live in March.", shapes: [{ shape: "rect", text: "Draft", x: 0.7, y: 0.1, width: 0.2, height: 0.1 }] }
|
|
127
|
+
),
|
|
128
|
+
"opf/chart-label-collision": ex(
|
|
129
|
+
"Set the line where a bar or the area leaves room beside it at one of its ends, or give each reference its own value, so its label has a free place.",
|
|
130
|
+
{ title: "Results", chart: { type: "column", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12], ["Q2", 18], ["Q3", 22], ["Q4", 26]] }, referenceLines: [{ value: 6, label: "Floor" }] } },
|
|
131
|
+
{ title: "Results", chart: { type: "column", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12], ["Q2", 18], ["Q3", 22], ["Q4", 26]] }, referenceLines: [{ value: 15, label: "Floor" }] } }
|
|
132
|
+
),
|
|
133
|
+
"opf/timeline-period-short": ex(
|
|
134
|
+
"Give the timeline more room, or make its shortest period longer relative to the others.",
|
|
135
|
+
{ slides: [{ title: "Plan", timeline: { events: [{ when: "Day 1", what: "Kickoff", duration: 1 }, { when: "Year 3", what: "Delivery", duration: 1e3 }] } }] },
|
|
136
|
+
{ slides: [{ title: "Plan", timeline: { events: [{ when: "Day 1", what: "Kickoff", duration: 1 }, { when: "Year 3", what: "Delivery", duration: 3 }] } }] }
|
|
137
|
+
),
|
|
123
138
|
"opf/arrangement-adapted": ex(
|
|
124
139
|
"Give a matrix exactly four short entries, or choose another layout for another count.",
|
|
125
140
|
{ catalogs: { custom: { layouts: { quad: { name: "Quad", regions: [{ name: "title" }, { name: "quadrants", accepts: ["list"], flow: "none", arrangement: "matrix" }] } } } }, slides: [{ layout: "quad", title: "Markets", items: ["North", "South", "East"] }] },
|
|
@@ -137,8 +152,8 @@ var AUDIT_EXPLAIN = {
|
|
|
137
152
|
),
|
|
138
153
|
"opf/furniture-wraps": ex(
|
|
139
154
|
"Shorten the header or footer text, or move part of it to another zone. Headers and footers should fit on two lines.",
|
|
140
|
-
{ design: { footer: {
|
|
141
|
-
{ design: { footer: {
|
|
155
|
+
{ design: { footer: { start: { text: "A footer that keeps going and going and going and going and going and going and going and going and going and going and going and going" }, center: { text: "Confidential" }, end: { text: "{{slide.number}}" } } }, slides: [{ title: "Welcome" }] },
|
|
156
|
+
{ design: { footer: { start: { text: "Acme, confidential" }, end: { text: "{{slide.number}}" } } }, slides: [{ title: "Welcome" }] }
|
|
142
157
|
),
|
|
143
158
|
"opf/font-outside-scheme": ex(
|
|
144
159
|
"Remove `fontFamily` so the text uses the scheme font, or add the family to the deck's font scheme so it follows scheme changes.",
|
|
@@ -156,9 +171,9 @@ var AUDIT_EXPLAIN = {
|
|
|
156
171
|
{ slides: [{ title: "Findings", items: LONG_ITEMS.slice(0, 3) }, { title: "Findings (continued)", items: LONG_ITEMS.slice(3) }] }
|
|
157
172
|
),
|
|
158
173
|
"opf/centered-body": ex(
|
|
159
|
-
'Align paragraphs and lists to the start edge (`contentAlignment: "
|
|
174
|
+
'Align paragraphs and lists to the start edge (`contentAlignment: "start"`), and keep centering for titles, numbers and one- or two-line statements.',
|
|
160
175
|
{ title: "Why now", items: LONG_ITEMS.slice(0, 3), design: { contentAlignment: "center" } },
|
|
161
|
-
{ title: "Why now", items: LONG_ITEMS.slice(0, 3), design: { contentAlignment: "
|
|
176
|
+
{ title: "Why now", items: LONG_ITEMS.slice(0, 3), design: { contentAlignment: "start" } }
|
|
162
177
|
),
|
|
163
178
|
"opf/tight-spacing": ex(
|
|
164
179
|
"Keep the default spacing, or raise `composition.gap` and `composition.padding`, so blocks stand at least 0.25 in apart and 0.5 in from the slide edge.",
|
|
@@ -212,6 +227,11 @@ var CONTENT_EXPLAIN = {
|
|
|
212
227
|
{ slides: [{ title: "{{speaker.name}}" }] },
|
|
213
228
|
{ speaker: { name: "Ada Lovelace" }, slides: [{ title: "{{speaker.name}}" }] }
|
|
214
229
|
),
|
|
230
|
+
"opf/variable-group-omitted": ex(
|
|
231
|
+
"Give one of the group's optional variables a value to draw the group, or move what should always show out of the group. Unfilled, the whole group is left out, its picture and card with it.",
|
|
232
|
+
{ template: true, variables: { quote: { type: "text", required: false } }, slides: [{ title: "Customers", blocks: [{ blocks: [{ image: { src: "https://example.com/portrait.jpg", alt: "A customer" } }, { text: "var:quote" }] }] }] },
|
|
233
|
+
{ template: true, variables: { quote: { type: "text", required: false, value: "It just works." } }, slides: [{ title: "Customers", blocks: [{ blocks: [{ image: { src: "https://example.com/portrait.jpg", alt: "A customer" } }, { text: "var:quote" }] }] }] }
|
|
234
|
+
),
|
|
215
235
|
"opf/duration-outside-narrative": ex(
|
|
216
236
|
"Change `duration`, or choose a narrative that suits it. The range describes the narrative, so nothing is drawn differently.",
|
|
217
237
|
{ duration: 5, narrative: "arc", catalogs: { custom: { narratives: { arc: ARC({ min: 10, max: 20 }) } } }, slides: [{ title: "Intro", beat: "hook" }] },
|
|
@@ -298,7 +318,7 @@ var FORMAT_EXPLAIN = {
|
|
|
298
318
|
{ references: [{ id: "gartner", text: "Gartner, 2026" }], slides: [{ title: "Market", text: [{ text: "EMEA grew 12%", cite: "gartner" }], table: { columns: ["Region", "Growth"], rows: [["EMEA", "12%"]] } }] }
|
|
299
319
|
),
|
|
300
320
|
"opf/caption-unsupported-payload": ex(
|
|
301
|
-
"Put the `caption` on the image, chart, table or
|
|
321
|
+
"Put the `caption` on the image, chart, table, video or diagram it describes, or remove it.",
|
|
302
322
|
{ title: "Revenue", blocks: [{ text: "Revenue grew", caption: "Source: finance" }] },
|
|
303
323
|
{ title: "Revenue", blocks: [{ chart: CHART, caption: "Source: finance" }] }
|
|
304
324
|
),
|
|
@@ -327,6 +347,11 @@ var FORMAT_EXPLAIN = {
|
|
|
327
347
|
{ title: "Plan", blocks: [{ shape: "rect", text: "Pricing", link: "https://example.com/pricing", hidden: true }] },
|
|
328
348
|
{ title: "Plan", blocks: [{ shape: "rect", text: "Pricing", link: "https://example.com/pricing" }] }
|
|
329
349
|
),
|
|
350
|
+
"opf/shape-anchor-size-unit": ex(
|
|
351
|
+
"Write pixels as `widthPx`; `width` is a fraction.",
|
|
352
|
+
{ title: "T", blocks: [{ id: "a", text: "x" }], shapes: [{ shape: "ellipse", at: { block: "a", edge: "top", width: 6 } }] },
|
|
353
|
+
{ title: "T", blocks: [{ id: "a", text: "x" }], shapes: [{ shape: "ellipse", at: { block: "a", edge: "top", widthPx: 6 } }] }
|
|
354
|
+
),
|
|
330
355
|
"opf/shape-anchor-missing": ex(
|
|
331
356
|
"Name a block of the slide in `at.block` (give the block an `id`), or place the shape by `x`, `y`, `width` and `height`.",
|
|
332
357
|
{ title: "Team", blocks: [{ id: "photo", image: IMG("team") }], shapes: [{ shape: "ellipse", text: "New", at: { block: "phot", edge: "top" } }] },
|
|
@@ -339,8 +364,8 @@ var FORMAT_EXPLAIN = {
|
|
|
339
364
|
),
|
|
340
365
|
"opf/image-placement-invalid": ex(
|
|
341
366
|
"Use `placement` on a top-level block of the slide, with one placed image per slide edge.",
|
|
342
|
-
{ title: "Team", blocks: [{ image: IMG("a"), placement: { edge: "
|
|
343
|
-
{ title: "Team", blocks: [{ image: IMG("a"), placement: { edge: "
|
|
367
|
+
{ title: "Team", blocks: [{ image: IMG("a"), placement: { edge: "start" } }, { image: IMG("b"), placement: { edge: "start" } }] },
|
|
368
|
+
{ title: "Team", blocks: [{ image: IMG("a"), placement: { edge: "start" } }, { image: IMG("b"), placement: { edge: "end" } }] }
|
|
344
369
|
),
|
|
345
370
|
"opf/layout-placeholder-group": ex(
|
|
346
371
|
"Flatten the group so it nests at most three levels, and keep the headings (title, subtitle, tag) at the record's top level. Layout records written for current versions use `regions`, where the same limits apply to splits.",
|
|
@@ -367,6 +392,16 @@ var FORMAT_EXPLAIN = {
|
|
|
367
392
|
{ title: "Revenue", chart: { type: "column", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12]] }, mapping: { series: ["Profit"] } } },
|
|
368
393
|
{ title: "Revenue", chart: { type: "column", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12]] }, mapping: { series: ["Revenue"] } } }
|
|
369
394
|
),
|
|
395
|
+
"opf/chart-reference-axis-unavailable": ex(
|
|
396
|
+
"Use axis value, or add an actual secondary line series to a combo chart before using a secondary reference.",
|
|
397
|
+
{ title: "Revenue", chart: { ...CHART, referenceLines: [{ value: 20, axis: "secondary" }] } },
|
|
398
|
+
{ title: "Revenue", chart: { ...CHART, referenceLines: [{ value: 20, axis: "value" }] } }
|
|
399
|
+
),
|
|
400
|
+
"opf/chart-reference-unsupported-type": ex(
|
|
401
|
+
"Remove `referenceLines`, or change the chart to a type with one value axis for every series: column, bar, line, line-with-markers, area or combo.",
|
|
402
|
+
{ title: "Share", chart: { type: "pie", data: { columns: ["Region", "Share"], rows: [["North", 60], ["South", 40]] }, referenceLines: [{ value: 50 }] } },
|
|
403
|
+
{ title: "Share", chart: { type: "column", data: { columns: ["Region", "Share"], rows: [["North", 60], ["South", 40]] }, referenceLines: [{ value: 50 }] } }
|
|
404
|
+
),
|
|
370
405
|
"opf/number-format-invalid": ex(
|
|
371
406
|
"Write the format as an Excel-style pattern with a numeric part, such as `0.0`, `#,##0`, `0%` or `$#,##0.00`.",
|
|
372
407
|
{ title: "Revenue", table: { columns: [{ name: "Revenue", format: "units" }], rows: [[12]] } },
|
|
@@ -451,8 +486,8 @@ var REFERENCES_EXPLAIN = {
|
|
|
451
486
|
{ catalogs: { custom: { layouts: { mine: { name: "Mine", regions: [{ name: "title" }, { name: "a", accepts: ["text"], size: "auto" }, { name: "b", accepts: ["text"] }] } } } }, slides: [{ title: "Welcome", layout: "mine" }] }
|
|
452
487
|
),
|
|
453
488
|
"opf/layout-region": ex(
|
|
454
|
-
"Name each body region with a unique lowercase id that is not reserved (`title`, `subtitle`, `tag`, `auto`, `
|
|
455
|
-
{ catalogs: { custom: { layouts: { mine: { name: "Mine", regions: [{ name: "title" }, { name: "
|
|
489
|
+
"Name each body region with a unique lowercase id that is not reserved (`title`, `subtitle`, `tag`, `auto`, `start`, `center`, `end`, `top`, `middle`, `bottom`), and give it something to accept.",
|
|
490
|
+
{ catalogs: { custom: { layouts: { mine: { name: "Mine", regions: [{ name: "title" }, { name: "start", accepts: ["text"] }] } } } }, slides: [{ title: "Welcome", layout: "mine" }] },
|
|
456
491
|
{ catalogs: { custom: { layouts: { mine: { name: "Mine", regions: [{ name: "title" }, { name: "body", accepts: ["text"] }] } } } }, slides: [{ title: "Welcome", layout: "mine" }] }
|
|
457
492
|
),
|
|
458
493
|
"opf/unresolved-reference": ex(
|