@openpresentation/opf 0.17.0 → 0.18.3
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 +4 -4
- package/dist/browser.js +38 -0
- package/dist/{catalog-refs-C4K4y-vh.d.ts → catalog-refs-BSfGELpt.d.ts} +1 -1
- package/dist/{catalog-schemas-g7RFQBdc.d.ts → catalog-schemas-CinPh5WA.d.ts} +1 -1
- package/dist/catalog.d.ts +2 -2
- package/dist/{chart-data-DTxdRRT1.d.ts → chart-data-BnNqgnC-.d.ts} +1 -1
- package/dist/{chunk-RA64UQKI.js → chunk-2PEWUUBR.js} +97 -73
- package/dist/{chunk-TCD2FB2K.js → chunk-ECP7QPGK.js} +5 -5
- package/dist/{chunk-O2CX5NEH.js → chunk-FO3WGS4R.js} +6 -5
- package/dist/{chunk-N4EVOFEA.js → chunk-GVOLSWAJ.js} +4 -4
- package/dist/{chunk-WWYWFVOI.js → chunk-IM337HP5.js} +151 -25
- package/dist/{chunk-YT7FMQER.js → chunk-JCOSZTOI.js} +1 -1
- package/dist/{chunk-IPW5BS3X.js → chunk-K5EG3UMS.js} +190 -172
- package/dist/{chunk-NLNYNBTS.js → chunk-KA3ZPFVT.js} +84 -26
- package/dist/{chunk-M4UR3NPN.js → chunk-L5YACLWK.js} +2 -2
- package/dist/{chunk-CW7GEAV3.js → chunk-MBU42S5Y.js} +291 -133
- package/dist/{chunk-BIC3SWPK.js → chunk-MSFE2HUK.js} +30 -5
- package/dist/{chunk-ESRYBYLY.js → chunk-PNINP5IF.js} +1 -1
- package/dist/{chunk-IS5H5JKH.js → chunk-R7KIASS4.js} +1 -1
- package/dist/{chunk-PPROJP2E.js → chunk-TRELE6I6.js} +1 -1
- package/dist/{chunk-O3CVNJTL.js → chunk-WHHLGDCQ.js} +1 -1
- package/dist/{chunk-O263APNI.js → chunk-ZCFSDSUX.js} +3 -3
- package/dist/{composition-BbZ_9C-c.d.ts → composition-C-OoqvAr.d.ts} +80 -40
- package/dist/composition.d.ts +3 -3
- package/dist/composition.js +1 -1
- package/dist/conversion-4CLOEG6O.js +21 -0
- package/dist/{conversion-SBpTOwdg.d.ts → conversion-BxZbBd_0.d.ts} +96 -38
- package/dist/convert.d.ts +4 -4
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +7 -7
- package/dist/data.js +2 -2
- package/dist/{deck-report-Bx3naFlF.d.ts → deck-report-DiDf_Vew.d.ts} +5 -5
- package/dist/deck.d.ts +8 -8
- package/dist/deck.js +10 -10
- package/dist/diff.d.ts +1 -1
- package/dist/diff.js +5 -5
- package/dist/docs.js +35 -29
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +181 -214
- package/dist/{finding-CDQ_wH8j.d.ts → finding-CT_f_vbD.d.ts} +1 -1
- package/dist/format.js +2 -2
- package/dist/index.d.ts +153 -20
- package/dist/index.js +62 -15
- package/dist/markdown.d.ts +12 -8
- package/dist/markdown.js +7 -7
- package/dist/node-engine.d.ts +37 -17
- package/dist/node-engine.js +39 -16
- package/dist/{pagination-BhX4M48Y.d.ts → pagination-BaUjDrTz.d.ts} +7 -4
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +4 -4
- package/dist/patch.d.ts +1 -1
- package/dist/patch.js +4 -4
- package/dist/{presentation-fb8CZmRq.d.ts → presentation-81rNihF0.d.ts} +271 -384
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.d.ts +4 -2
- package/dist/schemas.js +1 -1
- package/dist/spec/README.md +1 -1
- package/dist/spec/schemas/opf.schema.json +67 -72
- package/dist/types.d.ts +3 -3
- package/dist/{validation-types-iZbXfES6.d.ts → validation-types-PbGDrNUr.d.ts} +12 -7
- package/dist/validator.d.ts +8 -8
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +6 -6
- package/dist/yaml.js +7 -7
- package/package.json +14 -12
- package/dist/node.d.ts +0 -60
- package/dist/node.js +0 -54
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { promotedRegionKeys, VARIABLE_KINDS, resolveChartData, chartPaletteForFill, imageBackground, tableGrid, timelineTextColor, visitContentPayloads, readingRows, visualReadingOrder, intrinsicImageSize, textWidthMeasurer, normalizeHexColor, resolveColorRef, resolveDesignRecords, resolveFontFamilies, resolveColorRoles, resolveCanvasDimensions, resolveSlideVariables, defaultSlideBackground, isRecord, hasContentVariables, isTemplate, instantiateForValidation, resolveScriptFonts, unusedDatasets, MAX_COMPOSITION_DEPTH, datasetDiagnostics, pathFor, collectCitations, numberingFindings, walkCitationRuns, resolveTableData, resolveChartOptions, chartOptionTarget, codeHighlightLines, chartNumberFixesByCell, MAX_PLACEHOLDER_GROUP_DEPTH, OPFCompositionError, composeSlide } from './chunk-
|
|
1
|
+
import { promotedRegionKeys, VARIABLE_KINDS, resolveChartData, chartPaletteForFill, imageBackground, tableGrid, timelineTextColor, LOGO_SHAPES, visitContentPayloads, readingRows, visualReadingOrder, intrinsicImageSize, textWidthMeasurer, normalizeHexColor, resolveColorRef, resolveDesignRecords, resolveFontFamilies, resolveColorRoles, resolveCanvasDimensions, resolveSlideVariables, defaultSlideBackground, isRecord, hasContentVariables, isTemplate, instantiateForValidation, resolveScriptFonts, unusedDatasets, MAX_COMPOSITION_DEPTH, datasetDiagnostics, pathFor, collectCitations, numberingFindings, walkCitationRuns, resolveTableData, resolveChartOptions, chartOptionTarget, codeHighlightLines, chartNumberFixesByCell, MAX_PLACEHOLDER_GROUP_DEPTH, OPFCompositionError, composeSlide } from './chunk-MBU42S5Y.js';
|
|
2
2
|
import { catalogSchemaNames } from './chunk-TRDXRRQK.js';
|
|
3
3
|
import { resolveReference, checkCatalogsOption, provenanceOf, unresolvedReference, OPFUnresolvedReferenceError, catalogReferenceSites, parseReference, catalogGroupDeclared, pointerPath, catalogRecords, catalogKinds, catalogGroupSource, registeredCatalog } from './chunk-SPFV27O5.js';
|
|
4
|
-
import { schemaEntries, schemas } from './chunk-
|
|
4
|
+
import { schemaEntries, schemas } from './chunk-2PEWUUBR.js';
|
|
5
5
|
import Ajv2020 from 'ajv/dist/2020.js';
|
|
6
6
|
import addFormats from 'ajv-formats';
|
|
7
7
|
import { parseTree, printParseErrorCode, getNodePath } from 'jsonc-parser';
|
|
@@ -539,6 +539,50 @@ function slideThemeDimensionsWarnings(document, slide, index, catalogs) {
|
|
|
539
539
|
{ code: "slide-theme-dimensions", slideDimensions: slideSize, deckDimensions: deckSize }
|
|
540
540
|
)];
|
|
541
541
|
}
|
|
542
|
+
var SLIDE_SIDE_MIN_EMU = 914400;
|
|
543
|
+
var SLIDE_SIDE_MAX_EMU = 51206400;
|
|
544
|
+
var EMU_PER_INCH = 914400;
|
|
545
|
+
var EMU_PER_REFERENCE_PIXEL = EMU_PER_INCH / 96;
|
|
546
|
+
function slideSizeRangeWarnings(document, catalogs) {
|
|
547
|
+
const design = isRecord(document.design) ? document.design : {};
|
|
548
|
+
const explicit = design.dimensions !== void 0;
|
|
549
|
+
let dimensions = design.dimensions;
|
|
550
|
+
if (!explicit) {
|
|
551
|
+
const theme = resolveDesignRecords(document, void 0, { catalogs: catalogs ?? [] }).theme;
|
|
552
|
+
dimensions = theme.dimensions;
|
|
553
|
+
if (dimensions === void 0) return [];
|
|
554
|
+
}
|
|
555
|
+
let size;
|
|
556
|
+
try {
|
|
557
|
+
size = resolveCanvasDimensions(dimensions);
|
|
558
|
+
} catch {
|
|
559
|
+
return [];
|
|
560
|
+
}
|
|
561
|
+
const sides = [["width", size.width], ["height", size.height]].map(([side, pixels]) => ({
|
|
562
|
+
side,
|
|
563
|
+
inches: pixels / 96,
|
|
564
|
+
emu: Math.round(pixels * EMU_PER_REFERENCE_PIXEL)
|
|
565
|
+
}));
|
|
566
|
+
const outside = sides.filter(({ emu }) => emu < SLIDE_SIDE_MIN_EMU || emu > SLIDE_SIDE_MAX_EMU);
|
|
567
|
+
if (outside.length === 0) return [];
|
|
568
|
+
const inches = (value) => String(Math.round(value * 1e4) / 1e4);
|
|
569
|
+
const detail = outside.map(({ side, inches: value, emu }) => `${side} ${inches(value)} in (${emu} EMU) is ${emu < SLIDE_SIDE_MIN_EMU ? "below 1 in" : "above 56 in"}`).join(", ");
|
|
570
|
+
const path = explicit ? "/design/dimensions" : typeof design.theme === "string" ? "/design/theme" : "/design";
|
|
571
|
+
return [semanticIssue(
|
|
572
|
+
path,
|
|
573
|
+
`the slide size ${inches(sides[0].inches)} x ${inches(sides[1].inches)} in is outside PowerPoint's 1 to 56 inch range per side (${detail}); the PPTX p:sldSz allows 914400 to 51206400 EMU${explicit ? "" : ", and the size comes from the deck's theme"}`,
|
|
574
|
+
{
|
|
575
|
+
code: "slide-size-out-of-range",
|
|
576
|
+
widthInches: sides[0].inches,
|
|
577
|
+
heightInches: sides[1].inches,
|
|
578
|
+
widthEmu: sides[0].emu,
|
|
579
|
+
heightEmu: sides[1].emu,
|
|
580
|
+
minEmu: SLIDE_SIDE_MIN_EMU,
|
|
581
|
+
maxEmu: SLIDE_SIDE_MAX_EMU,
|
|
582
|
+
sides: outside.map(({ side }) => side)
|
|
583
|
+
}
|
|
584
|
+
)];
|
|
585
|
+
}
|
|
542
586
|
function chartTypeWarnings(payload, path) {
|
|
543
587
|
if (!isRecord(payload)) {
|
|
544
588
|
return [];
|
|
@@ -726,6 +770,7 @@ function presentationReferenceWarnings(value, catalogs) {
|
|
|
726
770
|
}
|
|
727
771
|
const issues = [];
|
|
728
772
|
issues.push(...variableReferenceWarnings(value));
|
|
773
|
+
issues.push(...slideSizeRangeWarnings(value, catalogs));
|
|
729
774
|
value.slides.forEach((slide, index) => {
|
|
730
775
|
if (!isRecord(slide)) {
|
|
731
776
|
return;
|
|
@@ -1364,26 +1409,20 @@ var sourceOfAsset = (value) => {
|
|
|
1364
1409
|
const source = typeof value === "string" ? value : rec(value).src;
|
|
1365
1410
|
return typeof source === "string" ? source : void 0;
|
|
1366
1411
|
};
|
|
1367
|
-
var
|
|
1412
|
+
var isLogoReference = (value) => typeof value === "string" && value.startsWith("var:organization.");
|
|
1368
1413
|
function assetRefs(document, slide, slidePath, includeDeck) {
|
|
1369
1414
|
const out = [];
|
|
1370
1415
|
for (const payload of slidePayloads(slide, slidePath)) {
|
|
1371
1416
|
const at2 = (...tail) => pointer2(...splitPointer(payload.path), ...tail);
|
|
1372
|
-
if (payload.node.image !== void 0) out.push({ path: at2("image"), value: payload.node.image, kind: "image" });
|
|
1417
|
+
if (payload.node.image !== void 0 && !isLogoReference(payload.node.image)) out.push({ path: at2("image"), value: payload.node.image, kind: "image" });
|
|
1373
1418
|
if (payload.node.video !== void 0) out.push({ path: at2("video"), value: payload.node.video, kind: "video" });
|
|
1374
1419
|
if (rec(payload.node.quote).photo !== void 0) out.push({ path: at2("quote", "photo"), value: rec(payload.node.quote).photo, kind: "quote-photo" });
|
|
1375
1420
|
}
|
|
1376
1421
|
const designRefs = (design, base) => {
|
|
1377
|
-
const logo = design.logo;
|
|
1378
|
-
if (typeof logo === "string" || logo && typeof logo.src === "string") out.push({ path: `${base}/logo`, value: logo, kind: "logo" });
|
|
1379
|
-
else if (logo && typeof logo === "object") {
|
|
1380
|
-
for (const variant of LOGO_VARIANTS)
|
|
1381
|
-
if (logo[variant] !== void 0) out.push({ path: `${base}/logo/${variant}`, value: logo[variant], kind: "logo" });
|
|
1382
|
-
}
|
|
1383
1422
|
for (const kind of ["header", "footer"])
|
|
1384
1423
|
for (const zone of ["left", "center", "right"]) {
|
|
1385
1424
|
const item = rec(rec(design[kind])[zone]);
|
|
1386
|
-
if (item.image !== void 0) out.push({ path: `${base}/${kind}/${zone}/image`, value: item.image, kind: "furniture" });
|
|
1425
|
+
if (item.image !== void 0 && !isLogoReference(item.image)) out.push({ path: `${base}/${kind}/${zone}/image`, value: item.image, kind: "furniture" });
|
|
1387
1426
|
}
|
|
1388
1427
|
};
|
|
1389
1428
|
designRefs(rec(slide.design), `${slidePath}/design`);
|
|
@@ -1391,12 +1430,19 @@ function assetRefs(document, slide, slidePath, includeDeck) {
|
|
|
1391
1430
|
designRefs(rec(document.design), "/design");
|
|
1392
1431
|
const organizations = Array.isArray(document.organization) ? document.organization : document.organization ? [document.organization] : [];
|
|
1393
1432
|
organizations.forEach((organization, index) => {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1433
|
+
const logo = organization?.logo;
|
|
1434
|
+
if (logo === void 0) return;
|
|
1435
|
+
const base = Array.isArray(document.organization) ? `/organization/${index}/logo` : "/organization/logo";
|
|
1436
|
+
if (typeof logo === "string" || logo && typeof logo === "object" && "src" in logo) {
|
|
1437
|
+
out.push({ path: base, value: logo, kind: "organization" });
|
|
1438
|
+
return;
|
|
1439
|
+
}
|
|
1440
|
+
for (const shape of LOGO_SHAPES) {
|
|
1441
|
+
const entry = rec(logo)[shape];
|
|
1442
|
+
if (entry === void 0) continue;
|
|
1443
|
+
if (typeof entry === "string" || entry && typeof entry === "object" && "src" in entry) out.push({ path: `${base}/${shape}`, value: entry, kind: "organization" });
|
|
1444
|
+
else for (const tone of ["onLight", "onDark"]) if (rec(entry)[tone] !== void 0) out.push({ path: `${base}/${shape}/${tone}`, value: rec(entry)[tone], kind: "organization" });
|
|
1445
|
+
}
|
|
1400
1446
|
});
|
|
1401
1447
|
const speakers = Array.isArray(document.speaker) ? document.speaker : document.speaker ? [document.speaker] : [];
|
|
1402
1448
|
speakers.forEach((speaker, index) => {
|
|
@@ -1601,7 +1647,7 @@ var altRule = rule(
|
|
|
1601
1647
|
'People using a screen reader get nothing for a picture without alternative text. A picture that is purely decorative should say so with an empty alt (alt: ""), which is an explicit, reviewed choice instead of an omission.',
|
|
1602
1648
|
{
|
|
1603
1649
|
standard: "WCAG 2.2 SC 1.1.1 Non-text Content, level A",
|
|
1604
|
-
approximations: "Checks the alt field of images (image blocks, Slide.image and region images, placed or not), video, logos (
|
|
1650
|
+
approximations: "Checks the alt field of images (image blocks, Slide.image and region images, placed or not), video, organization logos (each shape and background), header/footer images (a logo reference such as var:organization.logo.icon is checked on the organization), quote photos and speaker photos, following asset: references to the assets registry. Whether the text describes the picture well is not judged here (see opf/poor-alt-text). Charts carry `chart.alt` and are checked by opf/chart-text-alternative. Picture backgrounds are decorative unless they carry their own alt, and watermarks are decorative, so neither is checked."
|
|
1605
1651
|
}
|
|
1606
1652
|
);
|
|
1607
1653
|
var poorAltRule = rule(
|
|
@@ -1615,7 +1661,7 @@ var poorAltRule = rule(
|
|
|
1615
1661
|
var GENERIC_ALT = /^(image|picture|photo|photograph|graphic|img|icon|figure|screenshot|untitled|alt|alt text|logo)$/i;
|
|
1616
1662
|
var FILE_ALT = /(\.(png|jpe?g|gif|svg|webp|bmp|tiff?|heic|avif)$)|^(img|dsc|image|screenshot|screen shot|photo|pic)[ _-]?\d+/i;
|
|
1617
1663
|
var GENERIC_CHART_ALT = /^((a|an|the)\s+)?([a-z-]+\s+){0,2}(chart|graph|plot|diagram|figure)$/i;
|
|
1618
|
-
var kindLabel = (kind) => ({ chart: "Chart", image: "Image", video: "Video",
|
|
1664
|
+
var kindLabel = (kind) => ({ chart: "Chart", image: "Image", video: "Video", furniture: "Header/footer image", speaker: "Speaker photo", "quote-photo": "Quote photo", organization: "Organization logo" })[kind] ?? "Picture";
|
|
1619
1665
|
function altFixes(path, value) {
|
|
1620
1666
|
const decorative = typeof value === "string" ? { id: "mark-decorative", title: "Mark as decorative (empty alt)", kind: "patch", safe: false, patch: [{ op: "replace", path, value: { src: value, alt: "" } }] } : { id: "mark-decorative", title: "Mark as decorative (empty alt)", kind: "patch", safe: false, patch: [{ op: "add", path: `${path}/alt`, value: "" }] };
|
|
1621
1667
|
return [{ id: "focus-alt", title: "Write alt text", kind: "focus", safe: true, focus: { path, field: "alt", value } }, decorative];
|
|
@@ -1634,12 +1680,12 @@ var altRules = [
|
|
|
1634
1680
|
if (alt !== void 0 && alt.trim() !== "") continue;
|
|
1635
1681
|
if (alt === "") continue;
|
|
1636
1682
|
const hasText = alt !== void 0;
|
|
1637
|
-
const organization = ref.kind === "organization"
|
|
1683
|
+
const organization = ref.kind === "organization" ? rec(Array.isArray(context.document.organization) ? context.document.organization[0] : context.document.organization).name : void 0;
|
|
1638
1684
|
context.report(altRule, {
|
|
1639
1685
|
path: ref.path,
|
|
1640
1686
|
slide: ref.path.startsWith("/slides/") ? slide : void 0,
|
|
1641
1687
|
message: `${kindLabel(ref.kind)} has ${hasText ? "blank" : "no"} alt text.`,
|
|
1642
|
-
help: `Describe what the ${ref.kind === "
|
|
1688
|
+
help: `Describe what the ${ref.kind === "organization" ? "logo shows" : "picture shows or why it is here"}${typeof organization === "string" ? ` (for a logo, the organization name, ${organization}, is usually right)` : ""}, or set alt to "" if it is purely decorative.`,
|
|
1643
1689
|
fixes: altFixes(ref.path, ref.value)
|
|
1644
1690
|
});
|
|
1645
1691
|
}
|
|
@@ -2421,7 +2467,7 @@ var formatRules = [
|
|
|
2421
2467
|
rule("chart-mapping-unknown-column", "format", "error", "A chart mapping names a column the data does not have.", "The series cannot be built from a column that is not there.", { standard: SCHEMA }),
|
|
2422
2468
|
rule("number-format-invalid", "format", "error", "A number format cannot be read.", "A format code that no engine can parse is drawn as the plain number or fails to export.", { standard: "Excel number format codes, as far as OPF supports them" }),
|
|
2423
2469
|
rule("variable-invalid-value", "format", "error", "A variable value does not match its declared type.", "A number variable given text, or a date given a non-date, cannot be filled into the deck.", { standard: SCHEMA }),
|
|
2424
|
-
rule("variable-unknown-builtin", "format", "error", "A token names a built-in variable that does not exist.", "The `deck.`, `speaker.`, `organization.` and `slide.` names (and `speakers`) are reserved for built-in variables; a name under them that is not a built-in can never be filled, so the token would show literally. The slide-scoped `slide.number`, `slide.section` and `deck.slideCount` are inline tokens only, so `var:slide.*` and `var:deck.slideCount` are reported too.", { standard: SCHEMA }),
|
|
2470
|
+
rule("variable-unknown-builtin", "format", "error", "A token names a built-in variable that does not exist.", "The `deck.`, `speaker.`, `organization.` and `slide.` names (and `speakers`) are reserved for built-in variables; a name under them that is not a built-in can never be filled, so the token would show literally. The slide-scoped `slide.number`, `slide.section` and `deck.slideCount` are inline tokens only, so `var:slide.*` and `var:deck.slideCount` are reported too; organization logos are whole-field references only (`var:organization.logo.icon`), so a `{{organization.logo}}` token, an unknown logo shape or an unknown organization id is reported.", { standard: SCHEMA }),
|
|
2425
2471
|
rule("chart-highlight-unknown-name", "format", "error", "A chart highlight names a series or category the chart does not have.", "`chart.highlight` emphasises marks by name; a name that matches no series or category in the chart data highlights nothing, so the chart is not drawn as authored.", { standard: SCHEMA }),
|
|
2426
2472
|
rule("variable-format", "format", "error", "A variable cannot be formatted.", "A number or date format that does not apply to the value leaves the token unreadable.", { standard: SCHEMA }),
|
|
2427
2473
|
rule(
|
|
@@ -2435,7 +2481,18 @@ var formatRules = [
|
|
|
2435
2481
|
}
|
|
2436
2482
|
),
|
|
2437
2483
|
rule("run-color-unrecognized", "format", "warning", "A text run colour is none of the documented forms.", "Run colours are open strings so imported decks stay valid, but a value that is not a hex colour, a colour-scheme name or a `var:` reference falls back to the theme colour.", { standard: SCHEMA }),
|
|
2438
|
-
rule("numbering-start-ignored", "format", "warning", "A list entry sets `start` where nothing is numbered.", "A start value only restarts an auto-number; without `numbering` on the payload it has no effect.", { standard: SCHEMA })
|
|
2484
|
+
rule("numbering-start-ignored", "format", "warning", "A list entry sets `start` where nothing is numbered.", "A start value only restarts an auto-number; without `numbering` on the payload it has no effect.", { standard: SCHEMA }),
|
|
2485
|
+
rule(
|
|
2486
|
+
"slide-size-out-of-range",
|
|
2487
|
+
"format",
|
|
2488
|
+
"warning",
|
|
2489
|
+
"The slide size is outside PowerPoint's 1 to 56 inch range.",
|
|
2490
|
+
"The schema accepts any positive custom `widthInches` and `heightInches`, but a PPTX stores the size as `p:sldSz` with each side between 914400 and 51206400 EMU, which is 1 to 56 inches. A custom size outside that range exports a file that does not conform to the standard, which PowerPoint may reject or clamp. It is a warning because the document is still correct OPF and the preview draws it.",
|
|
2491
|
+
{
|
|
2492
|
+
standard: "ECMA-376 / ISO/IEC 29500-1 section 19.2.1.39 (p:sldSz) and section 19.7.17 (ST_SlideSizeCoordinate): 914400 to 51206400 EMU",
|
|
2493
|
+
approximations: "Checks the deck's resolved size: `design.dimensions`, else the resolved theme's `dimensions`. Inches are converted to EMU as the PPTX exporter does (`Math.round(inches * 914400)`), so a side of exactly 1 in or 56 in passes. A slide-level theme with another size is `opf/slide-theme-dimensions`. Presets are always in range. PowerPoint's own behaviour at the limits was not measured."
|
|
2494
|
+
}
|
|
2495
|
+
)
|
|
2439
2496
|
];
|
|
2440
2497
|
var referenceRules = [
|
|
2441
2498
|
rule(
|
|
@@ -2505,7 +2562,7 @@ var dataRules = [
|
|
|
2505
2562
|
rule("chart-highlight-adapted", "content", "warning", "A chart highlight is adapted by the chart type.", "A highlight the chart type cannot show as authored (a category highlight on a chart without categories, for example) is adapted by every engine, so the emphasis is not exactly what was written.", { standard: SCHEMA }),
|
|
2506
2563
|
rule("code-highlight-out-of-range", "content", "warning", "A code highlight marks a line the code does not have.", "Marked lines count from 1 by line break in code.source; an entry past the last line marks nothing.", { standard: SCHEMA }),
|
|
2507
2564
|
rule("code-highlight-range-reversed", "content", "warning", "A code highlight range ends before it starts.", "A range written end before start marks nothing; write the smaller line number first.", { standard: SCHEMA }),
|
|
2508
|
-
rule("variable-builtin-missing", "content", "warning", "A built-in variable has no value in this document.", "A `{{deck.*}}`, `{{speaker.*}}` or `{{organization.*}}` token whose field the document does not set resolves to nothing, so the text shows a gap. `{{slide.section}}` is checked per slide: a slide without a `section` that uses it, in its own text or in the header or footer it inherits, is reported at that slide.", { standard: SCHEMA }),
|
|
2565
|
+
rule("variable-builtin-missing", "content", "warning", "A built-in variable has no value in this document.", "A `{{deck.*}}`, `{{speaker.*}}` or `{{organization.*}}` token whose field the document does not set resolves to nothing, so the text shows a gap; a `var:organization.logo` reference to an organization without a logo draws no image. `{{slide.section}}` is checked per slide: a slide without a `section` that uses it, in its own text or in the header or footer it inherits, is reported at that slide.", { standard: SCHEMA }),
|
|
2509
2566
|
rule("duration-outside-narrative", "content", "warning", "The target duration is outside the range the narrative suits.", "A narrative records the talk lengths it suits. A deck whose duration is outside that range probably needs a different narrative or a different length; nothing is drawn or exported differently.", { standard: SCHEMA }),
|
|
2510
2567
|
rule("narrative-duration-range", "content", "warning", "An inline narrative duration range has min greater than max.", "A range with its bounds swapped matches no duration, so the duration check cannot help.", { standard: "spec/schemas/narrative.schema.json" })
|
|
2511
2568
|
];
|
|
@@ -2833,7 +2890,8 @@ var HELP = {
|
|
|
2833
2890
|
"variable-unused": "Reference the variable as {{id}} or var:id where it belongs, or remove its declaration.",
|
|
2834
2891
|
"variable-reference-unknown": "Declare the variable in the top-level variables map, or use another colour.",
|
|
2835
2892
|
"run-color-unrecognized": "Use a #RRGGBB hex colour, a colour-scheme name or a var: reference to a declared colour variable.",
|
|
2836
|
-
"numbering-start-ignored": "Add a 'numbering' field to the payload, or remove 'start'."
|
|
2893
|
+
"numbering-start-ignored": "Add a 'numbering' field to the payload, or remove 'start'.",
|
|
2894
|
+
"slide-size-out-of-range": "Use a custom widthInches and heightInches between 1 and 56, or a preset. PowerPoint stores the slide size in 914400 to 51206400 EMU per side."
|
|
2837
2895
|
};
|
|
2838
2896
|
function engineFindings(document, engine, enabled) {
|
|
2839
2897
|
const findings = [];
|
|
@@ -3341,7 +3399,7 @@ function resolveSlideContext(presentation, index, options = {}) {
|
|
|
3341
3399
|
...options.fonts?.textMeasurement ? { textMeasurement: options.fonts.textMeasurement } : {},
|
|
3342
3400
|
...options.date !== void 0 ? { date: options.date } : {}
|
|
3343
3401
|
};
|
|
3344
|
-
const resolvedSlide = resolveSlideVariables(slide, { slideNumber: composeOptions.slideNumber, slideCount: composeOptions.slideCount });
|
|
3402
|
+
const resolvedSlide = resolveSlideVariables(slide, { slideNumber: composeOptions.slideNumber, slideCount: composeOptions.slideCount, presentation, darkBackground: composeOptions.darkBackground === true });
|
|
3345
3403
|
return { slide: resolvedSlide, options: composeOptions, diagnostics, resolved: { theme, colorScheme, fontScheme, fontSchemePath: records.fontSchemePath, ...layout ? { layout } : {}, provenance: { ...layoutProvenance ? { layout: layoutProvenance } : {}, ...records.provenance } } };
|
|
3346
3404
|
}
|
|
3347
3405
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonEqual, formatPointer } from './chunk-
|
|
2
|
-
import { annotationText } from './chunk-
|
|
1
|
+
import { jsonEqual, formatPointer } from './chunk-WHHLGDCQ.js';
|
|
2
|
+
import { annotationText } from './chunk-MBU42S5Y.js';
|
|
3
3
|
|
|
4
4
|
// src/diff-match.ts
|
|
5
5
|
var DEFAULT_MATCH_THRESHOLD = 0.5;
|