@openpresentation/opf 0.36.0 → 0.37.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 (86) hide show
  1. package/dist/browser.js +19 -19
  2. package/dist/{catalog-refs-BgotJhR5.d.ts → catalog-refs-BeRgtpZS.d.ts} +4 -4
  3. package/dist/{catalog-schemas-BX-VEc5Q.d.ts → catalog-schemas-CwY-3cCP.d.ts} +1 -1
  4. package/dist/{chunk-OFL3WY6F.js → chunk-3A3PNYNP.js} +77 -15
  5. package/dist/{chunk-TJMESSBQ.js → chunk-44IS6ZU2.js} +109 -9
  6. package/dist/{chunk-J7FUSZZ5.js → chunk-4FA4ZABY.js} +6 -6
  7. package/dist/{chunk-F5SY7MSA.js → chunk-56BYOGIF.js} +1 -1
  8. package/dist/{chunk-MS2LPR7F.js → chunk-6WN6PRCI.js} +1 -1
  9. package/dist/{chunk-7JE3XTL7.js → chunk-BHRCWV6B.js} +4 -4
  10. package/dist/{chunk-4FA4AZXY.js → chunk-C5ACMFKB.js} +1392 -808
  11. package/dist/{chunk-2NIID3QD.js → chunk-CYGQY6HH.js} +6 -6
  12. package/dist/{chunk-SER6GJTT.js → chunk-EOMENOKY.js} +23 -6
  13. package/dist/{chunk-O65COLKF.js → chunk-HS2JQ3AO.js} +118 -19
  14. package/dist/chunk-IW4TXMJY.js +646 -0
  15. package/dist/{chunk-6WVPFWPD.js → chunk-JTNCBTEH.js} +4 -4
  16. package/dist/{chunk-3KPTVK77.js → chunk-KANQVJGK.js} +1244 -119
  17. package/dist/{chunk-VDZXNNZF.js → chunk-M4IPCFDV.js} +1 -1
  18. package/dist/{chunk-XRMYP4JD.js → chunk-ORVMHVOS.js} +86 -2
  19. package/dist/{chunk-HHQROUYC.js → chunk-QFT4R2IL.js} +4405 -2808
  20. package/dist/chunk-QQBOI5XI.js +86 -0
  21. package/dist/{chunk-GNKOQ6NA.js → chunk-TIVBO56G.js} +4 -4
  22. package/dist/{chunk-APCNAAA7.js → chunk-VD7WLE3C.js} +2 -2
  23. package/dist/{chunk-AZELWKG2.js → chunk-XJU2X5JM.js} +5 -4
  24. package/dist/chunk-YESKKKVE.js +1 -0
  25. package/dist/{chunk-BPSZ7OWD.js → chunk-YZ4WMB5C.js} +26 -21
  26. package/dist/{composition-CSM7YfBl.d.ts → composition-DiKC371V.d.ts} +707 -134
  27. package/dist/composition.d.ts +3 -3
  28. package/dist/composition.js +1 -1
  29. package/dist/{conversion-CL7ipVGO.d.ts → conversion-DF_HgknQ.d.ts} +6 -6
  30. package/dist/conversion-XIWN7FMW.js +25 -0
  31. package/dist/convert.d.ts +5 -5
  32. package/dist/convert.js +63 -23
  33. package/dist/data.d.ts +41 -3
  34. package/dist/data.js +2 -2
  35. package/dist/{deck-report-DhsB0SUz.d.ts → deck-report-BwgsIRAf.d.ts} +3 -3
  36. package/dist/deck.d.ts +6 -6
  37. package/dist/deck.js +11 -11
  38. package/dist/diff.js +4 -4
  39. package/dist/docs.js +43 -31
  40. package/dist/examples.js +2338 -392
  41. package/dist/font-policy.js +1 -1
  42. package/dist/format.js +2 -2
  43. package/dist/ids.d.ts +17 -4
  44. package/dist/ids.js +4 -4
  45. package/dist/index.d.ts +140 -23
  46. package/dist/index.js +22 -22
  47. package/dist/markdown.d.ts +2 -2
  48. package/dist/markdown.js +8 -8
  49. package/dist/metric-data-B4Q8RFRR.d.ts +382 -0
  50. package/dist/node-engine.d.ts +6 -6
  51. package/dist/node-engine.js +21 -21
  52. package/dist/{pagination-BSqq32xt.d.ts → pagination-C9qnH_n-.d.ts} +5 -5
  53. package/dist/pagination.d.ts +4 -4
  54. package/dist/pagination.js +4 -4
  55. package/dist/patch.js +3 -3
  56. package/dist/precompiled.js +2 -2
  57. package/dist/{presentation-Dx-kZC8Y.d.ts → presentation-DmOhusrX.d.ts} +541 -110
  58. package/dist/schema-engine-ajv.js +1 -1
  59. package/dist/schema-engine-precompiled.js +2 -2
  60. package/dist/schema.d.ts +2 -2
  61. package/dist/schema.js +3 -3
  62. package/dist/schemas.d.ts +46 -2
  63. package/dist/schemas.js +1 -1
  64. package/dist/shape-engine-eager.js +2 -2
  65. package/dist/shape-engine-lazy.js +1 -1
  66. package/dist/{shape-engine-module-N74FCHGY.js → shape-engine-module-YU2XGIQN.js} +2 -2
  67. package/dist/shape-geometry.js +1 -1
  68. package/dist/source.js +10 -10
  69. package/dist/spec/reference/engine-defaults.json +1 -1
  70. package/dist/spec/reference/engine-vocabularies.json +1 -0
  71. package/dist/spec/schemas/font-scheme.schema.json +5 -6
  72. package/dist/spec/schemas/layout.schema.json +5 -4
  73. package/dist/spec/schemas/narrative.schema.json +1 -0
  74. package/dist/spec/schemas/opf.schema.json +661 -98
  75. package/dist/types.d.ts +11 -12
  76. package/dist/{validation-types-bnrso0JL.d.ts → validation-types-CV-ngACL.d.ts} +49 -6
  77. package/dist/validator.d.ts +5 -5
  78. package/dist/validator.js +3 -3
  79. package/dist/yaml.d.ts +2 -2
  80. package/dist/yaml.js +7 -7
  81. package/package.json +5 -5
  82. package/dist/chart-data-B_k-WTex.d.ts +0 -194
  83. package/dist/chunk-6VGLE7C5.js +0 -3983
  84. package/dist/chunk-SEC4IOOS.js +0 -1
  85. package/dist/chunk-WCPDN7AY.js +0 -642
  86. package/dist/conversion-FTGQLJK7.js +0 -25
