@openpresentation/opf 0.11.4 → 0.12.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.
Files changed (74) hide show
  1. package/README.md +16 -0
  2. package/dist/audit.d.ts +156 -0
  3. package/dist/audit.js +7 -0
  4. package/dist/{catalogs-CUClB3nl.d.ts → catalogs-BnI7JKcn.d.ts} +3 -3
  5. package/dist/catalogs.d.ts +2 -2
  6. package/dist/catalogs.js +2 -1
  7. package/dist/{chunk-KJKASEPE.js → chunk-4LAM3N6S.js} +753 -42
  8. package/dist/chunk-6LZK2IZB.js +1690 -0
  9. package/dist/{chunk-NSVVQ52O.js → chunk-AUM5MXBR.js} +8 -6
  10. package/dist/{chunk-AEUSVEUY.js → chunk-E34DJ5LL.js} +50 -14
  11. package/dist/chunk-FYLJVF7X.js +18448 -0
  12. package/dist/{chunk-HJL64ETN.js → chunk-GJKJL4YY.js} +14 -0
  13. package/dist/{chunk-3H2U7FDR.js → chunk-HOBSL7AJ.js} +1867 -247
  14. package/dist/chunk-JKVKYVWL.js +1332 -0
  15. package/dist/{chunk-3OJN7QAW.js → chunk-MWPMJE6P.js} +18 -4
  16. package/dist/chunk-RUC7L5DJ.js +261 -0
  17. package/dist/chunk-S5W34SIJ.js +1 -0
  18. package/dist/chunk-V2537ENL.js +198 -0
  19. package/dist/{chunk-RXNFDGPC.js → chunk-WXSPETQ6.js} +311 -40
  20. package/dist/{composition-Dl-d9FRj.d.ts → composition-DWbCiMwF.d.ts} +559 -10
  21. package/dist/composition.d.ts +1 -1
  22. package/dist/composition.js +2 -1
  23. package/dist/convert.d.ts +261 -0
  24. package/dist/convert.js +1107 -0
  25. package/dist/diff.d.ts +145 -0
  26. package/dist/diff.js +604 -0
  27. package/dist/docs.js +72 -18
  28. package/dist/examples.d.ts +1 -1
  29. package/dist/examples.js +112 -112
  30. package/dist/font-policy.d.ts +15 -0
  31. package/dist/font-policy.js +1 -1
  32. package/dist/format.d.ts +20 -0
  33. package/dist/format.js +83 -0
  34. package/dist/index.d.ts +173 -24
  35. package/dist/index.js +926 -262
  36. package/dist/lint.d.ts +4 -4
  37. package/dist/lint.js +6 -5
  38. package/dist/markdown.d.ts +74 -0
  39. package/dist/markdown.js +1941 -0
  40. package/dist/pagination.d.ts +1 -1
  41. package/dist/pagination.js +6 -5
  42. package/dist/patch.d.ts +99 -0
  43. package/dist/patch.js +6 -0
  44. package/dist/{presentation-j5PVrqfV.d.ts → presentation-DcF-MZcz.d.ts} +452 -17
  45. package/dist/repo-readme.js +1 -1
  46. package/dist/{schemas-X_NniU4A.d.ts → schemas-BSjlG8-R.d.ts} +28 -0
  47. package/dist/schemas.d.ts +1 -1
  48. package/dist/schemas.js +1 -1
  49. package/dist/spec/catalogs/audiences/customers.json +5 -1
  50. package/dist/spec/catalogs/audiences/executives.json +5 -1
  51. package/dist/spec/catalogs/audiences/index.json +20 -8
  52. package/dist/spec/catalogs/audiences/investors.json +5 -1
  53. package/dist/spec/catalogs/audiences/marketing-team.json +5 -1
  54. package/dist/spec/catalogs/audiences/regulators.json +5 -1
  55. package/dist/spec/catalogs/audiences/sales-team.json +5 -1
  56. package/dist/spec/catalogs/manifest.json +2 -2
  57. package/dist/spec/reference/engine-defaults.json +1 -1
  58. package/dist/spec/reference/font-policy.json +311 -40
  59. package/dist/spec/reference/font-policy.schema.json +40 -0
  60. package/dist/spec/reference/symbol-font-encodings.json +18354 -0
  61. package/dist/spec/reference/symbol-font-encodings.schema.json +156 -0
  62. package/dist/spec/schemas/audience.schema.json +7 -7
  63. package/dist/spec/schemas/narrative.schema.json +1 -1
  64. package/dist/spec/schemas/opf.schema.json +597 -28
  65. package/dist/spec-files.d.ts +1 -1
  66. package/dist/spec-files.js +1 -1
  67. package/dist/symbol-font-encodings.d.ts +128 -0
  68. package/dist/symbol-font-encodings.js +1 -0
  69. package/dist/types.d.ts +4 -4
  70. package/dist/validator-DfG9yxba.d.ts +172 -0
  71. package/dist/validator.d.ts +4 -36
  72. package/dist/validator.js +5 -4
  73. package/package.json +32 -3
  74. package/dist/chunk-FDCWQHWO.js +0 -1366
