@openpresentation/opf 0.12.1 → 0.13.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.
Files changed (50) hide show
  1. package/README.md +1 -1
  2. package/dist/audit.d.ts +9 -130
  3. package/dist/audit.js +5 -5
  4. package/dist/{catalogs-BnI7JKcn.d.ts → catalogs-ywCamd8C.d.ts} +1 -1
  5. package/dist/catalogs.d.ts +2 -2
  6. package/dist/chart-data-Cdr6rRVV.d.ts +177 -0
  7. package/dist/{chunk-6LZK2IZB.js → chunk-7N4VMAT4.js} +11 -7
  8. package/dist/{chunk-4LAM3N6S.js → chunk-7QBCWNWL.js} +424 -18
  9. package/dist/{chunk-SOSOBKQ2.js → chunk-ATGDDJPX.js} +4 -5
  10. package/dist/{chunk-V2537ENL.js → chunk-II5EYKZU.js} +9 -7
  11. package/dist/{chunk-MWPMJE6P.js → chunk-INU7ZNSB.js} +50 -2
  12. package/dist/{chunk-RUC7L5DJ.js → chunk-IS2CPNVJ.js} +1 -1
  13. package/dist/{chunk-JKVKYVWL.js → chunk-IYCJUKWD.js} +90 -471
  14. package/dist/{chunk-HOBSL7AJ.js → chunk-MPM7NRG7.js} +2396 -1408
  15. package/dist/{chunk-AUM5MXBR.js → chunk-RAYB46AB.js} +8 -6
  16. package/dist/{composition-DWbCiMwF.d.ts → composition-D7we69Tr.d.ts} +7 -0
  17. package/dist/composition.d.ts +2 -1
  18. package/dist/composition.js +1 -1
  19. package/dist/convert.d.ts +4 -1
  20. package/dist/convert.js +33 -16
  21. package/dist/data.d.ts +2 -1
  22. package/dist/data.js +3 -1
  23. package/dist/diff.d.ts +1 -1
  24. package/dist/diff.js +8 -7
  25. package/dist/docs.js +32 -26
  26. package/dist/examples.d.ts +1 -1
  27. package/dist/examples.js +102 -57
  28. package/dist/format.js +1 -1
  29. package/dist/index.d.ts +13 -10
  30. package/dist/index.js +8 -8
  31. package/dist/lint-B7azdiuE.d.ts +197 -0
  32. package/dist/lint.d.ts +7 -70
  33. package/dist/lint.js +4 -4
  34. package/dist/markdown.d.ts +7 -5
  35. package/dist/markdown.js +5 -5
  36. package/dist/pagination.d.ts +2 -1
  37. package/dist/pagination.js +4 -4
  38. package/dist/patch.js +4 -4
  39. package/dist/{presentation-DcF-MZcz.d.ts → presentation-mG-IYErQ.d.ts} +187 -14
  40. package/dist/repo-readme.js +1 -1
  41. package/dist/{schemas-BSjlG8-R.d.ts → schemas-BbPonsTz.d.ts} +18 -0
  42. package/dist/schemas.d.ts +1 -1
  43. package/dist/schemas.js +1 -1
  44. package/dist/spec/catalogs/manifest.json +3 -3
  45. package/dist/spec/schemas/opf.schema.json +238 -20
  46. package/dist/types.d.ts +4 -4
  47. package/dist/{validator-DfG9yxba.d.ts → validator-CIylxoIm.d.ts} +3 -3
  48. package/dist/validator.d.ts +4 -4
  49. package/dist/validator.js +3 -3
  50. package/package.json +3 -3
package/README.md CHANGED
@@ -22,7 +22,7 @@ pnpm add @openpresentation/opf
22
22
  # or: yarn add @openpresentation/opf