@@ -0,0 +1,382 @@
1
+ /** A place data comes from. It never holds credentials. Engines never read, fetch or refresh it. */
2
+ interface DataSource {
3
+ title?: string;
4
+ description?: string;
5
+ /** The kind of data source in the host's or author's words ('csv', 'xlsx', 'postgres'); engines do not interpret it. */
6
+ connector?: string;
7
+ /** An `asset:<id>` reference, a URL or a path. */
8
+ src?: string;
9
+ license?: string;
10
+ /** An ISO 8601 duration. No engine acts on it. */
11
+ refreshEvery?: string;
12
+ extensions?: Record<string, unknown>;
13
+ }
14
+ /** Who produced the data: a person or a model, and which. */
15
+ interface DataGenerator {
16
+ type: 'human' | 'model';
17
+ name: string;
18
+ }
19
+ /** What a dataset or inline chart data says about where it came from. */
20
+ interface DataProvenance {
21
+ /** The id of an entry in the root `datasources` map (a string is always an id), or a data source written inline. */
22
+ datasource?: string | DataSource;
23
+ /** What was taken from the data source, in its own language ('FY26!A1:C13'). */
24
+ query?: string;
25
+ /** An ISO 8601 date or date-time. */
26
+ retrieved?: string;
27
+ /** A free string the source system gives the snapshot. */
28
+ version?: string;
29
+ /** The SHA-256 of the source file's bytes as retrieved, 64 lowercase hexadecimal digits. */
30
+ sha256?: string;
31
+ generator?: DataGenerator;
32
+ }
33
+ /** The root `datasources` map of a document, or an empty one. */
34
+ declare function dataSourcesOf(document: unknown): Record<string, unknown>;
35
+ /** A copy of the provenance keys a dataset or inline chart data holds (only those that are present). */
36
+ declare function dataProvenance(value: unknown): DataProvenance;
37
+ /** The data source a `datasource` value names: the inline object, or the entry of `datasources` a string id names; undefined when there is none. */
38
+ declare function resolveDataSource(datasource: unknown, document: unknown): DataSource | undefined;
39
+
40
+ /** A scalar data cell (chart data, dataset rows). */
41
+ type DataCellValue = string | number | boolean | null;
42
+ /** A named column with an optional number format. The string column form is `{ name }` with no format. */
43
+ interface DataColumn {
44
+ name: string;
45
+ format?: string;
46
+ }
47
+ /** FR-05: what a dataset column's cells hold. `null` is a gap in any type. */
48
+ type DataColumnType = 'text' | 'number' | 'date' | 'boolean';
49
+ /** FR-05: what a dataset column is for. Time is type `date` with role `dimension`. */
50
+ type DataColumnRole = 'dimension' | 'measure';
51
+ /** FR-05: a dataset or inline chart data column: a DataColumn that may also say what its cells hold (`type`), what it is for (`role`) and a unit label engines never print. The string column form declares nothing. */
52
+ interface DatasetColumn extends DataColumn {
53
+ type?: DataColumnType;
54
+ role?: DataColumnRole;
55
+ unit?: string;
56
+ }
57
+ /** One shared data table in the top-level `datasets` map. Its provenance keys say where it came from; engines never read, fetch or refresh a data source. */
58
+ interface Dataset extends DataProvenance {
59
+ title?: string;
60
+ description?: string;
61
+ columns: (string | DatasetColumn)[];
62
+ rows: DataCellValue[][];
63
+ }
64
+ /** Chart data (or, as `{ dataset, fields }`, a table) taken from a top-level dataset. */
65
+ interface DatasetRef {
66
+ dataset: string;
67
+ fields?: string[];
68
+ }
69
+ /** `chart.mapping`: the category, X and series columns by name (after any `fields` selection). */
70
+ interface ChartMapping {
71
+ category?: string;
72
+ x?: string;
73
+ series?: string[];
74
+ target?: string;
75
+ }
76
+ /** One series of a combo chart: drawn as a clustered column or as a line with markers, against the primary (left) or secondary (right) value axis. */
77
+ interface ChartComboSeries {
78
+ role: 'bar' | 'line';
79
+ axis: 'primary' | 'secondary';
80
+ }
81
+ /** A text run as table cells and headers hold them (see the schema `TextRun`). */
82
+ type DataTextRun = string | {
83
+ text: string;
84
+ [key: string]: unknown;
85
+ };
86
+ /** A table cell's value: a scalar or rich runs. */
87
+ type DataTableValue = string | number | boolean | null | DataTextRun[];
88
+ /** A styled or spanning table cell, optionally with a number format. */
89
+ interface DataStyledCell {
90
+ value: DataTableValue;
91
+ style?: Record<string, unknown>;
92
+ colSpan?: number;
93
+ rowSpan?: number;
94
+ format?: string;
95
+ }
96
+ /** A table body cell. */
97
+ type DataTableCell = DataTableValue | DataStyledCell;
98
+ /** A table column header: a cell, or a DataColumn. */
99
+ type DataTableHeader = DataTableCell | DataColumn;
100
+ type DataDiagnosticCode = 'chart-value-not-numeric' | 'dataset-unknown' | 'dataset-field-unknown' | 'datasource-unknown' | 'datasource-credentials' | 'dataset-stale' | 'data-column-duplicate' | 'data-cell-type' | 'chart-mapping-unknown-column' | 'chart-mapping-adapted' | 'chart-highlight-unknown-name' | 'chart-highlight-adapted' | 'chart-series-dropped' | 'chart-reference-axis-unavailable' | 'chart-reference-unsupported-type' | 'chart-bands-order' | 'chart-bands-unsupported' | 'table-highlight-unknown-name' | 'table-color-scale-unknown-column' | 'table-color-scale-no-data' | 'table-color-scale-range' | 'number-format-invalid' | 'metric-data-stale' | 'metric-data-aggregate' | 'metric-data-empty' | 'metric-data-delta' | 'metric-unit-repeated' | 'metric-gauge-range' | 'metric-gauge-value';
101
+ interface DataDiagnostic {
102
+ code: DataDiagnosticCode;
103
+ severity: 'error' | 'warning';
104
+ /** JSON Pointer of the offending value: below the `path` option for the chart or table, or into `/datasets/<id>`. */
105
+ path: string;
106
+ message: string;
107
+ /** FR-05: set on the one `data-cell-type` finding that stands for every mismatched cell of a column (more than five of them). */
108
+ aggregate?: true;
109
+ }
110
+ interface DataResolveOptions {
111
+ /** JSON Pointer of the chart or table object, used as the base of diagnostic paths. Default: "" (paths start at `/data` or `/rows`). */
112
+ path?: string;
113
+ }
114
+ type ResolvedChartData = {
115
+ ok: true;
116
+ /** Column names in canonical order: category, then (scatter only) X, then every series. */
117
+ columns: string[];
118
+ /**
119
+ * True when `columns[1]` is the X column: an XY chart with three or more resolved columns. An XY chart with two
120
+ * columns has no X column; its second column is the one series, plotted against row numbers (the legacy rule).
121
+ */
122
+ hasX: boolean;
123
+ /** The number format of each column (from its DataColumn), aligned with `columns`. */
124
+ formats: (string | undefined)[];
125
+ /** FR-05: the declared type of each column (from its DatasetColumn), aligned with `columns`; undefined for a column that declares none. */
126
+ types: (DataColumnType | undefined)[];
127
+ /** Category cells as authored; X and series cells (and a lone column, which has no category) passed through `chartNumber` (null is a gap). */
128
+ rows: DataCellValue[][];
129
+ /** Where the data came from: the six provenance keys of the inline data, or of the dataset the chart references. */
130
+ provenance?: DataProvenance;
131
+ /** The dataset id when the chart references one. */
132
+ dataset?: string;
133
+ /**
134
+ * Combo charts only (FA-15): how each series is drawn, aligned with the series columns (`columns.slice(1)`). The series
135
+ * are ordered column series first, then the line series on the primary axis, then those on the secondary axis, each in
136
+ * plotted order, so every engine draws, exports and lists them in the legend alike.
137
+ */
138
+ combo?: ChartComboSeries[];
139
+ /**
140
+ * Bullet charts only (FR-07): the target column `mapping.target` names, with its number format and each row's target (null: no tick
141
+ * in that row). The target is not a series: `columns` and `rows` hold the category and the plotted series only.
142
+ */
143
+ target?: {
144
+ column: string;
145
+ format?: string;
146
+ values: (number | null)[];
147
+ };
148
+ diagnostics: DataDiagnostic[];
149
+ } | {
150
+ ok: false;
151
+ reason: 'dataset-unknown' | 'no-rows' | 'no-columns';
152
+ message: string;
153
+ diagnostics: DataDiagnostic[];
154
+ };
155
+ interface ResolvedTableData {
156
+ /** Headers as authored (dataset tables: the dataset's columns after `fields`), or undefined for a table without headers. */
157
+ columns?: DataTableHeader[];
158
+ rows: DataTableCell[][];
159
+ /** The column number formats (DataColumn or header StyledTableCell `format`), by column index. */
160
+ formats: (string | undefined)[];
161
+ /** FR-05: the declared type of each column of a dataset table (after `fields`), by column index; undefined where none is declared. Absent for an inline table. */
162
+ types?: (DataColumnType | undefined)[];
163
+ /** The dataset id when the table references one. */
164
+ dataset?: string;
165
+ diagnostics: DataDiagnostic[];
166
+ }
167
+ /**
168
+ * Strict chart number: finite numbers, and strings in strict decimal syntax (trimmed). Everything else is null (a gap):
169
+ * `"12%"`, `"$5"`, `"(5)"`, `"1,234"`, `"1.234,5"`, `"Q1"`, `""`, booleans and null. A plain digit string beyond the safe
170
+ * integer range is a gap too, as in data import (it is usually an identifier that would lose digits); a decimal or exponent
171
+ * form such as `"1e20"` is a number.
172
+ */
173
+ declare function chartNumber(value: unknown): number | null;
174
+ /** Why a NumberFormat is invalid, or undefined for a valid one. An absent format is valid (General). */
175
+ declare function numberFormatError(format: unknown): string | undefined;
176
+ /**
177
+ * Format a number with a NumberFormat; an absent or invalid format prints the General form (String(value)). LH-106: with `language`
178
+ * the text is in that language's numbering system (see `formatVariableNumber`); without it, Latin.
179
+ */
180
+ declare function formatDataNumber(value: number, format?: string, language?: string): string;
181
+ /** NumberFormat -> Excel format code ("General" when absent or invalid). Literal prefix/suffix text is quoted or escaped; placeholders are written '#' before '0' ("0#" -> "#0"). */
182
+ declare function toExcelNumberFormat(format?: string): string;
183
+ /** 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"). */
184
+ declare function fromExcelNumberFormat(code: string): string | undefined;
185
+ /**
186
+ * FR-05: what a dataset column declares: its `type`, `role` and `unit` (only the keys it writes), by dataset id and column name. An empty object for a
187
+ * column that declares none (a string column); undefined when the document has no such dataset or column. The one reader tools use (a metric
188
+ * that aggregates a column checks the type before it sums); it never looks at the cells.
189
+ */
190
+ declare function datasetColumnDeclaration(document: unknown, dataset: string, field: string): {
191
+ type?: DataColumnType;
192
+ role?: DataColumnRole;
193
+ unit?: string;
194
+ } | undefined;
195
+ /** True when the value is a dataset reference (`{ dataset: "<id>" }`). */
196
+ declare function isDatasetRef(value: unknown): value is DatasetRef;
197
+ /** True when `value` is a cell of the declared column `type`. `null` is a gap in any type; a number is a finite one and never a numeric string. */
198
+ declare function cellMatchesType(value: unknown, type: DataColumnType, language?: string): boolean;
199
+ /** A safe fix of a `data-cell-type` finding: JSON Patch operations that store the cell (or, for the finding of a whole column, every cell of it) in its column's declared type. */
200
+ interface CellTypeFix {
201
+ title: string;
202
+ patches: ChartNumberFixOperation[];
203
+ }
204
+ /**
205
+ * FR-05: the safe fix of the `data-cell-type` finding at `cellPath` (`/datasets/<id>/rows/<r>/<c>`, or the rows of inline chart data), or undefined
206
+ * when nothing can be converted without changing the meaning: in a `number` column a string in strict decimal syntax (the syntax chart values already
207
+ * read) becomes the number, and in a `text` column a finite number becomes its shortest decimal string. `"12%"` in a number column stays and keeps its
208
+ * warning. The fix never changes the column's declared type. `aggregate` is true for the finding that stands for the whole column.
209
+ */
210
+ declare function suggestCellTypeFix(document: unknown, cellPath: string, aggregate?: boolean): CellTypeFix | undefined;
211
+ /**
212
+ * Diagnostics of the top-level datasets themselves: duplicate column names, invalid column formats and a `datasource` that names no
213
+ * data source. (The credential and staleness checks of data sources are `validate`'s: data-source-checks.ts.)
214
+ */
215
+ declare function datasetDiagnostics(document: unknown): DataDiagnostic[];
216
+ /**
217
+ * Pure: a copy of the document where every chart and table DatasetRef is replaced by inline data (columns as
218
+ * DataColumn when a format applies, rows copied; a chart also takes the dataset's provenance keys). `datasets` stays in
219
+ * place. Unknown ids (and references naming an unknown field) are left as they are.
220
+ */
221
+ declare function inlineDatasets<T>(document: T): T;
222
+ /** A table in inline form: a dataset-backed table is copied from the document's dataset; anything else is returned as is. */
223
+ declare function inlineTableData<T>(table: T, document?: unknown): T;
224
+ /** A chart in inline form: a dataset reference in `data` is copied from the document's dataset; anything else is returned as is. */
225
+ declare function inlineChartData<T>(chart: T, document?: unknown): T;
226
+ /** The ids of top-level datasets that no chart or table references, in declaration order. */
227
+ declare function unusedDatasets(document: unknown): string[];
228
+ /** True for a chart type with an X value axis (scatter). */
229
+ declare function isXYChartType(type: unknown): boolean;
230
+ /**
231
+ * Resolve a chart's data to the canonical positional table: [category, (x,) ...series].
232
+ * Category cells are kept as authored; X and series cells pass through chartNumber.
233
+ * Inline ChartData, a DatasetRef (needs the document) and mapping are resolved here.
234
+ */
235
+ declare function resolveChartData(chart: unknown, document?: unknown, options?: DataResolveOptions): ResolvedChartData;
236
+ /** One JSON Patch `replace` operation of a ChartNumberFix. */
237
+ interface ChartNumberFixOperation {
238
+ op: 'replace';
239
+ path: string;
240
+ value: unknown;
241
+ }
242
+ /** A fix for a chart value column whose text cells all share one display style (`"12%"`, `"$1,234"`, `"1,234.5"`). */
243
+ interface ChartNumberFix {
244
+ /**
245
+ * JSON Patch: one `replace` per text cell (with its number), then one for the column (a DataColumn with `format`).
246
+ * Paths are those of the `chart-value-not-numeric` diagnostics: below `options.path` for inline data, or into
247
+ * `/datasets/<id>` for a dataset (which every chart and table that uses it shares; their text is unchanged).
248
+ */
249
+ patches: ChartNumberFixOperation[];
250
+ /** Index of the column in the authored columns (`chart.data.columns`, or the dataset's columns). */
251
+ column: number;
252
+ /** The column name. */
253
+ name: string;
254
+ /** The NumberFormat that displays every number of the column exactly as its text was written. */
255
+ format: string;
256
+ }
257
+ interface ChartNumberFixOptions extends DataResolveOptions {
258
+ /** The column to fix, by authored index or name. Default: the first value column that has a fix. */
259
+ column?: number | string;
260
+ }
261
+ /**
262
+ * Migration help for the strict number rule: when every text cell of a chart value column is written in one display
263
+ * style that a NumberFormat reproduces exactly (`"12%"`/`"8.5%"` -> 0.12/0.085 with `0.#%`; `"$1,234"` -> 1234 with
264
+ * `$#,##0`; `"1,234"` -> 1234 with `#,##0`), the patch that stores the numbers and gives the column that format.
265
+ * Undefined when there is nothing to fix or no exact fix: mixed styles, accounting negatives `(5)`, `1.234,5`, units,
266
+ * a column that already has a format, or any value the format would display differently (number cells included).
267
+ */
268
+ declare function suggestChartNumberFix(chart: unknown, document?: unknown, options?: ChartNumberFixOptions): ChartNumberFix | undefined;
269
+ /** Resolve a table (inline or dataset-backed) to headers, rows and per-column formats. */
270
+ declare function resolveTableData(table: unknown, document?: unknown, options?: DataResolveOptions): ResolvedTableData;
271
+ /** LH-113: the text of a table cell as its key (the first column): a string, a number, rich runs or a styled cell's value. */
272
+ declare function tableKeyText(cell: unknown): string;
273
+ /** Display value of a table cell: a number with a format (cell, else column) becomes formatted text; anything else is returned unchanged. */
274
+ declare function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string, language?: string): DataTableCell;
275
+
276
+ type DataConditionOperator = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'in';
277
+ type DataConditionValue = string | number | boolean | null;
278
+ /** One condition on a row: the row's cell in `field` compared with `value` (a list for `in`). */
279
+ interface DataCondition {
280
+ field: string;
281
+ op: DataConditionOperator;
282
+ value: DataConditionValue | DataConditionValue[];
283
+ }
284
+ /** Conditions a row must all meet (AND). */
285
+ type DataFilter = DataCondition[];
286
+ type DataAggregate = 'sum' | 'mean' | 'min' | 'max' | 'count' | 'first' | 'last';
287
+ /** A number computed from a dataset of the deck: `aggregate` over the cells of `field` in the rows that meet `filter`. */
288
+ interface DataLink {
289
+ dataset: string;
290
+ field: string;
291
+ aggregate: DataAggregate;
292
+ filter?: DataFilter;
293
+ }
294
+ /** How a metric's change is computed: against the previous row, a baseline, a fixed number, or read from a column. Exactly one of `compare` and `field`. */
295
+ interface MetricDelta {
296
+ compare?: 'previous' | {
297
+ filter: DataFilter;
298
+ } | {
299
+ value: number;
300
+ };
301
+ field?: string;
302
+ as?: 'difference' | 'percent';
303
+ format?: string;
304
+ }
305
+ /** A DataLink for a metric, with an optional change. */
306
+ interface MetricData extends DataLink {
307
+ delta?: MetricDelta;
308
+ }
309
+ /** The keys of a drawn metric that were computed (or derived) rather than written. */
310
+ type MetricDerivedKey = 'value' | 'delta' | 'trend' | 'sentiment';
311
+ /**
312
+ * The 0.37 part of a metric, which a PowerPoint export keeps beside the 0.36 form of what it draws (the `link` key of the metric's tag):
313
+ * the link, the direction that is good, the number format, which keys of the drawn metric were derived, and the numbers whose drawn text
314
+ * the 0.36 form holds.
315
+ */
316
+ interface MetricRecord {
317
+ data?: MetricData;
318
+ better?: 'up' | 'down';
319
+ format?: string;
320
+ /** The keys of the drawn metric that came from the link (or from `better`) and are not typed. */
321
+ derived?: MetricDerivedKey[];
322
+ /** The numbers behind the text the drawn `value` and `delta` hold, when a number format made them text. */
323
+ numbers?: {
324
+ value?: number;
325
+ delta?: number;
326
+ };
327
+ }
328
+ /** A finding of the metric's link; `fix` is the safe patch of a `metric-data-stale` warning. */
329
+ interface MetricDataDiagnostic extends DataDiagnostic {
330
+ fix?: {
331
+ title: string;
332
+ patch: {
333
+ op: 'add' | 'replace';
334
+ path: string;
335
+ value: string | number;
336
+ }[];
337
+ };
338
+ }
339
+ /**
340
+ * What a metric's value is drawn as, for an engine that draws it differently (a gauge's arc and its end labels): `text` is what the
341
+ * metric shows, `number` the number behind it (absent when the value is a string that is not computed from a number), `format` the pattern that
342
+ * wrote it (absent for the General form and for a string), `computed` whether it came from the link.
343
+ */
344
+ interface ResolvedMetricValue {
345
+ text: string;
346
+ number?: number;
347
+ format?: string;
348
+ isNumber: boolean;
349
+ computed: boolean;
350
+ }
351
+ interface ResolvedMetric {
352
+ /** The metric to draw: the 0.36 form (`data`, `better` and `format` removed; `value`, `delta`, `trend` and `sentiment` as drawn). The same object when the metric has none of the three. */
353
+ metric: unknown;
354
+ /** Whether the link resolved (the computed numbers are drawn). False without a link. */
355
+ resolved: boolean;
356
+ /** The value as drawn. Absent for a metric that is not an object. */
357
+ value?: ResolvedMetricValue;
358
+ /** The change as drawn, when there is one. */
359
+ delta?: {
360
+ text: string;
361
+ number?: number;
362
+ computed: boolean;
363
+ };
364
+ /** The 0.37 part, absent when the metric has no `data`, `better` or `format`. */
365
+ record?: MetricRecord;
366
+ diagnostics: MetricDataDiagnostic[];
367
+ }
368
+ interface ResolveMetricOptions {
369
+ /** JSON Pointer of the metric object, the base of diagnostic paths. Default: "" (paths start at `/data`). */
370
+ path?: string;
371
+ /** The deck language: the digits and separators of a formatted number. */
372
+ language?: string;
373
+ }
374
+ /**
375
+ * Resolve a metric against the deck's datasets. `datasets` is the top-level `datasets` map (or the document: its `datasets` key is read).
376
+ * A metric without `data`, `better` and `format` comes back as the same object. A metric whose link does not resolve (an error, an
377
+ * aggregate its column refuses, no usable cell) draws its written `value` and `delta`, as before.
378
+ */
379
+ declare function resolveMetric(metric: unknown, datasets: unknown, options?: ResolveMetricOptions): ResolvedMetric;
380
+
381
+ export { resolveTableData as $, cellMatchesType as I, chartNumber as J, dataProvenance as K, dataSourcesOf as L, datasetColumnDeclaration as N, datasetDiagnostics as O, formatDataNumber as P, fromExcelNumberFormat as Q, inlineChartData as S, inlineDatasets as T, inlineTableData as U, isDatasetRef as V, isXYChartType as W, numberFormatError as X, resolveChartData as Y, resolveDataSource as Z, resolveMetric as _, suggestCellTypeFix as a0, suggestChartNumberFix as a1, tableCellDisplayValue as a2, toExcelNumberFormat as a3, unusedDatasets as a4, tableKeyText as a6 };
382
+ export type { MetricDerivedKey as A, MetricRecord as B, ChartMapping as C, DataCellValue as D, ResolvedChartData as E, ResolvedMetric as F, ResolvedMetricValue as G, ResolvedTableData as H, MetricData as M, ResolveMetricOptions as R, DatasetColumn as a, ChartComboSeries as a5, DataColumnType as b, DataColumnRole as c, ChartNumberFix as d, ChartNumberFixOperation as e, ChartNumberFixOptions as f, DataAggregate as g, DataColumn as h, DataCondition as i, DataDiagnostic as j, DataDiagnosticCode as k, DataFilter as l, DataGenerator as m, DataLink as n, DataProvenance as o, DataResolveOptions as p, DataSource as q, DataStyledCell as r, DataTableCell as s, DataTableHeader as t, DataTableValue as u, DataTextRun as v, Dataset as w, DatasetRef as x, MetricDataDiagnostic as y, MetricDelta as z };
@@ -1,14 +1,14 @@
1
- export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-DhsB0SUz.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-CL7ipVGO.js';
3
- export { C as ConversionPlan, D as Diagnostic, c as EXPORT_FORMATS, d as EXPORT_TEXT, e as ExportContext, f as ExportContinuedSlide, g as ExportFile, h as ExportFontSummary, i as ExportFormat, j as ExportOptions, k as ExportResult, l as ExportRun, m as ExportText, I as ImportOptions, n as ImportResult, o as OPFExportError, p as OPFImportError, q as PEER_RANGES, r as PPTX_PACKAGE, s as PreparedExport, t as RENDER_EXTRAS, u as RENDER_PACKAGE, v as ReportFinding, w as ResolvedExportOptions, S as SlideSelection, x as Source, V as VERSIONS, y as asApiError, z as assetRoot, A as checkDate, B as checkOptions, G as checkRenamedOptions, H as checkScale, J as deckFileFormat, K as exportFormatOf, L as finishReport, M as importPresentation, N as loadPptx, Q as loadRenderer, T as locatePackage, U as missingPeerFrom, W as parseSlideSelection, X as planConversion, Y as prepareExport, Z as reaches, _ as readInput, $ as reportThrown, a0 as resolveExportOptions, a1 as runExport, a2 as runPreparedExport, a3 as writePlanned } from './conversion-CL7ipVGO.js';
1
+ export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-BwgsIRAf.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-DF_HgknQ.js';
3
+ export { C as ConversionPlan, D as Diagnostic, c as EXPORT_FORMATS, d as EXPORT_TEXT, e as ExportContext, f as ExportContinuedSlide, g as ExportFile, h as ExportFontSummary, i as ExportFormat, j as ExportOptions, k as ExportResult, l as ExportRun, m as ExportText, I as ImportOptions, n as ImportResult, o as OPFExportError, p as OPFImportError, q as PEER_RANGES, r as PPTX_PACKAGE, s as PreparedExport, t as RENDER_EXTRAS, u as RENDER_PACKAGE, v as ReportFinding, w as ResolvedExportOptions, S as SlideSelection, x as Source, V as VERSIONS, y as asApiError, z as assetRoot, A as checkDate, B as checkOptions, G as checkRenamedOptions, H as checkScale, J as deckFileFormat, K as exportFormatOf, L as finishReport, M as importPresentation, N as loadPptx, Q as loadRenderer, T as locatePackage, U as missingPeerFrom, W as parseSlideSelection, X as planConversion, Y as prepareExport, Z as reaches, _ as readInput, $ as reportThrown, a0 as resolveExportOptions, a1 as runExport, a2 as runPreparedExport, a3 as writePlanned } from './conversion-DF_HgknQ.js';
4
4
  import { Catalog } from './composition.js';
