@openpresentation/opf 0.30.0 → 0.32.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 +1 -1
- package/dist/browser.js +18 -18
- package/dist/{catalog-schemas-CC1d_h8s.d.ts → catalog-schemas-LdqOPebq.d.ts} +2 -2
- package/dist/{chart-data-Ci9s_NDN.d.ts → chart-data-oIZQlFGi.d.ts} +4 -2
- package/dist/{chunk-UKWNHK62.js → chunk-2E6CDYL2.js} +23 -6
- package/dist/{chunk-I6G32TB5.js → chunk-56J345KE.js} +5 -5
- package/dist/{chunk-AFYXG3IB.js → chunk-7U3TJBXE.js} +100 -16
- package/dist/chunk-AQEAZDL2.js +9 -0
- package/dist/{chunk-HRKV43GC.js → chunk-BBVW5ZC2.js} +3 -3
- package/dist/{chunk-7UO6H32I.js → chunk-CLRYHWQN.js} +162 -22
- package/dist/chunk-DGS47ONG.js +1 -0
- package/dist/{chunk-F5QC7E2O.js → chunk-F7DN33UL.js} +28 -8
- package/dist/{chunk-KELC4K62.js → chunk-HKUV7NEN.js} +1 -1
- package/dist/{chunk-XG4JKFZ6.js → chunk-IT7FQKED.js} +6 -6
- package/dist/{chunk-SYCHWS7C.js → chunk-J63CIRIV.js} +4 -4
- package/dist/{chunk-5Q4IYLMW.js → chunk-LEF4X4KI.js} +274 -33
- package/dist/{chunk-5OMZW44K.js → chunk-NEJ32O7X.js} +1 -1
- package/dist/chunk-NVAJASOD.js +14764 -0
- package/dist/{chunk-M7YZU3DX.js → chunk-OXLA4HXQ.js} +615 -58
- package/dist/{chunk-P5E3FNYO.js → chunk-PB7ME64J.js} +1 -1
- package/dist/{chunk-ARFAQNOH.js → chunk-SW676APJ.js} +2 -2
- package/dist/{chunk-W7KPMUJF.js → chunk-XFHXQCXL.js} +58 -5
- package/dist/{chunk-KOCXV7H3.js → chunk-XQO2CT6Q.js} +2 -2
- package/dist/{chunk-WHDOOLIO.js → chunk-YFJIIIOL.js} +3 -3
- package/dist/composition-DRqNGHJV.d.ts +5620 -0
- package/dist/composition.d.ts +2 -2
- package/dist/composition.js +1 -1
- package/dist/{conversion-jdVnvct4.d.ts → conversion-Cadul8Mu.d.ts} +56 -9
- package/dist/conversion-J3YPDS7C.js +24 -0
- package/dist/convert.d.ts +2 -2
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +2 -2
- package/dist/data.js +2 -2
- package/dist/{deck-report-DQMsvyBI.d.ts → deck-report-BA3IPJAV.d.ts} +2 -2
- package/dist/deck.d.ts +5 -5
- package/dist/deck.js +11 -11
- package/dist/diagram-engine-eager.js +6 -0
- package/dist/diagram-engine-lazy.js +2 -0
- package/dist/diff.js +4 -4
- package/dist/docs.js +26 -20
- package/dist/examples.js +4759 -995
- package/dist/format.js +2 -2
- package/dist/ids.js +4 -4
- package/dist/index.d.ts +16 -13
- package/dist/index.js +24 -23
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +8 -8
- package/dist/node-engine.d.ts +8 -10
- package/dist/node-engine.js +22 -22
- package/dist/{pagination-DyAKYpXu.d.ts → pagination-DwEkdJ6s.d.ts} +74 -4
- package/dist/pagination.d.ts +3 -3
- package/dist/pagination.js +4 -4
- package/dist/patch.js +3 -3
- package/dist/precompiled.js +2 -2
- package/dist/{presentation-8jLSTFqL.d.ts → presentation-DnD7mfmf.d.ts} +106 -27
- 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 +1 -1
- package/dist/schema.js +3 -3
- package/dist/schemas.d.ts +6 -0
- package/dist/schemas.js +1 -1
- package/dist/source.d.ts +4 -3
- package/dist/source.js +10 -10
- package/dist/spec/schemas/layout.schema.json +58 -8
- package/dist/spec/schemas/narrative.schema.json +2 -1
- package/dist/spec/schemas/opf.schema.json +122 -23
- package/dist/spec/schemas/theme.schema.json +9 -3
- package/dist/types.d.ts +69 -18
- package/dist/{validation-types-mNmfcY9A.d.ts → validation-types-vVah_PEv.d.ts} +1 -1
- package/dist/validator.d.ts +4 -4
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +2 -2
- package/dist/yaml.js +7 -7
- package/package.json +15 -6
- package/dist/chunk-W3SEWSO5.js +0 -8043
- package/dist/chunk-Z7XNHIW7.js +0 -16
- package/dist/chunk-ZROVYWGU.js +0 -1
- package/dist/composition-C-hd_Ci3.d.ts +0 -3207
- package/dist/conversion-FUOYO726.js +0 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { applyPatch, normalizePatch, walkPatch, toIdPointer, resolveIdPointer, parsePointer, readPointer, idToken, formatPointer, isIdToken } from './chunk-
|
|
2
|
-
import { isRecord, visitContentPayloads, promotedRegionKeys } from './chunk-
|
|
1
|
+
import { applyPatch, normalizePatch, walkPatch, toIdPointer, resolveIdPointer, parsePointer, readPointer, idToken, formatPointer, isIdToken } from './chunk-OXLA4HXQ.js';
|
|
2
|
+
import { isRecord, visitContentPayloads, promotedRegionKeys } from './chunk-NVAJASOD.js';
|
|
3
3
|
|
|
4
4
|
// src/ids.ts
|
|
5
5
|
var INDEX_TOKEN = /^(0|[1-9][0-9]*)$/;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SOURCE_EXPLAIN, ruleDocumentation, findValidationRule, us } from './chunk-
|
|
1
|
+
import { SOURCE_EXPLAIN, ruleDocumentation, findValidationRule, us } from './chunk-OXLA4HXQ.js';
|
|
2
2
|
|
|
3
3
|
// src/finding-text-explain-util.ts
|
|
4
4
|
var ex = (fix, problem, fixed) => ({ fix, problem, fixed });
|
|
@@ -11,6 +11,14 @@ var ROADMAP = { name: "Roadmap", regions: [{ name: "title" }, { direction: "row"
|
|
|
11
11
|
var TIMELINE = { timeline: { events: [{ when: "Q1", what: "Pilot" }, { when: "Q2", what: "Launch" }] } };
|
|
12
12
|
var PERSON = (n) => ({ blocks: [{ image: { src: `https://example.com/${n}.png`, alt: `Person ${n}` } }, { text: `Person ${n}` }], composition: { mode: "column" } });
|
|
13
13
|
var SERIES = (count) => ({ columns: ["Quarter", ...Array.from({ length: count }, (_, i) => `S${i + 1}`)], rows: [["Q1", ...Array.from({ length: count }, (_, i) => i + 1)]] });
|
|
14
|
+
var LONG_ITEMS = [
|
|
15
|
+
"Enterprise renewals slipped by three weeks in the northern region after the pricing change",
|
|
16
|
+
"Two of the five largest accounts asked for a phased rollout before they commit to the upgrade",
|
|
17
|
+
"Support tickets about the migration tool doubled once the self-serve flow went live in May",
|
|
18
|
+
"The partner channel closed fewer deals than planned because enablement started a quarter late",
|
|
19
|
+
"Hiring for the platform team is behind plan, and two senior roles have been open since March",
|
|
20
|
+
"Cloud spend rose faster than usage, mostly from idle staging environments left running overnight"
|
|
21
|
+
];
|
|
14
22
|
var AUDIT_EXPLAIN = {
|
|
15
23
|
"opf/text-contrast": ex(
|
|
16
24
|
"Pick a text color with enough contrast against the background (3:1 for large text, 4.5:1 for normal text), or remove the color override so the theme chooses a readable one.",
|
|
@@ -18,8 +26,8 @@ var AUDIT_EXPLAIN = {
|
|
|
18
26
|
{ design: WHITE, slides: [{ title: "Results", text: [{ text: "Readable note", color: "text" }] }] }
|
|
19
27
|
),
|
|
20
28
|
"opf/text-on-image": ex(
|
|
21
|
-
"
|
|
22
|
-
{ design: WHITE, slides: [{ title: "Welcome", design: { background: { type: "image", src: "https://example.com/hero.jpg" } } }] },
|
|
29
|
+
"Without an overlay, core draws a scrim behind text on a picture so it reads at 4.5:1 and notes it here. With the scrim turned off (`overlay: false`), add a full-frame overlay to the background image, or put the text on a solid or gradient background or a card, so contrast does not depend on the picture.",
|
|
30
|
+
{ design: WHITE, slides: [{ title: "Welcome", design: { background: { type: "image", src: "https://example.com/hero.jpg", overlay: false } } }] },
|
|
23
31
|
{ design: WHITE, slides: [{ title: "Welcome", design: { background: { type: "image", src: "https://example.com/hero.jpg", overlay: { color: "#FFFFFF", opacity: 1 } } } }] }
|
|
24
32
|
),
|
|
25
33
|
"opf/missing-alt-text": ex(
|
|
@@ -58,7 +66,7 @@ var AUDIT_EXPLAIN = {
|
|
|
58
66
|
{ title: "Trend", chart: { type: "line", alt: "Two series", data: SERIES(2) } }
|
|
59
67
|
),
|
|
60
68
|
"opf/chart-colors-adjusted": ex(
|
|
61
|
-
"Use a color that resolves (a hex color, a scheme color or a declared `var:`) and has at least 3:1 contrast against the
|
|
69
|
+
"Use a color that resolves (a hex color, a scheme color or a declared `var:`) and has at least 3:1 contrast against the slide background, or remove `colors` to use the palette.",
|
|
62
70
|
{ title: "Revenue", chart: { ...CHART, colors: ["var:missing"] } },
|
|
63
71
|
{ title: "Revenue", chart: { ...CHART, colors: ["accent1"] } }
|
|
64
72
|
),
|
|
@@ -79,7 +87,7 @@ var AUDIT_EXPLAIN = {
|
|
|
79
87
|
),
|
|
80
88
|
"opf/text-overflow": ex(
|
|
81
89
|
"Shorten the text, give it more space (fewer blocks, a different composition) or split the slide. Raising the readable minimum makes it worse.",
|
|
82
|
-
{ title: "Notes", composition: { minFontSize: 16 }, blocks: [{ text: "word ".repeat(
|
|
90
|
+
{ title: "Notes", composition: { minFontSize: 16 }, blocks: [{ text: "word ".repeat(900).trim() }] },
|
|
83
91
|
{ title: "Notes", blocks: [{ text: "The three points that matter." }, { text: "More" }] }
|
|
84
92
|
),
|
|
85
93
|
"opf/unresolved-content": ex(
|
|
@@ -131,6 +139,26 @@ var AUDIT_EXPLAIN = {
|
|
|
131
139
|
"Use an image with more pixels for the size it is shown at (about 96 per inch), or show it smaller.",
|
|
132
140
|
{ title: "Team", image: { src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAAAAAAAAAAAA", alt: "Team" } },
|
|
133
141
|
{ title: "Team", image: { src: "https://example.com/team-2400x1350.png", alt: "Team" } }
|
|
142
|
+
),
|
|
143
|
+
"opf/text-shrunk": ex(
|
|
144
|
+
"Split the slide (`opf paginate`), move detail to the speaker notes, or shorten the text, so it is drawn near its role size.",
|
|
145
|
+
{ slides: [{ title: "Findings", blocks: [{ items: LONG_ITEMS }, { items: LONG_ITEMS }, { items: LONG_ITEMS }] }] },
|
|
146
|
+
{ slides: [{ title: "Findings", items: LONG_ITEMS.slice(0, 3) }, { title: "Findings (continued)", items: LONG_ITEMS.slice(3) }] }
|
|
147
|
+
),
|
|
148
|
+
"opf/centered-body": ex(
|
|
149
|
+
'Align paragraphs and lists to the start edge (`contentAlignment: "left"`), and keep centering for titles, numbers and one- or two-line statements.',
|
|
150
|
+
{ title: "Why now", items: LONG_ITEMS.slice(0, 3), design: { contentAlignment: "center" } },
|
|
151
|
+
{ title: "Why now", items: LONG_ITEMS.slice(0, 3), design: { contentAlignment: "left" } }
|
|
152
|
+
),
|
|
153
|
+
"opf/tight-spacing": ex(
|
|
154
|
+
"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.",
|
|
155
|
+
{ title: "Two options", composition: { gap: 0.01 }, blocks: [{ text: "Build the platform in house." }, { text: "Buy a hosted service." }] },
|
|
156
|
+
{ title: "Two options", blocks: [{ text: "Build the platform in house." }, { text: "Buy a hosted service." }] }
|
|
157
|
+
),
|
|
158
|
+
"opf/layout-monotony": ex(
|
|
159
|
+
"Give the slides the layouts their content asks for (a comparison, a chart, a statement, a picture), or merge or split them so one arrangement does not repeat four times in a row.",
|
|
160
|
+
{ slides: ["Hiring", "Budget", "Roadmap", "Risks"].map((title) => ({ title, layout: "list", items: ["One point", "Another point"] })) },
|
|
161
|
+
{ slides: [...["Hiring", "Budget", "Roadmap"].map((title) => ({ title, layout: "list", items: ["One point", "Another point"] })), { title: "Risks", layout: "statement", text: "One risk matters." }] }
|
|
134
162
|
)
|
|
135
163
|
};
|
|
136
164
|
|
|
@@ -149,6 +177,11 @@ var CONTENT_EXPLAIN = {
|
|
|
149
177
|
{ title: "Revenue", chart: { type: "column", alt: "Revenue", data: { columns: COLUMNS, rows: ROWS }, mapping: { x: "Costs" } } },
|
|
150
178
|
{ title: "Revenue", chart: { type: "column", alt: "Revenue", data: { columns: COLUMNS, rows: ROWS } } }
|
|
151
179
|
),
|
|
180
|
+
"opf/chart-series-dropped": ex(
|
|
181
|
+
"Use a chart type that plots every series (column, bar, line), or draw one chart per series. A one-series type draws only the first.",
|
|
182
|
+
{ title: "Revenue", chart: { type: "treemap", alt: "Revenue", data: { columns: COLUMNS, rows: ROWS } } },
|
|
183
|
+
{ title: "Revenue", chart: { type: "column", alt: "Revenue", data: { columns: COLUMNS, rows: ROWS } } }
|
|
184
|
+
),
|
|
152
185
|
"opf/chart-highlight-adapted": ex(
|
|
153
186
|
"Name a series the chart plots in `highlight`, or remove the entry. A column that is the category or X column, or that the mapping leaves out, highlights nothing.",
|
|
154
187
|
{ title: "Revenue", chart: { type: "column", alt: "Revenue", data: { columns: COLUMNS, rows: ROWS }, highlight: { series: ["Quarter"] } } },
|
|
@@ -203,6 +236,21 @@ var CONTENT_EXPLAIN = {
|
|
|
203
236
|
"Write a well-formed BCP 47 tag with an assigned region, such as `en-GB` (the United Kingdom is `GB`, not `UK`), `pt-BR` or `es-419`.",
|
|
204
237
|
{ language: { bcp47: "fr-UK" }, slides: [{ title: "Bienvenue" }] },
|
|
205
238
|
{ language: { bcp47: "fr-GB" }, slides: [{ title: "Bienvenue" }] }
|
|
239
|
+
),
|
|
240
|
+
"opf/chart-dual-axis": ex(
|
|
241
|
+
"Show the secondary series in a chart of its own beside this one, each with its own axis; two scales in one plot make crossings and heights meaningless. Drop `secondaryAxis` when the series share a unit.",
|
|
242
|
+
{ title: "Revenue and margin", chart: { type: "combo", alt: "Revenue and margin", data: { columns: ["Quarter", "Revenue", "Margin"], rows: [["Q1", 12, 0.31], ["Q2", 15, 0.34]] }, line: ["Margin"], secondaryAxis: ["Margin"] } },
|
|
243
|
+
{ title: "Revenue and margin", blocks: [{ chart: { type: "column", alt: "Revenue", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12], ["Q2", 15]] } } }, { chart: { type: "line", alt: "Margin", data: { columns: ["Quarter", { name: "Margin", format: "0%" }], rows: [["Q1", 0.31], ["Q2", 0.34]] } } }] }
|
|
244
|
+
),
|
|
245
|
+
"opf/chart-pie-many-slices": ex(
|
|
246
|
+
'Show the parts as bars along one axis, which can be compared and ranked, or group the smallest categories into one "Other" slice.',
|
|
247
|
+
{ title: "Traffic sources", chart: { type: "pie", alt: "Traffic sources", data: { columns: ["Source", "Visits"], rows: [["Search", 48], ["Direct", 22], ["Social", 12], ["Email", 8], ["Referral", 5], ["Ads", 3], ["Other", 2]] } } },
|
|
248
|
+
{ title: "Traffic sources", chart: { type: "bar", alt: "Traffic sources", data: { columns: ["Source", "Visits"], rows: [["Search", 48], ["Direct", 22], ["Social", 12], ["Email", 8], ["Referral", 5], ["Ads", 3], ["Other", 2]] } } }
|
|
249
|
+
),
|
|
250
|
+
"opf/straight-quotes": ex(
|
|
251
|
+
`Type the quotation marks of the deck's language (\u201C\u2026\u201D and \u2018\u2026\u2019 in English, \xAB\u2026\xBB in French, \u201E\u2026\u201C in German) instead of the straight " and '. Apostrophes inside words and inch and foot marks after numbers are fine.`,
|
|
252
|
+
{ title: "What customers said", text: `They called it "the easiest setup we've done".` },
|
|
253
|
+
{ title: "What customers said", text: "They called it \u201Cthe easiest setup we've done\u201D." }
|
|
206
254
|
)
|
|
207
255
|
};
|
|
208
256
|
|
|
@@ -299,6 +347,11 @@ var FORMAT_EXPLAIN = {
|
|
|
299
347
|
{ title: "Revenue", chart: { type: "column", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12], ["Q2", 15]] }, highlight: { categories: ["Q9"] } } },
|
|
300
348
|
{ title: "Revenue", chart: { type: "column", data: { columns: ["Quarter", "Revenue"], rows: [["Q1", 12], ["Q2", 15]] }, highlight: { categories: ["Q2"] } } }
|
|
301
349
|
),
|
|
350
|
+
"opf/table-highlight-unknown-name": ex(
|
|
351
|
+
"Name a row of the table in `highlight.rows` by the text of its first cell; a name that matches no row highlights nothing.",
|
|
352
|
+
{ title: "Pricing", table: { columns: ["Region", "Change"], rows: [["Northeast", "Hold"], ["Southeast", "+3%"]], highlight: { rows: ["South"] } } },
|
|
353
|
+
{ title: "Pricing", table: { columns: ["Region", "Change"], rows: [["Northeast", "Hold"], ["Southeast", "+3%"]], highlight: { rows: ["Southeast"] } } }
|
|
354
|
+
),
|
|
302
355
|
"opf/variable-format": ex(
|
|
303
356
|
"Give the variable a `format` that fits its type and its values: `#,##0.0` for a number, a date pattern for a date.",
|
|
304
357
|
{ variables: { amount: { type: "number", value: 1e308, format: "0%" } }, slides: [{ title: "Value {{amount}}" }] },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { validate } from './chunk-
|
|
1
|
+
import { validate } from './chunk-OXLA4HXQ.js';
|
|
2
2
|
|
|
3
3
|
// src/convert/shared.ts
|
|
4
|
-
var CONTENT_KEYS = ["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline"];
|
|
4
|
+
var CONTENT_KEYS = ["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline", "diagram"];
|
|
5
5
|
var SLIDE_ONLY_KEYS = ["title", "subtitle", "tag", "layout", "design", "notes", "section", "hidden", "beat"];
|
|
6
6
|
var OPFConversionError = class extends Error {
|
|
7
7
|
code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonEqual, formatPointer } from './chunk-
|
|
2
|
-
import { annotationText } from './chunk-
|
|
1
|
+
import { jsonEqual, formatPointer } from './chunk-OXLA4HXQ.js';
|
|
2
|
+
import { annotationText } from './chunk-NVAJASOD.js';
|
|
3
3
|
|
|
4
4
|
// src/diff-match.ts
|
|
5
5
|
var DEFAULT_MATCH_THRESHOLD = 0.5;
|
|
@@ -499,7 +499,7 @@ function diff(a, b, options = {}) {
|
|
|
499
499
|
diffValue(a, b, [], [], ctx);
|
|
500
500
|
return { equal: ctx.patch.length === 0, changes: ctx.changes, patch: ctx.patch, slides: ctx.slides, summary: summarise(ctx.changes, ctx.slides) };
|
|
501
501
|
}
|
|
502
|
-
var CONTENT_KINDS = ["blocks", "chart", "table", "code", "metric", "quote", "timeline", "image", "video", "items", "bullets", "text"];
|
|
502
|
+
var CONTENT_KINDS = ["blocks", "chart", "table", "code", "metric", "quote", "timeline", "diagram", "image", "video", "items", "bullets", "text"];
|
|
503
503
|
function shorten(text, max = 60) {
|
|
504
504
|
const flat = text.replace(/\s+/gu, " ");
|
|
505
505
|
return flat.length > max ? `${flat.slice(0, max - 1)}\u2026` : flat;
|