@openpresentation/opf 0.16.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/browser.js +38 -0
- package/dist/{catalog-refs-_anZs-Qz.d.ts → catalog-refs-BSfGELpt.d.ts} +1 -1
- package/dist/{catalog-schemas-BZCjgAxu.d.ts → catalog-schemas-CinPh5WA.d.ts} +1 -1
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +3 -23712
- package/dist/{chunk-BSYQDWT4.js → chunk-64YSJZDH.js} +28 -15
- package/dist/{chunk-WEDGVC5W.js → chunk-6WW2EDUW.js} +108 -108
- package/dist/{chunk-5UEUAW57.js → chunk-CJPDTLGD.js} +1 -1
- package/dist/{chunk-FQSIIADJ.js → chunk-DBYZI75U.js} +30 -5
- package/dist/{chunk-PX5AWL7Y.js → chunk-JT3QXA22.js} +99 -29
- package/dist/{chunk-6OR326EA.js → chunk-JXVS7BJK.js} +1 -1
- package/dist/chunk-KXBZ6ZSB.js +991 -0
- package/dist/{chunk-5PDN7BN6.js → chunk-MBU42S5Y.js} +427 -167
- package/dist/{chunk-K4DQQIT4.js → chunk-NS3VYB57.js} +5 -5
- package/dist/chunk-QLFWWHRF.js +919 -0
- package/dist/{chunk-5TO6I3GB.js → chunk-RAKEVM52.js} +1 -1
- package/dist/{chunk-NAWQR7MN.js → chunk-VCGRMNY2.js} +1 -1
- package/dist/chunk-WCG3THTD.js +23712 -0
- package/dist/{chunk-UM24JFUE.js → chunk-YWXB4XAT.js} +2 -2
- package/dist/{chunk-3XDRQYWZ.js → chunk-YZXTXX2D.js} +1 -1
- package/dist/{chunk-SMLMI6IZ.js → chunk-ZCFSDSUX.js} +3 -3
- package/dist/{chunk-KINQFU6X.js → chunk-ZOHFLP3O.js} +19 -12
- package/dist/{composition-D4ADF5c-.d.ts → composition-C-OoqvAr.d.ts} +227 -167
- package/dist/composition.d.ts +2 -2
- package/dist/composition.js +1 -1
- package/dist/conversion-C5foedh6.d.ts +502 -0
- package/dist/conversion-KGDVJM75.js +21 -0
- package/dist/convert.d.ts +3 -3
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +6 -6
- package/dist/data.js +2 -2
- package/dist/deck-report-wszX7uo8.d.ts +40 -0
- package/dist/deck.d.ts +21 -51
- package/dist/deck.js +10 -10
- package/dist/diff.js +5 -5
- package/dist/docs.js +33 -27
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +418 -451
- package/dist/format.js +2 -2
- package/dist/index.d.ts +179 -16
- package/dist/index.js +51 -796
- package/dist/markdown.d.ts +10 -6
- package/dist/markdown.js +7 -7
- package/dist/node-engine.d.ts +114 -0
- package/dist/node-engine.js +44 -0
- package/dist/{pagination-DzZPFheM.d.ts → pagination-BaUjDrTz.d.ts} +25 -8
- package/dist/pagination.d.ts +3 -3
- package/dist/pagination.js +4 -4
- package/dist/patch.js +4 -4
- package/dist/{presentation-COrFuj2g.d.ts → presentation-HondgJ3l.d.ts} +278 -454
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.d.ts +4 -2
- package/dist/schemas.js +1 -1
- package/dist/spec/catalogs/manifest.json +1 -1
- package/dist/spec/schemas/opf.schema.json +74 -100
- package/dist/types.d.ts +2 -2
- package/dist/{validation-types-HxIgJfKx.d.ts → validation-types-PbGDrNUr.d.ts} +23 -7
- package/dist/validator.d.ts +6 -6
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +4 -4
- package/dist/yaml.js +7 -7
- package/package.json +37 -2
package/dist/markdown.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as Presentation } from './presentation-
|
|
1
|
+
import { a as Catalog } from './catalog-refs-BSfGELpt.js';
|
|
2
|
+
import { P as Presentation } from './presentation-HondgJ3l.js';
|
|
3
3
|
import { a as Finding, b as FindingLocation } from './finding-CT_f_vbD.js';
|
|
4
|
-
import {
|
|
5
|
-
import './composition-
|
|
4
|
+
import { a as ValidateOptions, V as ValidationReport } from './validation-types-PbGDrNUr.js';
|
|
5
|
+
import './composition-C-OoqvAr.js';
|
|
6
6
|
import './chart-data-BnNqgnC-.js';
|
|
7
7
|
import './json-BFSdESOE.js';
|
|
8
8
|
|
|
@@ -20,8 +20,12 @@ declare class OPFMarkdownError extends Error {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface ParseOptions {
|
|
23
|
-
/**
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* How the Markdown is cut into slides. `auto` (the default): by `---` lines, and an outline (no `---` line, and two or more `# `
|
|
25
|
+
* headings outside fences, comments and notes) by its headings. `rules`: by `---` lines only, so a second `# ` heading on a slide is a second title.
|
|
26
|
+
* `headings`: a `# ` heading also starts a new slide (outline input).
|
|
27
|
+
*/
|
|
28
|
+
split?: "auto" | "rules" | "headings";
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/**
|
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-DBYZI75U.js';
|
|
2
|
+
export { OPFMarkdownError } from './chunk-CJPDTLGD.js';
|
|
3
|
+
import './chunk-VCGRMNY2.js';
|
|
4
|
+
import './chunk-RAKEVM52.js';
|
|
5
|
+
import './chunk-JT3QXA22.js';
|
|
6
|
+
import './chunk-MBU42S5Y.js';
|
|
7
7
|
import './chunk-TRDXRRQK.js';
|
|
8
8
|
import './chunk-SPFV27O5.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-6WW2EDUW.js';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-wszX7uo8.js';
|
|
2
|
+
import { F as FontsHandle, E as EmbeddedFace, R as Renderer, a as Reporter, P as Peer, b as PptxModule, O as OPFApiError } from './conversion-C5foedh6.js';
|
|
3
|
+
export { C as ConversionPlan, D as Diagnostic, c as EXPORT_FORMATS, d as EXPORT_TEXT, e as ExportContext, f as ExportFile, g as ExportFontSummary, h as ExportFormat, i as ExportOptions, j as ExportResult, k as ExportRun, l as ExportText, I as ImportOptions, m as ImportResult, n as OPFExportError, o as OPFImportError, p as PEER_RANGES, q as PPTX_PACKAGE, r as PreparedExport, s as RENDER_EXTRAS, t as RENDER_PACKAGE, u as ReportFinding, v as ResolvedExportOptions, S as SlideSelection, w as Source, V as VERSIONS, x as asApiError, y as checkDate, z as checkOptions, A as checkRenamedOptions, B as checkScale, G as deckFileFormat, H as exportFormatOf, J as finishReport, K as importPresentation, L as loadPptx, M as loadRenderer, N as locatePackage, Q as missingPeerFrom, T as parseSlideSelection, 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-C5foedh6.js';
|
|
4
|
+
import { a as Catalog } from './catalog-refs-BSfGELpt.js';
|
|
5
|
+
import { P as PresentationPaginationResult } from './pagination-BaUjDrTz.js';
|
|
6
|
+
import './presentation-HondgJ3l.js';
|
|
7
|
+
import './validation-types-PbGDrNUr.js';
|
|
8
|
+
import './composition-C-OoqvAr.js';
|
|
9
|
+
import './chart-data-BnNqgnC-.js';
|
|
10
|
+
import './finding-CT_f_vbD.js';
|
|
11
|
+
import './json-BFSdESOE.js';
|
|
12
|
+
|
|
13
|
+
/** `deck.opf.json` and `deck.pptx` both give `deck`; stdin gives `deck`. */
|
|
14
|
+
declare function stemOf(input: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* The base name of render and export output files: the deck's `filename` (a trailing .pptx, .pdf, .png or .svg is dropped, any
|
|
17
|
+
* case), else the slugified `name`, else the input file's stem. The same rule opf-editor names its downloads by. Characters a file
|
|
18
|
+
* system rejects are replaced, so the name is safe to write.
|
|
19
|
+
*/
|
|
20
|
+
declare function deckStem(deck: unknown, input: string): string;
|
|
21
|
+
interface PlannedFile {
|
|
22
|
+
file: string;
|
|
23
|
+
bytes: Uint8Array;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fail before writing anything when a destination exists (the commands without --force; `convert` with `overwrite: false`), is a symlink or is
|
|
27
|
+
* not a regular file: `output-exists` and `output-not-file`, which the commands report at exit 1. `flags` false words the
|
|
28
|
+
* message for the library API.
|
|
29
|
+
*/
|
|
30
|
+
declare function checkDestinations(files: string[], overwrite: boolean, flags?: boolean): Promise<void>;
|
|
31
|
+
/** Write each file through a temporary sibling and a rename, so no partial output is ever published under its final name. */
|
|
32
|
+
declare function writeFiles(files: PlannedFile[], overwrite: boolean, flags?: boolean): Promise<void>;
|
|
33
|
+
declare function pointerOf(location: string): string;
|
|
34
|
+
|
|
35
|
+
interface PreparedFonts {
|
|
36
|
+
/** The fonts handle of opf-render `loadFonts()`: passed as `{ fonts }` to every deck-level call. */
|
|
37
|
+
handle: FontsHandle;
|
|
38
|
+
/** Absolute paths of the --fonts files, in load order. */
|
|
39
|
+
userFonts: string[];
|
|
40
|
+
}
|
|
41
|
+
/** Font files directly inside each directory (no recursion), sorted by name so the load order is the same everywhere. */
|
|
42
|
+
declare function listFontDirectories(directories: string[], label?: string): Promise<string[]>;
|
|
43
|
+
/**
|
|
44
|
+
* The office pack (Carlito, Intos, the open families font schemes select and the open replacements the font policy
|
|
45
|
+
* routes to, with lazy faces loaded on demand), visual substitution, and Noto script packages for the scripts the
|
|
46
|
+
* deck's text draws when they are installed. `faces` are the --fonts files, loaded first.
|
|
47
|
+
*/
|
|
48
|
+
declare function prepareFonts(renderer: Renderer, presentation: unknown, userFonts: string[], reporter: Reporter, embedScriptFonts?: boolean): Promise<PreparedFonts>;
|
|
49
|
+
/** A fonts handle lent to one export. `release` returns it; until then no other export uses the shared handle. */
|
|
50
|
+
interface FontsLease {
|
|
51
|
+
handle: FontsHandle;
|
|
52
|
+
release(): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The default fonts handle of this process, prepared once (the office pack plus `userFonts`, keyed by that file list and
|
|
56
|
+
* `embedScriptFonts`) and lent to one export at a time, so the substitutions it records are the export's own. It is lent
|
|
57
|
+
* only for a deck that draws no script beyond Latin, Greek and Cyrillic and needs no glyph-fallback face: for such a deck
|
|
58
|
+
* a handle prepared for it and the shared one hold the same faces, so the bytes are the same. Any other deck, or a
|
|
59
|
+
* renderer without `autoScriptSelection`, gets undefined and the caller prepares a handle of its own (`prepareFonts`).
|
|
60
|
+
*/
|
|
61
|
+
declare function leaseSharedFonts(renderer: Renderer, presentation: unknown, userFonts: string[], reporter: Reporter, embedScriptFonts?: boolean): Promise<FontsLease | undefined>;
|
|
62
|
+
/**
|
|
63
|
+
* Faces an SVG should carry for `text`. `"fonts"` (the default) marks every face `embed: "used"`, so the renderer embeds a face only
|
|
64
|
+
* when the slide's text names its family and a slide in one family ships kilobytes of font rather than the whole pack. `"system"`
|
|
65
|
+
* embeds none, and `"paths"` draws the text as outlines from the fonts handle itself, so it has no faces to list.
|
|
66
|
+
*/
|
|
67
|
+
declare function embeddedFor(handle: FontsHandle, text?: "fonts" | "system" | "paths"): (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
|
+
interface PaginateDeckOptions {
|
|
95
|
+
/** Folders of `.ttf` and `.otf` files, loaded before the bundled pack (as `--fonts`). They need opf-render. */
|
|
96
|
+
fontFolders?: readonly string[];
|
|
97
|
+
catalogs?: readonly Catalog[];
|
|
98
|
+
/** Receives the font diagnostics. */
|
|
99
|
+
reporter: Reporter;
|
|
100
|
+
/** Name options as the command's flags in messages. */
|
|
101
|
+
flags?: boolean;
|
|
102
|
+
}
|
|
103
|
+
interface PaginatedDeck {
|
|
104
|
+
result: PresentationPaginationResult;
|
|
105
|
+
/** Why the layout is estimated: the missing or too old peer (`peer-not-installed`, `peer-too-old`) that measuring needs. */
|
|
106
|
+
estimated?: OPFApiError;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Paginate with measured text when opf-render and its fonts load, else with core's estimate (and `estimated` saying why). With
|
|
110
|
+
* `fontFolders` the fonts are required, so a missing renderer throws. Throws `OPFPaginationError` when content cannot fit.
|
|
111
|
+
*/
|
|
112
|
+
declare function paginateDeck(deck: unknown, options: PaginateDeckOptions): Promise<PaginatedDeck>;
|
|
113
|
+
|
|
114
|
+
export { FontsHandle, type ImportRun, OPFApiError, type PaginateDeckOptions, type PaginatedDeck, Peer, type PlannedFile, PptxModule, Renderer, Reporter, checkDestinations, createZip, deckStem, embeddedFor, leaseSharedFonts, listFontDirectories, paginateDeck, pointerOf, prepareFonts, runImport, stemOf, writeFiles };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DEFAULT_CATALOGS, loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts } from './chunk-KXBZ6ZSB.js';
|
|
2
|
+
export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, checkDate, checkDestinations, checkOptions, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, locatePackage, missingPeerFrom, planConversion, pointerOf, prepareExport, prepareFonts, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-KXBZ6ZSB.js';
|
|
3
|
+
import { OPFApiError } from './chunk-QLFWWHRF.js';
|
|
4
|
+
export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-QLFWWHRF.js';
|
|
5
|
+
import './chunk-HXHOZ7AH.js';
|
|
6
|
+
import './chunk-ZCFSDSUX.js';
|
|
7
|
+
import './chunk-WCG3THTD.js';
|
|
8
|
+
export { readDeckReport } from './chunk-ZOHFLP3O.js';
|
|
9
|
+
import './chunk-DBYZI75U.js';
|
|
10
|
+
import './chunk-NS3VYB57.js';
|
|
11
|
+
import './chunk-CJPDTLGD.js';
|
|
12
|
+
import './chunk-YWXB4XAT.js';
|
|
13
|
+
import './chunk-YZXTXX2D.js';
|
|
14
|
+
import './chunk-JXVS7BJK.js';
|
|
15
|
+
import { paginate } from './chunk-64YSJZDH.js';
|
|
16
|
+
import './chunk-VCGRMNY2.js';
|
|
17
|
+
import './chunk-RAKEVM52.js';
|
|
18
|
+
import './chunk-JT3QXA22.js';
|
|
19
|
+
import './chunk-MBU42S5Y.js';
|
|
20
|
+
import './chunk-TRDXRRQK.js';
|
|
21
|
+
import './chunk-SPFV27O5.js';
|
|
22
|
+
import './chunk-6WW2EDUW.js';
|
|
23
|
+
import './chunk-WXSPETQ6.js';
|
|
24
|
+
|
|
25
|
+
// src/node/paginate.ts
|
|
26
|
+
async function paginateDeck(deck, options) {
|
|
27
|
+
const catalogs = options.catalogs ?? DEFAULT_CATALOGS;
|
|
28
|
+
const folders = options.fontFolders ?? [];
|
|
29
|
+
let lease;
|
|
30
|
+
try {
|
|
31
|
+
const renderer = await loadRenderer();
|
|
32
|
+
const userFonts = await listFontDirectories([...folders], options.flags ? "--fonts" : "fonts");
|
|
33
|
+
lease = await leaseSharedFonts(renderer, deck, userFonts, options.reporter);
|
|
34
|
+
const handle = lease?.handle ?? (await prepareFonts(renderer, deck, userFonts, options.reporter)).handle;
|
|
35
|
+
return { result: paginate(deck, { fonts: handle, catalogs }) };
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if (error instanceof OPFApiError && (error.code === "peer-not-installed" || error.code === "peer-too-old") && !folders.length) return { result: paginate(deck, { catalogs }), estimated: error };
|
|
38
|
+
throw error;
|
|
39
|
+
} finally {
|
|
40
|
+
lease?.release();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { paginateDeck };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ComposeSlideOptions, F as Fonts, L as LayoutDiagnostic } from './composition-
|
|
2
|
-
import { U as UnresolvedReferenceDiagnostic, R as RecordProvenance, b as CatalogOptions } from './catalog-refs-
|
|
1
|
+
import { C as ComposeSlideOptions, F as Fonts, L as LayoutDiagnostic } from './composition-C-OoqvAr.js';
|
|
2
|
+
import { U as UnresolvedReferenceDiagnostic, R as RecordProvenance, b as CatalogOptions, a as Catalog } from './catalog-refs-BSfGELpt.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,14 @@ 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`, and its
|
|
29
|
+
* logo references (`var:organization.logo.icon` in an image field) resolved for `options.darkBackground`.
|
|
30
|
+
* Its own header and footer text keeps the tokens: `layoutFurniture` substitutes them and marks each slide number
|
|
31
|
+
* as a live field. The source slide object itself when it carries no slide-scoped token.
|
|
32
|
+
*/
|
|
33
|
+
slide: Rec;
|
|
26
34
|
/** Ready for `composeSlide(slide, options)`. */
|
|
27
35
|
options: ComposeSlideOptions;
|
|
28
36
|
diagnostics: SlideContextDiagnostic[];
|
|
@@ -49,16 +57,23 @@ interface SlideContext {
|
|
|
49
57
|
};
|
|
50
58
|
}
|
|
51
59
|
/**
|
|
52
|
-
* Resolve slide `index` of `presentation` into the options `composeSlide` takes
|
|
53
|
-
*
|
|
54
|
-
*
|
|
60
|
+
* Resolve slide `index` of `presentation` into the slide and the options `composeSlide` takes: engines compose and draw
|
|
61
|
+
* `composeSlide(context.slide, context.options)`, so the slide-scoped built-ins carry the same number and count as the
|
|
62
|
+
* header and footer. Never throws for an unresolved reference unless `strictReferences` is set: the engine default (or
|
|
63
|
+
* 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
64
|
* non-positive canvas dimensions, which a schema-valid deck cannot have.
|
|
56
65
|
*/
|
|
57
66
|
declare function resolveSlideContext(presentation: unknown, index: number, options?: SlideContextOptions): SlideContext;
|
|
58
67
|
|
|
59
68
|
interface PaginationOptions extends Omit<ComposeSlideOptions, 'textMeasurement'> {
|
|
60
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* The fonts handle: page breaks are chosen with its `textMeasurement`. Without it core uses its portable estimate. With
|
|
71
|
+
* `presentation`, a measurement that plans scripts (`forScripts`) measures each script run in the slide's script fonts,
|
|
72
|
+
* as the engines do.
|
|
73
|
+
*/
|
|
61
74
|
fonts?: Fonts;
|
|
75
|
+
/** Registered catalogs, for resolving the slide's script fonts when `presentation` is given. `paginate` passes its own. */
|
|
76
|
+
catalogs?: readonly Catalog[];
|
|
62
77
|
/** Readability floor used while choosing page breaks. Default 24 reference pixels. */
|
|
63
78
|
minFontSize?: number;
|
|
64
79
|
/** All-or-nothing resource limit. Defaults to 100 output slides. */
|
|
@@ -112,8 +127,10 @@ interface PresentationPaginationResult {
|
|
|
112
127
|
pages: (PaginatedPage & {
|
|
113
128
|
sourceSlideIndex: number;
|
|
114
129
|
})[];
|
|
130
|
+
/** How the page breaks were chosen: `measured` with the `fonts` handle's text measurement, `estimated` with core's portable estimate (no `fonts`). */
|
|
131
|
+
layout: 'measured' | 'estimated';
|
|
115
132
|
}
|
|
116
133
|
/** Resolve the slides' references (the document's catalogs groups, then the registered catalogs) and paginate a complete presentation without mutating it. */
|
|
117
134
|
declare function paginate(input: unknown, options?: PresentationPaginationOptions): PresentationPaginationResult;
|
|
118
135
|
|
|
119
|
-
export { OPFPaginationError as O, type
|
|
136
|
+
export { OPFPaginationError as O, type PresentationPaginationResult as P, type SlideContext as S, type PaginatedPage as a, type PresentationPaginationOptions as b, type PaginationMapping as c, type PaginationOptions as d, type PaginationResult as e, type SlideContextDiagnostic as f, type SlideContextOptions as g, paginateSlide as h, paginate as p, resolveSlideContext as r };
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './composition-
|
|
2
|
-
import './catalog-refs-
|
|
3
|
-
export { O as OPFPaginationError,
|
|
1
|
+
import './composition-C-OoqvAr.js';
|
|
2
|
+
import './catalog-refs-BSfGELpt.js';
|
|
3
|
+
export { O as OPFPaginationError, a as PaginatedPage, c as PaginationMapping, d as PaginationOptions, e as PaginationResult, b as PresentationPaginationOptions, P as PresentationPaginationResult, p as paginate, h as paginateSlide } from './pagination-BaUjDrTz.js';
|
|
4
4
|
import './chart-data-BnNqgnC-.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-64YSJZDH.js';
|
|
2
|
+
import './chunk-JT3QXA22.js';
|
|
3
|
+
import './chunk-MBU42S5Y.js';
|
|
4
4
|
import './chunk-TRDXRRQK.js';
|
|
5
5
|
import './chunk-SPFV27O5.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-6WW2EDUW.js';
|
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-YZXTXX2D.js';
|
|
2
|
+
import './chunk-JT3QXA22.js';
|
|
3
|
+
import './chunk-MBU42S5Y.js';
|
|
4
4
|
import './chunk-TRDXRRQK.js';
|
|
5
5
|
import './chunk-SPFV27O5.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-6WW2EDUW.js';
|