5
5
  import { Fonts } from './composition.js';
6
6
  import { PresentationPaginationResult } from './index.js';
7
- import './presentation-Dx-kZC8Y.js';
8
- import './validation-types-bnrso0JL.js';
7
+ import './presentation-DmOhusrX.js';
8
+ import './validation-types-CV-ngACL.js';
9
9
  import './finding-mcHslZLA.js';
10
10
  import './json-BFSdESOE.js';
11
- import './chart-data-B_k-WTex.js';
11
+ import './metric-data-B4Q8RFRR.js';
12
12
  import './shape-geometry.js';
13
13
 
14
14
  /** `deck.opf.json` and `deck.pptx` both give `deck`; stdin gives `deck`. */
@@ -1,29 +1,29 @@
1
- import { loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts, missingPeerFrom } from './chunk-SER6GJTT.js';
2
- export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, iconSourceReader, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportSubstitutions, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-SER6GJTT.js';
1
+ import { loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts, missingPeerFrom } from './chunk-EOMENOKY.js';
2
+ export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, iconSourceReader, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportSubstitutions, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-EOMENOKY.js';
3
3
  import { defaultCatalogs } from './chunk-XJUMFH33.js';
4
4
  export { defaultCatalogs } from './chunk-XJUMFH33.js';
