@openpresentation/opf 0.34.0 → 0.34.2
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/dist/browser.js +18 -18
- package/dist/{catalog-refs-CoIrOdAw.d.ts → catalog-refs-wtuudZTe.d.ts} +12 -3
- package/dist/{catalog-schemas-FjLRPtjB.d.ts → catalog-schemas-CSxuFtsu.d.ts} +1 -1
- package/dist/{chunk-HHVQ2SDT.js → chunk-6MSH3KCZ.js} +1 -1
- package/dist/{chunk-QGJVOPLG.js → chunk-AQ3WR3H7.js} +2 -2
- package/dist/{chunk-2HX4BGAS.js → chunk-EQCZ2SFD.js} +6 -6
- package/dist/chunk-HSXWDXKM.js +1 -0
- package/dist/{chunk-RUV7CCE6.js → chunk-HX4HEJB4.js} +201 -21
- package/dist/{chunk-QGTJF7HV.js → chunk-IDYYLJCQ.js} +6 -6
- package/dist/{chunk-CJVKOJ6B.js → chunk-IGT4523S.js} +406 -58
- package/dist/{chunk-U7TYSPYM.js → chunk-KJFCHCWV.js} +2 -2
- package/dist/{chunk-WMFT5R7I.js → chunk-MDAXXFAY.js} +2 -2
- package/dist/{chunk-HUGVYHZ2.js → chunk-NMZCPZ3R.js} +3 -3
- package/dist/{chunk-F6BXO4AI.js → chunk-P2X4BBW2.js} +1 -1
- package/dist/{chunk-3THGTDL2.js → chunk-PHOSM2RA.js} +1 -1
- package/dist/{chunk-FIQMAIZV.js → chunk-RM4Z7ZSW.js} +4 -4
- package/dist/{chunk-244OPLAV.js → chunk-UKI43JE6.js} +1 -1
- package/dist/{chunk-DQ7QYOUV.js → chunk-V4G3BYPY.js} +2 -2
- package/dist/{chunk-LCT5ZV3Q.js → chunk-VI7VWDTN.js} +17 -1
- package/dist/{chunk-36DLVJGW.js → chunk-VVPPMHP6.js} +5 -5
- package/dist/{chunk-FAXO3SUE.js → chunk-WBPXRUZT.js} +463 -271
- package/dist/{chunk-42JBXJKW.js → chunk-XLXCXEVF.js} +2 -2
- package/dist/{composition-CvtvgBDE.d.ts → composition-DF07Ha4R.d.ts} +154 -135
- package/dist/composition.d.ts +2 -2
- package/dist/composition.js +1 -1
- package/dist/{conversion-B_5AKTYQ.d.ts → conversion-52ki0lfZ.d.ts} +9 -7
- package/dist/conversion-F3HSCFOV.js +25 -0
- package/dist/convert.d.ts +2 -2
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +1 -1
- package/dist/data.js +2 -2
- package/dist/{deck-report-BVlQZ42f.d.ts → deck-report-C3EsoHC3.d.ts} +3 -3
- package/dist/deck.d.ts +5 -5
- package/dist/deck.js +11 -11
- package/dist/diff.js +4 -4
- package/dist/docs.js +18 -18
- package/dist/example-files/technical/assets/alice.png +0 -0
- package/dist/example-files/technical/assets/context-photo.png +0 -0
- package/dist/example-files/technical/assets/cover-image.png +0 -0
- package/dist/example-files/technical/assets/cover.png +0 -0
- package/dist/example-files/technical/assets/diagram.svg +1 -0
- package/dist/example-files/technical/assets/icon.svg +1 -0
- package/dist/example-files/technical/assets/logo-dark.svg +1 -0
- package/dist/example-files/technical/assets/logo-light.svg +1 -0
- package/dist/example-files/technical/assets/logo.svg +1 -0
- package/dist/example-files/technical/assets/primary-logo.svg +1 -0
- package/dist/example-files/technical/assets/product-shot.png +0 -0
- package/dist/example-files/technical/assets/watermark.png +0 -0
- package/dist/example-files/technical/assets/wordmark.svg +1 -0
- package/dist/examples.js +49 -1
- package/dist/format.js +2 -2
- package/dist/ids.js +4 -4
- package/dist/index.d.ts +12 -12
- package/dist/index.js +21 -21
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +8 -8
- package/dist/node-engine.d.ts +21 -7
- package/dist/node-engine.js +37 -21
- package/dist/{pagination-CZQQYk7L.d.ts → pagination-Do7vNgU-.d.ts} +2 -2
- 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-s9262acV.d.ts → presentation-ANs2WkaS.d.ts} +8 -0
- package/dist/schema-engine-ajv.js +1 -1
- package/dist/schema-engine-precompiled.js +2 -2
- package/dist/schema.d.ts +2 -2
- package/dist/schema.js +3 -3
- package/dist/schemas.js +1 -1
- package/dist/source.d.ts +5 -0
- package/dist/source.js +10 -10
- package/dist/spec/schemas/icon-set.schema.json +5 -0
- package/dist/spec/schemas/opf.schema.json +9 -1
- package/dist/symbol-font-encodings.js +12695 -12736
- package/dist/types.d.ts +2 -2
- package/dist/{validation-types-CYbsUuZ9.d.ts → validation-types-BNS41nzb.d.ts} +2 -2
- package/dist/validator.d.ts +4 -4
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +1 -1
- package/dist/yaml.js +7 -7
- package/package.json +7 -7
- package/dist/chunk-UJZN2ZH6.js +0 -1
- package/dist/conversion-CMBGOTAC.js +0 -25
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defaultCatalogs } from './chunk-XJUMFH33.js';
|
|
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-
|
|
2
|
+
import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-NMZCPZ3R.js';
|
|
3
|
+
import { paginate, continueOverfull } from './chunk-XLXCXEVF.js';
|
|
4
|
+
import { deckFormatOf, readDeckReport, stringify } from './chunk-RM4Z7ZSW.js';
|
|
5
|
+
import { validate, OPFValidationError } from './chunk-WBPXRUZT.js';
|
|
6
|
+
import { ensureIcons } from './chunk-IGT4523S.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';
|
|
@@ -131,7 +131,7 @@ function iconSourceReader(root, resolver = createImageResolver(root, { add() {
|
|
|
131
131
|
}
|
|
132
132
|
var RENDER_PACKAGE = "@openpresentation/opf-render";
|
|
133
133
|
var PPTX_PACKAGE = "@openpresentation/opf-pptx";
|
|
134
|
-
var PEER_RANGES = { [RENDER_PACKAGE]: "^0.34.
|
|
134
|
+
var PEER_RANGES = { [RENDER_PACKAGE]: "^0.34.2", [PPTX_PACKAGE]: "^0.34.2" };
|
|
135
135
|
var PPTX_TEXT_OPTIONS_FROM = "0.22.0";
|
|
136
136
|
var numbers = (version) => version.replace(/[-+].*$/, "").split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
137
137
|
function atLeast(version, minimum) {
|
|
@@ -148,7 +148,7 @@ function requirePptxOptions(pptx, options, flags = false) {
|
|
|
148
148
|
throw new OPFApiError(`${newer.join(" and ")} needs a newer ${pptx.name}; ${pptx.version} is installed and would ignore it.`, "peer-too-old", { details: { package: pptx.name } });
|
|
149
149
|
}
|
|
150
150
|
var RENDER_EXTRAS = {
|
|
151
|
-
/** The
|
|
151
|
+
/** The font packages of the base and office packs. A deck needs only the ones its faces use (opf-render loads faces on demand); `opf doctor <deck>` names them. */
|
|
152
152
|
fonts: ["@expo-google-fonts/roboto@0.4.3", "@expo-google-fonts/roboto-mono@0.4.2", "@expo-google-fonts/caladea@0.4.2", "@expo-google-fonts/arimo@0.4.3", "@expo-google-fonts/tinos@0.4.2", "@expo-google-fonts/cousine@0.4.3", "@expo-google-fonts/gelasio@0.4.1", "@expo-google-fonts/noto-sans@0.4.2"],
|
|
153
153
|
/** PNG output (and raster fallbacks): the SVG rasterizer, and sharp for WebP and rotated JPEG pictures. */
|
|
154
154
|
png: ["@resvg/resvg-js@^2.6.2", "sharp@^0.35.5"],
|
|
@@ -245,7 +245,7 @@ function missingPeerFrom(error) {
|
|
|
245
245
|
const details = current.details ?? {};
|
|
246
246
|
const fontPackages = current.code === "font-resource-unavailable" && (Array.isArray(details.packages) || typeof details.package === "string");
|
|
247
247
|
if (current.code !== "converter-missing" && !fontPackages) continue;
|
|
248
|
-
const kept = Object.fromEntries(["package", "packages", "range", "install", "purpose"].filter((key) => details[key] !== void 0).map((key) => [key, details[key]]));
|
|
248
|
+
const kept = Object.fromEntries(["package", "packages", "faces", "range", "install", "purpose"].filter((key) => details[key] !== void 0).map((key) => [key, details[key]]));
|
|
249
249
|
return new OPFApiError(current.message ?? String(current.code), details.installed === true ? "peer-load-failed" : "peer-not-installed", { details: kept, cause: error });
|
|
250
250
|
}
|
|
251
251
|
return void 0;
|
|
@@ -293,7 +293,7 @@ async function prepareFonts(renderer, presentation, userFonts, reporter, embedSc
|
|
|
293
293
|
presentation,
|
|
294
294
|
...renderOptions ? { renderOptions } : {},
|
|
295
295
|
faces: userFonts.map((file) => ({ path: file })),
|
|
296
|
-
onDiagnostic: (diagnostic) => reporter.add("fonts",
|
|
296
|
+
onDiagnostic: (diagnostic) => reporter.add("fonts", diagnostic)
|
|
297
297
|
});
|
|
298
298
|
return { handle, userFonts };
|
|
299
299
|
} catch (error) {
|
|
@@ -350,11 +350,6 @@ async function leaseSharedFonts(renderer, presentation, userFonts, reporter, emb
|
|
|
350
350
|
throw error;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function scriptDiagnostic(diagnostic) {
|
|
354
|
-
if (diagnostic.code !== "script-font-not-installed") return diagnostic;
|
|
355
|
-
const name = typeof diagnostic.package === "string" ? diagnostic.package : "the Noto script package";
|
|
356
|
-
return { ...diagnostic, message: `${diagnostic.message} Install ${name} next to the CLI (npm install -g ${name}) to draw this script with a bundled open font.` };
|
|
357
|
-
}
|
|
358
353
|
function embeddedFor(handle, text = "fonts") {
|
|
359
354
|
return text === "fonts" ? handle.embeddedFonts.map((face) => ({ ...face, embed: "used" })) : [];
|
|
360
355
|
}
|
|
@@ -366,6 +361,37 @@ function substitutionRows(handle) {
|
|
|
366
361
|
}
|
|
367
362
|
return [...rows.values()].sort((a, b) => a.requested + a.resolved < b.requested + b.resolved ? -1 : 1);
|
|
368
363
|
}
|
|
364
|
+
var SUBSTITUTE_KIND = {
|
|
365
|
+
metric: "a metric-compatible substitute, so lines break as they would with the requested font",
|
|
366
|
+
visual: "a visual substitute, so lines can break differently than with the requested font",
|
|
367
|
+
generic: "the fallback face"
|
|
368
|
+
};
|
|
369
|
+
function reportSubstitutions(reporter, handle) {
|
|
370
|
+
const byFamily = /* @__PURE__ */ new Map();
|
|
371
|
+
for (const item of handle.substitutions ?? []) {
|
|
372
|
+
if (!item.substitute || item.requestedFamily === item.resolvedFamily) continue;
|
|
373
|
+
const entry = byFamily.get(item.requestedFamily) ?? { resolved: /* @__PURE__ */ new Set(), compatibility: /* @__PURE__ */ new Set() };
|
|
374
|
+
entry.resolved.add(item.resolvedFamily);
|
|
375
|
+
entry.compatibility.add(item.compatibility);
|
|
376
|
+
if (item.licenseClass) entry.licenseClass = item.licenseClass;
|
|
377
|
+
byFamily.set(item.requestedFamily, entry);
|
|
378
|
+
}
|
|
379
|
+
for (const [requested, entry] of [...byFamily].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) {
|
|
380
|
+
const resolved = [...entry.resolved].sort();
|
|
381
|
+
const compatibility = ["generic", "visual", "metric"].find((tier) => entry.compatibility.has(tier)) ?? [...entry.compatibility][0] ?? "visual";
|
|
382
|
+
const reason = entry.licenseClass === "proprietary-standard" ? `${requested} is a proprietary font that OPF does not bundle` : entry.licenseClass === "open" ? `${requested} is openly licensed, but no font package OPF bundles serves it` : compatibility === "generic" ? `no bundled face or declared replacement serves ${requested}` : void 0;
|
|
383
|
+
const kind = SUBSTITUTE_KIND[compatibility] ?? `a ${compatibility} substitute`;
|
|
384
|
+
reporter.add("fonts", {
|
|
385
|
+
code: "font-substituted",
|
|
386
|
+
path: "",
|
|
387
|
+
message: `${requested} is drawn with ${resolved.join(" and ")}, ${kind}${reason ? `: ${reason}` : ""}.`,
|
|
388
|
+
requested,
|
|
389
|
+
resolved,
|
|
390
|
+
compatibility,
|
|
391
|
+
...entry.licenseClass ? { licenseClass: entry.licenseClass } : {}
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
}
|
|
369
395
|
function stemOf(input) {
|
|
370
396
|
if (input === "-") return "deck";
|
|
371
397
|
return path6.basename(input).replace(/\.opf\.json$/i, "").replace(/\.(json|pptx|potx)$/i, "") || "deck";
|
|
@@ -397,14 +423,16 @@ function checkOutputPattern(output, perSlide) {
|
|
|
397
423
|
function expandOutputPattern(output, slide, largest) {
|
|
398
424
|
return output.replace(PLACEHOLDER, () => padNumber(slide, largest));
|
|
399
425
|
}
|
|
400
|
-
function outputExists(file, flags) {
|
|
401
|
-
|
|
426
|
+
function outputExists(file, flags, existing = 1, total = 1) {
|
|
427
|
+
const many = total > 1 ? ` ${existing} of the ${total} files this would write already exist; nothing was written and they are unchanged.` : "";
|
|
428
|
+
return new OPFApiError(`Output already exists: ${file}.${many} ${flags ? `Use --force to replace ${total > 1 ? "them" : "it"}.` : `Pass overwrite: true (the default) to replace ${total > 1 ? "them" : "it"}.`}`, "output-exists", { details: total > 1 ? { path: file, existing, total } : { path: file } });
|
|
402
429
|
}
|
|
403
430
|
async function checkDestinations(files, overwrite, flags = true) {
|
|
431
|
+
const existing = overwrite ? [] : (await Promise.all(files.map((file) => lstat(file).then(() => file, () => void 0)))).filter((file) => file !== void 0);
|
|
404
432
|
for (const file of files) {
|
|
405
433
|
try {
|
|
406
434
|
const stat2 = await lstat(file);
|
|
407
|
-
if (!overwrite) throw outputExists(file, flags);
|
|
435
|
+
if (!overwrite) throw outputExists(existing[0] ?? file, flags, existing.length, files.length);
|
|
408
436
|
if (!stat2.isFile()) throw new OPFApiError(`Refusing to replace a symlink or non-regular file${flags ? "" : `: ${file}`}.`, "output-not-file", { details: { path: file } });
|
|
409
437
|
} catch (error) {
|
|
410
438
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -490,6 +518,12 @@ var INFO = /* @__PURE__ */ new Set([
|
|
|
490
518
|
"arrangement-adapted",
|
|
491
519
|
"prepared-late"
|
|
492
520
|
]);
|
|
521
|
+
var INVALID_TAG = "What the PPTX shows was imported as it is; only the OPF structure recorded with it at export (the message names it) was not restored, because that record was edited, duplicated, damaged or no longer matches the slide. To get it back, import the file as exported, or change the OPF source and export again.";
|
|
522
|
+
var REFLOW = "The text was recovered in its order, and OPF lays the slide out again: native positions, and the formatting the message names, are not carried over. Review the imported slide; keeping the OPF source as the master copy avoids this.";
|
|
523
|
+
var EDITED = "The PPTX was changed after export, so OPF imported what it shows now and did not restore the authored value the message names. Nothing needs to change if the edit is wanted; to keep the authored value, change it in the OPF source and export again.";
|
|
524
|
+
var NATIVE_FRAGMENT = "Nothing needs to change in the deck: the line was exported as one measured text box, as the preview draws it, instead of the separate source-bound boxes OPF writes for proofing-sensitive lines.";
|
|
525
|
+
var REFERENCE_UNCERTAIN = "The chart's reference lines were not restored as referenceLines (the message says why); what the slide shows stays as ordinary content. Add or fix referenceLines in the OPF source and export again if they should follow the data.";
|
|
526
|
+
var TABLE_STYLE = "The table and its text were imported; the cell formatting the message names has no OPF form, so it was left out or replaced by the nearest one. Set it in the imported OPF if it matters.";
|
|
493
527
|
var HELP = {
|
|
494
528
|
"text-overflow": "Shorten the text, or split the slide: add --paginate (measured with the same fonts) or run opf paginate.",
|
|
495
529
|
"small-cell": "Give the table more room or fewer columns, or run opf paginate.",
|
|
@@ -497,13 +531,14 @@ var HELP = {
|
|
|
497
531
|
"unresolved-asset": "Embed the image as a data URI, or keep the file inside the deck folder (see --asset-dir). URLs are never fetched.",
|
|
498
532
|
"picture-not-measured": "Check that the picture is a PNG, JPEG, GIF, WebP or SVG, and that the optional sharp peer is installed (npm install sharp). Until then the scrim under text on it is sized for any picture from black to white, which always reads.",
|
|
499
533
|
"asset-blocked": "Move the file under the deck folder or pass --asset-dir <directory> that contains it.",
|
|
500
|
-
"script-font-not-installed": "Install the Noto script package named in the message
|
|
534
|
+
"script-font-not-installed": "Install the Noto script package named in the message, at the version it names, where the CLI runs (the message gives the global, project and npx forms), then run the command again.",
|
|
501
535
|
"font-glyph-fallback": "The chosen font lacks these characters; a bundled font draws them. Supply a font with --fonts to change that.",
|
|
502
536
|
"unresolved-reference": "Use an id from opf catalog <kind>, define the record in catalogs.custom, or run opf embed to embed what the deck references.",
|
|
503
537
|
"unresolved-content": "Check the content at this path; it could not be drawn.",
|
|
504
538
|
"chart-data-adapted": "The chart data was reshaped to export a native chart; see the message.",
|
|
505
539
|
"chart-data-unplottable": "Provide inline chart data with at least one numeric column.",
|
|
506
540
|
"content-placeholder": "This content has no PowerPoint form; a placeholder frame stands in for it.",
|
|
541
|
+
"font-substituted": "To draw the requested font itself, pass its font files with --fonts (fonts in the API). A PPTX keeps the requested font name, and PowerPoint uses that font where it is installed.",
|
|
507
542
|
"unsupported-image-treatment": "Remove or change the image treatment at this path.",
|
|
508
543
|
"date-needs-value": "Pass --date YYYY-MM-DD. The CLI never reads a clock, so output stays reproducible.",
|
|
509
544
|
"font-unavailable": "Pass --fonts with the font files, or choose a font the bundled pack covers (opf catalog fontSchemes).",
|
|
@@ -517,7 +552,152 @@ var HELP = {
|
|
|
517
552
|
"duplicate-font-face": "A --fonts face repeats a bundled family, weight and style; remove it or rename the family.",
|
|
518
553
|
"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.",
|
|
519
554
|
"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.",
|
|
520
|
-
"shape-not-imported": "A filled shape across the whole slide is a background, and an overlay shape is drawn over the content; set the slide's background in OPF instead."
|
|
555
|
+
"shape-not-imported": "A filled shape across the whole slide is a background, and an overlay shape is drawn over the content; set the slide's background in OPF instead.",
|
|
556
|
+
// opf-pptx: export findings.
|
|
557
|
+
"native-body-fallback": "Nothing needs to change: this text was exported as measured text boxes, one per line, which look like the preview but do not re-wrap when edited; the reason in the finding says why. A wrapped title falls back in either body-text mode (a tab, a citation marker, lines in two directions). Under --body-text native, a text, list or bullets region falls back when it is in a group, shares its region, has several columns, overflows, has right-to-left text, nested, described, picture-bulleted or restarted list entries, a hard break inside a list entry, step badges, citations or footnotes, tabs or unsupported run properties, or lines PowerPoint could wrap differently; the opf-pptx README (Choosing body text mode) lists the reasons.",
|
|
558
|
+
"unsupported-pattern": "Only the background color was exported: this pattern has no DrawingML preset. Use one of DrawingML's presets (such as pct20, ltUpDiag or smGrid; see docs/shapes.md) for a native pattern, or accept the plain color.",
|
|
559
|
+
"numbering-unsupported-core": "The installed @openpresentation/opf is too old to compose numbered lists, so the list was exported with bullets. Install the @openpresentation/opf of the same version as @openpresentation/opf-pptx (they are released together), then export again.",
|
|
560
|
+
"chartex-fallback-picture-unavailable": "Nothing needs to change in the deck: apps without extended charts show the clustered column fallback instead of a picture of the preview chart. The reason says why no picture was drawn; when it names a missing @openpresentation/opf-render, install it to get the picture.",
|
|
561
|
+
"chart-map-geodata": "PowerPoint fetches the region shapes of a map chart from its online map service, so the chart draws only when it is online. Use another chart type if the deck must open offline.",
|
|
562
|
+
"chart-reference-overlay": "These reference lines and labels are editable shapes over the chart, not part of it: they do not follow the chart when it is moved or its data or axis is edited in PowerPoint. To change a reference line, change it in the OPF source and export again.",
|
|
563
|
+
"chart-mapping-adapted": "The chart's data mapping was adapted to draw the chart (the message says how). Choose a chart type or mapping that fits the data if the result is not what you meant.",
|
|
564
|
+
"chart-highlight-adapted": "The highlight names a column that is not plotted as a series, so it was adapted (the message says how). Name a plotted series or a category, or remove the entry.",
|
|
565
|
+
"variable-example-used": "The template variable has no value, so its example was exported. Supply a value for it when exporting if the example should not ship.",
|
|
566
|
+
"variable-builtin-missing": "The token's deck, speaker or organization field is not set, so it exports as a gap (or no logo). Set that field in the deck, or remove the token.",
|
|
567
|
+
"furniture-date-fixed": "The date was exported as fixed text that PowerPoint will not update: its dateFormat is not one of PowerPoint's date field formats for the deck language (or en-US). Use one of those formats for a live date, or accept the fixed text.",
|
|
568
|
+
"furniture-field-fixed": "The field was exported as fixed text that PowerPoint will not update, because it does not fit on one line of its footer or header text. Shorten the text around it so it sits on one line, or accept the fixed text.",
|
|
569
|
+
"furniture-on-slide": "Nothing is lost: on the slides the message names, this part is a shape drawn over the slide content, as in the preview, instead of furniture on the slide master, which PowerPoint draws beneath the content. Move the content clear of it to keep it on the master.",
|
|
570
|
+
"svg-render-failed": "The SVG's PNG fallback could not be drawn; the message gives the rasterizer's error. Check the SVG, or supply the picture as a PNG or JPEG.",
|
|
571
|
+
"slide-render-failed": "A slide could not be drawn as a picture for --as images; the message gives the renderer's error. Fix what it names, or export without --as images.",
|
|
572
|
+
"unsupported-background-image-orientation": "Rotate or mirror the image file itself, then use it as the background: PowerPoint cannot apply the EXIF orientation to a picture fill.",
|
|
573
|
+
"language-export-unavailable": "The script fonts could not be resolved (the message gives the error), so the PPTX keeps the defaults the message names. Fix what the error names, then export again.",
|
|
574
|
+
"language-unresolved": "Use a BCP-47 language tag whose script OPF knows (en-US, ar-SA, ja-JP), or accept the language the PPTX uses.",
|
|
575
|
+
"script-font-notes-not-exported": "Nothing needs to change in the slides: a PPTX has one notes master, so this slide's notes use the presentation theme's East Asian and complex-script fonts, not the slide's own. Set those fonts for the whole deck if the notes must use them.",
|
|
576
|
+
"native-fragment-unavailable": NATIVE_FRAGMENT,
|
|
577
|
+
"native-scalar-fragment-unavailable": NATIVE_FRAGMENT,
|
|
578
|
+
"native-latin-slot-unavailable": "Nothing needs to change in the deck: the shape was exported, but the Latin font chosen for the Latin characters of its Arabic text could not be bound to their run, so PowerPoint may not draw them in that font. Check the shape in PowerPoint if it matters.",
|
|
579
|
+
"data-provenance-omitted": "Nothing needs to change for the values, which export and import as native data; only the dataset references, mapping and formats were not stored, because the record exceeds the tag limit. Make the data smaller to keep them, or keep the OPF source as the master copy.",
|
|
580
|
+
"document-provenance-omitted": "The field the message names was not stored for import (the message says why), so a reimport keeps the values the PPTX shows instead. Keep the OPF source as the master copy if that field matters.",
|
|
581
|
+
"media-provenance-omitted": "The OPF video value was not stored in the PPTX (the message says why), so a reimport keeps the current native link and caption instead. Keep the OPF source as the master copy if the video value matters.",
|
|
582
|
+
"smartart-renderer-unavailable": "The SmartArt fallback picture needs the optional peer @openpresentation/opf-render; install it (npm install @openpresentation/opf-render) and export again.",
|
|
583
|
+
// opf-pptx: import findings.
|
|
584
|
+
"invalid-caption-provenance": INVALID_TAG,
|
|
585
|
+
"invalid-footnote-provenance": INVALID_TAG,
|
|
586
|
+
"invalid-card-provenance": INVALID_TAG,
|
|
587
|
+
"invalid-code-provenance": INVALID_TAG,
|
|
588
|
+
"invalid-data-provenance": INVALID_TAG,
|
|
589
|
+
"invalid-diagram-provenance": INVALID_TAG,
|
|
590
|
+
"invalid-document-provenance": INVALID_TAG,
|
|
591
|
+
"invalid-furniture-provenance": INVALID_TAG,
|
|
592
|
+
"invalid-heading-provenance": INVALID_TAG,
|
|
593
|
+
"invalid-image-callout-provenance": INVALID_TAG,
|
|
594
|
+
"invalid-image-provenance": INVALID_TAG,
|
|
595
|
+
"invalid-layout-provenance": INVALID_TAG,
|
|
596
|
+
"invalid-logo-provenance": INVALID_TAG,
|
|
597
|
+
"invalid-metric-provenance": INVALID_TAG,
|
|
598
|
+
"invalid-native-fragments": INVALID_TAG,
|
|
599
|
+
"invalid-native-scalar-fragments": INVALID_TAG,
|
|
600
|
+
"invalid-quote-provenance": INVALID_TAG,
|
|
601
|
+
"invalid-smartart-provenance": INVALID_TAG,
|
|
602
|
+
"invalid-text-provenance": INVALID_TAG,
|
|
603
|
+
"invalid-timeline-provenance": INVALID_TAG,
|
|
604
|
+
"invalid-watermark-provenance": INVALID_TAG,
|
|
605
|
+
"invalid-media-provenance": "The video was not restored as a video (the message says why): its caption stays text, and a web URL stays a link. Add the video again in OPF, or import the file as exported.",
|
|
606
|
+
"code-import-reflow": REFLOW,
|
|
607
|
+
"furniture-import-reflow": REFLOW,
|
|
608
|
+
"heading-import-reflow": REFLOW,
|
|
609
|
+
"image-callout-import-reflow": REFLOW,
|
|
610
|
+
"metric-import-reflow": REFLOW,
|
|
611
|
+
"native-fragment-reflow": REFLOW,
|
|
612
|
+
"native-scalar-fragment-reflow": REFLOW,
|
|
613
|
+
"quote-import-reflow": REFLOW,
|
|
614
|
+
"text-import-reflow": REFLOW,
|
|
615
|
+
"timeline-import-reflow": REFLOW,
|
|
616
|
+
"content-card-reflow": "The card's text was imported, but its frame (fill, outline and placement) was read as decoration and not rebuilt; OPF lays the content out again. Review the imported slide.",
|
|
617
|
+
"scaled-shape-text-reflow": "The shape's words and emphasis were kept, but its text uses OPF's composed sizes, not the sizes PowerPoint's autofit shrank it to. Review the imported shape.",
|
|
618
|
+
"grouped-text-reflow": "Review the grouped content: its text and pictures were kept, but the group's transforms and the members OPF cannot import were not.",
|
|
619
|
+
"native-language-unowned": "Nothing needs to change: the shape's current proofing language is kept.",
|
|
620
|
+
"native-language-reference-changed": "Nothing needs to change: the shape's current proofing language is kept. Set the language in OPF and export again to change it.",
|
|
621
|
+
"unclassified-native-footer": "Nothing needs to change: the text stays slide content (the message says why it was not read as a footer). To make it a footer, date or slide number, set it in design.footer in OPF.",
|
|
622
|
+
"caption-detached": "The caption stayed an ordinary text block because its picture or video shape is gone or was renamed. Restore the media shape, or keep the text block.",
|
|
623
|
+
"reference-text-changed": EDITED,
|
|
624
|
+
"chart-data-provenance-changed": EDITED,
|
|
625
|
+
"table-data-provenance-changed": EDITED,
|
|
626
|
+
"design-reference-changed": EDITED,
|
|
627
|
+
"layout-reference-changed": EDITED,
|
|
628
|
+
"list-line-break-changed": EDITED,
|
|
629
|
+
"list-line-role-changed": EDITED,
|
|
630
|
+
"list-scalar-reference-changed": EDITED,
|
|
631
|
+
"slide-reference-changed": EDITED,
|
|
632
|
+
"content-structure-changed": EDITED,
|
|
633
|
+
"metadata-reference-changed": EDITED,
|
|
634
|
+
"color-reference-changed": EDITED,
|
|
635
|
+
"media-source-changed": EDITED,
|
|
636
|
+
"metric-value-type-changed": EDITED,
|
|
637
|
+
"quote-footer-merged": EDITED,
|
|
638
|
+
"chart-dataset-unavailable": "The chart's values were imported inline, without its dataset reference: the package's datasets record lacks that dataset or holds other data (as after pasting the slide from another deck). Point the chart at the dataset again in OPF if it should follow it.",
|
|
639
|
+
"table-dataset-unavailable": "The table's cells were imported inline, without its dataset reference, because the package's datasets record lacks that dataset. Point the table at the dataset again in OPF if it should follow it.",
|
|
640
|
+
"layout-changed": "Nothing needs to change: the slide now uses the layout PowerPoint shows. To keep the original layout, change it back in OPF and export again.",
|
|
641
|
+
"media-asset-conflict": "Nothing needs to change: the video keeps its current URL and caption, but its stored assets were not restored because their ids conflict with another video's (as after duplicating a slide). Give each video its own asset ids in OPF if both must keep them.",
|
|
642
|
+
"quote-photo-missing": "Restore the headshot picture in PowerPoint or in the OPF source, or accept the quote without a photo.",
|
|
643
|
+
"duplicate-block-id": "Nothing needs to change: the first block keeps the id and the duplicate gets none. Give duplicated blocks their own ids in OPF if they must stay distinct.",
|
|
644
|
+
"duplicate-slide-id": "Nothing needs to change: the first slide keeps the id and the duplicate gets none. Give duplicated slides their own ids in OPF if they must stay distinct.",
|
|
645
|
+
"unresolved-asset-reference": "The field refers to a picture or asset the PPTX no longer holds, so it was not restored and the imported document keeps the value observed in the file. Put the picture back in the PPTX, or set the field again in OPF.",
|
|
646
|
+
"legacy-chart-reference-overlay": "The old reference shapes stay visible as ordinary content. Delete them and add referenceLines to the chart in OPF if the line should follow the data.",
|
|
647
|
+
"chart-reference-style-uncertain": "The reference line was restored with the stroke the PPTX shows now, because the stored stroke is not valid. Set its stroke in OPF if it should differ.",
|
|
648
|
+
"chart-reference-ownership-uncertain": REFERENCE_UNCERTAIN,
|
|
649
|
+
"chart-reference-overlay-uncertain": REFERENCE_UNCERTAIN,
|
|
650
|
+
"chart-number-format-adapted": "The values were imported as numbers without their PowerPoint number format, which has no OPF equivalent. Set a format on that column of the chart data in OPF if the display matters.",
|
|
651
|
+
"chart-option-adapted": "The chart option at this path was adapted (the message says how): on export to what the chart can draw, on import to what OPF can express. Change the option in OPF if the difference matters.",
|
|
652
|
+
"chart-value-not-numeric": "Each value that is not a number is plotted as a gap, never guessed. In an OPF deck, write chart values as numbers and put currency, percent and units in the column format; in a PPTX, make the chart's cached values numbers (Edit Data in PowerPoint).",
|
|
653
|
+
"unsupported-background-fill": "The slide's PowerPoint background was not imported (the message says why: an unresolved style or theme color, a pattern without a DrawingML preset and colors, or another fill). Set the background in the imported OPF as a color, gradient, pattern or image.",
|
|
654
|
+
"unsupported-background-image": "Embed the background as a PNG, JPEG, GIF or WebP picture in the PPTX (not linked), or set it in OPF.",
|
|
655
|
+
"approximate-background-image": "The background picture uses effects or a fill OPF has no exact form for (the message names them), so it was imported as the closest OPF image background. Review it.",
|
|
656
|
+
"unsupported-background-gradient": "The background was not imported: the PowerPoint gradient's geometry or color transforms are outside what an OPF linear gradient expresses. Set the background in the imported OPF.",
|
|
657
|
+
"unsupported-color-map": "design.variant was not imported: the slide master's color map is not a variant OPF can name. Set design.variant in the imported OPF if the deck should use one.",
|
|
658
|
+
"unsupported-theme-colors": "The theme's color scheme, or the slots the message names, was not imported as design.colorScheme. Set a color scheme in the imported OPF if the deck should keep one.",
|
|
659
|
+
"theme-unverified": "design.theme was not set: the PPTX theme has the name of an OPF catalog theme, but neither its colors nor its fonts match that theme. Set design.theme in the imported OPF if the deck should use it.",
|
|
660
|
+
"unsupported-body-inherited-style": "Set the font, size and color on the text itself in PowerPoint, or in OPF, so they do not depend on the layout and master it inherits them from.",
|
|
661
|
+
"unsupported-body-text-style": "The text was imported; the run formatting the message names (an effect, capitalization, spacing, an underline style or an unreadable value) has no OPF run property and was not kept. Reapply it in OPF if it matters.",
|
|
662
|
+
"approximate-body-text-baseline": "The superscript or subscript was kept, but not its exact offset. Review the imported text.",
|
|
663
|
+
"unsupported-body-font": "The run was imported with its Latin font: an OPF run has one font family, so the separate East Asian or complex-script face set on it was not kept. Set the deck's script fonts in OPF if they matter.",
|
|
664
|
+
"unsupported-body-link": "The text was imported without its mouse-over action, which an OPF run link cannot express.",
|
|
665
|
+
"unsupported-native-autofit": "PowerPoint's saved autofit was not applied because it is invalid or ambiguous, so the text imports at its unscaled sizes. Review the imported text sizes.",
|
|
666
|
+
"unsupported-native-autofit-size": "PowerPoint's saved font scale was not applied because the run has no resolved size, and no size was invented. Review the imported text size.",
|
|
667
|
+
"native-autofit-applied": "The text was imported at the sizes PowerPoint's autofit shrank it to, as fixed sizes (some may be below OPF's usual minimum); OPF does not refit it automatically. Review the imported sizes.",
|
|
668
|
+
"native-autofit-line-spacing": "The line spacing PowerPoint's autofit reduced was not imported, because OPF body text has no line-spacing override. Review the imported text.",
|
|
669
|
+
"unsupported-table-cell-fill": TABLE_STYLE,
|
|
670
|
+
"unsupported-table-padding": TABLE_STYLE,
|
|
671
|
+
"unsupported-table-alignment": TABLE_STYLE,
|
|
672
|
+
"unsupported-table-border": TABLE_STYLE,
|
|
673
|
+
"unsupported-table-cell-effect": TABLE_STYLE,
|
|
674
|
+
"unsupported-table-cell-style": TABLE_STYLE,
|
|
675
|
+
"unsupported-table-merge-border": TABLE_STYLE,
|
|
676
|
+
"unsupported-table-style": "The table style the table refers to is missing from the PPTX, so the table imports with only its cells' direct formatting. Review the imported table.",
|
|
677
|
+
"unsupported-table-direction": "The table's right-to-left layout was not imported; its cells keep their order in the file. Review the imported table.",
|
|
678
|
+
"unsupported-table-merge": "The merged cells are malformed, so the table imports every cell without merges rather than hide text behind a guessed one. Merge the cells again in OPF if needed.",
|
|
679
|
+
"table-header-in-body": "A merge crosses the first row, so the table imports without a repeated header row; the first row keeps its formatting as a body row.",
|
|
680
|
+
"unsupported-image-orientation": "The picture was imported without its rotation or mirroring, which OPF cannot express; the original image bytes were kept. Rotate or mirror the image file itself if it matters.",
|
|
681
|
+
"unsupported-image-fit": "Review the imported image: PowerPoint's tiling or offset stretch has no form on an OPF image block, so it fills its frame by an OPF fit instead. Set fit (cover, contain, stretch or auto) if the result differs.",
|
|
682
|
+
"unsupported-image-crop": "The full image was imported without PowerPoint's crop, which OPF cannot express. Crop the image file itself if only part of it should show.",
|
|
683
|
+
"invalid-svg-image": "The SVG could not be read (the message says why). Replace it with a valid SVG; on import, the picture's PNG fallback stands in for it where the file has one.",
|
|
684
|
+
"svg-sanitized": "Nothing needs to change unless the SVG needs the removed parts (scripts, external references): redraw it without them.",
|
|
685
|
+
"mixed-body-paragraphs": "Make every paragraph of the body bulleted, or none, to import it as a list or plain text; the text was kept as list entries.",
|
|
686
|
+
"math-equation-flattened": "The equation's fallback text was imported as plain text, because OPF has no equation model. Retype it as text, or use a picture of it in an image block.",
|
|
687
|
+
"numbering-mixed": "The list mixes numbered and other paragraphs, so it imports as bullets. Number every paragraph of the list in PowerPoint to import it as a numbered list.",
|
|
688
|
+
"numbering-scheme-adapted": "Use an arabic, letter or roman numbering scheme in PowerPoint; the others import as arabic with a period.",
|
|
689
|
+
"numbering-style-adapted": "Use one numbering scheme per list level in PowerPoint; the level imports in its first entry's style.",
|
|
690
|
+
"mixed-run-languages": "Nothing needs to change: runs keep their own language. Set a slide's language in OPF if one language should lead it.",
|
|
691
|
+
"rtl-language-mismatch": "Right-to-left paragraphs carry no language, or one that does not match the presentation language, so their direction was not imported. Set a right-to-left language on them in PowerPoint (Review, Language), or as the presentation or slide language in OPF.",
|
|
692
|
+
"script-font-not-imported": "The theme's East Asian or complex-script font the message names was not imported. If it matters, use a font scheme in OPF whose eastAsian or complexScript fonts name it.",
|
|
693
|
+
"smartart-unreadable": "The SmartArt, or its drawing, could not be read, so it was not imported as SmartArt (the message says what was kept). Check the file in PowerPoint, or redraw it in OPF as a diagram or list.",
|
|
694
|
+
"smartart-limited": "The SmartArt is too large or too deeply nested for OPF's outline, so its drawing was imported, or without one its entries as a flat list (the message says whether entries were left out). Review the imported slide.",
|
|
695
|
+
"smartart-connection-dropped": "Each entry was imported once, under its first parent; the extra connections were dropped. Review the imported structure.",
|
|
696
|
+
"smartart-text-dropped": "This text was not imported (the message quotes it): it is on a connection, belongs to no entry, or is on an entry no connection reaches. Add it in the imported OPF if it matters.",
|
|
697
|
+
"smartart-picture-dropped": "The entries' pictures were not imported; their text was. Add the pictures in the imported OPF if they matter.",
|
|
698
|
+
"smartart-edited": "Nothing needs to change: the list was read from the SmartArt nodes as edited. To keep the original, change it in OPF and export again.",
|
|
699
|
+
"smartart-adapted": "OPF has no exact form for this SmartArt layout, so it was imported as the nearest OPF form the message names (an OPF layout, a list, a diagram or shapes). Review the imported slide.",
|
|
700
|
+
"smartart-formatting-dropped": "The hierarchy was imported as a diagram, whose labels carry no bold, italic, underline or strikethrough; the words were kept."
|
|
521
701
|
};
|
|
522
702
|
var Reporter = class {
|
|
523
703
|
findings = [];
|
|
@@ -800,7 +980,7 @@ async function drawWith(presentation, handle, options, ctx, environment) {
|
|
|
800
980
|
const { format, scale } = options;
|
|
801
981
|
const { reporter, catalogs, date, renderer, pptx, userFonts, resolver } = environment;
|
|
802
982
|
let deck = presentation;
|
|
803
|
-
const fontSummary = () => ({
|
|
983
|
+
const fontSummary = () => (reportSubstitutions(reporter, handle), {
|
|
804
984
|
pack: "office",
|
|
805
985
|
substitutionPolicy: "visual",
|
|
806
986
|
userFonts,
|
|
@@ -1284,4 +1464,4 @@ async function saveDeck(presentation, file, options = {}) {
|
|
|
1284
1464
|
return { path: file, format };
|
|
1285
1465
|
}
|
|
1286
1466
|
|
|
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 };
|
|
1467
|
+
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, reportSubstitutions, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, saveDeck, stemOf, writeFiles, writePlanned };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NOT_CHECKED } from './chunk-RYZPBJLB.js';
|
|
2
|
-
import { readMarkdown, parseSlideText, escapeInline, serializeRuns } from './chunk-
|
|
3
|
-
import { fenceCode } from './chunk-
|
|
4
|
-
import { OPFMarkdownError, writeYaml, Ctx, readYamlMapping, csvField, scalarText } from './chunk-
|
|
5
|
-
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-
|
|
6
|
-
import { validate } from './chunk-
|
|
7
|
-
import { checkCatalogsOption } from './chunk-
|
|
2
|
+
import { readMarkdown, parseSlideText, escapeInline, serializeRuns } from './chunk-VVPPMHP6.js';
|
|
3
|
+
import { fenceCode } from './chunk-P2X4BBW2.js';
|
|
4
|
+
import { OPFMarkdownError, writeYaml, Ctx, readYamlMapping, csvField, scalarText } from './chunk-MDAXXFAY.js';
|
|
5
|
+
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-PHOSM2RA.js';
|
|
6
|
+
import { validate } from './chunk-WBPXRUZT.js';
|
|
7
|
+
import { checkCatalogsOption } from './chunk-IGT4523S.js';
|
|
8
8
|
|
|
9
9
|
// src/markdown/canon.ts
|
|
10
10
|
var FORMAT_KEYS = FORMATTING;
|