@openpresentation/opf 0.33.0 → 0.34.1
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-KVHNDHVS.js → chunk-2B6GLT2O.js} +1 -1
- package/dist/{chunk-VMBLNCX2.js → chunk-6PMXVP5G.js} +117 -30
- package/dist/{chunk-BI4ERFAA.js → chunk-AAWHOCXS.js} +48 -13
- package/dist/{chunk-QD6DPS7X.js → chunk-ABA2D6X5.js} +2 -2
- package/dist/{chunk-UK3J6FSU.js → chunk-AEHDXNZX.js} +862 -269
- package/dist/{chunk-DAS75LGR.js → chunk-AGYPRTEC.js} +4 -4
- package/dist/chunk-BLCDUM7B.js +7 -0
- package/dist/{chunk-OPVJLL7H.js → chunk-CJVKOJ6B.js} +11841 -8687
- package/dist/{chunk-Y557TYML.js → chunk-CQXBGZQP.js} +19 -16
- package/dist/{chunk-VKEYV3ZK.js → chunk-FCSYIBVR.js} +2 -2
- package/dist/{chunk-PJSPHHRK.js → chunk-FK5XG742.js} +3 -16
- package/dist/{chunk-R6C6BQOG.js → chunk-HHVQ2SDT.js} +1 -1
- package/dist/{chunk-ABWEUXLV.js → chunk-L3MCLD3X.js} +117 -21
- package/dist/{chunk-QF5RSRXU.js → chunk-LCT5ZV3Q.js} +750 -199
- package/dist/{chunk-E7WQHMCL.js → chunk-MAFJ5O2D.js} +16 -14
- package/dist/{chunk-XANW7MB7.js → chunk-MUILZGRY.js} +4 -4
- package/dist/chunk-NLJFNCZ4.js +1560 -0
- package/dist/{chunk-VSBZC2PR.js → chunk-SR6T4LKI.js} +3 -3
- 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-S5QRGMUQ.js → chunk-X72WPTST.js} +6 -6
- package/dist/{chunk-INIMUBSE.js → chunk-XJUMFH33.js} +1 -1
- package/dist/{chunk-YS333HLA.js → chunk-XLSWZSQS.js} +2 -2
- 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-CSQ5EHD2.js +25 -0
- package/dist/{conversion-mNth9XKm.d.ts → conversion-CyNRlWGw.d.ts} +25 -7
- 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 +65 -53
- 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
|
@@ -57,7 +57,7 @@ interface DataStyledCell {
|
|
|
57
57
|
type DataTableCell = DataTableValue | DataStyledCell;
|
|
58
58
|
/** A table column header: a cell, or a DataColumn. */
|
|
59
59
|
type DataTableHeader = DataTableCell | DataColumn;
|
|
60
|
-
type DataDiagnosticCode = 'chart-value-not-numeric' | 'dataset-unknown' | 'dataset-field-unknown' | 'data-column-duplicate' | 'chart-mapping-unknown-column' | 'chart-mapping-adapted' | 'chart-highlight-unknown-name' | 'chart-highlight-adapted' | 'chart-series-dropped' | 'table-highlight-unknown-name' | 'number-format-invalid';
|
|
60
|
+
type DataDiagnosticCode = 'chart-value-not-numeric' | 'dataset-unknown' | 'dataset-field-unknown' | 'data-column-duplicate' | 'chart-mapping-unknown-column' | 'chart-mapping-adapted' | 'chart-highlight-unknown-name' | 'chart-highlight-adapted' | 'chart-series-dropped' | 'chart-reference-axis-unavailable' | 'chart-reference-unsupported-type' | 'table-highlight-unknown-name' | 'number-format-invalid';
|
|
61
61
|
interface DataDiagnostic {
|
|
62
62
|
code: DataDiagnosticCode;
|
|
63
63
|
severity: 'error' | 'warning';
|
|
@@ -117,8 +117,11 @@ interface ResolvedTableData {
|
|
|
117
117
|
declare function chartNumber(value: unknown): number | null;
|
|
118
118
|
/** Why a NumberFormat is invalid, or undefined for a valid one. An absent format is valid (General). */
|
|
119
119
|
declare function numberFormatError(format: unknown): string | undefined;
|
|
120
|
-
/**
|
|
121
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Format a number with a NumberFormat; an absent or invalid format prints the General form (String(value)). LH-106: with `language`
|
|
122
|
+
* the text is in that language's numbering system (see `formatVariableNumber`); without it, Latin.
|
|
123
|
+
*/
|
|
124
|
+
declare function formatDataNumber(value: number, format?: string, language?: string): string;
|
|
122
125
|
/** NumberFormat -> Excel format code ("General" when absent or invalid). Literal prefix/suffix text is quoted or escaped; placeholders are written '#' before '0' ("0#" -> "#0"). */
|
|
123
126
|
declare function toExcelNumberFormat(format?: string): string;
|
|
124
127
|
/** Excel format code -> NumberFormat, or undefined when the code has no exact NumberFormat equivalent (General, sections, scaling commas, and placeholder orders Excel reads by position such as "0#" or "0.#0"). */
|
|
@@ -185,7 +188,7 @@ declare function resolveTableData(table: unknown, document?: unknown, options?:
|
|
|
185
188
|
/** LH-113: the text of a table cell as its key (the first column): a string, a number, rich runs or a styled cell's value. */
|
|
186
189
|
declare function tableKeyText(cell: unknown): string;
|
|
187
190
|
/** Display value of a table cell: a number with a format (cell, else column) becomes formatted text; anything else is returned unchanged. */
|
|
188
|
-
declare function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string): DataTableCell;
|
|
191
|
+
declare function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string, language?: string): DataTableCell;
|
|
189
192
|
|
|
190
193
|
export { resolveChartData as A, resolveTableData as B, suggestChartNumberFix as E, tableCellDisplayValue as F, toExcelNumberFormat as G, unusedDatasets as H, tableKeyText as J, chartNumber as q, datasetDiagnostics as r, formatDataNumber as s, fromExcelNumberFormat as t, inlineChartData as u, inlineDatasets as v, inlineTableData as w, isDatasetRef as x, isXYChartType as y, numberFormatError as z };
|
|
191
194
|
export type { ChartMapping as C, DataCellValue as D, ChartComboSeries as I, ResolvedChartData as R, ChartNumberFix as a, ChartNumberFixOperation as b, ChartNumberFixOptions as c, DataColumn as d, DataDiagnostic as e, DataDiagnosticCode as f, DataResolveOptions as g, DataSourceRef as h, DataStyledCell as i, DataTableCell as j, DataTableHeader as k, DataTableValue as l, DataTextRun as m, Dataset as n, DatasetRef as o, ResolvedTableData as p };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defaultCatalogs } from './chunk-
|
|
2
|
-
import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-
|
|
3
|
-
import { paginate, continueOverfull } from './chunk-
|
|
4
|
-
import { deckFormatOf, readDeckReport, stringify } from './chunk-
|
|
5
|
-
import { validate, OPFValidationError } from './chunk-
|
|
6
|
-
import { ensureIcons } from './chunk-
|
|
1
|
+
import { defaultCatalogs } from './chunk-XJUMFH33.js';
|
|
2
|
+
import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-AGYPRTEC.js';
|
|
3
|
+
import { paginate, continueOverfull } from './chunk-L3MCLD3X.js';
|
|
4
|
+
import { deckFormatOf, readDeckReport, stringify } from './chunk-MUILZGRY.js';
|
|
5
|
+
import { validate, OPFValidationError } from './chunk-AEHDXNZX.js';
|
|
6
|
+
import { ensureIcons } from './chunk-CJVKOJ6B.js';
|
|
7
7
|
import { link, stat, readdir, lstat, readFile, open, unlink, mkdir, rename } from 'fs/promises';
|
|
8
8
|
import path6 from 'path';
|
|
9
9
|
import { readFileSync, statSync, realpathSync } from 'fs';
|
|
@@ -122,9 +122,16 @@ function localAssetProblems(deck, root) {
|
|
|
122
122
|
}
|
|
123
123
|
return problems;
|
|
124
124
|
}
|
|
125
|
+
function iconSourceReader(root, resolver = createImageResolver(root, { add() {
|
|
126
|
+
} })) {
|
|
127
|
+
return async (source) => {
|
|
128
|
+
const uri = resolver.forMeasure(source);
|
|
129
|
+
return uri?.startsWith("data:image/svg+xml;base64,") ? Buffer.from(uri.slice(26), "base64").toString("utf8") : void 0;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
125
132
|
var RENDER_PACKAGE = "@openpresentation/opf-render";
|
|
126
133
|
var PPTX_PACKAGE = "@openpresentation/opf-pptx";
|
|
127
|
-
var PEER_RANGES = { [RENDER_PACKAGE]: "^0.
|
|
134
|
+
var PEER_RANGES = { [RENDER_PACKAGE]: "^0.34.1", [PPTX_PACKAGE]: "^0.34.1" };
|
|
128
135
|
var PPTX_TEXT_OPTIONS_FROM = "0.22.0";
|
|
129
136
|
var numbers = (version) => version.replace(/[-+].*$/, "").split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
130
137
|
function atLeast(version, minimum) {
|
|
@@ -160,7 +167,8 @@ var hint = (name) => `${name} is not installed. It is an optional peer of @openp
|
|
|
160
167
|
npx -p @openpresentation/cli -p @openpresentation/opf-render -p @openpresentation/opf-pptx opf <command> ... (one run)` + (name === RENDER_PACKAGE ? `
|
|
161
168
|
${renderHint()}` : "");
|
|
162
169
|
function bases() {
|
|
163
|
-
|
|
170
|
+
const here = import.meta.url;
|
|
171
|
+
return [...typeof here === "string" ? [here] : [], pathToFileURL(path6.join(process.cwd(), "noop.js")).href];
|
|
164
172
|
}
|
|
165
173
|
function locate(specifier) {
|
|
166
174
|
for (const base of bases()) {
|
|
@@ -275,7 +283,7 @@ async function listFontDirectories(directories, label = "--fonts") {
|
|
|
275
283
|
}
|
|
276
284
|
return files;
|
|
277
285
|
}
|
|
278
|
-
async function prepareFonts(renderer, presentation, userFonts, reporter, embedScriptFonts = false) {
|
|
286
|
+
async function prepareFonts(renderer, presentation, userFonts, reporter, embedScriptFonts = false, renderOptions) {
|
|
279
287
|
try {
|
|
280
288
|
const handle = await renderer.fonts.loadFonts({
|
|
281
289
|
pack: "office",
|
|
@@ -283,6 +291,7 @@ async function prepareFonts(renderer, presentation, userFonts, reporter, embedSc
|
|
|
283
291
|
scripts: "auto",
|
|
284
292
|
embedScriptFonts,
|
|
285
293
|
presentation,
|
|
294
|
+
...renderOptions ? { renderOptions } : {},
|
|
286
295
|
faces: userFonts.map((file) => ({ path: file })),
|
|
287
296
|
onDiagnostic: (diagnostic) => reporter.add("fonts", scriptDiagnostic(diagnostic))
|
|
288
297
|
});
|
|
@@ -299,10 +308,10 @@ async function prepareFonts(renderer, presentation, userFonts, reporter, embedSc
|
|
|
299
308
|
}
|
|
300
309
|
var NEUTRAL_DECK = { slides: [] };
|
|
301
310
|
var shared = /* @__PURE__ */ new Map();
|
|
302
|
-
async function leaseSharedFonts(renderer, presentation, userFonts, reporter, embedScriptFonts = false) {
|
|
311
|
+
async function leaseSharedFonts(renderer, presentation, userFonts, reporter, embedScriptFonts = false, renderOptions) {
|
|
303
312
|
const select = renderer.fonts.autoScriptSelection;
|
|
304
313
|
if (typeof select !== "function") return void 0;
|
|
305
|
-
const selection = select(presentation);
|
|
314
|
+
const selection = select(presentation, renderOptions);
|
|
306
315
|
if (selection.detected?.length || selection.scripts?.length || selection.unavailable?.length) return void 0;
|
|
307
316
|
const key = JSON.stringify([userFonts, embedScriptFonts]);
|
|
308
317
|
let entry = shared.get(key);
|
|
@@ -324,14 +333,22 @@ async function leaseSharedFonts(renderer, presentation, userFonts, reporter, emb
|
|
|
324
333
|
release = resolve;
|
|
325
334
|
});
|
|
326
335
|
await previous;
|
|
327
|
-
|
|
328
|
-
|
|
336
|
+
try {
|
|
337
|
+
const prepared = handle;
|
|
338
|
+
if (typeof prepared.pending === "function" && prepared.pending(presentation, renderOptions).length) {
|
|
339
|
+
if (typeof prepared.ensure !== "function") {
|
|
340
|
+
release();
|
|
341
|
+
return void 0;
|
|
342
|
+
}
|
|
343
|
+
await prepared.ensure(presentation, { renderOptions, onDiagnostic: (diagnostic) => reporter.add("fonts", diagnostic) });
|
|
344
|
+
}
|
|
345
|
+
handle.registry?.clearSubstitutions?.();
|
|
346
|
+
for (const diagnostic of diagnostics) reporter.add("fonts", diagnostic);
|
|
347
|
+
return { handle, release };
|
|
348
|
+
} catch (error) {
|
|
329
349
|
release();
|
|
330
|
-
|
|
350
|
+
throw error;
|
|
331
351
|
}
|
|
332
|
-
handle.registry?.clearSubstitutions?.();
|
|
333
|
-
for (const diagnostic of diagnostics) reporter.add("fonts", diagnostic);
|
|
334
|
-
return { handle, release };
|
|
335
352
|
}
|
|
336
353
|
function scriptDiagnostic(diagnostic) {
|
|
337
354
|
if (diagnostic.code !== "script-font-not-installed") return diagnostic;
|
|
@@ -470,7 +487,8 @@ var INFO = /* @__PURE__ */ new Set([
|
|
|
470
487
|
"picture-not-measured",
|
|
471
488
|
"diagram-shapes-unavailable",
|
|
472
489
|
"smartart-unavailable",
|
|
473
|
-
"arrangement-adapted"
|
|
490
|
+
"arrangement-adapted",
|
|
491
|
+
"prepared-late"
|
|
474
492
|
]);
|
|
475
493
|
var HELP = {
|
|
476
494
|
"text-overflow": "Shorten the text, or split the slide: add --paginate (measured with the same fonts) or run opf paginate.",
|
|
@@ -495,6 +513,7 @@ var HELP = {
|
|
|
495
513
|
"typeface-replaced": "Drop --typefaces safe to keep the selected families in the file.",
|
|
496
514
|
"diagram-shapes-unavailable": "The diagram stays one picture in PowerPoint (see the message). It looks the same; to edit it, change its source in OPF and export again.",
|
|
497
515
|
"smartart-unavailable": "The pyramid, matrix or cycle is exported as editable native shapes, which look the same; live SmartArt is written only where PowerPoint draws it exactly as the preview (docs/smartart.md). Shorten the entries named in the message, or give the region other proportions, to get live SmartArt. When the message names the fallback picture, install @openpresentation/opf-render: every live SmartArt carries OPF's picture of it for apps without SmartArt.",
|
|
516
|
+
"prepared-late": "Nothing to change in the deck: the output is correct. OPF prepared this face only when the export measured it, which its font analysis should have foreseen; please report the deck so the analysis covers it.",
|
|
498
517
|
"duplicate-font-face": "A --fonts face repeats a bundled family, weight and style; remove it or rename the family.",
|
|
499
518
|
"shape-property-dropped": "OPF has no form for this property of a PowerPoint shape (3-D, preset shadows, autofit and the others in docs/shapes.md); it was dropped and the shape imported. Set it again in the PowerPoint file if it matters.",
|
|
500
519
|
"shape-covers-content": "An overlay shape is always drawn over the content, and OPF has no layer behind it: give the content a card, or the slide a background, instead of a shape behind it.",
|
|
@@ -503,8 +522,29 @@ var HELP = {
|
|
|
503
522
|
var Reporter = class {
|
|
504
523
|
findings = [];
|
|
505
524
|
seen = /* @__PURE__ */ new Set();
|
|
525
|
+
/** The identity key of each finding, by index ("" for the initial findings, which are not deduplicated). */
|
|
526
|
+
keys = [];
|
|
506
527
|
constructor(initial = []) {
|
|
507
|
-
for (const item of initial)
|
|
528
|
+
for (const item of initial) {
|
|
529
|
+
this.findings.push(item);
|
|
530
|
+
this.keys.push("");
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
/** The point `withdrawErrors` looks back to: the number of findings so far. */
|
|
534
|
+
mark() {
|
|
535
|
+
return this.findings.length;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Withdraw the error findings added after `mark`: the failure of an attempt that is run again (RR-105). Its other findings stay; the
|
|
539
|
+
* next attempt repeats them and they are kept once.
|
|
540
|
+
*/
|
|
541
|
+
withdrawErrors(mark) {
|
|
542
|
+
for (let index = this.findings.length - 1; index >= mark; index--) {
|
|
543
|
+
if (this.findings[index]?.severity !== "error") continue;
|
|
544
|
+
this.seen.delete(this.keys[index] ?? "");
|
|
545
|
+
this.findings.splice(index, 1);
|
|
546
|
+
this.keys.splice(index, 1);
|
|
547
|
+
}
|
|
508
548
|
}
|
|
509
549
|
/** Add a library diagnostic (`code`, `path`, `message` and details). Identical entries are kept once. */
|
|
510
550
|
add(source, diagnostic, severity) {
|
|
@@ -522,6 +562,7 @@ var Reporter = class {
|
|
|
522
562
|
const key = JSON.stringify([entry.ruleId, entry.path, entry.message, details]);
|
|
523
563
|
if (this.seen.has(key)) return;
|
|
524
564
|
this.seen.add(key);
|
|
565
|
+
this.keys.push(key);
|
|
525
566
|
this.findings.push(entry);
|
|
526
567
|
}
|
|
527
568
|
/** Add a finding as the library made it (the `findings` of a thrown OPFRenderError, OPFPptxError or core validation error). Identical entries are kept once. */
|
|
@@ -529,6 +570,7 @@ var Reporter = class {
|
|
|
529
570
|
const key = JSON.stringify(finding);
|
|
530
571
|
if (this.seen.has(key)) return;
|
|
531
572
|
this.seen.add(key);
|
|
573
|
+
this.keys.push(key);
|
|
532
574
|
this.findings.push(finding);
|
|
533
575
|
}
|
|
534
576
|
error(source, code, message, where = "", details = {}) {
|
|
@@ -707,19 +749,53 @@ async function runExport(presentation, options, ctx) {
|
|
|
707
749
|
const pptx = format === "pptx" ? ctx.pptx ?? await loadPptx() : void 0;
|
|
708
750
|
const userFonts = options.fonts ? [] : ctx.userFonts ?? await listFontDirectories(options.fontFolders, ctx.flags ? "--fonts" : "fonts");
|
|
709
751
|
const resolver = createImageResolver(assetRoot(options.assetDir, ctx.flags), reporter, ctx.flags ? "pass --asset-dir" : "pass assetDir");
|
|
710
|
-
await ensureIcons(presentation, { catalogs, readSource:
|
|
711
|
-
const uri = resolver.forMeasure(source);
|
|
712
|
-
return uri?.startsWith("data:image/svg+xml;base64,") ? Buffer.from(uri.slice(26), "base64").toString("utf8") : void 0;
|
|
713
|
-
} });
|
|
752
|
+
await ensureIcons(presentation, { catalogs, readSource: iconSourceReader(void 0, resolver) });
|
|
714
753
|
const embedScripts = format === "svg" && options.text === "fonts";
|
|
715
|
-
const lease = options.fonts ? void 0 : await leaseSharedFonts(renderer, presentation, userFonts, reporter, embedScripts);
|
|
754
|
+
const lease = options.fonts ? void 0 : await leaseSharedFonts(renderer, presentation, userFonts, reporter, embedScripts, { catalogs, ...date ? { date } : {} });
|
|
716
755
|
try {
|
|
717
|
-
const handle = options.fonts ?? lease?.handle ?? (await prepareFonts(renderer, presentation, userFonts, reporter, embedScripts)).handle;
|
|
718
|
-
|
|
756
|
+
const handle = options.fonts ?? lease?.handle ?? (await prepareFonts(renderer, presentation, userFonts, reporter, embedScripts, { catalogs, ...date ? { date } : {} })).handle;
|
|
757
|
+
if (options.fonts && handle.registry?.fontNames) await handle.ensure?.(presentation, { renderOptions: { catalogs, ...date ? { date } : {} } });
|
|
758
|
+
const environment = { reporter, catalogs, date, renderer, ...pptx ? { pptx } : {}, userFonts, resolver };
|
|
759
|
+
const late = /* @__PURE__ */ new Set();
|
|
760
|
+
for (let round = 0; ; round++) {
|
|
761
|
+
const mark = reporter.mark();
|
|
762
|
+
const result = await drawWith(presentation, handle, options, ctx, environment);
|
|
763
|
+
const face = result.failure ? unpreparedFace(thrownBy.get(result)) : void 0;
|
|
764
|
+
if (!face || round >= LATE_FACE_ROUNDS || late.has(face.key) || typeof handle.ensure !== "function" || !handle.registry?.fontNames) return result;
|
|
765
|
+
late.add(face.key);
|
|
766
|
+
try {
|
|
767
|
+
await handle.ensure(presentation, { renderOptions: { catalogs, ...date ? { date } : {} }, measurementRequests: [{ text: " ", size: 16, style: face.style }] });
|
|
768
|
+
} catch {
|
|
769
|
+
return result;
|
|
770
|
+
}
|
|
771
|
+
reporter.withdrawErrors(mark);
|
|
772
|
+
reporter.add(
|
|
773
|
+
"fonts",
|
|
774
|
+
{ code: "prepared-late", path: face.path, message: `${face.style.fontFamily} ${face.style.fontWeight}${face.style.italic ? " italic" : ""} was prepared only when the export measured it; the export ran again with it.`, fontFamily: face.style.fontFamily, fontWeight: face.style.fontWeight, italic: face.style.italic },
|
|
775
|
+
"info"
|
|
776
|
+
);
|
|
777
|
+
}
|
|
719
778
|
} finally {
|
|
720
779
|
lease?.release();
|
|
721
780
|
}
|
|
722
781
|
}
|
|
782
|
+
var LATE_FACE_ROUNDS = 4;
|
|
783
|
+
var thrownBy = /* @__PURE__ */ new WeakMap();
|
|
784
|
+
var failedWith = (run, error) => {
|
|
785
|
+
thrownBy.set(run, error);
|
|
786
|
+
return run;
|
|
787
|
+
};
|
|
788
|
+
function unpreparedFace(error) {
|
|
789
|
+
let current = error;
|
|
790
|
+
for (let depth = 0; current && depth < 3; depth++, current = current.cause) {
|
|
791
|
+
const details = current.details;
|
|
792
|
+
if (current.code !== "font-unavailable" || typeof current.message !== "string" || !current.message.startsWith("The selected face is not prepared") || !details) continue;
|
|
793
|
+
const { fontFamily, fontWeight, italic, path: path7 } = details;
|
|
794
|
+
if (typeof fontFamily !== "string" || !fontFamily.trim() || typeof fontWeight !== "number" || !Number.isFinite(fontWeight) || typeof italic !== "boolean") return void 0;
|
|
795
|
+
return { key: JSON.stringify([fontFamily.toLowerCase(), fontWeight, italic]), path: typeof path7 === "string" ? path7 : "", style: { fontFamily, fontWeight, italic } };
|
|
796
|
+
}
|
|
797
|
+
return void 0;
|
|
798
|
+
}
|
|
723
799
|
async function drawWith(presentation, handle, options, ctx, environment) {
|
|
724
800
|
const { format, scale } = options;
|
|
725
801
|
const { reporter, catalogs, date, renderer, pptx, userFonts, resolver } = environment;
|
|
@@ -740,7 +816,7 @@ async function drawWith(presentation, handle, options, ctx, environment) {
|
|
|
740
816
|
pagination = { pages: result.pages };
|
|
741
817
|
} catch (error) {
|
|
742
818
|
reportThrown(reporter, "render", error);
|
|
743
|
-
return { files: [], fonts: fontSummary(), skippedHidden: [], failure: failureOf(error) };
|
|
819
|
+
return failedWith({ files: [], fonts: fontSummary(), skippedHidden: [], failure: failureOf(error) }, error);
|
|
744
820
|
}
|
|
745
821
|
} else if (options.paginate !== false) {
|
|
746
822
|
const source = format === "pptx" ? "pptx" : "render";
|
|
@@ -766,9 +842,10 @@ async function drawWith(presentation, handle, options, ctx, environment) {
|
|
|
766
842
|
}
|
|
767
843
|
} catch (error) {
|
|
768
844
|
reportThrown(reporter, source, error);
|
|
769
|
-
return { files: [], fonts: fontSummary(), skippedHidden: [], failure: failureOf(error) };
|
|
845
|
+
return failedWith({ files: [], fonts: fontSummary(), skippedHidden: [], failure: failureOf(error) }, error);
|
|
770
846
|
}
|
|
771
847
|
}
|
|
848
|
+
if (deck !== presentation && handle.registry?.fontNames) await handle.ensure?.(deck, { renderOptions: { catalogs, ...date ? { date } : {} } });
|
|
772
849
|
const pictureLuminance = options.measurePictures === false ? void 0 : await measurePictureBackgrounds(renderer, deck, resolver, catalogs, reporter);
|
|
773
850
|
const slideCount = deck.slides?.length ?? 0;
|
|
774
851
|
const isHidden = (number) => deck.slides?.[number - 1]?.hidden === true;
|
|
@@ -777,6 +854,16 @@ async function drawWith(presentation, handle, options, ctx, environment) {
|
|
|
777
854
|
const named = options.slides === void 0 ? void 0 : parseSlideSelection(options.slides, slideCount, slidesLabel);
|
|
778
855
|
const selected = format === "pptx" ? [] : named ?? (options.includeHidden ? everySlide : everySlide.filter((number) => !isHidden(number)));
|
|
779
856
|
const skippedHidden = format === "pptx" || named || options.includeHidden ? [] : everySlide.filter(isHidden);
|
|
857
|
+
if (format !== "pptx" || options.as === "images") {
|
|
858
|
+
const rules = ["opf/chart-mapping-adapted", "opf/chart-series-dropped"];
|
|
859
|
+
const chartCheck = validate(deck, { only: rules, catalogs });
|
|
860
|
+
for (const finding of chartCheck.findings) {
|
|
861
|
+
if (finding.severity !== "warning" || !rules.includes(finding.ruleId)) continue;
|
|
862
|
+
const sourceIndex = /^\/slides\/(\d+)(?:\/|$)/.exec(finding.path)?.[1];
|
|
863
|
+
if (format !== "pptx" && (sourceIndex === void 0 || !selected.includes(Number(sourceIndex) + 1))) continue;
|
|
864
|
+
if (!reporter.findings.some((existing) => existing.ruleId === finding.ruleId && existing.path === finding.path && existing.message === finding.message)) reporter.addFinding(finding);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
780
867
|
if (format !== "pptx" && !selected.length)
|
|
781
868
|
throw new OPFApiError(skippedHidden.length ? ctx.flags ? "Every slide is hidden. Use --include-hidden to write them, or --slides to name slides." : "Every slide is hidden. Use includeHidden to write them, or slides to name slides." : "The presentation has no slides.", skippedHidden.length ? "all-slides-hidden" : "no-slides");
|
|
782
869
|
const stem = deckStem(options.name === void 0 ? deck : { filename: options.name }, "-");
|
|
@@ -871,7 +958,7 @@ async function drawWith(presentation, handle, options, ctx, environment) {
|
|
|
871
958
|
const missing = missingPeerFrom(error);
|
|
872
959
|
if (missing) throw missing;
|
|
873
960
|
reportThrown(reporter, format === "pptx" ? "pptx" : "render", error);
|
|
874
|
-
return { files: [], fonts: fontSummary(), ...pagination ? { pagination } : {}, skippedHidden: [], failure: failureOf(error) };
|
|
961
|
+
return failedWith({ files: [], fonts: fontSummary(), ...pagination ? { pagination } : {}, skippedHidden: [], failure: failureOf(error) }, error);
|
|
875
962
|
}
|
|
876
963
|
}
|
|
877
964
|
async function measurePictureBackgrounds(renderer, deck, resolver, catalogs, reporter) {
|
|
@@ -1197,4 +1284,4 @@ async function saveDeck(presentation, file, options = {}) {
|
|
|
1197
1284
|
return { path: file, format };
|
|
1198
1285
|
}
|
|
1199
1286
|
|
|
1200
|
-
export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, convertFiles, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, openDeck, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, saveDeck, stemOf, writeFiles, writePlanned };
|
|
1287
|
+
export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, convertFiles, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, iconSourceReader, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, openDeck, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, saveDeck, stemOf, writeFiles, writePlanned };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SOURCE_EXPLAIN, ruleDocumentation, findValidationRule, us } from './chunk-
|
|
1
|
+
import { SOURCE_EXPLAIN, ruleDocumentation, findValidationRule, us } from './chunk-AEHDXNZX.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(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isRecord, same } from './chunk-
|
|
2
|
-
import { createLocator } from './chunk-
|
|
1
|
+
import { isRecord, same } from './chunk-FCSYIBVR.js';
|
|
2
|
+
import { createLocator } from './chunk-AEHDXNZX.js';
|
|
3
3
|
import { parseDocument, isMap, isSeq, isScalar, YAMLMap, Scalar, stringify, visit } from 'yaml';
|
|
4
4
|
|
|
5
5
|
var sentence = (text) => text.charAt(0).toUpperCase() + text.slice(1);
|