5
- import { OPFApiError } from './chunk-O65COLKF.js';
6
- export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-O65COLKF.js';
5
+ import { OPFApiError } from './chunk-HS2JQ3AO.js';
6
+ export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-HS2JQ3AO.js';
7
7
  import './chunk-W4DYDRV2.js';
8
- import './chunk-6VGLE7C5.js';
9
- import './chunk-XRMYP4JD.js';
10
- import { paginate } from './chunk-BPSZ7OWD.js';
11
- export { readDeckReport } from './chunk-GNKOQ6NA.js';
12
- import './chunk-2NIID3QD.js';
13
- import './chunk-J7FUSZZ5.js';
14
- import './chunk-MS2LPR7F.js';
8
+ import './chunk-QQBOI5XI.js';
9
+ import './chunk-ORVMHVOS.js';
10
+ import { paginate } from './chunk-YZ4WMB5C.js';
11
+ export { readDeckReport } from './chunk-TIVBO56G.js';
12
+ import './chunk-CYGQY6HH.js';
13
+ import './chunk-4FA4ZABY.js';
14
+ import './chunk-6WN6PRCI.js';
15
15
  import './chunk-RYZPBJLB.js';
16
- import './chunk-TJMESSBQ.js';
17
- import './chunk-7JE3XTL7.js';
18
- import './chunk-F5SY7MSA.js';
19
- import './chunk-APCNAAA7.js';
20
- import './chunk-AZELWKG2.js';
21
- import './chunk-OFL3WY6F.js';
22
- import './chunk-6WVPFWPD.js';
23
- import './chunk-4FA4AZXY.js';
16
+ import './chunk-44IS6ZU2.js';
17
+ import './chunk-BHRCWV6B.js';
18
+ import './chunk-56BYOGIF.js';
19
+ import './chunk-VD7WLE3C.js';
20
+ import './chunk-XJU2X5JM.js';
21
+ import './chunk-3A3PNYNP.js';
22
+ import './chunk-JTNCBTEH.js';
23
+ import './chunk-C5ACMFKB.js';
24
24
  import './chunk-JBARNYFR.js';