23
23
  ```
24
24
 
25
- Requires Node 24 starting with version 0.10.0. Earlier published versions retain their recorded runtime requirements.
25
+ Requires Node 22 or later (`engines.node` `>=22`) from the release after 0.12.1. Versions 0.10.0 to 0.12.1 declared `24.x`, so npm on Node 22 or 26 silently installed an older release that matched (RR-20). Earlier published versions retain their recorded runtime requirements.
26
26
 
27
27
  ## Usage
28
28
 
package/dist/audit.d.ts CHANGED
@@ -1,132 +1,11 @@
1
- import { C as CatalogKind } from './catalogs-BnI7JKcn.js';
2
- import { T as TextMeasurement } from './composition-DWbCiMwF.js';
3
- import { LintDiagnostic, LintSeverity } from './lint.js';
4
- import './schemas-BSjlG8-R.js';
5
- import './validator-DfG9yxba.js';
6
- import './presentation-DcF-MZcz.js';
7
-
8
- /** Same three levels as `lintSource`. */
9
- type AuditSeverity = LintSeverity;
10
- type AuditCategory = 'accessibility' | 'design' | 'content';
11
- /** One JSON Patch operation (RFC 6902 subset) a quick fix applies. Paths are JSON Pointers into the audited document. */
12
- interface AuditPatchOperation {
13
- op: 'add' | 'replace' | 'remove';
14
- path: string;
15
- value?: unknown;
16
- }
17
- /**
18
- * A suggested repair. Core never applies it: a host shows it and applies it through its own undoable edit path.
19
- * `focus` fixes only name the field the author must fill in; `patch` fixes are small, deterministic and leave
20
- * every unrelated field untouched.
21
- */
22
- interface AuditFix {
23
- /** Stable id within one diagnostic, such as `focus-alt` or `inherit-text-color`. */
24
- id: string;
25
- label: string;
26
- kind: 'patch' | 'focus';
27
- /** True when applying the fix cannot change the meaning of the content (a colour switched to a readable one, a field focused). */
28
- safe: boolean;
29
- patch?: AuditPatchOperation[];
30
- /** For `focus`: the JSON Pointer of the field to edit and a hint of what it is. */
31
- focus?: {
32
- path: string;
33
- field: 'alt' | 'title' | 'text' | 'link' | 'language' | 'fontSize';
34
- value?: unknown;
35
- };
36
- }
37
- interface AuditDiagnostic extends LintDiagnostic {
38
- /** `audit/<rule>`; ids are stable across releases. */
39
- ruleId: string;
40
- /** Zero-based slide index when the finding belongs to one slide. */
41
- slide?: number;
42
- slideId?: string;
43
- category: AuditCategory;
44
- /** Measured values behind the finding (ratios, sizes, counts), for reporters and tests. */
45
- measured?: Record<string, number | string | boolean | null>;
46
- fixes?: AuditFix[];
47
- }
48
- interface AuditThresholds {
49
- /** Minimum WCAG contrast ratio for normal text. WCAG 2.x AA: 4.5. */
50
- contrastNormal: number;
51
- /** Minimum ratio for large text (at least 18 pt, or 14 pt bold). WCAG 2.x AA: 3. */
52
- contrastLarge: number;
53
- /** Smallest rendered text size, in points, before `audit/min-font-size` reports. */
54
- minFontSizePt: number;
55
- /** Words on one slide above which `audit/slide-word-count` reports. */
56
- maxWordsPerSlide: number;
57
- /** Distinct font families across the deck above which `audit/font-family-count` reports. */
58
- maxFontFamilies: number;
59
- /** Minimum effective pixels per inch of an embedded raster image at its displayed size. */
60
- minImagePpi: number;
61
- /** Largest title offset between slides of the same layout, as a fraction of the slide width/height. */
62
- titlePositionTolerance: number;
63
- /** Smallest CIE76 colour difference between two chart series (after colour-vision simulation) before they count as confusable. */
64
- minSeriesColorDifference: number;
65
- }
66
- interface AuditOptions {
67
- /** Per-rule severity, or `off`. Keys are full ids (`audit/text-contrast`) or the bare name (`text-contrast`). */
68
- rules?: Record<string, AuditSeverity | 'off'>;
69
- /** Rules not to run (full ids or bare names). */
70
- ignore?: readonly string[];
71
- /** When set, run only these rules (full ids or bare names). */
72
- only?: readonly string[];
73
- /**
74
- * Suppress a rule below a JSON Pointer prefix, for one accepted exception, for example
75
- * `{rule: 'audit/text-contrast', path: '/slides/3'}`. A prefix matches whole path segments.
76
- */
77
- ignorePaths?: readonly {
78
- rule: string;
79
- path: string;
80
- }[];
81
- thresholds?: Partial<AuditThresholds>;
82
- /** Loaded catalog records, consulted after the document's own `catalogs` and before the bundled ones. */
83
- catalogs?: Partial<Record<CatalogKind, readonly unknown[]>>;
84
- /**
85
- * The host's measured fonts. Without it composition uses core's portable estimate; see docs/audit.md.
86
- * A function receives the zero-based slide index, so a host can supply a script-aware measurement per slide.
87
- */
88
- textMeasurement?: TextMeasurement | ((slideIndex: number) => TextMeasurement | undefined);
89
- /** Chart series palette (opaque `#RRGGBB`), in the engine's order. Default: the palette opf-render and opf-pptx use. */
90
- chartPalette?: readonly string[];
91
- }
92
- interface AuditRuleInfo {
93
- /** Stable `audit/<name>` id. */
94
- id: string;
95
- name: string;
96
- category: AuditCategory;
97
- /** Default severity. */
98
- severity: AuditSeverity;
99
- summary: string;
100
- /** Why the rule exists. */
101
- rationale: string;
102
- /** The accessibility or design standard it follows, when there is one. */
103
- standard?: string;
104
- /** What the check cannot see or approximates. */
105
- approximations?: string;
106
- /** Threshold names (`AuditThresholds`) the rule reads. */
107
- thresholds?: (keyof AuditThresholds)[];
108
- }
109
- interface AuditReport {
110
- /** True when no finding has severity `error` (the same meaning as lint's `valid`). */
111
- valid: boolean;
112
- /** False when the document failed schema validation, so no design rule was run. */
113
- documentValid: boolean;
114
- diagnostics: AuditDiagnostic[];
115
- counts: Record<AuditSeverity, number>;
116
- /** Rule ids that ran, in registry order. */
117
- rulesRun: string[];
118
- slideCount: number;
119
- thresholds: AuditThresholds;
120
- checks: {
121
- /** `estimated` unless the host supplied `textMeasurement`. */
122
- textMeasurement: 'estimated' | 'provided';
123
- /** Text contrast is computed against solid, gradient and pattern backgrounds; picture pixels are never read. */
124
- backgroundPixels: 'not-read';
125
- /** Image resolution reads only embedded `data:` images; URLs are never fetched. */
126
- imageBytes: 'embedded-only';
127
- nativeExport: 'not-checked';
128
- };
129
- }
1
+ import { A as AuditThresholds, a as AuditOptions, b as AuditReport, c as AuditRuleInfo } from './lint-B7azdiuE.js';
2
+ export { d as AuditCategory, e as AuditDiagnostic, f as AuditFix, g as AuditPatchOperation, h as AuditSeverity } from './lint-B7azdiuE.js';
3
+ import './catalogs-ywCamd8C.js';
4
+ import './schemas-BbPonsTz.js';
5
+ import './validator-CIylxoIm.js';
6
+ import './presentation-mG-IYErQ.js';
7
+ import './composition-D7we69Tr.js';
8
+ import './chart-data-Cdr6rRVV.js';
130
9
 