@@ -1 +1 @@
1
- export { a as CodeContent, b as CodeLayout, c as CodeLayoutDiagnostic, d as CodeLayoutOptions, e as CodeLineSegment, f as CodeLineSource, g as CodeTextFit, h as CodeTextPart, C as ComposeSlideOptions, i as ComposedFlow, j as ComposedGroup, k as ComposedItem, l as ComposedLogo, m as ComposedSlideImage, n as Composition, o as CompositionCandidate, p as CompositionDecision, q as CompositionExplanation, r as CompositionPenalties, s as CompositionTrack, D as DEFAULT_FONT_SCHEME, t as DEFAULT_FURNITURE_DATE_FORMAT, u as DEFAULT_SLIDE_NUMBER_FORMAT, aV as FontFaceSelection, v as FontFamilies, F as FontSchemeDiagnostic, w as FurnitureField, x as FurnitureImagePart, y as FurnitureLayout, z as FurniturePart, A as FurniturePartBase, B as FurnitureSocialLink, E as FurnitureTextExtras, G as FurnitureTextPart, H as LayoutBox, L as LayoutDiagnostic, I as ListBulletImage, J as ListEntryLayout, K as ListFit, M as ListFitOptions, N as ListText, O as ListValue, P as LogoSlot, Q as MAX_COMPOSITION_DEPTH, R as MeasureTextWidth, S as MetricContent, U as MetricLayout, V as MetricLayoutDiagnostic, W as MetricLayoutOptions, X as MetricTextPart, Y as MetricTextSource, Z as OPFCompositionError, _ as PICTURE_BULLET_SCALE, $ as QuoteContent, a0 as QuoteLayout, a1 as QuoteLayoutDiagnostic, a2 as QuoteLayoutOptions, a3 as QuoteTextPart, a4 as QuoteTextSource, a7 as ResolveLogoOptions, a8 as ResolvedFontScheme, a9 as ResolvedLogo, aa as RichTextFit, ab as RichTextFragment, ac as RichTextLine, ad as RichTextOptions, ae as RichTextRun, af as SlideComposition, ag as SlideImageShape, ah as SocialPlatformRecord, ai as SocialProfile, aW as SourceTextFit, aX as TableBorder, aY as TableCellLayout, aZ as TableCellStyle, a_ as TableGrid, a$ as TableGridCell, b0 as TableGridIssue, b1 as TableLayout, b2 as TableLayoutOptions, b3 as TableRowLayout, aj as TextFit, ak as TextLineInk, b4 as TextLineSegment, b5 as TextLineSource, T as TextMeasurement, al as TextPlacement, am as TextPlacementLine, an as TextStyle, ao as TimelineContent, ap as TimelineEvent, aq as TimelineLayout, ar as TimelineLayoutDiagnostic, as as TimelineLayoutOptions, at as TimelineTextPart, au as chartColorForFill, av as colorContrast, aw as composeSlide, ax as fitList, ay as fitRichText, az as fitText, aA as formatFurnitureDate, aB as formatSlideNumber, aC as layoutCode, aD as layoutFurniture, aE as layoutMetric, aF as layoutQuote, b6 as layoutTable, aG as layoutTimeline, aH as measureText, aI as measureTextOutline, aK as placeTextLines, aL as resolveCanvasDimensions, aN as resolveFontFamilies, aO as resolveFontSchemeReference, aP as resolveLogo, aQ as resolveSocialProfile, aR as resolveTextStyle, b7 as slideImageShape, b8 as tableGrid, b9 as tableRowBoundaries, aS as textColorForFill, aT as textWidthMeasurer, aU as wrapText } from './composition-Dl-d9FRj.js';
1
+ export { A as AnnotatedRun, a as AnnotationFitter, b as AnnotationLayoutOptions, c as CAPTIONABLE_FIELDS, d as CAPTION_FONT_RATIO, e as CAPTION_MAX_RATIO, f as CHART_SERIES_MIN_DIFFERENCE, g as CHART_SERIES_MIN_LIGHTNESS_STEP, h as CITATION_MARKER_RAISE, i as CITATION_MARKER_SCALE, j as Caption, k as CaptionAlignment, l as CaptionObject, m as CaptionPosition, n as CaptionSettings, o as ChartLabelContent, p as ChartLabelPosition, q as ChartLegendPosition, r as ChartOptionDiagnostic, s as ChartOptionKind, t as ChartOptionSupport, u as ChartOptionTarget, v as CitationMarker, w as CitationNote, x as CodeContent, y as CodeLayout, z as CodeLayoutDiagnostic, B as CodeLayoutOptions, D as CodeLineSegment, E as CodeLineSource, G as CodeTextFit, H as CodeTextPart, C as ComposeSlideOptions, I as ComposedCaption, J as ComposedFlow, K as ComposedFootnoteEntry, N as ComposedFootnotes, O as ComposedGroup, P as ComposedItem, Q as ComposedLogo, R as ComposedSlideImage, S as Composition, U as CompositionCandidate, V as CompositionDecision, W as CompositionExplanation, X as CompositionPenalties, Y as CompositionTrack, Z as DEFAULT_CHART_LABEL_SEPARATOR, _ as DEFAULT_FONT_SCHEME, $ as DEFAULT_FURNITURE_DATE_FORMAT, a0 as DEFAULT_SLIDE_NUMBER_FORMAT, a1 as DeckCitations, a2 as FONT_SIZE_GRID_PER_PX, a3 as FOOTNOTE_MAX_RATIO, c7 as FontFaceSelection, a4 as FontFamilies, F as FontSchemeDiagnostic, a5 as FootnoteLayoutOptions, a6 as FurnitureField, a7 as FurnitureImagePart, a8 as FurnitureLayout, a9 as FurniturePart, aa as FurniturePartBase, ab as FurnitureSocialLink, ac as FurnitureTextExtras, ad as FurnitureTextPart, ae as LayoutBox, L as LayoutDiagnostic, af as ListBulletImage, ag as ListEntryLayout, ah as ListFit, ai as ListFitOptions, aj as ListNumber, ak as ListText, al as ListValue, am as LogoSlot, an as MAX_COMPOSITION_DEPTH, ao as MAX_NUMBERING_LEVELS, ap as MAX_NUMBERING_VALUE, aq as MAX_ROMAN_VALUE, ar as MeasureTextWidth, as as MetricContent, M as MetricLayout, at as MetricLayoutDiagnostic, au as MetricLayoutOptions, av as MetricTextPart, aw as MetricTextSource, ax as NUMBERING_STYLES, ay as NUMBERING_SUFFIXES, az as Numbering, aA as NumberingInput, aB as NumberingStyleName, aC as NumberingSuffix, aD as OPFCompositionError, aE as PICTURE_BULLET_SCALE, aF as PhysicalAlignment, aG as QuoteContent, aH as QuoteLayout, aI as QuoteLayoutDiagnostic, aJ as QuoteLayoutOptions, aK as QuoteTextPart, aL as QuoteTextSource, c8 as ReadingBox, aM as Reference, aN as ReferencesSlideOptions, aQ as ResolveLogoOptions, aR as ResolvedChartDataLabels, aS as ResolvedChartOptions, aT as ResolvedFontScheme, aU as ResolvedLogo, aV as ResolvedNumbering, aW as RichText, aX as RichTextFit, aY as RichTextFragment, aZ as RichTextLine, a_ as RichTextOptions, a$ as RichTextRun, b0 as SlideCitations, b1 as SlideComposition, b2 as SlideImageShape, b3 as SocialPlatformRecord, b4 as SocialProfile, c9 as SourceTextFit, ca as TableBorder, cb as TableCellLayout, cc as TableCellStyle, cd as TableGrid, ce as TableGridCell, cf as TableGridIssue, cg as TableLayout, ch as TableLayoutOptions, ci as TableRowLayout, b5 as TextDirection, b6 as TextFit, b7 as TextLineInk, cj as TextLineSegment, ck as TextLineSource, T as TextMeasurement, b8 as TextPlacement, b9 as TextPlacementLine, ba as TextStyle, bb as TimelineContent, bc as TimelineEvent, bd as TimelineLayout, be as TimelineLayoutDiagnostic, bf as TimelineLayoutOptions, bg as TimelineTextPart, bh as annotationText, bi as captionSettings, bj as chartColorForFill, bk as chartLabelText, bl as chartOptionSupport, bm as chartOptionTarget, bn as chartPaletteForFill, bo as citationMarkerText, bp as collectCitations, bq as colorContrast, br as composeSlide, bs as fitList, bt as fitRichText, bu as fitText, bv as formatChartLabelNumber, bw as formatChartLabelPercent, bx as formatFurnitureDate, by as formatListNumber, bz as formatSlideNumber, bA as layoutCaption, bB as layoutCode, bC as layoutFootnotes, bD as layoutFurniture, bE as layoutMetric, bF as layoutQuote, cl as layoutTable, bG as layoutTimeline, bH as listNumbers, bI as measureText, bJ as measureTextOutline, bL as numberingAtLevel, bM as numberingStyleDraws, bN as paragraphDirection, bO as paragraphDirectionAt, bP as physicalAlignment, bQ as placeTextLines, bR as referencesSlide, bS as resolveCanvasDimensions, bT as resolveChartOptions, bV as resolveFontFamilies, bW as resolveFontSchemeReference, bX as resolveLogo, bY as resolveNumbering, bZ as resolveSocialProfile, b_ as resolveTextStyle, b$ as sliceNumberedItems, c0 as slideCitations, cm as slideImageShape, c1 as snapFontSizeDown, c2 as snapFontSizeUp, cn as tableGrid, co as tableRowBoundaries, c3 as textColorForFill, c4 as textWidthMeasurer, cp as visualReadingOrder, c5 as walkCitationRuns, c6 as wrapText } from './composition-DWbCiMwF.js';
@@ -1 +1,2 @@
1
- export { DEFAULT_FONT_SCHEME, DEFAULT_FURNITURE_DATE_FORMAT, DEFAULT_SLIDE_NUMBER_FORMAT, MAX_COMPOSITION_DEPTH, OPFCompositionError, PICTURE_BULLET_SCALE, chartColorForFill, colorContrast, composeSlide, fitList, fitRichText, fitText, formatFurnitureDate, formatSlideNumber, layoutCode, layoutFurniture, layoutMetric, layoutQuote, layoutTable, layoutTimeline, measureText, measureTextOutline, placeTextLines, resolveCanvasDimensions, resolveFontFamilies, resolveFontSchemeReference, resolveLogo, resolveSocialProfile, resolveTextStyle, slideImageShape, tableGrid, tableRowBoundaries, textColorForFill, textWidthMeasurer, wrapText } from './chunk-3H2U7FDR.js';
1
+ export { CAPTIONABLE_FIELDS, CAPTION_FONT_RATIO, CAPTION_MAX_RATIO, CHART_SERIES_MIN_DIFFERENCE, CHART_SERIES_MIN_LIGHTNESS_STEP, CITATION_MARKER_RAISE, CITATION_MARKER_SCALE, DEFAULT_CHART_LABEL_SEPARATOR, DEFAULT_FONT_SCHEME, DEFAULT_FURNITURE_DATE_FORMAT, DEFAULT_SLIDE_NUMBER_FORMAT, FONT_SIZE_GRID_PER_PX, FOOTNOTE_MAX_RATIO, MAX_COMPOSITION_DEPTH, MAX_NUMBERING_LEVELS, MAX_NUMBERING_VALUE, MAX_ROMAN_VALUE, NUMBERING_STYLES, NUMBERING_SUFFIXES, OPFCompositionError, PICTURE_BULLET_SCALE, annotationText, captionSettings, chartColorForFill, chartLabelText, chartOptionSupport, chartOptionTarget, chartPaletteForFill, citationMarkerText, collectCitations, colorContrast, composeSlide, fitList, fitRichText, fitText, formatChartLabelNumber, formatChartLabelPercent, formatFurnitureDate, formatListNumber, formatSlideNumber, layoutCaption, layoutCode, layoutFootnotes, layoutFurniture, layoutMetric, layoutQuote, layoutTable, layoutTimeline, listNumbers, measureText, measureTextOutline, numberingAtLevel, numberingStyleDraws, paragraphDirection, paragraphDirectionAt, physicalAlignment, placeTextLines, referencesSlide, resolveCanvasDimensions, resolveChartOptions, resolveFontFamilies, resolveFontSchemeReference, resolveLogo, resolveNumbering, resolveSocialProfile, resolveTextStyle, sliceNumberedItems, slideCitations, slideImageShape, snapFontSizeDown, snapFontSizeUp, tableGrid, tableRowBoundaries, textColorForFill, textWidthMeasurer, visualReadingOrder, walkCitationRuns, wrapText } from './chunk-HOBSL7AJ.js';
2
+ import './chunk-E34DJ5LL.js';
@@ -0,0 +1,261 @@
1
+ import { PaginatedPage, PresentationPaginationOptions } from './pagination.js';
2
+ import './composition-DWbCiMwF.js';
3
+
4
+ type Json = any;
5
+ type Obj = Record<string, any>;
6
+ /**
7
+ * Raised when a conversion is refused. `code` is `not-convertible` when the pair or the content has no
8
+ * safe mapping (the message says why and what to change) and `invalid-output` when the result would not
9
+ * validate as OPF (a bug in a converter or an input outside the supported shapes).
10
+ */
11
+ declare class OPFConversionError extends Error {
12
+ readonly code: "not-convertible" | "invalid-output";
13
+ readonly details: Record<string, unknown>;
14
+ constructor(code: "not-convertible" | "invalid-output", message: string, details?: Record<string, unknown>);
15
+ }
16
+ /** What every conversion reports: nothing is lost when `lossless` is true, otherwise `loss` names what is not carried over. */
17
+ interface ConversionReport {
18
+ /** True when everything in the source is carried over (formatting, structure and metadata included). */
19
+ lossless: boolean;
20
+ /** Human-readable names of what the result cannot carry, for example `text formatting` or `list nesting levels`. Empty when lossless. */
21
+ loss: string[];
22
+ }
23
+
24
+ interface TableOptions {
25
+ /** Timeline and metrics to table: write the column headings (default true). A table without headings cannot be read back by role. */
26
+ headings?: boolean;
27
+ /** Table to timeline: the column index of each role, overriding the heading names. */
28
+ columns?: {
29
+ when?: number;
30
+ what?: number;
31
+ description?: number;
32
+ };
33
+ /** Text to table: the cell delimiter when the text is not a tab or pipe table, for example "," or ";". */
34
+ delimiter?: string;
35
+ /** Text to table with tabs or a delimiter: read the first row as the column headings. Pipe tables use their separator row. */
36
+ header?: boolean;
37
+ }
38
+
39
+ type ContentKind = "text" | "list" | "quote" | "metric" | "code" | "timeline" | "chart" | "table" | "image" | "video" | "group" | "metrics";
40
+ /** Display label of every content kind. `metrics` is the target "a group of metric blocks". */
41
+ declare const CONTENT_KIND_LABELS: Readonly<Record<ContentKind, string>>;
42
+ /**
43
+ * The conversion matrix: source kind to the kinds it converts to. A conversion never invents content; what
44
+ * the target cannot carry is reported. `group` is a group whose blocks are all metrics; `metrics` is that
45
+ * group as a target.
46
+ */
47
+ declare const CONTENT_CONVERSIONS: Readonly<Record<string, readonly ContentKind[]>>;
48
+ interface ConvertOptions extends TableOptions {
49
+ /** Text to timeline: also read `label: text` with any short label as the date (default: only date-like labels). */
50
+ looseWhen?: boolean;
51
+ /** Code to text: `auto` (default) writes a fenced block when the code has a language or file name so nothing is lost; `never` writes the bare source and reports the loss. */
52
+ fences?: "auto" | "never";
53
+ }
54
+ interface ContentInfo {
55
+ /** The content field (`items` and `bullets` are both "list"; a group holds `blocks`). */
56
+ key: string;
57
+ kind: ContentKind;
58
+ content: Json;
59
+ }
60
+ /**
61
+ * The single content payload of an object (a block or a slide or region holding one content field), or
62
+ * undefined when it holds none or several. A payload with `blocks` is a `group`.
63
+ */
64
+ declare function readContent(payload: unknown): ContentInfo | undefined;
65
+ interface ConvertedContent extends ConversionReport {
66
+ /** The new payload: the old one with its content field replaced (its `id`, `extensions` and any slide fields are kept). */
67
+ payload: Obj;
68
+ from: ContentKind;
69
+ to: ContentKind;
70
+ /** The content field the payload now holds (`blocks` for a group of metrics). */
71
+ key: string;
72
+ /** False when the payload already has the requested kind (then `payload` is a copy of the input). */
73
+ changed: boolean;
74
+ }
75
+ /**
76
+ * Convert the content of one payload to another kind. The payload is a block (`{ text }`), a slide or region
77
+ * that holds one content field, or a group of metric blocks (`{ blocks: [{ metric }, ...] }`, to `table`).
78
+ * Throws `OPFConversionError` (`not-convertible`) for a pair without a mapping or content that does not fit,
79
+ * with a message that says why. The result is validated as OPF.
80
+ */
81
+ declare function convertContent(payload: unknown, to: ContentKind, options?: ConvertOptions): ConvertedContent;
82
+ interface ContentConversionTarget extends ConversionReport {
83
+ kind: ContentKind;
84
+ label: string;
85
+ /** False when the content does not fit this target; `reason` says why. */
86
+ available: boolean;
87
+ reason?: string;
88
+ }
89
+ /**
90
+ * The kinds the payload can convert to, each with whether the conversion keeps everything (`lossless`),
91
+ * what it cannot carry (`loss`), or why it is unavailable (`available: false`). Returns [] for a payload
92
+ * with no convertible content (an image, a video, a group that is not a set of metrics, several fields).
93
+ */
94
+ declare function contentConversionTargets(payload: unknown, options?: ConvertOptions): ContentConversionTarget[];
95
+
96
+ interface ListLevelOptions {
97
+ /** Move the items nested under each selected item with it (default true), so a subtree keeps its shape. */
98
+ withChildren?: boolean;
99
+ }
100
+ interface ListLevelChange extends ConversionReport {
101
+ /** The list payload with the new levels. */
102
+ payload: Obj;
103
+ /** False when nothing could move; `reason` says why. */
104
+ changed: boolean;
105
+ reason?: string;
106
+ /** The nesting level of every item after the change. */
107
+ levels: number[];
108
+ }
109
+ /**
110
+ * Raise (`delta` > 0, "demote", Tab) or lower (`delta` < 0, "promote", Shift+Tab) the nesting level of the
111
+ * items at `indices`. A level never exceeds one more than the item before it and never goes below 0, so the
112
+ * outline stays valid; the first item cannot be nested. Items under a selected item move with it unless
113
+ * `withChildren` is false. Nothing in the text changes, so the change is lossless.
114
+ */
115
+ declare function shiftListLevels(payload: unknown, indices: number[], delta: number, options?: ListLevelOptions): ListLevelChange;
116
+ /** Nest the items one level deeper (the Tab key in a list). See `shiftListLevels`. */
117
+ declare const demoteListItems: (payload: unknown, indices: number[], options?: ListLevelOptions) => ListLevelChange;
118
+ /** Move the items one level up (Shift+Tab). See `shiftListLevels`. */
119
+ declare const promoteListItems: (payload: unknown, indices: number[], options?: ListLevelOptions) => ListLevelChange;
120
+ interface ListFormChange extends ConversionReport {
121
+ payload: Obj;
122
+ changed: boolean;
123
+ }
124
+ /**
125
+ * Switch a list between the `items` form (ListItem: text, description, level) and the `bullets` form
126
+ * (BulletItem: text and level, which infers a text slide). Item descriptions have no place in bullets and are
127
+ * reported as lost.
128
+ */
129
+ declare function convertListForm(payload: unknown, to: "items" | "bullets"): ListFormChange;
130
+
131
+ /** A path inside one slide: `["blocks", 1]` is its second block, `["left"]` the payload of its `left` region, `[]` the slide itself. */
132
+ type SlidePath = (string | number)[];
133
+ interface StructureChange extends ConversionReport {
134
+ /** The slide after the change. */
135
+ slide: Obj;
136
+ changed: boolean;
137
+ /** Where the affected block now is (the new group, the first unwrapped child, the moved image block). */
138
+ path?: SlidePath;
139
+ }
140
+ /**
141
+ * Wrap the blocks at `indices` of a container (the slide by default, or a group or region group named by
142
+ * `container`) in a new group placed where the first of them was. The blocks keep their order; the group
143
+ * takes the optional `composition`. Nothing is lost.
144
+ */
145
+ declare function wrapBlocks(slide: unknown, indices: number[], options?: {
146
+ container?: SlidePath;
147
+ composition?: Obj;
148
+ }): StructureChange;
149
+ /**
150
+ * Replace the group at `path` (a group inside a `blocks` array) by its blocks. The group's own `composition`,
151
+ * `id` and `extensions` cannot be kept and are reported.
152
+ */
153
+ declare function unwrapGroup(slide: unknown, path: SlidePath): StructureChange;
154
+ /**
155
+ * Move every block of a slide into its own named region. `regions[i]` is the region key of block i (`left`,
156
+ * `right`, `top:left`, ...); every block needs a distinct region and the regions may not overlap, because a
157
+ * slide cannot hold both `blocks` and regions. Nothing is lost.
158
+ */
159
+ declare function blocksToRegions(slide: unknown, regions: string[]): StructureChange;
160
+ /**
161
+ * Turn the named regions of a slide into ordinary blocks, in reading order (top to bottom, left to right).
162
+ * The position each region gave its content cannot be kept and is reported.
163
+ */
164
+ declare function regionsToBlocks(slide: unknown): StructureChange;
165
+ /** Move the content of region `from` to region `to`, or swap the two when `to` is taken and `swap` is true. */
166
+ declare function moveRegion(slide: unknown, from: string, to: string, options?: {
167
+ swap?: boolean;
168
+ }): StructureChange;
169
+ /** The design slot an image can move to or from. */
170
+ type ImageTarget = "slideImage" | "background" | "watermark";
171
+ declare const IMAGE_POSITIONS: readonly ["background", "top", "bottom", "left", "right"];
172
+ interface PromoteImageOptions {
173
+ /** Slide image: where it sits (default `right`, an image band beside the content). Ignored for background and watermark. */
174
+ position?: (typeof IMAGE_POSITIONS)[number];
175
+ /** Watermark: opacity from 0 to 1 (default 0.1). */
176
+ opacity?: number;
177
+ /** Replace the slide's existing design value for this slot instead of refusing. */
178
+ replace?: boolean;
179
+ }
180
+ /**
181
+ * Move the image block at `path` out of the content and into the slide's design as its slide image,
182
+ * background or watermark. The block is removed (and any group it leaves empty). Alt text, titles and other
183
+ * asset details a design slot cannot hold are reported. Refuses when the slide already sets that slot,
184
+ * unless `replace` is true.
185
+ */
186
+ declare function promoteImage(slide: unknown, path: SlidePath, to: ImageTarget, options?: PromoteImageOptions): StructureChange;
187
+ /**
188
+ * Move a slide's slide image, background image or watermark back into its content as an image block, added
189
+ * after the existing blocks (or at `index`, or in the free region named by `region` on a slide that uses
190
+ * regions). Placement, framing, fit and opacity cannot be kept by a block and are reported.
191
+ */
192
+ declare function demoteImage(slide: unknown, from: ImageTarget, options?: {
193
+ index?: number;
194
+ region?: string;
195
+ }): StructureChange;
196
+
197
+ interface SlideEdit extends ConversionReport {
198
+ /** The presentation after the change. */
199
+ presentation: Obj;
200
+ /** The slides that replace `range`. */
201
+ slides: Obj[];
202
+ /** The slides of the old presentation that were replaced: `deleteCount` slides from `start`. */
203
+ range: {
204
+ start: number;
205
+ deleteCount: number;
206
+ };
207
+ /** False when the slide already fits or nothing needed to change (then `slides` is the original). */
208
+ changed: boolean;
209
+ }
210
+ interface SplitSlideOptions {
211
+ /** Block indexes where a new slide starts, for example `[2]` puts blocks 0 and 1 on the first slide and the rest on the second. */
212
+ at?: number[];
213
+ /** One block per slide (alternative to `at`). */
214
+ each?: boolean;
215
+ /** Repeat the title, subtitle and tag on every new slide (default true, the way pagination repeats headings). */
216
+ repeatHeadings?: boolean;
217
+ }
218
+ /**
219
+ * Split one slide into several by its blocks. The slide's design, layout, composition, section and other slide
220
+ * fields are copied to each part, its first part keeps its `id` and notes, later parts get ids ending `--2`,
221
+ * `--3`, ... that no other slide uses, and every block (with its own id) moves to exactly one part. A slide that
222
+ * uses named regions is split region by region and loses the regions' placement (reported).
223
+ */
224
+ declare function splitSlide(presentation: unknown, slideIndex: number, options?: SplitSlideOptions): SlideEdit;
225
+ interface SplitOverflowResult extends SlideEdit {
226
+ /** The pagination mapping of the new slides, with paths for the returned presentation; pass it to `unpaginate` to undo the split. */
227
+ pages: (PaginatedPage & {
228
+ sourceSlideIndex: number;
229
+ })[];
230
+ }
231
+ /**
232
+ * Split a slide that does not fit into continuation slides with the existing pagination (`paginatePresentation`):
233
+ * text, lists, tables and timelines break at item or sentence boundaries, headings are repeated and nothing is
234
+ * dropped. The slide is paginated on its own, as slide 1 of 1, with the host's `options` (fonts, text
235
+ * measurement); a slide that already fits is returned unchanged. Throws `not-convertible` when pagination
236
+ * cannot resolve it (for example one item that cannot fit a slide).
237
+ */
238
+ declare function splitSlideOnOverflow(presentation: unknown, slideIndex: number, options?: PresentationPaginationOptions): SplitOverflowResult;
239
+ /**
240
+ * Merge `count` consecutive slides starting at `start` into one. The first slide's `id`, title, layout, design
241
+ * and other slide fields win; where a later slide differs, what is dropped is reported. The blocks of all the
242
+ * slides follow each other in one `blocks` list (a slide's inline content becomes blocks) and speaker notes are
243
+ * joined with a blank line. Slides that use named regions cannot be merged.
244
+ */
245
+ declare function mergeSlides(presentation: unknown, start: number, count?: number): SlideEdit;
246
+ interface UnpaginateOptions {
247
+ /** Only put back the slides cut from this source slide (an index into the pagination's source presentation). Default: every one. */
248
+ sourceSlideIndex?: number;
249
+ }
250
+ /**
251
+ * The inverse of `paginatePresentation` for slides still as it returned them: given its `pages` mapping, join the
252
+ * slices of each source slide back into the original leaves (text, list items, table rows, timeline events, code
253
+ * lines) and replace the continuation slides by one slide. The first slide's id, headings and design are kept; the
254
+ * slides must not have been edited or reordered since (a gap between two slices is refused). The readability floor
255
+ * pagination wrote into `composition.minFontSize` stays, because the original value is not recorded.
256
+ */
257
+ declare function unpaginate(presentation: unknown, pages: readonly (PaginatedPage & {
258
+ sourceSlideIndex: number;
259
+ })[], options?: UnpaginateOptions): SlideEdit;
260
+
261
+ export { CONTENT_CONVERSIONS, CONTENT_KIND_LABELS, type ContentConversionTarget, type ContentInfo, type ContentKind, type ConversionReport, type ConvertOptions, type ConvertedContent, type ImageTarget, type ListFormChange, type ListLevelChange, type ListLevelOptions, OPFConversionError, type PromoteImageOptions, type SlideEdit, type SlidePath, type SplitOverflowResult, type SplitSlideOptions, type StructureChange, type TableOptions, type UnpaginateOptions, blocksToRegions, contentConversionTargets, convertContent, convertListForm, demoteImage, demoteListItems, mergeSlides, moveRegion, promoteImage, promoteListItems, readContent, regionsToBlocks, shiftListLevels, splitSlide, splitSlideOnOverflow, unpaginate, unwrapGroup, wrapBlocks };