25
- import './chunk-3KPTVK77.js';
26
- import './chunk-HHQROUYC.js';
25
+ import './chunk-KANQVJGK.js';
26
+ import './chunk-QFT4R2IL.js';
27
27
  import './chunk-BLCDUM7B.js';
28
28
  import './chunk-PRXZD2II.js';
29
29
 
@@ -1,5 +1,5 @@
1
- import { C as ComposeSlideOptions, M as MessageSurface, F as Fonts, L as LayoutDiagnostic } from './composition-CSM7YfBl.js';
2
- import { U as UnresolvedReferenceDiagnostic, R as ResolvedColorRoles, b as ColorVariant, c as RecordProvenance, d as CatalogOptions, C as Catalog } from './catalog-refs-BgotJhR5.js';
1
+ import { C as ComposeSlideOptions, M as MessageSurface, F as Fonts, L as LayoutDiagnostic } from './composition-DiKC371V.js';
2
+ import { U as UnresolvedReferenceDiagnostic, R as ResolvedColorRoles, b as ColorVariant, c as RecordProvenance, d as CatalogOptions, C as Catalog } from './catalog-refs-BeRgtpZS.js';
3
3
 
4
4
  /**
5
5
  * One slide's composition context: the layout, canvas, theme and font families that `composeSlide` needs,
@@ -90,9 +90,9 @@ interface PaginationOptions extends Omit<ComposeSlideOptions, 'textMeasurement'>
90
90
  catalogs?: readonly Catalog[];
91
91
  /**
92
92
  * Readability floor used while choosing page breaks. Default 24 reference pixels; with `wholeBlocks`, the slide's own floor
93
- * (its `composition.minFontSize`, its layout's, else 16), and the pages keep the slide's composition as authored.
93
+ * (its `composition.minFontSizePx`, its layout's, else 16), and the pages keep the slide's composition as authored.
94
94
  */