131
10
  /**
132
11
  * The series palette opf-render and opf-pptx draw charts with (`CHART_COLORS`), in series order. A host with
@@ -153,4 +32,4 @@ declare function auditPresentation(document: unknown, options?: AuditOptions): A
153
32
  /** Audit JSON source text. Findings carry original-source UTF-16 ranges and one-based line/column, like `lintSource`. */
154
33
  declare function auditSource(source: string, options?: AuditOptions): AuditReport;
155
34
 
156
- export { type AuditCategory, type AuditDiagnostic, type AuditFix, type AuditOptions, type AuditPatchOperation, type AuditReport, type AuditRuleInfo, type AuditSeverity, type AuditThresholds, DEFAULT_AUDIT_THRESHOLDS, DEFAULT_CHART_PALETTE, auditPresentation, auditRules, auditSource, findAuditRule };
35
+ export { AuditOptions, AuditReport, AuditRuleInfo, AuditThresholds, DEFAULT_AUDIT_THRESHOLDS, DEFAULT_CHART_PALETTE, auditPresentation, auditRules, auditSource, findAuditRule };
package/dist/audit.js CHANGED
@@ -1,7 +1,7 @@
1
- export { DEFAULT_AUDIT_THRESHOLDS, DEFAULT_CHART_PALETTE, auditPresentation, auditRules, auditSource, findAuditRule } from './chunk-6LZK2IZB.js';
2
- import './chunk-MWPMJE6P.js';
3
- import './chunk-JKVKYVWL.js';
4
- import './chunk-HOBSL7AJ.js';
1
+ export { DEFAULT_AUDIT_THRESHOLDS, DEFAULT_CHART_PALETTE, auditPresentation, auditRules, auditSource, findAuditRule } from './chunk-7N4VMAT4.js';
2
+ import './chunk-INU7ZNSB.js';
3
+ import './chunk-IYCJUKWD.js';
4
+ import './chunk-MPM7NRG7.js';
5
5
  import './chunk-S5W34SIJ.js';
