@openpresentation/opf-pptx 0.11.5 → 0.11.7

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/dist/index.d.ts CHANGED
@@ -39,6 +39,8 @@ export interface MediaProvenanceDiagnostic { code: "media-provenance-omitted"; p
39
39
  export interface ChartDataUnplottableDiagnostic { code: "chart-data-unplottable"; path: string; message: string; reason: "data-not-inline" | "no-rows" | "no-columns" | "single-column-not-numeric" }
40
40
  /** Content with no PowerPoint export (an empty table, an unsupported payload) is replaced by a plain-language placeholder frame. */
41
41
  export interface ContentPlaceholderDiagnostic { code: "content-placeholder"; path: string; message: string; reason: "table-has-no-rows" | "unsupported-payload" }
42
+ /** An image that has no embeddable raster. `reason: "unsupported-format"`: the embedded bytes are no readable PNG, JPEG, GIF or WebP (an SVG, for example); the preview's placeholder was exported instead (or no watermark, or the background colour). `strictAssets` throws `unsupported-image-dimensions` instead. */
43
+ export interface UnresolvedAssetDiagnostic { code: "unresolved-asset"; path: string; message: string; reason?: "unsupported-format" }
42
44
  export interface WatermarkNotExportedDiagnostic { code: "watermark-not-exported"; path: string; message: string }
43
45
  /**
44
46
  * The chart data was reshaped to export a native chart: a single value column was plotted against row numbers; a one-series construct
@@ -47,7 +49,7 @@ export interface WatermarkNotExportedDiagnostic { code: "watermark-not-exported"
47
49
  * (`histogram-binned`).
48
50
  */
49
51
  export interface ChartDataAdaptedDiagnostic { code: "chart-data-adapted"; path: string; message: string; adaptation: "histogram-binned" | "row-numbers" | "series-dropped" | "chartex-fallback" }
50
- /** With `chartex: "native"`, a map chart (`world`) is exported as a chartex regionMap without cached geography: PowerPoint fetches the region shapes from Bing Maps online, so the map may show no regions offline. */
52
+ /** With `chartex: "native"`, a map chart (`world`) is exported as a chartex regionMap (`Requires="cx4"`) without cached geography: PowerPoint must fetch the region shapes from its online map service and shows "There was a problem getting the information for your map chart" with an empty chart until it does. */
51
53
  export interface ChartMapGeodataDiagnostic { code: "chart-map-geodata"; path: string; message: string }
52
54
 
53
55
  export interface ToPptxOptions {
@@ -55,25 +57,32 @@ export interface ToPptxOptions {
55
57
  imageFormat?: "compatible" | "preserve";
56
58
  /**
57
59
  * How the chartex chart types (treemap, histogram, pareto, box-and-whisker, waterfall, funnel, world) are exported.
58
- * "fallback" (default) writes the clustered column chart of the data and reports `chart-data-adapted` (`chartex-fallback`,
59
- * `histogram-binned`). "native" writes Office 2016 chartex parts (`cx:chartSpace`, style parts, an `mc:AlternateContent`
60
- * frame with the clustered column chart as fallback). Native chartex is opt-in pending native PowerPoint confirmation (FF-22b);
61
- * the default flips once that check passes. Import of chartex parts is always on.
60
+ * "auto" (default) writes Office 2016 chartex parts (`cx:chartSpace`, style parts, an `mc:AlternateContent` frame with the
61
+ * clustered column chart as fallback) for the constructs desktop PowerPoint confirmed natively on 2026-09-30 (treemap,
62
+ * histogram, pareto, box-and-whisker, waterfall, funnel) and keeps `world` on the clustered column chart with
63
+ * `chart-data-adapted` (`chartex-fallback`) because the regionMap part, though accepted with `Requires="cx4"`, draws
64
+ * nothing until PowerPoint fetches map data online. "native" writes every chartex part, the map included (reports
65
+ * `chart-map-geodata`). "fallback" writes clustered columns only
66
+ * (`chartex-fallback`, `histogram-binned`), as releases before FF-22b did. Import of chartex parts is always on.
62
67
  */
63
- chartex?: "native" | "fallback";
68
+ chartex?: "auto" | "native" | "fallback";
64
69
  /**
65
70
  * OPF_DOCUMENT_V1 / OPF_SLIDE_V1 customer-data tags that let fromPptx restore
66
- * catalog references, layout ids and authoring metadata (docs/document-roundtrip.md).
71
+ * catalog references, layout ids, authoring metadata (`filename` and `extensions`
72
+ * included), `design.logo`, the asset registry, slide `section`/`extensions` and
73
+ * the slide content structure: nested groups, promoted regions, the root payload
74
+ * form, block ids and extensions, group composition (docs/document-roundtrip.md).
67
75
  * Tags are not shown in PowerPoint's UI. Default "full"; "references-only"
68
- * stores catalog references without organization, speaker, free text, slide ids
69
- * or assets; false writes no tags.
76
+ * stores catalog references without organization, speaker, free text, slide ids,
77
+ * assets or content structure; false writes no tags. Slide `section` labels are
78
+ * also written as PowerPoint's native section list whatever this option says.
70
79
  */
71
80
  provenance?: "full" | "references-only" | false;
72
81
  textMeasurement?: TextMeasurement;
73
82
  /** Match preview/pagination clearance around supplied vector text outlines; default 1. */
74
83
  textRasterPadding?: number;
75
84
  /** Layout diagnostics, `media-provenance-omitted` when video data cannot be stored, plus `unresolved-font-scheme` (once per reference path) when a font-scheme id matches no record and the default `aptos` scheme is used as the base. */
76
- onDiagnostic?: (diagnostic: LayoutDiagnostic | FontSchemeDiagnostic | MediaProvenanceDiagnostic | ChartDataUnplottableDiagnostic | ChartDataAdaptedDiagnostic | ChartMapGeodataDiagnostic | ContentPlaceholderDiagnostic | WatermarkNotExportedDiagnostic) => void;
85
+ onDiagnostic?: (diagnostic: LayoutDiagnostic | FontSchemeDiagnostic | MediaProvenanceDiagnostic | ChartDataUnplottableDiagnostic | ChartDataAdaptedDiagnostic | ChartMapGeodataDiagnostic | ContentPlaceholderDiagnostic | UnresolvedAssetDiagnostic | WatermarkNotExportedDiagnostic) => void;
77
86
  baseDir?: string;
78
87
  compressionLevel?: number;
79
88
  imageResolver?: (src: string, context: ImageResolverContext) => ImageResolverResult | Promise<ImageResolverResult | null | undefined> | null | undefined;
@@ -97,12 +106,12 @@ export interface ToPptxOptions {
97
106
  date?: string;
98
107
  /** Host-supplied catalog records, as in opf-render. Currently consulted for socialPlatforms (generated socials furniture). */
99
108
  catalogs?: Record<string, { records?: unknown[] } | unknown[]>;
100
- /** Records for document `catalogs.<kind>.source` URLs, as in opf-render. Currently consulted for socialPlatforms. */
109
+ /** Records for document `catalogs.<kind>.source` URLs (a single source or each entry of an ordered search path), as in opf-render. Currently consulted for socialPlatforms. */
101
110
  catalogSources?: Record<string, { records?: unknown[] } | unknown[]>;
102
111
  }
103
112
 
104
113
  export interface FromPptxOptions {
105
- /** Reports native details that import cannot preserve, including code provenance fallback/reflow and grouped text transforms. Table paths identify native frame and row/cell indexes (including headers). Stored catalog references that no longer match the package report `design-reference-changed` / `layout-reference-changed` at the reference path; a slide layout id that resolves to no inline or bundled record reports `unresolved-layout-reference` (docs/document-roundtrip.md). */
114
+ /** Reports native details that import cannot preserve, including code provenance fallback/reflow and grouped text transforms. Table paths identify native frame and row/cell indexes (including headers). Stored catalog references that no longer match the package report `design-reference-changed` / `layout-reference-changed` at the reference path; a slide layout id that resolves to no inline or bundled record reports `unresolved-layout-reference`; a slide whose imported blocks no longer fit the stored content structure reports `content-structure-changed` at `slides.N`, a block id repeated by a duplicated slide `duplicate-block-id`, and a footer section text that disagrees with PowerPoint's section list `section-reference-changed` (docs/document-roundtrip.md). */
106
115
  onDiagnostic?: (diagnostic: {code: string; path: string; message: string}) => void;
107
116
  fallbackName?: string;
108
117
  schema?: string;