95
- minFontSize?: number;
95
+ minFontSizePx?: number;
96
96
  /**
97
97
  * LH-90: break only between the slide's block units (`blockUnits`: a lead block and the blocks that follow it; each root block
98
98
  * alone when the slide has none), never inside one. Retain settled source sizes for comparable automatic body roles, then
@@ -151,7 +151,7 @@ interface PresentationPaginationOptions extends CatalogOptions {
151
151
  fonts?: Fonts;
152
152
  /** Unscaled reference-pixel clearance for supplied vector text outlines. */
153
153
  textRasterPadding?: number;
154
- minFontSize?: number;
154
+ minFontSizePx?: number;
155
155
  maxSlides?: number;
156
156
  /** Host-supplied current calendar date (ISO YYYY-MM-DD) for `date: true` header/footer fields. */
157
157
  date?: string;
@@ -1,5 +1,5 @@
1
- import './composition-CSM7YfBl.js';
2
- import './catalog-refs-BgotJhR5.js';
3
- export { C as ContinuationResult, d as ContinuedSlide, O as OPFPaginationError, P as PaginatedPage, m as PaginationDiagnostic, e as PaginationMapping, f as PaginationOptions, g as PaginationResult, a as PresentationPaginationOptions, b as PresentationPaginationResult, j as blockUnits, k as continuationPages, c as continueOverfull, p as paginate, l as paginateSlide } from './pagination-BSqq32xt.js';
4
- import './chart-data-B_k-WTex.js';
1
+ import './composition-DiKC371V.js';
2
+ import './catalog-refs-BeRgtpZS.js';
3
+ export { C as ContinuationResult, d as ContinuedSlide, O as OPFPaginationError, P as PaginatedPage, m as PaginationDiagnostic, e as PaginationMapping, f as PaginationOptions, g as PaginationResult, a as PresentationPaginationOptions, b as PresentationPaginationResult, j as blockUnits, k as continuationPages, c as continueOverfull, p as paginate, l as paginateSlide } from './pagination-C9qnH_n-.js';
4
+ import './metric-data-B4Q8RFRR.js';
5
5
  import './shape-geometry.js';
