@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/README.md +22 -8
- package/dist/background.js +15 -13
- package/dist/chart-types.js +5 -1
- package/dist/chartex.js +40 -24
- package/dist/code-provenance.js +1 -1
- package/dist/content-topology.js +295 -0
- package/dist/document-provenance.js +260 -46
- package/dist/furniture-provenance.js +57 -4
- package/dist/index.d.ts +21 -12
- package/dist/index.js +380 -65
- package/dist/logo-provenance.js +173 -0
- package/dist/sections.js +111 -0
- package/dist/watermark-provenance.js +2 -1
- package/package.json +7 -6
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
|
|
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
|
-
* "
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
|
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
|
|
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;
|