6
6
  import './chunk-E34DJ5LL.js';
7
- import './chunk-4LAM3N6S.js';
7
+ import './chunk-7QBCWNWL.js';
@@ -1,4 +1,4 @@
1
- import { a as SchemaName } from './schemas-BSjlG8-R.js';
1
+ import { a as SchemaName } from './schemas-BbPonsTz.js';
2
2
 
3
3
  /**
4
4
  * Schema for audience records in the pptx.gallery library. Each record names an audience archetype (e.g. 'executive', 'engineering-team', 'investor') and carries seniority, technical-fluency, decision-power, and attention-budget hints used by AI-driven generation. Audiences are referenced from OPF documents via audience; the engine resolves the reference against catalogs.audiences (inline) → catalogs.audiences.source → the default catalog at https://www.pptx.gallery/audiences. The audience field also accepts free-form strings; this catalog is for engine-aware audience archetypes that carry generation hints.
@@ -1,2 +1,2 @@
1
- export { a as CatalogEntry, b as CatalogIndex, c as CatalogIndexRecord, C as CatalogKind, d as CatalogRecord, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-BnI7JKcn.js';
2
- import './schemas-BSjlG8-R.js';
1
+ export { a as CatalogEntry, b as CatalogIndex, c as CatalogIndexRecord, C as CatalogKind, d as CatalogRecord, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-ywCamd8C.js';
2
+ import './schemas-BbPonsTz.js';
@@ -0,0 +1,177 @@
1
+ /** A scalar data cell (chart data, dataset rows). */
2
+ type DataCellValue = string | number | boolean | null;
3
+ /** A named column with an optional number format. The string column form is `{ name }` with no format. */
4
+ interface DataColumn {
5
+ name: string;
6
+ format?: string;
7
+ }
8
+ /** Provenance of inline data or a dataset. Engines never read, fetch or refresh it. */
9
+ interface DataSourceRef {
10
+ src: string;
11
+ sheet?: string;
12
+ range?: string;
13
+ fields?: string[];
14
+ retrieved?: string;
15
+ description?: string;
16
+ }
17
+ /** One shared data table in the top-level `datasets` map. */
18
+ interface Dataset {
19
+ title?: string;
20
+ description?: string;
21
+ columns: (string | DataColumn)[];
22
+ rows: DataCellValue[][];
23
+ source?: DataSourceRef;
24
+ }
25
+ /** Chart data (or, as `{ dataset, fields }`, a table) taken from a top-level dataset. */
26
+ interface DatasetRef {
27
+ dataset: string;
28
+ fields?: string[];
29
+ }
30
+ /** `chart.mapping`: the category, X and series columns by name (after any `fields` selection). */
31
+ interface ChartMapping {
32
+ category?: string;
33
+ x?: string;
34
+ series?: string[];
35
+ }
36
+ /** A text run as table cells and headers hold them (see the schema `TextRun`). */
37
+ type DataTextRun = string | {
38
+ text: string;
39
+ [key: string]: unknown;
40
+ };
41
+ /** A table cell's value: a scalar or rich runs. */
42
+ type DataTableValue = string | number | boolean | null | DataTextRun[];
43
+ /** A styled or spanning table cell, optionally with a number format. */
44
+ interface DataStyledCell {
45
+ value: DataTableValue;
46
+ style?: Record<string, unknown>;
47
+ colSpan?: number;
48
+ rowSpan?: number;
49
+ format?: string;
50
+ }
51
+ /** A table body cell. */
52
+ type DataTableCell = DataTableValue | DataStyledCell;
53
+ /** A table column header: a cell, or a DataColumn. */
54
+ type DataTableHeader = DataTableCell | DataColumn;
55
+ type DataDiagnosticCode = 'chart-value-not-numeric' | 'chart-data-source-unresolved' | 'dataset-unknown' | 'dataset-field-unknown' | 'data-column-duplicate' | 'chart-mapping-unknown-column' | 'chart-mapping-adapted' | 'number-format-invalid';
56
+ interface DataDiagnostic {
57
+ code: DataDiagnosticCode;
58
+ severity: 'error' | 'warning';
59
+ /** JSON Pointer of the offending value: below the `path` option for the chart or table, or into `/datasets/<id>`. */
60
+ path: string;
61
+ message: string;
62
+ }
63
+ interface DataResolveOptions {
64
+ /** JSON Pointer of the chart or table object, used as the base of diagnostic paths. Default: "" (paths start at `/data` or `/rows`). */
65
+ path?: string;
66
+ }
67
+ type ResolvedChartData = {
68
+ ok: true;
69
+ /** Column names in canonical order: category, then (scatter only) X, then every series. */
70
+ columns: string[];
71
+ /**
72
+ * True when `columns[1]` is the X column: an XY chart with three or more resolved columns. An XY chart with two
73
+ * columns has no X column; its second column is the one series, plotted against row numbers (the legacy rule).
74
+ */
75
+ hasX: boolean;
76
+ /** The number format of each column (from its DataColumn), aligned with `columns`. */
77
+ formats: (string | undefined)[];
78
+ /** Category cells as authored; X and series cells (and a lone column, which has no category) passed through `chartNumber` (null is a gap). */
79
+ rows: DataCellValue[][];
80
+ source?: DataSourceRef;
81
+ /** The dataset id when the chart references one. */
82
+ dataset?: string;
83
+ diagnostics: DataDiagnostic[];
84
+ } | {
85
+ ok: false;
86
+ reason: 'data-not-inline' | 'dataset-unknown' | 'no-rows' | 'no-columns';
87
+ message: string;
88
+ diagnostics: DataDiagnostic[];
89
+ };
90
+ interface ResolvedTableData {
91
+ /** Headers as authored (dataset tables: the dataset's columns after `fields`), or undefined for a table without headers. */
92
+ columns?: DataTableHeader[];
93
+ rows: DataTableCell[][];
94
+ /** The column number formats (DataColumn or header StyledTableCell `format`), by column index. */
95
+ formats: (string | undefined)[];
96
+ /** The dataset id when the table references one. */
97
+ dataset?: string;
98
+ diagnostics: DataDiagnostic[];
99
+ }
100
+ /**
101
+ * Strict chart number: finite numbers, and strings in strict decimal syntax (trimmed). Everything else is null (a gap):
102
+ * `"12%"`, `"$5"`, `"(5)"`, `"1,234"`, `"1.234,5"`, `"Q1"`, `""`, booleans and null. A plain digit string beyond the safe
103
+ * integer range is a gap too, as in data import (it is usually an identifier that would lose digits); a decimal or exponent
104
+ * form such as `"1e20"` is a number.
105
+ */
106
+ declare function chartNumber(value: unknown): number | null;
107
+ /** Why a NumberFormat is invalid, or undefined for a valid one. An absent format is valid (General). */
108
+ declare function numberFormatError(format: unknown): string | undefined;
109
+ /** Format a number with a NumberFormat; an absent or invalid format prints the General form (String(value)). */
110
+ declare function formatDataNumber(value: number, format?: string): string;
111
+ /** NumberFormat -> Excel format code ("General" when absent or invalid). Literal prefix/suffix text is quoted or escaped; placeholders are written '#' before '0' ("0#" -> "#0"). */
112
+ declare function excelNumberFormat(format?: string): string;
113
+ /** Excel format code -> NumberFormat, or undefined when the code has no exact NumberFormat equivalent (General, sections, scaling commas, and placeholder orders Excel reads by position such as "0#" or "0.#0"). */
114
+ declare function numberFormatFromExcel(code: string): string | undefined;
115
+ /** True when the value is a dataset reference (`{ dataset: "<id>" }`). */
116
+ declare function isDatasetRef(value: unknown): value is DatasetRef;
117
+ /** Diagnostics of the top-level datasets themselves: duplicate column names and invalid column formats. */
118
+ declare function datasetDiagnostics(document: unknown): DataDiagnostic[];
119
+ /**
120
+ * Pure: a copy of the document where every chart and table DatasetRef is replaced by inline data (columns as
121
+ * DataColumn when a format applies, rows copied; a chart also takes the dataset's `source`). `datasets` stays in
122
+ * place. Unknown ids (and references naming an unknown field) are left as they are.
123
+ */
124
+ declare function inlineDatasets<T>(document: T): T;
125
+ /** A table in inline form: a dataset-backed table is copied from the document's dataset; anything else is returned as is. */
126
+ declare function inlineTableData<T>(table: T, document?: unknown): T;
127
+ /** A chart in inline form: a dataset reference in `data` is copied from the document's dataset; anything else is returned as is. */
128
+ declare function inlineChartData<T>(chart: T, document?: unknown): T;
129
+ /** The ids of top-level datasets that no chart or table references, in declaration order. */
130
+ declare function unusedDatasets(document: unknown): string[];
131
+ /** True for a chart type with an X value axis (scatter; deprecated ids resolve through their replacement first). */
132
+ declare function isXYChartType(type: unknown): boolean;
133
+ /**
134
+ * Resolve a chart's data to the canonical positional table: [category, (x,) ...series].
135
+ * Category cells are kept as authored; X and series cells pass through chartNumber.
136
+ * Inline ChartData, a DatasetRef (needs the document) and mapping are resolved here.
137
+ */
138
+ declare function resolveChartData(chart: unknown, document?: unknown, options?: DataResolveOptions): ResolvedChartData;
139
+ /** One JSON Patch `replace` operation of a ChartNumberFix. */
140
+ interface ChartNumberFixOperation {
141
+ op: 'replace';
142
+ path: string;
143
+ value: unknown;
144
+ }
145
+ /** A fix for a chart value column whose text cells all share one display style (`"12%"`, `"$1,234"`, `"1,234.5"`). */
146
+ interface ChartNumberFix {
147
+ /**
148
+ * JSON Patch: one `replace` per text cell (with its number), then one for the column (a DataColumn with `format`).
149
+ * Paths are those of the `chart-value-not-numeric` diagnostics: below `options.path` for inline data, or into
150
+ * `/datasets/<id>` for a dataset (which every chart and table that uses it shares; their text is unchanged).
151
+ */
152
+ patches: ChartNumberFixOperation[];
153
+ /** Index of the column in the authored columns (`chart.data.columns`, or the dataset's columns). */
154
+ column: number;
155
+ /** The column name. */
156
+ name: string;
157
+ /** The NumberFormat that displays every number of the column exactly as its text was written. */
158
+ format: string;
159
+ }
160
+ interface ChartNumberFixOptions extends DataResolveOptions {
161
+ /** The column to fix, by authored index or name. Default: the first value column that has a fix. */
162
+ column?: number | string;
163
+ }
164
+ /**
165
+ * Migration help for the strict number rule: when every text cell of a chart value column is written in one display
166
+ * style that a NumberFormat reproduces exactly (`"12%"`/`"8.5%"` -> 0.12/0.085 with `0.#%`; `"$1,234"` -> 1234 with
167
+ * `$#,##0`; `"1,234"` -> 1234 with `#,##0`), the patch that stores the numbers and gives the column that format.
168
+ * Undefined when there is nothing to fix or no exact fix: mixed styles, accounting negatives `(5)`, `1.234,5`, units,
169
+ * a column that already has a format, or any value the format would display differently (number cells included).
170
+ */
171
+ declare function suggestChartNumberFix(chart: unknown, document?: unknown, options?: ChartNumberFixOptions): ChartNumberFix | undefined;
172
+ /** Resolve a table (inline or dataset-backed) to headers, rows and per-column formats. */
173
+ declare function resolveTableData(table: unknown, document?: unknown, options?: DataResolveOptions): ResolvedTableData;
174
+ /** Display value of a table cell: a number with a format (cell, else column) becomes formatted text; anything else is returned unchanged. */
175
+ declare function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string): DataTableCell;
176
+
177
+ export { numberFormatFromExcel as A, resolveChartData as B, type ChartMapping as C, type DataCellValue as D, resolveTableData as E, suggestChartNumberFix as F, tableCellDisplayValue as G, unusedDatasets as H, type ResolvedChartData as R, type ChartNumberFix as a, type ChartNumberFixOperation as b, type ChartNumberFixOptions as c, type DataColumn as d, type DataDiagnostic as e, type DataDiagnosticCode as f, type DataResolveOptions as g, type DataSourceRef as h, type DataStyledCell as i, type DataTableCell as j, type DataTableHeader as k, type DataTableValue as l, type DataTextRun as m, type Dataset as n, type DatasetRef as o, type ResolvedTableData as p, chartNumber as q, datasetDiagnostics as r, excelNumberFormat as s, formatDataNumber as t, inlineChartData as u, inlineDatasets as v, inlineTableData as w, isDatasetRef as x, isXYChartType as y, numberFormatError as z };
@@ -1,6 +1,6 @@
1
- import { lintSource } from './chunk-MWPMJE6P.js';
2
- import { validatePresentation } from './chunk-JKVKYVWL.js';
3
- import { chartPaletteForFill, tableGrid, readingRows, visualReadingOrder, visitContentPayloads, intrinsicImageSize, textWidthMeasurer, normalizeHexColor, resolveColorRef, resolveScriptFonts, OPFCompositionError, resolveFontSchemeReference, DEFAULT_FONT_SCHEME, resolveCanvasDimensions, resolveFontFamilies, composeSlide } from './chunk-HOBSL7AJ.js';
1
+ import { lintSource } from './chunk-INU7ZNSB.js';
2
+ import { validatePresentation } from './chunk-IYCJUKWD.js';
3
+ import { resolveChartData, chartPaletteForFill, tableGrid, readingRows, visualReadingOrder, visitContentPayloads, intrinsicImageSize, textWidthMeasurer, normalizeHexColor, resolveColorRef, resolveScriptFonts, OPFCompositionError, resolveFontSchemeReference, DEFAULT_FONT_SCHEME, resolveCanvasDimensions, resolveFontFamilies, composeSlide } from './chunk-MPM7NRG7.js';
4
4
  import { catalogs } from './chunk-E34DJ5LL.js';