@@ -1,7 +1,7 @@
1
- export { OPFPaginationError, blockUnits, continuationPages, continueOverfull, paginate, paginateSlide } from './chunk-BPSZ7OWD.js';
2
- import './chunk-4FA4AZXY.js';
1
+ export { OPFPaginationError, blockUnits, continuationPages, continueOverfull, paginate, paginateSlide } from './chunk-YZ4WMB5C.js';
2
+ import './chunk-C5ACMFKB.js';
3
3
  import './chunk-JBARNYFR.js';
4
- import './chunk-3KPTVK77.js';
5
- import './chunk-HHQROUYC.js';
4
+ import './chunk-KANQVJGK.js';
5
+ import './chunk-QFT4R2IL.js';
6
6
  import './chunk-BLCDUM7B.js';
7
7
  import './chunk-PRXZD2II.js';
package/dist/patch.js CHANGED
@@ -1,6 +1,6 @@
1
- export { OPFPatchError, OPFPatchHashError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, documentHash, escapePointerToken, formatPointer, getAtPointer, hasPointer, idToken, invertPatch, isIdToken, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, resolveIdPatch, resolveIdPointer, splitPointer, toIdPatch, toIdPointer, unescapePointerToken, walkPatch } from './chunk-4FA4AZXY.js';
1
+ export { OPFPatchError, OPFPatchHashError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, documentHash, escapePointerToken, formatPointer, getAtPointer, hasPointer, idToken, invertPatch, isIdToken, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, resolveIdPatch, resolveIdPointer, splitPointer, toIdPatch, toIdPointer, unescapePointerToken, walkPatch } from './chunk-C5ACMFKB.js';
2
2
  import './chunk-JBARNYFR.js';
3
- import './chunk-3KPTVK77.js';
4
- import './chunk-HHQROUYC.js';
3
+ import './chunk-KANQVJGK.js';
4
+ import './chunk-QFT4R2IL.js';
5
5
  import './chunk-BLCDUM7B.js';
6
6
  import './chunk-PRXZD2II.js';
@@ -1,6 +1,6 @@
1
1
  import { installSchemaEngine } from './chunk-43JWUIGF.js';
2
- import { schemaEngine } from './chunk-SEC4IOOS.js';
3
- import './chunk-3KPTVK77.js';
2
+ import { schemaEngine } from './chunk-YESKKKVE.js';
3
+ import './chunk-KANQVJGK.js';
4
4
  import './chunk-PRXZD2II.js';
5
5
 
6
6
  // src/precompiled.ts