@openpresentation/opf 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -1
- package/dist/{catalog-refs-BSfGELpt.d.ts → catalog-refs-C4K4y-vh.d.ts} +1 -1
- package/dist/{catalog-schemas-CinPh5WA.d.ts → catalog-schemas-g7RFQBdc.d.ts} +1 -1
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +3 -23224
- package/dist/{chart-data-BnNqgnC-.d.ts → chart-data-DTxdRRT1.d.ts} +1 -1
- package/dist/{chunk-3JG4YXWF.js → chunk-BIC3SWPK.js} +12 -5
- package/dist/{chunk-O744SXXA.js → chunk-CW7GEAV3.js} +350 -141
- package/dist/{chunk-374R35TJ.js → chunk-ESRYBYLY.js} +1 -1
- package/dist/chunk-IPW5BS3X.js +973 -0
- package/dist/{chunk-3RKB4RDJ.js → chunk-IS5H5JKH.js} +4 -2
- package/dist/{chunk-TWQJLI6E.js → chunk-M4UR3NPN.js} +2 -2
- package/dist/chunk-N4EVOFEA.js +58 -0
- package/dist/{chunk-QDI75P2M.js → chunk-NLNYNBTS.js} +217 -20
- package/dist/{chunk-U4J75TRG.js → chunk-O263APNI.js} +5 -2
- package/dist/{chunk-UBFJ2QHH.js → chunk-O2CX5NEH.js} +36 -14
- package/dist/{chunk-5FTUIDUH.js → chunk-O3CVNJTL.js} +1 -1
- package/dist/{chunk-VGAOJEY7.js → chunk-PPROJP2E.js} +1 -1
- package/dist/{chunk-2CJPC4HI.js → chunk-RA64UQKI.js} +203 -53
- package/dist/chunk-TCD2FB2K.js +319 -0
- package/dist/chunk-WCG3THTD.js +23712 -0
- package/dist/chunk-WWYWFVOI.js +793 -0
- package/dist/{chunk-ZPU46TFA.js → chunk-YT7FMQER.js} +1 -1
- package/dist/{composition-D2tghM82.d.ts → composition-BbZ_9C-c.d.ts} +238 -139
- package/dist/composition.d.ts +3 -3
- package/dist/composition.js +1 -1
- package/dist/conversion-SBpTOwdg.d.ts +444 -0
- package/dist/convert.d.ts +4 -4
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +28 -11
- package/dist/data.js +2 -2
- package/dist/deck-report-Bx3naFlF.d.ts +40 -0
- package/dist/deck.d.ts +47 -0
- package/dist/deck.js +12 -0
- package/dist/diff.d.ts +1 -1
- package/dist/diff.js +5 -5
- package/dist/docs.js +33 -27
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +3229 -985
- package/dist/{finding-CT_f_vbD.d.ts → finding-CDQ_wH8j.d.ts} +1 -1
- package/dist/format.js +2 -2
- package/dist/index.d.ts +43 -12
- package/dist/index.js +15 -805
- package/dist/markdown.d.ts +7 -8
- package/dist/markdown.js +7 -7
- package/dist/node-engine.d.ts +94 -0
- package/dist/node-engine.js +21 -0
- package/dist/node.d.ts +60 -0
- package/dist/node.js +54 -0
- package/dist/{pagination-wedbe7eq.d.ts → pagination-BhX4M48Y.d.ts} +21 -7
- 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-CDKQVkyI.d.ts → presentation-fb8CZmRq.d.ts} +28 -83
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.d.ts +14 -0
- package/dist/schemas.js +1 -1
- package/dist/spec/catalogs/layouts/business-model-canvas.json +66 -1
- package/dist/spec/catalogs/layouts/capability-map.json +53 -3
- package/dist/spec/catalogs/layouts/chart-2x.json +32 -8
- package/dist/spec/catalogs/layouts/chart-3x-bottom-vertical-title-left.json +16 -10
- package/dist/spec/catalogs/layouts/chart-3x-left-title-center.json +16 -10
- package/dist/spec/catalogs/layouts/chart-3x-left.json +16 -10
- package/dist/spec/catalogs/layouts/chart-3x-right-title-center.json +16 -10
- package/dist/spec/catalogs/layouts/chart-3x-right.json +16 -10
- package/dist/spec/catalogs/layouts/chart-3x-top-vertical-title-left.json +16 -10
- package/dist/spec/catalogs/layouts/chart-3x.json +48 -12
- package/dist/spec/catalogs/layouts/dashboard.json +37 -5
- package/dist/spec/catalogs/layouts/image-2x.json +32 -8
- package/dist/spec/catalogs/layouts/image-3x.json +48 -12
- package/dist/spec/catalogs/layouts/index.json +1 -1
- package/dist/spec/catalogs/layouts/kpi-scorecard.json +48 -3
- package/dist/spec/catalogs/layouts/logic-tree.json +69 -0
- package/dist/spec/catalogs/layouts/market-size.json +26 -2
- package/dist/spec/catalogs/layouts/org-chart.json +53 -6
- package/dist/spec/catalogs/manifest.json +3 -3
- package/dist/spec/schemas/layout.schema.json +172 -5
- package/dist/spec/schemas/opf.schema.json +27 -43
- package/dist/types.d.ts +10 -32
- package/dist/{validation-types-BOcY9GTs.d.ts → validation-types-iZbXfES6.d.ts} +19 -8
- package/dist/validator.d.ts +8 -8
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +6 -6
- package/dist/yaml.js +8 -321
- package/package.json +38 -1
package/dist/markdown.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as Presentation } from './presentation-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import './composition-
|
|
6
|
-
import './chart-data-
|
|
1
|
+
import { b as Catalog } from './catalog-refs-C4K4y-vh.js';
|
|
2
|
+
import { P as Presentation } from './presentation-fb8CZmRq.js';
|
|
3
|
+
import { F as Finding, d as FindingLocation } from './finding-CDQ_wH8j.js';
|
|
4
|
+
import { c as ValidateOptions, f as ValidationReport } from './validation-types-iZbXfES6.js';
|
|
5
|
+
import './composition-BbZ_9C-c.js';
|
|
6
|
+
import './chart-data-DTxdRRT1.js';
|
|
7
7
|
import './json-BFSdESOE.js';
|
|
8
8
|
|
|
9
9
|
interface EmbeddedPart {
|
|
@@ -45,7 +45,7 @@ interface FromMarkdownOptions extends ParseOptions {
|
|
|
45
45
|
/** Catalogs the host registered, for the references check of `validate: true` (the default). Nothing is fetched. */
|
|
46
46
|
catalogs?: readonly Catalog[];
|
|
47
47
|
}
|
|
48
|
-
interface FromMarkdownResult {
|
|
48
|
+
interface FromMarkdownResult extends ValidationReport {
|
|
49
49
|
/** The converted deck. Always an object; when `valid` is false it is a best effort that does not validate. */
|
|
50
50
|
presentation: Presentation;
|
|
51
51
|
/** True when there are no errors (Markdown syntax errors and OPF validation errors both count). */
|
|
@@ -54,7 +54,6 @@ interface FromMarkdownResult {
|
|
|
54
54
|
findings: (Finding & {
|
|
55
55
|
location: FindingLocation;
|
|
56
56
|
})[];
|
|
57
|
-
counts: FindingReport["counts"];
|
|
58
57
|
}
|
|
59
58
|
/** Convert Markdown in the OPF dialect to an OPF document. Never throws for malformed content; read `valid` and `findings`. */
|
|
60
59
|
declare function fromMarkdown(markdown: string, options?: FromMarkdownOptions): FromMarkdownResult;
|
package/dist/markdown.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { fromMarkdown, toMarkdown } from './chunk-
|
|
2
|
-
export { OPFMarkdownError } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
export { fromMarkdown, toMarkdown } from './chunk-BIC3SWPK.js';
|
|
2
|
+
export { OPFMarkdownError } from './chunk-IS5H5JKH.js';
|
|
3
|
+
import './chunk-ESRYBYLY.js';
|
|
4
|
+
import './chunk-PPROJP2E.js';
|
|
5
|
+
import './chunk-NLNYNBTS.js';
|
|
6
|
+
import './chunk-CW7GEAV3.js';
|
|
7
7
|
import './chunk-TRDXRRQK.js';
|
|
8
8
|
import './chunk-SPFV27O5.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-RA64UQKI.js';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-Bx3naFlF.js';
|
|
2
|
+
import { F as FontsHandle, i as EmbeddedFace, R as Renderer, j as Reporter, P as Peer, k as PptxModule } from './conversion-SBpTOwdg.js';
|
|
3
|
+
export { l as ConversionPlan, D as Diagnostic, m as EXPORT_FORMATS, n as ExportContext, o as ExportFile, p as ExportFontSummary, E as ExportFormat, q as ExportOptions, r as ExportResult, s as ExportRun, I as ImportOptions, t as ImportResult, f as OPFApiError, g as OPFExportError, h as OPFImportError, u as PEER_RANGES, v as PPTX_PACKAGE, w as PreparedExport, x as RENDER_PACKAGE, y as ReportFinding, z as Source, V as VERSIONS, A as asApiError, B as checkDate, G as checkOptions, H as checkScale, J as deckFileFormat, K as exportFormatOf, L as finishReport, M as importPresentation, N as loadPptx, Q as loadRenderer, T as missingPeerFrom, U as planConversion, W as prepareExport, X as reaches, Y as readInput, Z as reportThrown, _ as resolveExportOptions, $ as runExport, a0 as runPreparedExport, a1 as writePlanned } from './conversion-SBpTOwdg.js';
|
|
4
|
+
import './catalog-refs-C4K4y-vh.js';
|
|
5
|
+
import './presentation-fb8CZmRq.js';
|
|
6
|
+
import './validation-types-iZbXfES6.js';
|
|
7
|
+
import './composition-BbZ_9C-c.js';
|
|
8
|
+
import './chart-data-DTxdRRT1.js';
|
|
9
|
+
import './finding-CDQ_wH8j.js';
|
|
10
|
+
import './json-BFSdESOE.js';
|
|
11
|
+
|
|
12
|
+
/** `1,3-5`, `2-` (to the end) and `-3` (from the start), one-based, in ascending order without repeats. */
|
|
13
|
+
declare function parseSlideSelection(spec: string, total: number, label?: string): number[];
|
|
14
|
+
/** `deck.opf.json` and `deck.pptx` both give `deck`; stdin gives `deck`. */
|
|
15
|
+
declare function stemOf(input: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* The base name of render and export output files: the deck's `filename` (a trailing .pptx, .pdf, .png or .svg is dropped, any
|
|
18
|
+
* case), else the slugified `name`, else the input file's stem. The same rule opf-editor names its downloads by. Characters a file
|
|
19
|
+
* system rejects are replaced, so the name is safe to write.
|
|
20
|
+
*/
|
|
21
|
+
declare function deckStem(deck: unknown, input: string): string;
|
|
22
|
+
interface PlannedFile {
|
|
23
|
+
file: string;
|
|
24
|
+
bytes: Uint8Array;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Fail before writing anything when a destination exists (the commands without --force; `convert` with `overwrite: false`), is a symlink or is
|
|
28
|
+
* not a regular file: `output-exists` and `output-not-file`, which the commands report at exit 1. `flags` false words the
|
|
29
|
+
* message for the library API.
|
|
30
|
+
*/
|
|
31
|
+
declare function checkDestinations(files: string[], overwrite: boolean, flags?: boolean): Promise<void>;
|
|
32
|
+
/** Write each file through a temporary sibling and a rename, so no partial output is ever published under its final name. */
|
|
33
|
+
declare function writeFiles(files: PlannedFile[], overwrite: boolean, flags?: boolean): Promise<void>;
|
|
34
|
+
declare function pointerOf(location: string): string;
|
|
35
|
+
|
|
36
|
+
interface PreparedFonts {
|
|
37
|
+
/** The fonts handle of opf-render `loadFonts()`: passed as `{ fonts }` to every deck-level call. */
|
|
38
|
+
handle: FontsHandle;
|
|
39
|
+
/** Absolute paths of the --font-dir files, in load order. */
|
|
40
|
+
userFonts: string[];
|
|
41
|
+
}
|
|
42
|
+
/** Font files directly inside each directory (no recursion), sorted by name so the load order is the same everywhere. */
|
|
43
|
+
declare function listFontDirectories(directories: string[], label?: string): Promise<string[]>;
|
|
44
|
+
/**
|
|
45
|
+
* The office pack (Carlito, Intos, the open families font schemes select and the open replacements the font policy
|
|
46
|
+
* routes to, with lazy faces loaded on demand), visual substitution, and Noto script packages for the scripts the
|
|
47
|
+
* deck's text draws when they are installed. `faces` are the --font-dir files, loaded first.
|
|
48
|
+
*/
|
|
49
|
+
declare function prepareFonts(renderer: Renderer, presentation: unknown, userFonts: string[], reporter: Reporter, embedScriptFonts?: boolean): Promise<PreparedFonts>;
|
|
50
|
+
/** A fonts handle lent to one export. `release` returns it; until then no other export uses the shared handle. */
|
|
51
|
+
interface FontsLease {
|
|
52
|
+
handle: FontsHandle;
|
|
53
|
+
release(): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The default fonts handle of this process, prepared once (the office pack plus `userFonts`, keyed by that file list and
|
|
57
|
+
* `embedScriptFonts`) and lent to one export at a time, so the substitutions it records are the export's own. It is lent
|
|
58
|
+
* only for a deck that draws no script beyond Latin, Greek and Cyrillic and needs no glyph-fallback face: for such a deck
|
|
59
|
+
* a handle prepared for it and the shared one hold the same faces, so the bytes are the same. Any other deck, or a
|
|
60
|
+
* renderer without `autoScriptSelection`, gets undefined and the caller prepares a handle of its own (`prepareFonts`).
|
|
61
|
+
*/
|
|
62
|
+
declare function leaseSharedFonts(renderer: Renderer, presentation: unknown, userFonts: string[], reporter: Reporter, embedScriptFonts?: boolean): Promise<FontsLease | undefined>;
|
|
63
|
+
/**
|
|
64
|
+
* Faces an SVG should carry. Marking every face `embed: "used"` makes the renderer embed a face only when the slide's
|
|
65
|
+
* text names its family, so a slide in one family ships kilobytes of font rather than the whole pack.
|
|
66
|
+
*/
|
|
67
|
+
declare function embeddedFor(handle: FontsHandle, mode: "used" | "none"): (EmbeddedFace & {
|
|
68
|
+
embed?: "used";
|
|
69
|
+
})[];
|
|
70
|
+
|
|
71
|
+
interface ImportRun {
|
|
72
|
+
/** The imported presentation, undefined when `fromPptx` threw (the reporter then holds the error finding). */
|
|
73
|
+
presentation?: Record<string, unknown>;
|
|
74
|
+
/** With `signals`: the raw per-shape layout and style signals of the file. */
|
|
75
|
+
signals?: {
|
|
76
|
+
version?: number;
|
|
77
|
+
};
|
|
78
|
+
failure?: {
|
|
79
|
+
code: string;
|
|
80
|
+
message: string;
|
|
81
|
+
};
|
|
82
|
+
pptx: Peer<PptxModule>;
|
|
83
|
+
}
|
|
84
|
+
/** Read a PowerPoint file. Diagnostics (and the error finding of a failure) are added to `reporter`. Throws an `OPFApiError` when opf-pptx is missing or too old. */
|
|
85
|
+
declare function runImport(bytes: Uint8Array, options: {
|
|
86
|
+
signals?: boolean;
|
|
87
|
+
}, reporter: Reporter, loaded?: Peer<PptxModule>): Promise<ImportRun>;
|
|
88
|
+
|
|
89
|
+
declare function createZip(entries: {
|
|
90
|
+
name: string;
|
|
91
|
+
bytes: Uint8Array;
|
|
92
|
+
}[]): Uint8Array;
|
|
93
|
+
|
|
94
|
+
export { FontsHandle, type ImportRun, Peer, type PlannedFile, PptxModule, Renderer, Reporter, checkDestinations, createZip, deckStem, embeddedFor, leaseSharedFonts, listFontDirectories, parseSlideSelection, pointerOf, prepareFonts, runImport, stemOf, writeFiles };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { EXPORT_FORMATS, OPFApiError, OPFExportError, OPFImportError, PEER_RANGES, PPTX_PACKAGE, RENDER_PACKAGE, Reporter, VERSIONS, asApiError, checkDate, checkDestinations, checkOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, missingPeerFrom, parseSlideSelection, planConversion, pointerOf, prepareExport, prepareFonts, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-IPW5BS3X.js';
|
|
2
|
+
import './chunk-WWYWFVOI.js';
|
|
3
|
+
import './chunk-HXHOZ7AH.js';
|
|
4
|
+
import './chunk-O263APNI.js';
|
|
5
|
+
import './chunk-WCG3THTD.js';
|
|
6
|
+
export { readDeckReport } from './chunk-N4EVOFEA.js';
|
|
7
|
+
import './chunk-BIC3SWPK.js';
|
|
8
|
+
import './chunk-TCD2FB2K.js';
|
|
9
|
+
import './chunk-IS5H5JKH.js';
|
|
10
|
+
import './chunk-M4UR3NPN.js';
|
|
11
|
+
import './chunk-O3CVNJTL.js';
|
|
12
|
+
import './chunk-YT7FMQER.js';
|
|
13
|
+
import './chunk-O2CX5NEH.js';
|
|
14
|
+
import './chunk-ESRYBYLY.js';
|
|
15
|
+
import './chunk-PPROJP2E.js';
|
|
16
|
+
import './chunk-NLNYNBTS.js';
|
|
17
|
+
import './chunk-CW7GEAV3.js';
|
|
18
|
+
import './chunk-TRDXRRQK.js';
|
|
19
|
+
import './chunk-SPFV27O5.js';
|
|
20
|
+
import './chunk-RA64UQKI.js';
|
|
21
|
+
import './chunk-WXSPETQ6.js';
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export { SchemaEntry, SchemaName, audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './schemas.js';
|
|
2
|
+
export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, validate, validateCatalogRecord, validationRules } from './validator.js';
|
|
3
|
+
export { B as BuiltinVariableInfo, C as Contract, D as DEFAULT_VARIABLE_DATE_FORMAT, O as OPFVariableError, R as ResolveVariablesOptions, a as ResolveVariablesResult, V as VARIABLE_KINDS, b as ValidateFonts, c as ValidateOptions, d as ValidationCategory, e as ValidationChecks, f as ValidationReport, g as ValidationRuleCost, h as ValidationRuleInfo, i as ValidationThresholds, j as VariableDeclaration, k as VariableDiagnostic, l as VariableDiagnosticCode, m as VariableDiagnosticSeverity, n as VariableInfo, o as VariableKind, p as VariableUse, q as VariableUseForm, r as VariableValues, s as coerceVariableValue, t as formatVariableNumber, u as hasContentVariables, v as isTemplate, w as listBuiltinVariables, x as listVariables, y as resolveVariables, z as validationCategories, A as variableDeclarations } from './validation-types-iZbXfES6.js';
|
|
4
|
+
export { CatalogPatchOperation, CatalogRecordChange, CatalogRef, CatalogUpdate, CopiedRecordRename, CopySlidesResult, DatasetFact, EmbedResult, EmbeddedRecord, HeaderFooterFact, MoveToCustomErrorCode, MoveToCustomPatchOperation, MoveToCustomResult, MovedRecord, OPFMoveToCustomError, PresentationStats, ReferenceFact, ResolvedDesignRecords, SLIDE_SCOPED_BUILTINS, SlideScopedBuiltin, SlideSizeFact, SlideStats, StatsOptions, StatsSlideRef, TableFact, copySlides, embed, moveToCustom, resolveDesignRecords, resolveFontScheme, resolveSlideVariables, sameRecord, stats, updateFromCatalog } from './index.js';
|
|
5
|
+
export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
|
|
6
|
+
import { P as Presentation } from './presentation-fb8CZmRq.js';
|
|
7
|
+
export { Audience, ChartType, ColorScheme, FontScheme, Language, Layout, Narrative, Purpose, SocialPlatform, Theme, Tone } from './types.js';
|
|
8
|
+
export { C as CATALOG_GROUP_PATTERN, a as CATALOG_REFERENCE_PATTERN, b as Catalog, c as CatalogKind, d as CatalogOptions, e as CatalogRecordMap, f as CatalogRecords, g as CatalogReferenceSite, O as OPFCatalogsOptionError, h as OPFUnresolvedReferenceError, R as RecordProvenance, i as ResolvedReference, U as UnresolvedReferenceDiagnostic, j as catalogGroupSource, k as catalogKinds, l as catalogRecords, m as catalogReferenceSites, p as parseReference, r as resolveReference, u as unresolvedReference } from './catalog-refs-C4K4y-vh.js';
|
|
9
|
+
export { F as Finding, a as FindingCategory, b as FindingFix, c as FindingFocus, d as FindingLocation, e as FindingReport, f as FindingSeverity, g as FindingSuggestion, J as JsonPatchOperation, V as ValidationIssue } from './finding-CDQ_wH8j.js';
|
|
10
|
+
export { C as CHART_TYPES, a as ComposeSlideOptions, E as ENGINE_DEFAULT_CHART_TYPES, b as ENGINE_DEFAULT_COLOR_SCHEME, c as ENGINE_DEFAULT_FONT_SCHEME, d as ENGINE_DEFAULT_THEME, F as FontFamilies, e as Fonts, L as LANGUAGES, f as LanguageFamilyName, g as LanguageVocabulary, h as LayoutDiagnostic, M as MeasureTextWidth, S as SOCIAL_PLATFORMS, i as SocialPlatformVocabulary, T as TextMeasurement, j as TextStyle, n as normalizeLanguageFamily } from './composition-BbZ_9C-c.js';
|
|
11
|
+
export { C as CatalogDisplayKind, a as CatalogRecordKind, c as catalogDisplayKinds, b as catalogSchemaNames } from './catalog-schemas-g7RFQBdc.js';
|
|
12
|
+
export { O as OPFPaginationError, P as PaginatedPage, a as PaginationMapping, b as PaginationOptions, c as PaginationResult, d as PresentationPaginationOptions, e as PresentationPaginationResult, S as SlideContext, f as SlideContextDiagnostic, g as SlideContextOptions, p as paginate, h as paginateSlide, r as resolveSlideContext } from './pagination-BhX4M48Y.js';
|
|
13
|
+
export { ApplyPatchOptions, OPFPatchError, OPFPatchValidationError, PatchResult, applyPatch } from './patch.js';
|
|
14
|
+
export { DiffOptions, MergeConflict, MergeOptions, MergeResult, PresentationDiff, diff, merge } from './diff.js';
|
|
15
|
+
export { FormatOptions, OPFFormatError, format } from './format.js';
|
|
16
|
+
export { FromMarkdownOptions, FromMarkdownResult, OPFMarkdownError, ToMarkdownOptions, ToMarkdownResult, fromMarkdown, toMarkdown } from './markdown.js';
|
|
17
|
+
export { StringifyOptions, parse, stringify } from './deck.js';
|
|
18
|
+
export { DataCell, DataImportOptions, ImportDataOptions, ImportedChart, ImportedChartData, ImportedChartType, ImportedTable, OPFDataImportError, TabularData, importData, parseTabularData } from './data.js';
|
|
19
|
+
export { C as ChartComboSeries, a as ChartMapping, b as ChartNumberFix, c as ChartNumberFixOperation, d as ChartNumberFixOptions, D as DataCellValue, e as DataColumn, f as DataDiagnostic, g as DataDiagnosticCode, h as DataResolveOptions, i as DataSourceRef, j as DataStyledCell, k as DataTableCell, l as DataTableHeader, m as DataTableValue, n as DataTextRun, o as Dataset, p as DatasetRef, R as ResolvedChartData, q as ResolvedTableData, r as chartNumber, s as datasetDiagnostics, t as formatDataNumber, u as fromExcelNumberFormat, v as inlineChartData, w as inlineDatasets, x as inlineTableData, y as isDatasetRef, z as isXYChartType, A as numberFormatError, B as resolveChartData, E as resolveTableData, F as suggestChartNumberFix, G as tableCellDisplayValue, H as toExcelNumberFormat, I as unusedDatasets } from './chart-data-DTxdRRT1.js';
|
|
20
|
+
export { FONT_POLICY, FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './font-policy.js';
|
|
21
|
+
import { C as ConvertInput, a as ConvertOptions, b as ConvertResult, c as ConvertFormat, O as OpenOptions, S as SaveOptions, d as SaveResult } from './conversion-SBpTOwdg.js';
|
|
22
|
+
export { e as ConvertedFile, E as ExportFormat, F as FontsHandle, f as OPFApiError, g as OPFExportError, h as OPFImportError } from './conversion-SBpTOwdg.js';
|
|
23
|
+
export { defaultCatalog } from './catalog.js';
|
|
24
|
+
export { D as DECK_FORMATS, a as DeckFormat, P as ParseOptions, d as deckFormatOf } from './deck-report-Bx3naFlF.js';
|
|
25
|
+
import './json-BFSdESOE.js';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Convert a file, a deck or the bytes of a `.pptx` file. With an `output` path the format comes from its extension and the
|
|
29
|
+
* files are written: `.pdf`, `.pptx`, `.png` and `.svg` are exported (one PNG or SVG per slide, `slides/deck.png` giving
|
|
30
|
+
* `slides/deck-001.png`, ...; one selected slide is written to `output` itself), `.zip` is one archive of the slides (`format`
|
|
31
|
+
* `png`, the default, or `svg`), and `.opf.md`, `.yaml`/`.yml` or `.json` writes the deck in that form. Without an output path,
|
|
32
|
+
* pass `{ format }`: nothing is written and the files come back with their names and bytes.
|
|
33
|
+
*
|
|
34
|
+
* A `.pptx` input is imported first. Local images resolve next to the input file unless `assetDir` says otherwise; URLs are
|
|
35
|
+
* never fetched. Everything is produced before anything is written, and each file is written atomically, replacing an existing
|
|
36
|
+
* output (`overwrite: false` refuses one with `output-exists`, as the commands do without `--force`). Throws `OPFApiError` for the request and the files (`invalid-option`, `input-not-found`,
|
|
37
|
+
* `input-unreadable`, `invalid-presentation`, `output-exists`, `output-not-file`, `output-unwritable`), `OPFImportError` for the
|
|
38
|
+
* import step and `OPFExportError` for the export step (`peer-not-installed`, `peer-too-old`, `peer-load-failed`,
|
|
39
|
+
* `invalid-presentation`, `no-slides`, `all-slides-hidden`, `export-failed`, `import-failed`).
|
|
40
|
+
*/
|
|
41
|
+
declare function convert(input: ConvertInput, output: string, options?: ConvertOptions): Promise<ConvertResult>;
|
|
42
|
+
declare function convert(input: ConvertInput, options: ConvertOptions & {
|
|
43
|
+
format: ConvertFormat;
|
|
44
|
+
}): Promise<ConvertResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Open a deck: a `.opf.md`, `.yaml`/`.yml` or `.json` file (the form named by the extension), or a PowerPoint file (a `.pptx`
|
|
47
|
+
* path or its bytes), imported. Returns the presentation. A deck file that fails the format and references check throws
|
|
48
|
+
* `OPFValidationError` (its findings located by line and column in the file); a PowerPoint file that cannot be imported throws
|
|
49
|
+
* `OPFImportError`; a missing file throws `OPFApiError` `input-not-found`. Warnings are not returned: `validate` reports them,
|
|
50
|
+
* and `convert("deck.pptx", "deck.opf.yaml")` returns what an import could not keep.
|
|
51
|
+
*/
|
|
52
|
+
declare function open(input: string | Uint8Array | ArrayBuffer, options?: OpenOptions): Promise<Presentation>;
|
|
53
|
+
/**
|
|
54
|
+
* Save a deck in the form its file name names (`.opf.md`, `.yaml`/`.yml` or `.json`), atomically, creating folders, replacing
|
|
55
|
+
* the file. It is checked for format and references first and an invalid deck is refused with `OPFValidationError`;
|
|
56
|
+
* `validate: false` writes work in progress, as an editor's autosave does. Returns `{ path, format }`.
|
|
57
|
+
*/
|
|
58
|
+
declare function save(deck: Presentation, path: string, options?: SaveOptions): Promise<SaveResult>;
|
|
59
|
+
|
|
60
|
+
export { ConvertFormat, ConvertInput, ConvertOptions, ConvertResult, OpenOptions, Presentation, SaveOptions, SaveResult, convert, open, save };
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { convertFiles, OPFApiError, openDeck, saveDeck, asApiError } from './chunk-IPW5BS3X.js';
|
|
2
|
+
export { OPFApiError, OPFExportError, OPFImportError } from './chunk-IPW5BS3X.js';
|
|
3
|
+
export { OPFMoveToCustomError, copySlides, embed, moveToCustom, sameRecord, stats, updateFromCatalog } from './chunk-WWYWFVOI.js';
|
|
4
|
+
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-HXHOZ7AH.js';
|
|
5
|
+
export { OPFDataImportError, importData, parseTabularData } from './chunk-O263APNI.js';
|
|
6
|
+
export { defaultCatalog } from './chunk-WCG3THTD.js';
|
|
7
|
+
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-N4EVOFEA.js';
|
|
8
|
+
export { fromMarkdown, toMarkdown } from './chunk-BIC3SWPK.js';
|
|
9
|
+
import './chunk-TCD2FB2K.js';
|
|
10
|
+
export { OPFMarkdownError } from './chunk-IS5H5JKH.js';
|
|
11
|
+
export { diff, merge } from './chunk-M4UR3NPN.js';
|
|
12
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-O3CVNJTL.js';
|
|
13
|
+
export { OPFFormatError, format } from './chunk-YT7FMQER.js';
|
|
14
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-O2CX5NEH.js';
|
|
15
|
+
import './chunk-ESRYBYLY.js';
|
|
16
|
+
import './chunk-PPROJP2E.js';
|
|
17
|
+
import { OPFValidationError } from './chunk-NLNYNBTS.js';
|
|
18
|
+
export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-NLNYNBTS.js';
|
|
19
|
+
export { CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unusedDatasets, variableDeclarations } from './chunk-CW7GEAV3.js';
|
|
20
|
+
export { catalogDisplayKinds, catalogSchemaNames } from './chunk-TRDXRRQK.js';
|
|
21
|
+
export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, OPFCatalogsOptionError, OPFUnresolvedReferenceError, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, parseReference, resolveReference, unresolvedReference } from './chunk-SPFV27O5.js';
|
|
22
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-RA64UQKI.js';
|
|
23
|
+
export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-WXSPETQ6.js';
|
|
24
|
+
|
|
25
|
+
// src/node.ts
|
|
26
|
+
var rethrow = (error, fallback) => {
|
|
27
|
+
if (error instanceof OPFValidationError) throw error;
|
|
28
|
+
throw asApiError(OPFApiError, error, fallback);
|
|
29
|
+
};
|
|
30
|
+
async function convert(input, output, options = {}) {
|
|
31
|
+
try {
|
|
32
|
+
if (output !== null && typeof output === "object") return await convertFiles(input, void 0, output);
|
|
33
|
+
if (typeof output !== "string") throw new OPFApiError("convert takes an output file path, or options with a format.", "invalid-option");
|
|
34
|
+
return await convertFiles(input, output, options);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return rethrow(error, "convert-failed");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function open(input, options = {}) {
|
|
40
|
+
try {
|
|
41
|
+
return await openDeck(input, options);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
return rethrow(error, "input-unreadable");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function save(deck, path, options = {}) {
|
|
47
|
+
try {
|
|
48
|
+
return await saveDeck(deck, path, options);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
return rethrow(error, "output-unwritable");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { convert, open, save };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { U as UnresolvedReferenceDiagnostic, R as RecordProvenance,
|
|
1
|
+
import { a as ComposeSlideOptions, e as Fonts, h as LayoutDiagnostic } from './composition-BbZ_9C-c.js';
|
|
2
|
+
import { U as UnresolvedReferenceDiagnostic, R as RecordProvenance, d as CatalogOptions, b as Catalog } from './catalog-refs-C4K4y-vh.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* One slide's composition context: the layout, canvas, theme and font families that `composeSlide` needs,
|
|
@@ -15,7 +15,7 @@ interface SlideContextOptions extends CatalogOptions {
|
|
|
15
15
|
fonts?: Fonts;
|
|
16
16
|
/** One-based displayed slide number. Default: index + 1. */
|
|
17
17
|
slideNumber?: number;
|
|
18
|
-
/** Displayed slide count for `{
|
|
18
|
+
/** Displayed slide count for `{{deck.slideCount}}`. Default: the deck's slide count. */
|
|
19
19
|
slideCount?: number;
|
|
20
20
|
/** Host-supplied current calendar date (ISO YYYY-MM-DD) for `date: true` header/footer fields. */
|
|
21
21
|
date?: string;
|
|
@@ -23,6 +23,13 @@ interface SlideContextOptions extends CatalogOptions {
|
|
|
23
23
|
strictReferences?: boolean;
|
|
24
24
|
}
|
|
25
25
|
interface SlideContext {
|
|
26
|
+
/**
|
|
27
|
+
* The slide to compose and draw: slide `index` with `{{slide.number}}`, `{{slide.section}}` and
|
|
28
|
+
* `{{deck.slideCount}}` substituted (`resolveSlideVariables`) for `options.slideNumber` and `options.slideCount`.
|
|
29
|
+
* Its own header and footer text keeps the tokens: `layoutFurniture` substitutes them and marks each slide number
|
|
30
|
+
* as a live field. The source slide object itself when it carries no slide-scoped token.
|
|
31
|
+
*/
|
|
32
|
+
slide: Rec;
|
|
26
33
|
/** Ready for `composeSlide(slide, options)`. */
|
|
27
34
|
options: ComposeSlideOptions;
|
|
28
35
|
diagnostics: SlideContextDiagnostic[];
|
|
@@ -49,16 +56,23 @@ interface SlideContext {
|
|
|
49
56
|
};
|
|
50
57
|
}
|
|
51
58
|
/**
|
|
52
|
-
* Resolve slide `index` of `presentation` into the options `composeSlide` takes
|
|
53
|
-
*
|
|
54
|
-
*
|
|
59
|
+
* Resolve slide `index` of `presentation` into the slide and the options `composeSlide` takes: engines compose and draw
|
|
60
|
+
* `composeSlide(context.slide, context.options)`, so the slide-scoped built-ins carry the same number and count as the
|
|
61
|
+
* header and footer. Never throws for an unresolved reference unless `strictReferences` is set: the engine default (or
|
|
62
|
+
* automatic composition, for a layout) applies and `diagnostics` holds one `unresolved-reference` per reference. Throws a RangeError for an index outside the deck or
|
|
55
63
|
* non-positive canvas dimensions, which a schema-valid deck cannot have.
|
|
56
64
|
*/
|
|
57
65
|
declare function resolveSlideContext(presentation: unknown, index: number, options?: SlideContextOptions): SlideContext;
|
|
58
66
|
|
|
59
67
|
interface PaginationOptions extends Omit<ComposeSlideOptions, 'textMeasurement'> {
|
|
60
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* The fonts handle: page breaks are chosen with its `textMeasurement`. Without it core uses its portable estimate. With
|
|
70
|
+
* `presentation`, a measurement that plans scripts (`forScripts`) measures each script run in the slide's script fonts,
|
|
71
|
+
* as the engines do.
|
|
72
|
+
*/
|
|
61
73
|
fonts?: Fonts;
|
|
74
|
+
/** Registered catalogs, for resolving the slide's script fonts when `presentation` is given. `paginate` passes its own. */
|
|
75
|
+
catalogs?: readonly Catalog[];
|
|
62
76
|
/** Readability floor used while choosing page breaks. Default 24 reference pixels. */
|
|
63
77
|
minFontSize?: number;
|
|
64
78
|
/** All-or-nothing resource limit. Defaults to 100 output slides. */
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './composition-
|
|
2
|
-
import './catalog-refs-
|
|
3
|
-
export { O as OPFPaginationError, P as PaginatedPage, a as PaginationMapping, b as PaginationOptions, c as PaginationResult, d as PresentationPaginationOptions, e as PresentationPaginationResult, p as paginate, h as paginateSlide } from './pagination-
|
|
4
|
-
import './chart-data-
|
|
1
|
+
import './composition-BbZ_9C-c.js';
|
|
2
|
+
import './catalog-refs-C4K4y-vh.js';
|
|
3
|
+
export { O as OPFPaginationError, P as PaginatedPage, a as PaginationMapping, b as PaginationOptions, c as PaginationResult, d as PresentationPaginationOptions, e as PresentationPaginationResult, p as paginate, h as paginateSlide } from './pagination-BhX4M48Y.js';
|
|
4
|
+
import './chart-data-DTxdRRT1.js';
|
package/dist/pagination.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { OPFPaginationError, paginate, paginateSlide } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-O2CX5NEH.js';
|
|
2
|
+
import './chunk-NLNYNBTS.js';
|
|
3
|
+
import './chunk-CW7GEAV3.js';
|
|
4
4
|
import './chunk-TRDXRRQK.js';
|
|
5
5
|
import './chunk-SPFV27O5.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-RA64UQKI.js';
|
package/dist/patch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as FindingReport, F as Finding, J as JsonPatchOperation } from './finding-CDQ_wH8j.js';
|
|
2
2
|
|
|
3
3
|
type JsonPointer = string;
|
|
4
4
|
type PatchErrorCode = "invalid-patch" | "invalid-patch-operation" | "unsupported-patch-operation" | "invalid-json-pointer" | "patch-path-missing" | "patch-parent-missing" | "invalid-array-index" | "patch-test-failed" | "patch-invalid-move" | "patch-root-remove" | "patch-invalid-document";
|
package/dist/patch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { OPFPatchError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-O3CVNJTL.js';
|
|
2
|
+
import './chunk-NLNYNBTS.js';
|
|
3
|
+
import './chunk-CW7GEAV3.js';
|
|
4
4
|
import './chunk-TRDXRRQK.js';
|
|
5
5
|
import './chunk-SPFV27O5.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-RA64UQKI.js';
|