5
5
  import { parseTree } from 'jsonc-parser';
6
6
 
@@ -309,8 +309,11 @@ function textValues(slide, slidePath) {
309
309
  if (Array.isArray(table.columns))
310
310
  table.columns.forEach((cell, c) => {
311
311
  const styled = rec(cell);
312
- const value = Object.hasOwn(styled, "value") ? styled.value : cell;
313
- push(at("table", "columns", c, ...Object.hasOwn(styled, "value") ? ["value"] : []), value, "table-header", "table");
312
+ if (!Object.hasOwn(styled, "value") && typeof styled.name === "string") push(at("table", "columns", c, "name"), styled.name, "table-header", "table");
313
+ else {
314
+ const value = Object.hasOwn(styled, "value") ? styled.value : cell;
315
+ push(at("table", "columns", c, ...Object.hasOwn(styled, "value") ? ["value"] : []), value, "table-header", "table");
316
+ }
314
317
  });
315
318
  if (Array.isArray(table.rows))
316
319
  table.rows.forEach((row, r) => {
@@ -864,8 +867,9 @@ var chartRules = [
864
867
  for (const slide of context.slides)
865
868
  for (const payload of slidePayloads(slide.slide, slide.path)) {
866
869
  const chart = rec(payload.node.chart);
867
- const data = rec(chart.data);
868
- if (!Array.isArray(data.columns) || !Array.isArray(data.rows)) continue;
870
+ const resolved = resolveChartData(chart, context.document);
871
+ if (!resolved.ok) continue;
872
+ const data = { columns: resolved.columns.filter((_, index) => !(resolved.hasX && index === 1)), rows: resolved.rows };
869
873
  const type = String(chart.type ?? "").toLowerCase();
870
874
  if (chartSkip.test(type)) continue;
871
875
  const slices = perCategory.test(type);