@openpresentation/opf 0.20.3 → 0.20.4
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 -6
- package/dist/browser.js +16 -16
- package/dist/{chunk-BWZS3RVK.js → chunk-2M7U4WL3.js} +7 -6
- package/dist/{chunk-AMIQJVJR.js → chunk-52GKVP3I.js} +12 -7
- package/dist/{chunk-X3F6PRH2.js → chunk-5SQ6CIWR.js} +5 -5
- package/dist/{chunk-QBYGIIS7.js → chunk-7PQZDC2H.js} +1 -1
- package/dist/{chunk-D3YLFLYO.js → chunk-DYGYMBBW.js} +2 -2
- package/dist/{chunk-SXNVC2ZU.js → chunk-IDMQWS6O.js} +6 -6
- package/dist/{chunk-UFTKB25U.js → chunk-OIGCC6VA.js} +2 -2
- package/dist/{chunk-QNJMY5GX.js → chunk-S4FR7ATF.js} +1 -1
- package/dist/{chunk-HML2TNTA.js → chunk-TCBEF5OY.js} +6 -5
- package/dist/{chunk-J4NYP5JC.js → chunk-TZ5IZETE.js} +1 -1
- package/dist/{chunk-S5IZLAFK.js → chunk-URUNMZFO.js} +14 -10
- package/dist/{chunk-BDVU4CJV.js → chunk-V66KJA3H.js} +1 -1
- package/dist/{chunk-3XLQI7SW.js → chunk-VFMHM2IL.js} +3 -3
- package/dist/{chunk-WGNSYVLB.js → chunk-WD4W7KKK.js} +30 -13
- package/dist/{chunk-K66K65UQ.js → chunk-XAYMPBNE.js} +13 -3
- package/dist/{chunk-2XVYJMLR.js → chunk-YOLDSF7U.js} +1 -1
- package/dist/{chunk-R72S2GLS.js → chunk-Z75YB54S.js} +5 -5
- package/dist/composition.js +1 -1
- package/dist/{conversion-Ca_346Zv.d.ts → conversion-Cqwu0Ds9.d.ts} +6 -6
- package/dist/conversion-DRCJIMWS.js +19 -0
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +1 -1
- package/dist/data.js +2 -2
- package/dist/{deck-report-ByHBxLUO.d.ts → deck-report-BdG5H3Qj.d.ts} +1 -1
- package/dist/deck.d.ts +3 -3
- package/dist/deck.js +10 -10
- package/dist/diff.js +5 -5
- package/dist/docs.js +23 -23
- package/dist/examples.d.ts +1 -1
- package/dist/format.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +20 -20
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +7 -7
- package/dist/node-engine.d.ts +5 -5
- package/dist/node-engine.js +20 -20
- package/dist/pagination.js +4 -4
- package/dist/patch.js +4 -4
- package/dist/{presentation-CKbo-axq.d.ts → presentation-BG4QCcdB.d.ts} +2 -2
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.js +1 -1
- package/dist/spec/schemas/opf.schema.json +3 -3
- package/dist/types.d.ts +1 -1
- package/dist/{validator-DDTYh9sp.d.ts → validator-BJtXHJKh.d.ts} +1 -1
- package/dist/validator.d.ts +2 -2
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +1 -1
- package/dist/yaml.js +7 -7
- package/package.json +1 -1
- package/dist/conversion-5IGYAS4A.js +0 -19
package/README.md
CHANGED
|
@@ -107,11 +107,9 @@ Added in 0.12.0 (not in 0.11.4 or earlier): `@openpresentation/opf/patch` is the
|
|
|
107
107
|
|
|
108
108
|
### Layout previews
|
|
109
109
|
|
|
110
|
-
`@openpresentation/gallery/previews` ships pre-rendered
|
|
111
|
-
slide layouts catalogued at pptx.gallery. Each preview is a
|
|
112
|
-
|
|
113
|
-
`--background`, `--foreground`, `--card`, `--muted`, `--muted-foreground`,
|
|
114
|
-
`--accent`, and `--border` CSS variables.
|
|
110
|
+
`@openpresentation/gallery/previews` ships pre-rendered SVG thumbnails for the
|
|
111
|
+
slide layouts catalogued at pptx.gallery. Each preview is a self-contained SVG
|
|
112
|
+
sized to fill a 16:9 container, with its colors and layout already rendered.
|
|
115
113
|
|
|
116
114
|
```tsx
|
|
117
115
|
import { getLayoutPreview } from "@openpresentation/gallery/previews";
|
|
@@ -128,7 +126,7 @@ export function LayoutThumbnail({ slug }: { slug: string }) {
|
|
|
128
126
|
}
|
|
129
127
|
```
|
|
130
128
|
|
|
131
|
-
The
|
|
129
|
+
The preview source lives in [OpenPresentation/gallery](https://github.com/OpenPresentation/gallery); this checkout materializes ignored copies from the installed package for checks.
|
|
132
130
|
|
|
133
131
|
### Example decks
|
|
134
132
|
|
package/dist/browser.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { OPFApiError } from './chunk-
|
|
2
|
-
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-
|
|
1
|
+
import { OPFApiError } from './chunk-52GKVP3I.js';
|
|
2
|
+
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-52GKVP3I.js';
|
|
3
3
|
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
|
|
4
|
-
export { OPFDataImportError, ingest, parseTabularData } from './chunk-
|
|
5
|
-
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-
|
|
6
|
-
export { fromMarkdown, toMarkdown } from './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
export { OPFMarkdownError } from './chunk-
|
|
9
|
-
export { diff, merge } from './chunk-
|
|
10
|
-
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-
|
|
11
|
-
export { OPFFormatError, format } from './chunk-
|
|
12
|
-
export { OPFPaginationError, paginate, paginateSlide } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
export { CATALOG_SCHEMA, DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-
|
|
16
|
-
export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-
|
|
17
|
-
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-
|
|
4
|
+
export { OPFDataImportError, ingest, parseTabularData } from './chunk-TZ5IZETE.js';
|
|
5
|
+
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-5SQ6CIWR.js';
|
|
6
|
+
export { fromMarkdown, toMarkdown } from './chunk-Z75YB54S.js';
|
|
7
|
+
import './chunk-IDMQWS6O.js';
|
|
8
|
+
export { OPFMarkdownError } from './chunk-7PQZDC2H.js';
|
|
9
|
+
export { diff, merge } from './chunk-URUNMZFO.js';
|
|
10
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-YOLDSF7U.js';
|
|
11
|
+
export { OPFFormatError, format } from './chunk-S4FR7ATF.js';
|
|
12
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-DYGYMBBW.js';
|
|
13
|
+
import './chunk-V66KJA3H.js';
|
|
14
|
+
import './chunk-TCBEF5OY.js';
|
|
15
|
+
export { CATALOG_SCHEMA, DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-2M7U4WL3.js';
|
|
16
|
+
export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-XAYMPBNE.js';
|
|
17
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-VFMHM2IL.js';
|
|
18
18
|
export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-F7PLNWHQ.js';
|
|
19
19
|
|
|
20
20
|
// src/browser.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { promotedRegionKeys, VARIABLE_KINDS, resolveChartData, chartPaletteForFill, imageBackground, tableGrid, timelineTextColor, LOGO_SHAPES, visitContentPayloads, readingRows, visualReadingOrder, intrinsicImageSize, resolveReference, textWidthMeasurer, normalizeHexColor, resolveColorRef, resolveDesignRecords, resolveFontFamilies, checkCatalogsOption, provenanceOf, unresolvedReference, OPFUnresolvedReferenceError, resolveColorRoles, resolveCanvasDimensions, resolveSlideVariables, defaultSlideBackground, isRecord, hasContentVariables, isTemplate, instantiateForValidation, layoutTemplateIssues, resolveScriptFonts, catalogReferenceSites, parseReference, catalogGroupDeclared, pointerPath, unusedDatasets, MAX_COMPOSITION_DEPTH, datasetDiagnostics, pathFor, catalogRecords, collectCitations, numberingFindings, walkCitationRuns, resolveTableData, resolveChartOptions, chartOptionTarget, codeHighlightLines, chartNumberFixesByCell, catalogKinds, catalogGroupSource, registeredCatalog, OPFCompositionError, composeSlide } from './chunk-
|
|
2
|
-
import { schemaEntries, schemas } from './chunk-
|
|
1
|
+
import { promotedRegionKeys, VARIABLE_KINDS, resolveChartData, chartPaletteForFill, imageBackground, tableGrid, timelineTextColor, LOGO_SHAPES, visitContentPayloads, readingRows, visualReadingOrder, intrinsicImageSize, resolveReference, textWidthMeasurer, normalizeHexColor, resolveColorRef, resolveDesignRecords, resolveFontFamilies, checkCatalogsOption, provenanceOf, unresolvedReference, OPFUnresolvedReferenceError, resolveColorRoles, resolveCanvasDimensions, resolveSlideVariables, defaultSlideBackground, isRecord, hasContentVariables, isTemplate, instantiateForValidation, layoutTemplateIssues, resolveScriptFonts, catalogReferenceSites, parseReference, catalogGroupDeclared, pointerPath, unusedDatasets, MAX_COMPOSITION_DEPTH, datasetDiagnostics, pathFor, catalogRecords, collectCitations, numberingFindings, walkCitationRuns, resolveTableData, resolveChartOptions, chartOptionTarget, codeHighlightLines, chartNumberFixesByCell, catalogKinds, catalogGroupSource, registeredCatalog, OPFCompositionError, composeSlide } from './chunk-XAYMPBNE.js';
|
|
2
|
+
import { schemaEntries, schemas } from './chunk-VFMHM2IL.js';
|
|
3
3
|
import Ajv2020 from 'ajv/dist/2020.js';
|
|
4
4
|
import addFormats from 'ajv-formats';
|
|
5
5
|
import { parseTree, printParseErrorCode, getNodePath } from 'jsonc-parser';
|
|
@@ -225,10 +225,10 @@ function getAjv() {
|
|
|
225
225
|
return instance;
|
|
226
226
|
}
|
|
227
227
|
function isSchemaName(value) {
|
|
228
|
-
return typeof value === "string" && value
|
|
228
|
+
return typeof value === "string" && hasOwn(schemas, value);
|
|
229
229
|
}
|
|
230
230
|
function isCatalogKind(value) {
|
|
231
|
-
return typeof value === "string" && value
|
|
231
|
+
return typeof value === "string" && hasOwn(schemaNameByCatalogKind, value);
|
|
232
232
|
}
|
|
233
233
|
function resolveValidator(schemaOrKind) {
|
|
234
234
|
const instance = getAjv();
|
|
@@ -278,7 +278,7 @@ function presentFields(value, fields2) {
|
|
|
278
278
|
return fields2.filter((field) => hasOwn(value, field));
|
|
279
279
|
}
|
|
280
280
|
function isContentKind(value) {
|
|
281
|
-
return typeof value === "string" && value
|
|
281
|
+
return typeof value === "string" && hasOwn(contentKindSpecs, value);
|
|
282
282
|
}
|
|
283
283
|
function inferredKinds(value) {
|
|
284
284
|
const kinds = [];
|
|
@@ -1250,7 +1250,8 @@ function backdropColors(backdrop, box, size, layer) {
|
|
|
1250
1250
|
for (let j = 0; j <= 4; j++) {
|
|
1251
1251
|
const px = (region.x + region.width * i / 4) / size.width, py = (region.y + region.height * j / 4) / size.height, t = Math.max(0, Math.min(1, 0.5 + (px - 0.5) * c + (py - 0.5) * s));
|
|
1252
1252
|
const after = stops.findIndex((stop) => stop.position >= t);
|
|
1253
|
-
if (after
|
|
1253
|
+
if (after < 0) colors.add(stops[stops.length - 1].color);
|
|
1254
|
+
else if (after === 0) colors.add(stops[0].color);
|
|
1254
1255
|
else {
|
|
1255
1256
|
const lo = stops[after - 1], hi = stops[after], span = hi.position - lo.position || 1;
|
|
1256
1257
|
colors.add(blend(hi.color, lo.color, (t - lo.position) / span));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OPFDataImportError, parseTabularData } from './chunk-
|
|
2
|
-
import { applyPatchWithInverse } from './chunk-
|
|
3
|
-
import { validate, OPFValidationError } from './chunk-
|
|
4
|
-
import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN, isRecord, visitContentPayloads, listVariables, resolveVariables, LOGO_SHAPES, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-
|
|
1
|
+
import { OPFDataImportError, parseTabularData } from './chunk-TZ5IZETE.js';
|
|
2
|
+
import { applyPatchWithInverse } from './chunk-YOLDSF7U.js';
|
|
3
|
+
import { validate, OPFValidationError } from './chunk-2M7U4WL3.js';
|
|
4
|
+
import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN, isRecord, visitContentPayloads, annotationText, listVariables, resolveVariables, LOGO_SHAPES, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-XAYMPBNE.js';
|
|
5
5
|
|
|
6
6
|
// src/api-errors.ts
|
|
7
7
|
var OPFApiError = class extends Error {
|
|
@@ -292,7 +292,11 @@ function moveToCustom(document, ref, options = {}) {
|
|
|
292
292
|
if (options.id !== void 0 && (typeof options.id !== "string" || !CATALOG_GROUP_PATTERN.test(options.id))) throw new OPFMoveToCustomError("invalid-id", `moveToCustom: the new id ${JSON.stringify(options.id)} is not a lowercase kebab-case id.`);
|
|
293
293
|
const wanted = options.id ?? fromId;
|
|
294
294
|
let toId = wanted;
|
|
295
|
-
|
|
295
|
+
const reusable = (candidate) => sameRecord(candidate, moved) && ownSites.every(({ site, found }) => {
|
|
296
|
+
const destination = resolveReference(before, site.kind, site.reference, { ...catalogs, group: "custom" });
|
|
297
|
+
return found === void 0 ? destination === void 0 : destination !== void 0 && found.kind === destination.kind && found.group === destination.group && found.id === destination.id && found.origin === destination.origin;
|
|
298
|
+
});
|
|
299
|
+
for (let n = 2; Object.hasOwn(existing, toId) && !reusable(existing[toId]); n++) toId = `${wanted}-${n}`;
|
|
296
300
|
const reused = Object.hasOwn(existing, toId);
|
|
297
301
|
const patch = [];
|
|
298
302
|
const fromRecords = groups[fromGroup][kind];
|
|
@@ -701,7 +705,8 @@ function stats(presentation2, options = {}) {
|
|
|
701
705
|
total.links += slideTally.links;
|
|
702
706
|
for (const cite of slideTally.cited) total.cited.add(cite);
|
|
703
707
|
for (const family of slideTally.families) total.families.add(family);
|
|
704
|
-
const
|
|
708
|
+
const titleText = typeof slide.title === "string" || Array.isArray(slide.title) ? annotationText(slide.title) : "";
|
|
709
|
+
const title = titleText.trim() !== "" ? titleText : null;
|
|
705
710
|
if (title) withTitle++;
|
|
706
711
|
if (slide.beat !== void 0) withBeat++;
|
|
707
712
|
if (slide.hidden === true) hidden.push(ref);
|
|
@@ -896,7 +901,7 @@ function combine(decks) {
|
|
|
896
901
|
} else slides.push(slide);
|
|
897
902
|
}
|
|
898
903
|
if (isRecord2(deck.presentation.assets)) {
|
|
899
|
-
for (const [key, value] of Object.entries(deck.presentation.assets)) if (!(key
|
|
904
|
+
for (const [key, value] of Object.entries(deck.presentation.assets)) if (!Object.hasOwn(assets, key)) assets[key] = value;
|
|
900
905
|
}
|
|
901
906
|
}
|
|
902
907
|
return { ...first.presentation, ...Object.keys(assets).length ? { assets } : {}, slides };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fromMarkdown, toMarkdown } from './chunk-
|
|
2
|
-
import { fromYaml, toYaml } from './chunk-
|
|
3
|
-
import { NOT_CHECKED } from './chunk-
|
|
4
|
-
import { parseSource, validate, OPFValidationError } from './chunk-
|
|
5
|
-
import { checkCatalogsOption } from './chunk-
|
|
1
|
+
import { fromMarkdown, toMarkdown } from './chunk-Z75YB54S.js';
|
|
2
|
+
import { fromYaml, toYaml } from './chunk-IDMQWS6O.js';
|
|
3
|
+
import { NOT_CHECKED } from './chunk-7PQZDC2H.js';
|
|
4
|
+
import { parseSource, validate, OPFValidationError } from './chunk-2M7U4WL3.js';
|
|
5
|
+
import { checkCatalogsOption } from './chunk-XAYMPBNE.js';
|
|
6
6
|
|
|
7
7
|
// src/deck-report.ts
|
|
8
8
|
var DECK_FORMATS = ["json", "yaml", "markdown"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertValid, resolveSlideScriptMeasurement, resolveSlideContext } from './chunk-
|
|
2
|
-
import { resolveSlideVariables, checkCatalogsOption, usesSlideBuiltin, composeSlide, codeHighlightSlice, tableRowBoundaries, visitContentPayloads, regionAccepts, slideTokenSpans, sliceNumberedItems } from './chunk-
|
|
1
|
+
import { assertValid, resolveSlideScriptMeasurement, resolveSlideContext } from './chunk-2M7U4WL3.js';
|
|
2
|
+
import { resolveSlideVariables, checkCatalogsOption, usesSlideBuiltin, composeSlide, codeHighlightSlice, tableRowBoundaries, visitContentPayloads, regionAccepts, slideTokenSpans, sliceNumberedItems } from './chunk-XAYMPBNE.js';
|
|
3
3
|
|
|
4
4
|
// src/pagination.ts
|
|
5
5
|
var OPFPaginationError = class extends Error {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NOT_CHECKED, Ctx } from './chunk-
|
|
2
|
-
import { sortPresentationKeys } from './chunk-
|
|
3
|
-
import { same } from './chunk-
|
|
4
|
-
import { validate } from './chunk-
|
|
5
|
-
import { checkCatalogsOption } from './chunk-
|
|
6
|
-
import { presentation } from './chunk-
|
|
1
|
+
import { NOT_CHECKED, Ctx } from './chunk-7PQZDC2H.js';
|
|
2
|
+
import { sortPresentationKeys } from './chunk-S4FR7ATF.js';
|
|
3
|
+
import { same } from './chunk-TCBEF5OY.js';
|
|
4
|
+
import { validate } from './chunk-2M7U4WL3.js';
|
|
5
|
+
import { checkCatalogsOption } from './chunk-XAYMPBNE.js';
|
|
6
|
+
import { presentation } from './chunk-VFMHM2IL.js';
|
|
7
7
|
import { Parser, parseDocument, isMap, Document, visit, isScalar, isAlias, isSeq } from 'yaml';
|
|
8
8
|
|
|
9
9
|
var MAX_ALIAS_COUNT = 100;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OPFApiError } from './chunk-
|
|
2
|
-
import { CATALOG_SCHEMA } from './chunk-
|
|
1
|
+
import { OPFApiError } from './chunk-52GKVP3I.js';
|
|
2
|
+
import { CATALOG_SCHEMA } from './chunk-2M7U4WL3.js';
|
|
3
3
|
import { CATALOG_SCHEMA as CATALOG_SCHEMA$1, gallery } from '@openpresentation/gallery';
|
|
4
4
|
|
|
5
5
|
function galleryMismatch(declared, reads = CATALOG_SCHEMA) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validate } from './chunk-
|
|
1
|
+
import { validate } from './chunk-2M7U4WL3.js';
|
|
2
2
|
|
|
3
3
|
// src/convert/shared.ts
|
|
4
4
|
var CONTENT_KEYS = ["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline"];
|
|
@@ -38,9 +38,9 @@ var contentKeysOf = (payload) => CONTENT_KEYS.filter((key) => payload[key] !== v
|
|
|
38
38
|
function assertValidOutput(value, as = "block", context = {}) {
|
|
39
39
|
const slides = as === "slides" ? value : as === "slide" ? [value] : [{ blocks: [value] }];
|
|
40
40
|
const datasets = isRecord(context.datasets) ? context.datasets : void 0;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const errors =
|
|
41
|
+
const referencesProvided = own(context, "references");
|
|
42
|
+
const report2 = validate({ ...datasets ? { datasets } : {}, ...referencesProvided ? { references: context.references } : {}, slides }, { only: ["format"] });
|
|
43
|
+
const errors = report2.findings.filter((entry) => entry.severity === "error").filter((entry) => (datasets || entry.ruleId !== "opf/dataset-unknown" && entry.ruleId !== "opf/dataset-field-unknown") && (referencesProvided || entry.ruleId !== "opf/cite-unknown-reference"));
|
|
44
44
|
if (errors.length) {
|
|
45
45
|
const first = errors[0];
|
|
46
46
|
throw new OPFConversionError("invalid-output", `The converted content is not valid OPF: ${first?.message ?? "unknown error"}${first?.path ? ` (${first.path})` : ""}.`, { issues: errors });
|
|
@@ -48,7 +48,8 @@ function assertValidOutput(value, as = "block", context = {}) {
|
|
|
48
48
|
}
|
|
49
49
|
var assertValidOwner = (owner, context = {}) => assertValidOutput(owner, isSlideLike(owner) ? "slide" : "block", context);
|
|
50
50
|
var FORMATTING = ["bold", "italic", "underline", "strikethrough", "color", "fontSize", "fontFamily", "link", "superscript", "subscript", "code", "lang"];
|
|
51
|
-
var
|
|
51
|
+
var RUN_METADATA = [...FORMATTING, "cite", "footnote"];
|
|
52
|
+
var isPlainRun = (run) => typeof run === "string" || isRecord(run) && !RUN_METADATA.some((key) => run[key] !== void 0);
|
|
52
53
|
var runText = (run) => typeof run === "string" ? run : run.text ?? "";
|
|
53
54
|
var runsOf = (value) => typeof value === "string" ? [value] : Array.isArray(value) ? value : [];
|
|
54
55
|
var plainOf = (value) => runsOf(value).map(runText).join("");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonEqual, formatPointer } from './chunk-
|
|
2
|
-
import { annotationText } from './chunk-
|
|
1
|
+
import { jsonEqual, formatPointer } from './chunk-YOLDSF7U.js';
|
|
2
|
+
import { annotationText } from './chunk-XAYMPBNE.js';
|
|
3
3
|
|
|
4
4
|
// src/diff-match.ts
|
|
5
5
|
var DEFAULT_MATCH_THRESHOLD = 0.5;
|
|
@@ -9,17 +9,15 @@ var MAX_LCS_CELLS = 4e6;
|
|
|
9
9
|
var isObject = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
10
10
|
var isComposite = (value) => !!value && typeof value === "object";
|
|
11
11
|
var idOf = (value) => isObject(value) && typeof value.id === "string" && value.id !== "" ? value.id : void 0;
|
|
12
|
-
|
|
13
|
-
function canonical(value) {
|
|
12
|
+
function canonicalCached(value, canonCache) {
|
|
14
13
|
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "undefined";
|
|
15
14
|
const cached = canonCache.get(value);
|
|
16
15
|
if (cached !== void 0) return cached;
|
|
17
|
-
const text = Array.isArray(value) ? `[${value.map(
|
|
16
|
+
const text = Array.isArray(value) ? `[${value.map((item) => canonicalCached(item, canonCache)).join(",")}]` : `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalCached(value[key], canonCache)}`).join(",")}}`;
|
|
18
17
|
canonCache.set(value, text);
|
|
19
18
|
return text;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
function leaves(value) {
|
|
20
|
+
function leaves(value, leafCache) {
|
|
23
21
|
if (!isComposite(value)) return /* @__PURE__ */ new Map();
|
|
24
22
|
const cached = leafCache.get(value);
|
|
25
23
|
if (cached) return cached;
|
|
@@ -43,8 +41,11 @@ function wordOverlap(a, b) {
|
|
|
43
41
|
return shared / (left.size + right.size - shared);
|
|
44
42
|
}
|
|
45
43
|
function similarity(a, b) {
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
return similarityCached(a, b, /* @__PURE__ */ new WeakMap(), /* @__PURE__ */ new WeakMap());
|
|
45
|
+
}
|
|
46
|
+
function similarityCached(a, b, canonCache, leafCache) {
|
|
47
|
+
if (canonicalCached(a, canonCache) === canonicalCached(b, canonCache)) return 1;
|
|
48
|
+
const left = leaves(a, leafCache), right = leaves(b, leafCache);
|
|
48
49
|
const size = Math.max(left.size, right.size);
|
|
49
50
|
if (!size) return 0;
|
|
50
51
|
let score = 0;
|
|
@@ -105,6 +106,9 @@ function lcsPairs(keysA, keysB) {
|
|
|
105
106
|
return pairs;
|
|
106
107
|
}
|
|
107
108
|
function matchArrays(a, b, options = {}) {
|
|
109
|
+
const canonCache = /* @__PURE__ */ new WeakMap(), leafCache = /* @__PURE__ */ new WeakMap();
|
|
110
|
+
const canonical = (value) => canonicalCached(value, canonCache);
|
|
111
|
+
const similarity2 = (left, right) => similarityCached(left, right, canonCache, leafCache);
|
|
108
112
|
const threshold = options.threshold ?? DEFAULT_MATCH_THRESHOLD;
|
|
109
113
|
const matchA = new Array(a.length).fill(-1), matchB = new Array(b.length).fill(-1);
|
|
110
114
|
const pairs = [];
|
|
@@ -150,7 +154,7 @@ function matchArrays(a, b, options = {}) {
|
|
|
150
154
|
for (const i of freeA) for (const j of freeB) {
|
|
151
155
|
const idA = idOf(a[i]), idB = idOf(b[j]);
|
|
152
156
|
const needed = idA !== void 0 && idB !== void 0 && idA !== idB ? Math.max(threshold, DIFFERENT_ID_THRESHOLD) : threshold;
|
|
153
|
-
const score =
|
|
157
|
+
const score = similarity2(a[i], b[j]);
|
|
154
158
|
if (score >= needed && score > 0) scored.push({ i, j, score });
|
|
155
159
|
}
|
|
156
160
|
scored.sort((x, y) => y.score - x.score || x.i - y.i || x.j - y.j);
|
|
@@ -1250,7 +1250,7 @@ var presentation = {
|
|
|
1250
1250
|
"character",
|
|
1251
1251
|
"image"
|
|
1252
1252
|
],
|
|
1253
|
-
"description": "Marker style for items and bullets lists. Effective value: the slide's design, then the deck's design, then the theme's design.listBullet, then the layout record's design.listBullet, then 'character'. 'character' (the default) draws the glyph marker. 'image' draws the primary organization's icon logo (or the organization and shape design.logo names; the onDark value on dark backgrounds) as a picture bullet: a square
|
|
1253
|
+
"description": "Marker style for items and bullets lists. Effective value: the slide's design, then the deck's design, then the theme's design.listBullet, then the layout record's design.listBullet, then 'character'. 'character' (the default) draws the glyph marker. 'image' draws the primary organization's icon logo (or the organization and shape design.logo names; the onDark value on dark backgrounds) as a picture bullet: a square with side 0.65 times the marker's font size whose bottom sits on the marker baseline, so list geometry does not change. Without a logo the glyph is drawn and the engine reports unresolved-content at this field."
|
|
1254
1254
|
},
|
|
1255
1255
|
"mirror": {
|
|
1256
1256
|
"type": "boolean",
|
|
@@ -2391,7 +2391,7 @@ var presentation = {
|
|
|
2391
2391
|
"required": [
|
|
2392
2392
|
"edge"
|
|
2393
2393
|
],
|
|
2394
|
-
"description": "Bleeds an image block to one edge of the slide: the image takes a band along that edge, edge to edge, and the headings and other content compose in the rest of the slide at the normal padding. Only top-level blocks (slides.N.blocks.I) can be placed, at most one per edge
|
|
2394
|
+
"description": "Bleeds an image block to one edge of the slide: the image takes a band along that edge, edge to edge, and the headings and other content compose in the rest of the slide at the normal padding. Only top-level blocks (slides.N.blocks.I) can be placed, at most one per edge. Template layout regions do not supply image placement; set it on the image block itself. Bands are taken in block order, each spanning the free area left by earlier ones. Placement is the only mechanism that moves content aside; a background never does. A slide whose only body is placed images is composed like a cover: its headings center in the free area. In a right-to-left deck 'left' is the start side, drawn at the right.",
|
|
2395
2395
|
"properties": {
|
|
2396
2396
|
"edge": {
|
|
2397
2397
|
"type": "string",
|
|
@@ -3797,7 +3797,7 @@ var presentation = {
|
|
|
3797
3797
|
},
|
|
3798
3798
|
"photo": {
|
|
3799
3799
|
"$ref": "#/$defs/Asset",
|
|
3800
|
-
"description": "Headshot of the attributed person, drawn as a circle beside the attribution and role lines (on the
|
|
3800
|
+
"description": "Headshot of the attributed person, drawn as a circle beside the attribution and role lines (on the logical start side: left in a left-to-right deck, right in a right-to-left deck). Give it alt text (validate's opf/missing-alt-text rule checks it). A raster photograph works best; an SVG exports as its PNG raster because the circular mask is not confirmed on SVG pictures in PowerPoint. An unresolved source draws the ordinary image placeholder.",
|
|
3801
3801
|
"examples": [
|
|
3802
3802
|
"./assets/priya-raman.jpg",
|
|
3803
3803
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defaultCatalogs } from './chunk-
|
|
2
|
-
import { OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-
|
|
3
|
-
import { deckFormatOf, readDeckReport, stringify } from './chunk-
|
|
4
|
-
import { paginate } from './chunk-
|
|
5
|
-
import { validate, OPFValidationError } from './chunk-
|
|
6
|
-
import { stat, readdir, lstat, mkdir,
|
|
1
|
+
import { defaultCatalogs } from './chunk-OIGCC6VA.js';
|
|
2
|
+
import { OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-52GKVP3I.js';
|
|
3
|
+
import { deckFormatOf, readDeckReport, stringify } from './chunk-5SQ6CIWR.js';
|
|
4
|
+
import { paginate } from './chunk-DYGYMBBW.js';
|
|
5
|
+
import { validate, OPFValidationError } from './chunk-2M7U4WL3.js';
|
|
6
|
+
import { stat, readdir, lstat, mkdir, open, rename, link, unlink, readFile } from 'fs/promises';
|
|
7
7
|
import path6 from 'path';
|
|
8
8
|
import { readFileSync, realpathSync, statSync } from 'fs';
|
|
9
9
|
import { pathToFileURL, fileURLToPath } from 'url';
|
|
@@ -128,7 +128,7 @@ function locate(specifier) {
|
|
|
128
128
|
return void 0;
|
|
129
129
|
}
|
|
130
130
|
function locatePackage(name, from) {
|
|
131
|
-
const starts =
|
|
131
|
+
const starts = from === void 0 ? bases() : [pathToFileURL(from).href];
|
|
132
132
|
for (const base of starts) {
|
|
133
133
|
const manifest = manifestFrom(name, base);
|
|
134
134
|
if (!manifest) continue;
|
|
@@ -309,10 +309,10 @@ function stemOf(input) {
|
|
|
309
309
|
}
|
|
310
310
|
function deckStem(deck, input) {
|
|
311
311
|
const root = deck && typeof deck === "object" && !Array.isArray(deck) ? deck : {};
|
|
312
|
-
const clean = (value) => value.replace(/[
|
|
312
|
+
const clean = (value) => value.replace(/[\\/:*?"<>|\p{Cc}]+/gu, "-").replace(/\s+/g, "-").replace(/-{2,}/g, "-").replace(/^[-.\s]+|[-.\s]+$/g, "");
|
|
313
313
|
const text = (value) => typeof value === "string" ? value : "";
|
|
314
314
|
const slug = (value) => value.replace(/[^\p{L}\p{N}_-]+/gu, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "");
|
|
315
|
-
return clean(text(root.filename).trim().replace(/\.(pptx|pdf|png|svg)$/i, "")) || slug(text(root.name)) || stemOf(input);
|
|
315
|
+
return clean(text(root.filename).trim().replace(/\.(pptx|pdf|png|svg)$/i, "")) || slug(text(root.name)) || clean(stemOf(input)) || "deck";
|
|
316
316
|
}
|
|
317
317
|
function padNumber(value, largest) {
|
|
318
318
|
return String(value).padStart(String(largest).length, "0");
|
|
@@ -334,11 +334,14 @@ function checkOutputPattern(output, perSlide) {
|
|
|
334
334
|
function expandOutputPattern(output, slide, largest) {
|
|
335
335
|
return output.replace(PLACEHOLDER, () => padNumber(slide, largest));
|
|
336
336
|
}
|
|
337
|
+
function outputExists(file, flags) {
|
|
338
|
+
return new OPFApiError(`Output already exists: ${file}. ${flags ? "Use --force." : "Pass overwrite: true (the default) to replace it."}`, "output-exists", { details: { path: file } });
|
|
339
|
+
}
|
|
337
340
|
async function checkDestinations(files, overwrite, flags = true) {
|
|
338
341
|
for (const file of files) {
|
|
339
342
|
try {
|
|
340
343
|
const stat2 = await lstat(file);
|
|
341
|
-
if (!overwrite) throw
|
|
344
|
+
if (!overwrite) throw outputExists(file, flags);
|
|
342
345
|
if (!stat2.isFile()) throw new OPFApiError(`Refusing to replace a symlink or non-regular file${flags ? "" : `: ${file}`}.`, "output-not-file", { details: { path: file } });
|
|
343
346
|
} catch (error) {
|
|
344
347
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -355,12 +358,26 @@ async function writeFiles(files, overwrite, flags = true) {
|
|
|
355
358
|
const output = path6.resolve(entry.file);
|
|
356
359
|
await mkdir(path6.dirname(output), { recursive: true });
|
|
357
360
|
const temporary = path6.join(path6.dirname(output), `.${path6.basename(output)}.${randomUUID()}.tmp`);
|
|
358
|
-
await
|
|
361
|
+
const handle = await open(temporary, "wx");
|
|
359
362
|
staged.push({ temporary, output });
|
|
363
|
+
try {
|
|
364
|
+
await handle.writeFile(entry.bytes);
|
|
365
|
+
} finally {
|
|
366
|
+
await handle.close();
|
|
367
|
+
}
|
|
360
368
|
}
|
|
361
369
|
for (const item of staged) {
|
|
362
|
-
|
|
363
|
-
|
|
370
|
+
if (overwrite) {
|
|
371
|
+
await rename(item.temporary, item.output);
|
|
372
|
+
item.temporary = "";
|
|
373
|
+
} else {
|
|
374
|
+
try {
|
|
375
|
+
await link(item.temporary, item.output);
|
|
376
|
+
} catch (error) {
|
|
377
|
+
if (error.code === "EEXIST") throw outputExists(item.output, flags);
|
|
378
|
+
throw error;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
364
381
|
}
|
|
365
382
|
} finally {
|
|
366
383
|
for (const item of staged) if (item.temporary) await unlink(item.temporary).catch(() => void 0);
|
|
@@ -790,7 +790,9 @@ function formatVariableNumber(value, pattern) {
|
|
|
790
790
|
const minInteger = [...integerPattern].filter((char) => char === "0").length;
|
|
791
791
|
const minDecimals = [...decimalPattern2].filter((char) => char === "0").length;
|
|
792
792
|
const maxDecimals = decimalPattern2.length;
|
|
793
|
+
if (maxDecimals > 100) return { error: `Number format '${pattern}' supports at most 100 decimal places.` };
|
|
793
794
|
const scaled = prefix.includes("%") || suffix.includes("%") ? value * 100 : value;
|
|
795
|
+
if (!Number.isFinite(scaled)) return { error: `Number format '${pattern}' scales the value beyond the finite number range.` };
|
|
794
796
|
const absolute = Math.abs(scaled);
|
|
795
797
|
let fixed;
|
|
796
798
|
const shifted = Number(`${absolute}e${maxDecimals}`);
|
|
@@ -1942,8 +1944,12 @@ function svgDimensions(text2) {
|
|
|
1942
1944
|
if (root === void 0) return void 0;
|
|
1943
1945
|
const attribute = (name) => new RegExp(`\\s${name}\\s*=\\s*["']([^"']*)["']`, "i").exec(root)?.[1];
|
|
1944
1946
|
const length = (value) => {
|
|
1945
|
-
const match = value && /^\s*([0-9]*\.?[0-9]+)\s*(px|pt|in|cm|mm
|
|
1946
|
-
|
|
1947
|
+
const match = value && /^\s*([0-9]*\.?[0-9]+)\s*(px|pt|in|cm|mm)?\s*$/i.exec(value);
|
|
1948
|
+
if (!match) return void 0;
|
|
1949
|
+
const number = Number(match[1]);
|
|
1950
|
+
const unit = (match[2] ?? "px").toLowerCase();
|
|
1951
|
+
const pixels = number * (unit === "pt" ? 96 / 72 : unit === "in" ? 96 : unit === "cm" ? 96 / 2.54 : unit === "mm" ? 96 / 25.4 : 1);
|
|
1952
|
+
return Number.isFinite(pixels) ? pixels : void 0;
|
|
1947
1953
|
};
|
|
1948
1954
|
const width = length(attribute("width")), height = length(attribute("height"));
|
|
1949
1955
|
if (width && height) return { width, height };
|
|
@@ -5947,7 +5953,7 @@ function richTextLayouter(input, box, requestedSize, options, minimum = 0) {
|
|
|
5947
5953
|
lineStart = end;
|
|
5948
5954
|
lineEnd = end;
|
|
5949
5955
|
};
|
|
5950
|
-
for (const match of whole.matchAll(/\r\n|\r|\n|[^\S\r\n]+|[^\s]+/gu)) {
|
|
5956
|
+
for (const match of whole.matchAll(/\r\n|\r|\n|[^\S\r\n\u00a0\u202f\ufeff]+|(?:[^\s]|\u00a0|\u202f|\ufeff)+/gu)) {
|
|
5951
5957
|
const start = match.index, end = start + match[0].length;
|
|
5952
5958
|
if (/^[\r\n]/.test(match[0])) {
|
|
5953
5959
|
push(start);
|
|
@@ -5969,6 +5975,10 @@ function richTextLayouter(input, box, requestedSize, options, minimum = 0) {
|
|
|
5969
5975
|
lineEnd = end;
|
|
5970
5976
|
continue;
|
|
5971
5977
|
}
|
|
5978
|
+
if (/[\u00a0\u202f\u2060\ufeff]/u.test(match[0])) {
|
|
5979
|
+
lineEnd = end;
|
|
5980
|
+
continue;
|
|
5981
|
+
}
|
|
5972
5982
|
for (const { segment: segment2, index } of textSegments.segment(match[0])) {
|
|
5973
5983
|
const next = start + index + segment2.length;
|
|
5974
5984
|
if (lineEnd > lineStart && width(lineStart, next) > box.width + WRAP_TOLERANCE) push(start + index);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ctx, splitLines, lineRange, readYamlMapping, NOT_CHECKED, OPFMarkdownError, writeYaml, readCsv, DECIMAL, csvField, scalarText } from './chunk-
|
|
2
|
-
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, fenceCode } from './chunk-
|
|
3
|
-
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-
|
|
4
|
-
import { validate } from './chunk-
|
|
5
|
-
import { checkCatalogsOption, PROMOTED_REGION_KEY } from './chunk-
|
|
1
|
+
import { Ctx, splitLines, lineRange, readYamlMapping, NOT_CHECKED, OPFMarkdownError, writeYaml, readCsv, DECIMAL, csvField, scalarText } from './chunk-7PQZDC2H.js';
|
|
2
|
+
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, fenceCode } from './chunk-V66KJA3H.js';
|
|
3
|
+
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-TCBEF5OY.js';
|
|
4
|
+
import { validate } from './chunk-2M7U4WL3.js';
|
|
5
|
+
import { checkCatalogsOption, PROMOTED_REGION_KEY } from './chunk-XAYMPBNE.js';
|
|
6
6
|
|
|
7
7
|
// src/markdown/canon.ts
|
|
8
8
|
var FORMAT_KEYS = FORMATTING;
|
package/dist/composition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AUTO_LAYOUT, CAPTIONABLE_FIELDS, CAPTION_FONT_RATIO, CAPTION_MAX_RATIO, CATALOG_REFERENCE_PATTERN, CHART_HIGHLIGHT_MUTED_MIN_CONTRAST, CHART_HIGHLIGHT_MUTED_MIX, CHART_SERIES_MIN_DIFFERENCE, CHART_SERIES_MIN_LIGHTNESS_STEP, CHART_TYPES, CITATION_MARKER_RAISE, CITATION_MARKER_SCALE, CODE_HIGHLIGHT_LANGUAGES, CODE_HIGHLIGHT_MAX_LENGTH, CODE_PANEL_BACKGROUND, CODE_PANEL_FOREGROUND, CODE_SYNTAX_MIN_CONTRAST, DARK_BACKGROUND_LUMINANCE, DEFAULT_CHART_LABEL_SEPARATOR, DEFAULT_FURNITURE_DATE_FORMAT, DESIGN_HINT_KEYS, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, FONT_SIZE_GRID_PER_PX, FOOTNOTE_MAX_RATIO, FURNITURE_GAP, FURNITURE_IMAGE_SHARE, HEADING_AREAS, LANGUAGES, LAYOUT_BODY_KINDS, LOGO_SHAPES, MAX_COMPOSITION_DEPTH, MAX_NUMBERING_LEVELS, MAX_NUMBERING_VALUE, MAX_REGION_BLOCKS, MAX_ROMAN_VALUE, MAX_TEMPLATE_TRACKS, METRIC_TREND_MIN_CONTRAST, METRIC_TREND_SHAPES, NUMBERING_STYLES, NUMBERING_SUFFIXES, OPFCatalogsOptionError, OPFCompositionError, OPFLayoutTemplateError, OPFUnresolvedReferenceError, PATTERN_PRESETS, PATTERN_PRESET_ALIASES, PATTERN_TILE_SIZE, PICTURE_BULLET_SCALE, REGION_ANCHORS, REGION_FLOWS, REGION_KINDS, REGION_ROLES, RESERVED_REGION_NAMES, SOCIAL_PLATFORMS, SURFACE_ALT_MIN_CONTRAST, SURFACE_ALT_MIX, THEME_DESIGN_KEYS, TIMELINE_OUTLINE_MIN_CONTRAST, TIMELINE_STATUSES, TIMELINE_TEXT_MIN_CONTRAST, allocateRows, annotationText, bindRegions, blockKind, captionSettings, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartColorForFill, chartHighlightColors, chartHighlightMarks, chartLabelText, chartNumber, chartOptionSupport, chartOptionTarget, chartPaletteForFill, citationMarkerText, codeHighlightBands, codeHighlightColors, codeHighlightLines, codeLineNumbers, codeLineRuns, codeSyntaxPalette, codeSyntaxPaletteForScheme, collectCitations, colorContrast, composeLayoutAreas, composeSlide, defaultSlideBackground, fitImage, fitList, fitRichText, fitText, formatChartLabelNumber, formatChartLabelPercent, formatDataNumber, formatFurnitureDate, formatListNumber, fromExcelNumberFormat, gridFlowShape, imageBackground, imageShape, inlineChartData, inlineDatasets, inlineTableData, intrinsicImageAspect, intrinsicImageSize, isDarkColor, isDatasetRef, isLayoutTemplate, isXYChartType, layoutCaption, layoutCode, layoutContent, layoutFootnotes, layoutFurniture, layoutMetric, layoutQuote, layoutRegion, layoutStructure, layoutTable, layoutTemplate, layoutTemplateIssues, layoutTimeline, layoutWatermark, listColumnBreaks, listNumbers, measureText, measureTextOutline, metricTrendColor, metricTrendMark, metricTrendPoints, normalizeHexColor, numberFormatError, numberingAtLevel, numberingStyleDraws, paragraphDirection, paragraphDirectionAt, parseReference, patternBitmap, patternRuns, physicalAlignment, placeTextLines, placedImageBlocks, referencesSlide, regionAccepts, regionRoleRank, resolveCanvasDimensions, resolveChartData, resolveChartOptions, resolveCodeLanguage, resolveColorRef, resolveColorRoles, resolveDesignHints, resolveFontFamilies, resolveLogo, resolveNumbering, resolvePatternPreset, resolveReference, resolveScriptFonts, resolveSlideDirection, resolveSocialProfile, resolveTableData, resolveTextStyle, rootNodes, scriptFontRole, sliceNumberedItems, slideCitations, snapFontSizeDown, snapFontSizeUp, surfaceAltColor, tableCellDisplayValue, tableGrid, tableRowBoundaries, textColorForFill, textWidthMeasurer, timelineMarkerShapes, timelineTextColor, toExcelNumberFormat, tokenizeCode, unresolvedReference, visualReadingOrder, walkCitationRuns, wrapText } from './chunk-
|
|
1
|
+
export { AUTO_LAYOUT, CAPTIONABLE_FIELDS, CAPTION_FONT_RATIO, CAPTION_MAX_RATIO, CATALOG_REFERENCE_PATTERN, CHART_HIGHLIGHT_MUTED_MIN_CONTRAST, CHART_HIGHLIGHT_MUTED_MIX, CHART_SERIES_MIN_DIFFERENCE, CHART_SERIES_MIN_LIGHTNESS_STEP, CHART_TYPES, CITATION_MARKER_RAISE, CITATION_MARKER_SCALE, CODE_HIGHLIGHT_LANGUAGES, CODE_HIGHLIGHT_MAX_LENGTH, CODE_PANEL_BACKGROUND, CODE_PANEL_FOREGROUND, CODE_SYNTAX_MIN_CONTRAST, DARK_BACKGROUND_LUMINANCE, DEFAULT_CHART_LABEL_SEPARATOR, DEFAULT_FURNITURE_DATE_FORMAT, DESIGN_HINT_KEYS, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, FONT_SIZE_GRID_PER_PX, FOOTNOTE_MAX_RATIO, FURNITURE_GAP, FURNITURE_IMAGE_SHARE, HEADING_AREAS, LANGUAGES, LAYOUT_BODY_KINDS, LOGO_SHAPES, MAX_COMPOSITION_DEPTH, MAX_NUMBERING_LEVELS, MAX_NUMBERING_VALUE, MAX_REGION_BLOCKS, MAX_ROMAN_VALUE, MAX_TEMPLATE_TRACKS, METRIC_TREND_MIN_CONTRAST, METRIC_TREND_SHAPES, NUMBERING_STYLES, NUMBERING_SUFFIXES, OPFCatalogsOptionError, OPFCompositionError, OPFLayoutTemplateError, OPFUnresolvedReferenceError, PATTERN_PRESETS, PATTERN_PRESET_ALIASES, PATTERN_TILE_SIZE, PICTURE_BULLET_SCALE, REGION_ANCHORS, REGION_FLOWS, REGION_KINDS, REGION_ROLES, RESERVED_REGION_NAMES, SOCIAL_PLATFORMS, SURFACE_ALT_MIN_CONTRAST, SURFACE_ALT_MIX, THEME_DESIGN_KEYS, TIMELINE_OUTLINE_MIN_CONTRAST, TIMELINE_STATUSES, TIMELINE_TEXT_MIN_CONTRAST, allocateRows, annotationText, bindRegions, blockKind, captionSettings, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartColorForFill, chartHighlightColors, chartHighlightMarks, chartLabelText, chartNumber, chartOptionSupport, chartOptionTarget, chartPaletteForFill, citationMarkerText, codeHighlightBands, codeHighlightColors, codeHighlightLines, codeLineNumbers, codeLineRuns, codeSyntaxPalette, codeSyntaxPaletteForScheme, collectCitations, colorContrast, composeLayoutAreas, composeSlide, defaultSlideBackground, fitImage, fitList, fitRichText, fitText, formatChartLabelNumber, formatChartLabelPercent, formatDataNumber, formatFurnitureDate, formatListNumber, fromExcelNumberFormat, gridFlowShape, imageBackground, imageShape, inlineChartData, inlineDatasets, inlineTableData, intrinsicImageAspect, intrinsicImageSize, isDarkColor, isDatasetRef, isLayoutTemplate, isXYChartType, layoutCaption, layoutCode, layoutContent, layoutFootnotes, layoutFurniture, layoutMetric, layoutQuote, layoutRegion, layoutStructure, layoutTable, layoutTemplate, layoutTemplateIssues, layoutTimeline, layoutWatermark, listColumnBreaks, listNumbers, measureText, measureTextOutline, metricTrendColor, metricTrendMark, metricTrendPoints, normalizeHexColor, numberFormatError, numberingAtLevel, numberingStyleDraws, paragraphDirection, paragraphDirectionAt, parseReference, patternBitmap, patternRuns, physicalAlignment, placeTextLines, placedImageBlocks, referencesSlide, regionAccepts, regionRoleRank, resolveCanvasDimensions, resolveChartData, resolveChartOptions, resolveCodeLanguage, resolveColorRef, resolveColorRoles, resolveDesignHints, resolveFontFamilies, resolveLogo, resolveNumbering, resolvePatternPreset, resolveReference, resolveScriptFonts, resolveSlideDirection, resolveSocialProfile, resolveTableData, resolveTextStyle, rootNodes, scriptFontRole, sliceNumberedItems, slideCitations, snapFontSizeDown, snapFontSizeUp, surfaceAltColor, tableCellDisplayValue, tableGrid, tableRowBoundaries, textColorForFill, textWidthMeasurer, timelineMarkerShapes, timelineTextColor, toExcelNumberFormat, tokenizeCode, unresolvedReference, visualReadingOrder, walkCitationRuns, wrapText } from './chunk-XAYMPBNE.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeckFormat } from './deck-report-
|
|
1
|
+
import { D as DeckFormat } from './deck-report-BdG5H3Qj.js';
|
|
2
2
|
import { a as Finding, c as FindingSeverity } from './finding-DqgwzUmr.js';
|
|
3
|
-
import { P as Presentation } from './presentation-
|
|
3
|
+
import { P as Presentation } from './presentation-BG4QCcdB.js';
|
|
4
4
|
import { V as ValidationReport, f as ValidationChecks, a as ValidateOptions } from './validation-types-DRaNnieo.js';
|
|
5
5
|
import { C as Catalog } from './catalog-refs-CSHevLn1.js';
|
|
6
6
|
|
|
@@ -127,9 +127,9 @@ declare const RENDER_EXTRAS: {
|
|
|
127
127
|
readonly pdfPictures: readonly ["sharp@^0.35.5"];
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
|
-
* A package as the engine would find it (RR-75, `opf doctor`):
|
|
131
|
-
* directory
|
|
132
|
-
* not installed. Nothing is loaded.
|
|
130
|
+
* A package as the engine would find it (RR-75, `opf doctor`): without `from`, resolve from core's location, then the working
|
|
131
|
+
* directory. With `from`, use only that file's normal Node resolution chain, for the optional peers opf-render loads itself.
|
|
132
|
+
* An unrelated core/global install cannot satisfy those peers. Undefined when it is not installed. Nothing is loaded.
|
|
133
133
|
*/
|
|
134
134
|
declare function locatePackage(name: string, from?: string): {
|
|
135
135
|
manifest: string;
|
|
@@ -494,7 +494,7 @@ declare function readInput(file: string): Promise<Uint8Array>;
|
|
|
494
494
|
*/
|
|
495
495
|
declare function planConversion(input: ConvertInput, output: string | undefined, options?: ConvertOptions, flags?: boolean): Promise<ConversionPlan>;
|
|
496
496
|
/**
|
|
497
|
-
*
|
|
497
|
+
* Stage planned files, then publish each atomically, creating folders. `overwrite` false refuses an existing output
|
|
498
498
|
* (`output-exists`): the opf commands pass it unless `--force`; `convert` passes its `overwrite` option, true by default.
|
|
499
499
|
*/
|
|
500
500
|
declare function writePlanned(files: readonly ConvertedFile[], overwrite: boolean, flags?: boolean): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { convertFiles, deckFileFormat, exportFormatOf, openDeck, planConversion, readInput, saveDeck, writePlanned } from './chunk-WD4W7KKK.js';
|
|
2
|
+
import './chunk-OIGCC6VA.js';
|
|
3
|
+
import './chunk-52GKVP3I.js';
|
|
4
|
+
import './chunk-UJSAR6GF.js';
|
|
5
|
+
import './chunk-TZ5IZETE.js';
|
|
6
|
+
import './chunk-5SQ6CIWR.js';
|
|
7
|
+
import './chunk-Z75YB54S.js';
|
|
8
|
+
import './chunk-IDMQWS6O.js';
|
|
9
|
+
import './chunk-7PQZDC2H.js';
|
|
10
|
+
import './chunk-URUNMZFO.js';
|
|
11
|
+
import './chunk-YOLDSF7U.js';
|
|
12
|
+
import './chunk-S4FR7ATF.js';
|
|
13
|
+
import './chunk-DYGYMBBW.js';
|
|
14
|
+
import './chunk-V66KJA3H.js';
|
|
15
|
+
import './chunk-TCBEF5OY.js';
|
|
16
|
+
import './chunk-2M7U4WL3.js';
|
|
17
|
+
import './chunk-XAYMPBNE.js';
|
|
18
|
+
import './chunk-VFMHM2IL.js';
|
|
19
|
+
import './chunk-F7PLNWHQ.js';
|
package/dist/convert.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { paginate, OPFPaginationError } from './chunk-
|
|
2
|
-
import { parseQuoteLines, parseCodeFence, splitWhen, parseListLine, levelsFromIndents, fenceCode } from './chunk-
|
|
3
|
-
import { CONTENT_KEYS, isRecord, contentKeysOf, refuse, clone, Loss, isSlideLike, assertValidOwner, report, OPFConversionError, plainOf, assertValidOutput, same, splitRuns, runsOf, lineIsPlain, linePlain, concatText, lineValue, joinLines, hasFormatting } from './chunk-
|
|
4
|
-
export { OPFConversionError } from './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import { promotedRegionKeys, isDatasetRef, inlineTableData, visitContentPayloads, chartNumber } from './chunk-
|
|
7
|
-
import './chunk-
|
|
1
|
+
import { paginate, OPFPaginationError } from './chunk-DYGYMBBW.js';
|
|
2
|
+
import { parseQuoteLines, parseCodeFence, splitWhen, parseListLine, levelsFromIndents, fenceCode } from './chunk-V66KJA3H.js';
|
|
3
|
+
import { CONTENT_KEYS, isRecord, contentKeysOf, refuse, clone, Loss, isSlideLike, assertValidOwner, report, OPFConversionError, plainOf, assertValidOutput, same, splitRuns, runsOf, lineIsPlain, linePlain, concatText, lineValue, joinLines, hasFormatting } from './chunk-TCBEF5OY.js';
|
|
4
|
+
export { OPFConversionError } from './chunk-TCBEF5OY.js';
|
|
5
|
+
import './chunk-2M7U4WL3.js';
|
|
6
|
+
import { promotedRegionKeys, isDatasetRef, inlineTableData, visitContentPayloads, chartNumber } from './chunk-XAYMPBNE.js';
|
|
7
|
+
import './chunk-VFMHM2IL.js';
|
|
8
8
|
|
|
9
9
|
// src/convert/tables.ts
|
|
10
10
|
function cellOf(raw) {
|