@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.
- package/README.md +1 -1
- package/dist/audit.d.ts +9 -130
- package/dist/audit.js +5 -5
- package/dist/{catalogs-BnI7JKcn.d.ts → catalogs-ywCamd8C.d.ts} +1 -1
- package/dist/catalogs.d.ts +2 -2
- package/dist/chart-data-Cdr6rRVV.d.ts +177 -0
- package/dist/{chunk-6LZK2IZB.js → chunk-7N4VMAT4.js} +11 -7
- package/dist/{chunk-4LAM3N6S.js → chunk-7QBCWNWL.js} +424 -18
- package/dist/{chunk-SOSOBKQ2.js → chunk-ATGDDJPX.js} +4 -5
- package/dist/{chunk-V2537ENL.js → chunk-II5EYKZU.js} +9 -7
- package/dist/{chunk-MWPMJE6P.js → chunk-INU7ZNSB.js} +50 -2
- package/dist/{chunk-RUC7L5DJ.js → chunk-IS2CPNVJ.js} +1 -1
- package/dist/{chunk-JKVKYVWL.js → chunk-IYCJUKWD.js} +90 -471
- package/dist/{chunk-HOBSL7AJ.js → chunk-MPM7NRG7.js} +2396 -1408
- package/dist/{chunk-AUM5MXBR.js → chunk-RAYB46AB.js} +8 -6
- package/dist/{composition-DWbCiMwF.d.ts → composition-D7we69Tr.d.ts} +7 -0
- package/dist/composition.d.ts +2 -1
- package/dist/composition.js +1 -1
- package/dist/convert.d.ts +4 -1
- package/dist/convert.js +33 -16
- package/dist/data.d.ts +2 -1
- package/dist/data.js +3 -1
- package/dist/diff.d.ts +1 -1
- package/dist/diff.js +8 -7
- package/dist/docs.js +32 -26
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +102 -57
- package/dist/format.js +1 -1
- package/dist/index.d.ts +13 -10
- package/dist/index.js +8 -8
- package/dist/lint-B7azdiuE.d.ts +197 -0
- package/dist/lint.d.ts +7 -70
- package/dist/lint.js +4 -4
- package/dist/markdown.d.ts +7 -5
- package/dist/markdown.js +5 -5
- package/dist/pagination.d.ts +2 -1
- package/dist/pagination.js +4 -4
- package/dist/patch.js +4 -4
- package/dist/{presentation-DcF-MZcz.d.ts → presentation-mG-IYErQ.d.ts} +187 -14
- package/dist/repo-readme.js +1 -1
- package/dist/{schemas-BSjlG8-R.d.ts → schemas-BbPonsTz.d.ts} +18 -0
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/spec/catalogs/manifest.json +3 -3
- package/dist/spec/schemas/opf.schema.json +238 -20
- package/dist/types.d.ts +4 -4
- package/dist/{validator-DfG9yxba.d.ts → validator-CIylxoIm.d.ts} +3 -3
- package/dist/validator.d.ts +4 -4
- package/dist/validator.js +3 -3
- package/package.json +3 -3
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { C as CatalogKind } from './catalogs-ywCamd8C.js';
|
|
2
|
+
import { V as ValidationIssue } from './validator-CIylxoIm.js';
|
|
3
|
+
import { J as JsonPrimitive } from './schemas-BbPonsTz.js';
|
|
4
|
+
import { T as TextMeasurement } from './composition-D7we69Tr.js';
|
|
5
|
+
|
|
6
|
+
/** Same three levels as `lintSource`. */
|
|
7
|
+
type AuditSeverity = LintSeverity;
|
|
8
|
+
type AuditCategory = 'accessibility' | 'design' | 'content';
|
|
9
|
+
/** One JSON Patch operation (RFC 6902 subset) a quick fix applies. Paths are JSON Pointers into the audited document. */
|
|
10
|
+
interface AuditPatchOperation {
|
|
11
|
+
op: 'add' | 'replace' | 'remove';
|
|
12
|
+
path: string;
|
|
13
|
+
value?: unknown;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A suggested repair. Core never applies it: a host shows it and applies it through its own undoable edit path.
|
|
17
|
+
* `focus` fixes only name the field the author must fill in; `patch` fixes are small, deterministic and leave
|
|
18
|
+
* every unrelated field untouched.
|
|
19
|
+
*/
|
|
20
|
+
interface AuditFix {
|
|
21
|
+
/** Stable id within one diagnostic, such as `focus-alt` or `inherit-text-color`. */
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
kind: 'patch' | 'focus';
|
|
25
|
+
/** True when applying the fix cannot change the meaning of the content (a colour switched to a readable one, a field focused). */
|
|
26
|
+
safe: boolean;
|
|
27
|
+
patch?: AuditPatchOperation[];
|
|
28
|
+
/** For `focus`: the JSON Pointer of the field to edit and a hint of what it is. */
|
|
29
|
+
focus?: {
|
|
30
|
+
path: string;
|
|
31
|
+
field: 'alt' | 'title' | 'text' | 'link' | 'language' | 'fontSize';
|
|
32
|
+
value?: unknown;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
interface AuditDiagnostic extends LintDiagnostic {
|
|
36
|
+
/** `audit/<rule>`; ids are stable across releases. */
|
|
37
|
+
ruleId: string;
|
|
38
|
+
/** Zero-based slide index when the finding belongs to one slide. */
|
|
39
|
+
slide?: number;
|
|
40
|
+
slideId?: string;
|
|
41
|
+
category: AuditCategory;
|
|
42
|
+
/** Measured values behind the finding (ratios, sizes, counts), for reporters and tests. */
|
|
43
|
+
measured?: Record<string, number | string | boolean | null>;
|
|
44
|
+
fixes?: AuditFix[];
|
|
45
|
+
}
|
|
46
|
+
interface AuditThresholds {
|
|
47
|
+
/** Minimum WCAG contrast ratio for normal text. WCAG 2.x AA: 4.5. */
|
|
48
|
+
contrastNormal: number;
|
|
49
|
+
/** Minimum ratio for large text (at least 18 pt, or 14 pt bold). WCAG 2.x AA: 3. */
|
|
50
|
+
contrastLarge: number;
|
|
51
|
+
/** Smallest rendered text size, in points, before `audit/min-font-size` reports. */
|
|
52
|
+
minFontSizePt: number;
|
|
53
|
+
/** Words on one slide above which `audit/slide-word-count` reports. */
|
|
54
|
+
maxWordsPerSlide: number;
|
|
55
|
+
/** Distinct font families across the deck above which `audit/font-family-count` reports. */
|
|
56
|
+
maxFontFamilies: number;
|
|
57
|
+
/** Minimum effective pixels per inch of an embedded raster image at its displayed size. */
|
|
58
|
+
minImagePpi: number;
|
|
59
|
+
/** Largest title offset between slides of the same layout, as a fraction of the slide width/height. */
|
|
60
|
+
titlePositionTolerance: number;
|
|
61
|
+
/** Smallest CIE76 colour difference between two chart series (after colour-vision simulation) before they count as confusable. */
|
|
62
|
+
minSeriesColorDifference: number;
|
|
63
|
+
}
|
|
64
|
+
interface AuditOptions {
|
|
65
|
+
/** Per-rule severity, or `off`. Keys are full ids (`audit/text-contrast`) or the bare name (`text-contrast`). */
|
|
66
|
+
rules?: Record<string, AuditSeverity | 'off'>;
|
|
67
|
+
/** Rules not to run (full ids or bare names). */
|
|
68
|
+
ignore?: readonly string[];
|
|
69
|
+
/** When set, run only these rules (full ids or bare names). */
|
|
70
|
+
only?: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Suppress a rule below a JSON Pointer prefix, for one accepted exception, for example
|
|
73
|
+
* `{rule: 'audit/text-contrast', path: '/slides/3'}`. A prefix matches whole path segments.
|
|
74
|
+
*/
|
|
75
|
+
ignorePaths?: readonly {
|
|
76
|
+
rule: string;
|
|
77
|
+
path: string;
|
|
78
|
+
}[];
|
|
79
|
+
thresholds?: Partial<AuditThresholds>;
|
|
80
|
+
/** Loaded catalog records, consulted after the document's own `catalogs` and before the bundled ones. */
|
|
81
|
+
catalogs?: Partial<Record<CatalogKind, readonly unknown[]>>;
|
|
82
|
+
/**
|
|
83
|
+
* The host's measured fonts. Without it composition uses core's portable estimate; see docs/audit.md.
|
|
84
|
+
* A function receives the zero-based slide index, so a host can supply a script-aware measurement per slide.
|
|
85
|
+
*/
|
|
86
|
+
textMeasurement?: TextMeasurement | ((slideIndex: number) => TextMeasurement | undefined);
|
|
87
|
+
/** Chart series palette (opaque `#RRGGBB`), in the engine's order. Default: the palette opf-render and opf-pptx use. */
|
|
88
|
+
chartPalette?: readonly string[];
|
|
89
|
+
}
|
|
90
|
+
interface AuditRuleInfo {
|
|
91
|
+
/** Stable `audit/<name>` id. */
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
category: AuditCategory;
|
|
95
|
+
/** Default severity. */
|
|
96
|
+
severity: AuditSeverity;
|
|
97
|
+
summary: string;
|
|
98
|
+
/** Why the rule exists. */
|
|
99
|
+
rationale: string;
|
|
100
|
+
/** The accessibility or design standard it follows, when there is one. */
|
|
101
|
+
standard?: string;
|
|
102
|
+
/** What the check cannot see or approximates. */
|
|
103
|
+
approximations?: string;
|
|
104
|
+
/** Threshold names (`AuditThresholds`) the rule reads. */
|
|
105
|
+
thresholds?: (keyof AuditThresholds)[];
|
|
106
|
+
}
|
|
107
|
+
interface AuditReport {
|
|
108
|
+
/** True when no finding has severity `error` (the same meaning as lint's `valid`). */
|
|
109
|
+
valid: boolean;
|
|
110
|
+
/** False when the document failed schema validation, so no design rule was run. */
|
|
111
|
+
documentValid: boolean;
|
|
112
|
+
diagnostics: AuditDiagnostic[];
|
|
113
|
+
counts: Record<AuditSeverity, number>;
|
|
114
|
+
/** Rule ids that ran, in registry order. */
|
|
115
|
+
rulesRun: string[];
|
|
116
|
+
slideCount: number;
|
|
117
|
+
thresholds: AuditThresholds;
|
|
118
|
+
checks: {
|
|
119
|
+
/** `estimated` unless the host supplied `textMeasurement`. */
|
|
120
|
+
textMeasurement: 'estimated' | 'provided';
|
|
121
|
+
/** Text contrast is computed against solid, gradient and pattern backgrounds; picture pixels are never read. */
|
|
122
|
+
backgroundPixels: 'not-read';
|
|
123
|
+
/** Image resolution reads only embedded `data:` images; URLs are never fetched. */
|
|
124
|
+
imageBytes: 'embedded-only';
|
|
125
|
+
nativeExport: 'not-checked';
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
type LintSeverity = 'error' | 'warning' | 'info';
|
|
130
|
+
interface LintLocation {
|
|
131
|
+
offset: number;
|
|
132
|
+
length: number;
|
|
133
|
+
line: number;
|
|
134
|
+
column: number;
|
|
135
|
+
}
|
|
136
|
+
interface LintSuggestion {
|
|
137
|
+
value: JsonPrimitive;
|
|
138
|
+
label: string;
|
|
139
|
+
origin: 'schema' | 'built-in' | 'loaded' | 'document' | 'contract';
|
|
140
|
+
definition: string;
|
|
141
|
+
}
|
|
142
|
+
interface LintDiagnostic {
|
|
143
|
+
ruleId: string;
|
|
144
|
+
severity: LintSeverity;
|
|
145
|
+
/** JSON Pointer into the document, or the explicitly supplied lint context. */
|
|
146
|
+
path: string;
|
|
147
|
+
scope: 'document' | 'context';
|
|
148
|
+
message: string;
|
|
149
|
+
help: string;
|
|
150
|
+
definition?: string;
|
|
151
|
+
lookup?: string[];
|
|
152
|
+
suggestions?: LintSuggestion[];
|
|
153
|
+
/** Full validation issue retained, including errors inside union alternatives. */
|
|
154
|
+
validation?: ValidationIssue;
|
|
155
|
+
/** Original-source UTF-16 offsets and one-based line/column. */
|
|
156
|
+
location?: LintLocation;
|
|
157
|
+
/**
|
|
158
|
+
* Suggested repairs (the audit fix shape: JSON Patch that core never applies). RR-54: an
|
|
159
|
+
* `opf/chart-value-not-numeric` cell whose column is written in one display style carries the column's fix.
|
|
160
|
+
*/
|
|
161
|
+
fixes?: AuditFix[];
|
|
162
|
+
}
|
|
163
|
+
interface LintContract {
|
|
164
|
+
/** JSON Pointer pattern; a complete '*' segment matches one path segment. */
|
|
165
|
+
path: string;
|
|
166
|
+
allowedValues: JsonPrimitive[];
|
|
167
|
+
severity?: LintSeverity;
|
|
168
|
+
message?: string;
|
|
169
|
+
documentation?: string;
|
|
170
|
+
}
|
|
171
|
+
interface LintOptions {
|
|
172
|
+
/** Records already loaded by the host. This API never fetches catalog URLs. */
|
|
173
|
+
catalogs?: Partial<Record<CatalogKind, readonly unknown[]>>;
|
|
174
|
+
/** Explicit host policy. Document metadata is never interpreted as policy. */
|
|
175
|
+
contracts?: readonly LintContract[];
|
|
176
|
+
}
|
|
177
|
+
interface LintReport {
|
|
178
|
+
valid: boolean;
|
|
179
|
+
schemaValid: boolean | null;
|
|
180
|
+
diagnostics: LintDiagnostic[];
|
|
181
|
+
counts: Record<LintSeverity, number>;
|
|
182
|
+
checks: {
|
|
183
|
+
syntax: 'checked' | 'not-applicable';
|
|
184
|
+
schema: 'checked' | 'not-run';
|
|
185
|
+
catalogReferences: 'local-context' | 'not-run';
|
|
186
|
+
assetReferences: 'registry-only' | 'not-run';
|
|
187
|
+
contracts: 'checked' | 'not-run';
|
|
188
|
+
layout: 'not-checked';
|
|
189
|
+
fonts: 'not-checked';
|
|
190
|
+
nativeExport: 'not-checked';
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
declare function lintPresentation(document: unknown, options?: LintOptions): LintReport;
|
|
194
|
+
/** Lint strict JSON source without normalizing whitespace or duplicate keys. */
|
|
195
|
+
declare function lintSource(source: string, options?: LintOptions): LintReport;
|
|
196
|
+
|
|
197
|
+
export { type AuditThresholds as A, type LintDiagnostic as L, type AuditOptions as a, type AuditReport as b, type AuditRuleInfo as c, type AuditCategory as d, type AuditDiagnostic as e, type AuditFix as f, type AuditPatchOperation as g, type AuditSeverity as h, type LintLocation as i, type LintSeverity as j, type LintContract as k, type LintOptions as l, type LintReport as m, type LintSuggestion as n, lintPresentation as o, lintSource as p };
|
package/dist/lint.d.ts
CHANGED
|
@@ -1,70 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
offset: number;
|
|
9
|
-
length: number;
|
|
10
|
-
line: number;
|
|
11
|
-
column: number;
|
|
12
|
-
}
|
|
13
|
-
interface LintSuggestion {
|
|
14
|
-
value: JsonPrimitive;
|
|
15
|
-
label: string;
|
|
16
|
-
origin: 'schema' | 'built-in' | 'loaded' | 'document' | 'contract';
|
|
17
|
-
definition: string;
|
|
18
|
-
}
|
|
19
|
-
interface LintDiagnostic {
|
|
20
|
-
ruleId: string;
|
|
21
|
-
severity: LintSeverity;
|
|
22
|
-
/** JSON Pointer into the document, or the explicitly supplied lint context. */
|
|
23
|
-
path: string;
|
|
24
|
-
scope: 'document' | 'context';
|
|
25
|
-
message: string;
|
|
26
|
-
help: string;
|
|
27
|
-
definition?: string;
|
|
28
|
-
lookup?: string[];
|
|
29
|
-
suggestions?: LintSuggestion[];
|
|
30
|
-
/** Full validation issue retained, including errors inside union alternatives. */
|
|
31
|
-
validation?: ValidationIssue;
|
|
32
|
-
/** Original-source UTF-16 offsets and one-based line/column. */
|
|
33
|
-
location?: LintLocation;
|
|
34
|
-
}
|
|
35
|
-
interface LintContract {
|
|
36
|
-
/** JSON Pointer pattern; a complete '*' segment matches one path segment. */
|
|
37
|
-
path: string;
|
|
38
|
-
allowedValues: JsonPrimitive[];
|
|
39
|
-
severity?: LintSeverity;
|
|
40
|
-
message?: string;
|
|
41
|
-
documentation?: string;
|
|
42
|
-
}
|
|
43
|
-
interface LintOptions {
|
|
44
|
-
/** Records already loaded by the host. This API never fetches catalog URLs. */
|
|
45
|
-
catalogs?: Partial<Record<CatalogKind, readonly unknown[]>>;
|
|
46
|
-
/** Explicit host policy. Document metadata is never interpreted as policy. */
|
|
47
|
-
contracts?: readonly LintContract[];
|
|
48
|
-
}
|
|
49
|
-
interface LintReport {
|
|
50
|
-
valid: boolean;
|
|
51
|
-
schemaValid: boolean | null;
|
|
52
|
-
diagnostics: LintDiagnostic[];
|
|
53
|
-
counts: Record<LintSeverity, number>;
|
|
54
|
-
checks: {
|
|
55
|
-
syntax: 'checked' | 'not-applicable';
|
|
56
|
-
schema: 'checked' | 'not-run';
|
|
57
|
-
catalogReferences: 'local-context' | 'not-run';
|
|
58
|
-
assetReferences: 'registry-only' | 'not-run';
|
|
59
|
-
contracts: 'checked' | 'not-run';
|
|
60
|
-
layout: 'not-checked';
|
|
61
|
-
fonts: 'not-checked';
|
|
62
|
-
nativeExport: 'not-checked';
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
/** Read-only lint with actionable schema, local catalog and explicit policy context. */
|
|
66
|
-
declare function lintPresentation(document: unknown, options?: LintOptions): LintReport;
|
|
67
|
-
/** Lint strict JSON source without normalizing whitespace or duplicate keys. */
|
|
68
|
-
declare function lintSource(source: string, options?: LintOptions): LintReport;
|
|
69
|
-
|
|
70
|
-
export { type LintContract, type LintDiagnostic, type LintLocation, type LintOptions, type LintReport, type LintSeverity, type LintSuggestion, lintPresentation, lintSource };
|
|
1
|
+
import './catalogs-ywCamd8C.js';
|
|
2
|
+
import './validator-CIylxoIm.js';
|
|
3
|
+
import './schemas-BbPonsTz.js';
|
|
4
|
+
export { k as LintContract, L as LintDiagnostic, i as LintLocation, l as LintOptions, m as LintReport, j as LintSeverity, n as LintSuggestion, o as lintPresentation, p as lintSource } from './lint-B7azdiuE.js';
|
|
5
|
+
import './presentation-mG-IYErQ.js';
|
|
6
|
+
import './composition-D7we69Tr.js';
|
|
7
|
+
import './chart-data-Cdr6rRVV.js';
|
package/dist/lint.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { lintPresentation, lintSource } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { lintPresentation, lintSource } from './chunk-INU7ZNSB.js';
|
|
2
|
+
import './chunk-IYCJUKWD.js';
|
|
3
|
+
import './chunk-MPM7NRG7.js';
|
|
4
4
|
import './chunk-S5W34SIJ.js';
|
|
5
5
|
import './chunk-E34DJ5LL.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-7QBCWNWL.js';
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { LintDiagnostic, LintLocation, LintSeverity } from './lint.js';
|
|
2
|
-
import { P as Presentation } from './presentation-
|
|
3
|
-
import './catalogs-
|
|
4
|
-
import './schemas-
|
|
5
|
-
import './validator-
|
|
1
|
+
import { L as LintDiagnostic, i as LintLocation, j as LintSeverity } from './lint-B7azdiuE.js';
|
|
2
|
+
import { P as Presentation } from './presentation-mG-IYErQ.js';
|
|
3
|
+
import './catalogs-ywCamd8C.js';
|
|
4
|
+
import './schemas-BbPonsTz.js';
|
|
5
|
+
import './validator-CIylxoIm.js';
|
|
6
|
+
import './composition-D7we69Tr.js';
|
|
7
|
+
import './chart-data-Cdr6rRVV.js';
|
|
6
8
|
|
|
7
9
|
interface EmbeddedPart {
|
|
8
10
|
/** JSON Pointer into the OPF document. */
|
package/dist/markdown.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { same, isRecord, parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, runText, isPlainRun, FORMATTING, fenceCode } from './chunk-
|
|
2
|
-
import { lintPresentation } from './chunk-
|
|
3
|
-
import { validatePresentation } from './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { same, isRecord, parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, runText, isPlainRun, FORMATTING, fenceCode } from './chunk-II5EYKZU.js';
|
|
2
|
+
import { lintPresentation } from './chunk-INU7ZNSB.js';
|
|
3
|
+
import { validatePresentation } from './chunk-IYCJUKWD.js';
|
|
4
|
+
import './chunk-MPM7NRG7.js';
|
|
5
5
|
import './chunk-S5W34SIJ.js';
|
|
6
6
|
import './chunk-E34DJ5LL.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-7QBCWNWL.js';
|
|
8
8
|
import { parseDocument, YAMLMap, Scalar, stringify } from 'yaml';
|
|
9
9
|
|
|
10
10
|
// src/markdown/canon.ts
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { T as TextMeasurement, C as ComposeSlideOptions, F as FontSchemeDiagnostic, L as LayoutDiagnostic } from './composition-
|
|
1
|
+
import { T as TextMeasurement, C as ComposeSlideOptions, F as FontSchemeDiagnostic, L as LayoutDiagnostic } from './composition-D7we69Tr.js';
|
|
2
|
+
import './chart-data-Cdr6rRVV.js';
|
|
2
3
|
|
|
3
4
|
interface PaginationOptions extends ComposeSlideOptions {
|
|
4
5
|
/** Readability floor used while choosing page breaks. Default 24 reference pixels. */
|
package/dist/pagination.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-RAYB46AB.js';
|
|
2
|
+
import './chunk-IYCJUKWD.js';
|
|
3
|
+
import './chunk-MPM7NRG7.js';
|
|
4
4
|
import './chunk-S5W34SIJ.js';
|
|
5
5
|
import './chunk-E34DJ5LL.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-7QBCWNWL.js';
|
package/dist/patch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { PatchError, PatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { PatchError, PatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-IS2CPNVJ.js';
|
|
2
|
+
import './chunk-IYCJUKWD.js';
|
|
3
|
+
import './chunk-MPM7NRG7.js';
|
|
4
4
|
import './chunk-S5W34SIJ.js';
|
|
5
5
|
import './chunk-E34DJ5LL.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-7QBCWNWL.js';
|
|
@@ -403,6 +403,12 @@ type NumberingStyle = ("arabic" | "roman-upper" | "roman-lower" | "alpha-upper"
|
|
|
403
403
|
* via the `definition` "ChartDataCell".
|
|
404
404
|
*/
|
|
405
405
|
type ChartDataCell = (string | number | boolean | null);
|
|
406
|
+
/**
|
|
407
|
+
* The dataset columns to use, by name and in order. Absent uses every column.
|
|
408
|
+
*
|
|
409
|
+
* @minItems 1
|
|
410
|
+
*/
|
|
411
|
+
type DatasetFields = [string, ...(string)[]];
|
|
406
412
|
/**
|
|
407
413
|
* A scalar, rich-run array, or styled/spanning cell object. Existing scalar and rich forms remain valid.
|
|
408
414
|
*
|
|
@@ -417,6 +423,12 @@ type TableCell = (TableCellValue | StyledTableCell);
|
|
|
417
423
|
* via the `definition` "TableCellValue".
|
|
418
424
|
*/
|
|
419
425
|
type TableCellValue = (string | number | boolean | null | TextRun[]);
|
|
426
|
+
/**
|
|
427
|
+
* Dataset tables only: the dataset columns to show, by name and in order. Absent shows every column. An unknown name is a 'dataset-field-unknown' error.
|
|
428
|
+
*
|
|
429
|
+
* @minItems 1
|
|
430
|
+
*/
|
|
431
|
+
type DatasetFields1 = [string, ...(string)[]];
|
|
420
432
|
/**
|
|
421
433
|
* A content leaf or recursively composed group. A group contains blocks and optional composition; it cannot mix blocks with leaf payload fields. Groups may nest up to 32 levels.
|
|
422
434
|
*
|
|
@@ -688,6 +700,7 @@ interface Presentation {
|
|
|
688
700
|
* Sources that text runs cite with 'cite'. Ids are unique. A cited reference is listed in the footnote area of every slide that cites it, with a marker number assigned per deck in order of first use; a reference no run cites is a lint warning (opf/unused-reference). referencesSlide() turns the cited references into an ordinary list slide.
|
|
689
701
|
*/
|
|
690
702
|
references?: Reference[];
|
|
703
|
+
datasets?: Datasets;
|
|
691
704
|
assets?: Assets;
|
|
692
705
|
catalogs?: Catalogs;
|
|
693
706
|
/**
|
|
@@ -2199,7 +2212,7 @@ interface NumberVariable {
|
|
|
2199
2212
|
*/
|
|
2200
2213
|
example?: number;
|
|
2201
2214
|
/**
|
|
2202
|
-
* Display pattern used by '{{<id>}}'. A literal prefix, a numeric part of '#', '0', ',' and '.', and a literal suffix. '0' pads digits, '#' is optional, ',' groups thousands, digits after '.' fix the decimals ('0' required, '#' optional), and a '%' in the suffix scales by 100. English separators only. Absent: the shortest decimal form.
|
|
2215
|
+
* Display pattern used by '{{<id>}}' (the shared NumberFormat syntax). A literal prefix, a numeric part of '#', '0', ',' and '.', and a literal suffix. '0' pads digits, '#' is optional, ',' groups thousands, digits after '.' fix the decimals ('0' required, '#' optional), and a '%' in the suffix scales by 100. English separators only. Absent: the shortest decimal form.
|
|
2203
2216
|
*/
|
|
2204
2217
|
format?: string;
|
|
2205
2218
|
}
|
|
@@ -2760,9 +2773,10 @@ interface Chart {
|
|
|
2760
2773
|
*/
|
|
2761
2774
|
type: string;
|
|
2762
2775
|
/**
|
|
2763
|
-
* Chart data. Inline data uses a tabular columns/rows shape; renderers convert rows to chart series internally.
|
|
2776
|
+
* Chart data. Inline data uses a tabular columns/rows shape; renderers convert rows to chart series internally. A DatasetRef ({ "dataset": "<id>" }) plots a top-level dataset instead. A ChartDataSource is not resolved by any engine (a 'chart-data-source-unresolved' warning; engines draw a placeholder); prefer inline data with a 'source'.
|
|
2764
2777
|
*/
|
|
2765
|
-
data: (ChartData | ChartDataSource);
|
|
2778
|
+
data: (ChartData | ChartDataSource | DatasetRef);
|
|
2779
|
+
mapping?: ChartMapping;
|
|
2766
2780
|
axisTitles?: ChartAxisTitles;
|
|
2767
2781
|
/**
|
|
2768
2782
|
* Optional legend position. 'none' hides the legend. Absent keeps today's behaviour exactly (a legend at the right of multi-series charts and of pie and doughnut charts, none for single-series charts). A named position shows the legend there even for a single-series chart. Of the Office 2016 constructs only box-and-whisker takes a legend; histogram, pareto, waterfall, funnel, treemap and map drop the option with a 'chart-option-adapted' diagnostic.
|
|
@@ -2774,24 +2788,72 @@ interface Chart {
|
|
|
2774
2788
|
dataLabels?: (boolean | ChartDataLabels);
|
|
2775
2789
|
}
|
|
2776
2790
|
/**
|
|
2777
|
-
* Inline tabular data driving a chart. The first column usually supplies category/x-axis labels; subsequent columns are plotted measures unless a chart type
|
|
2791
|
+
* Inline tabular data driving a chart. The first column usually supplies category/x-axis labels; subsequent columns are plotted measures unless 'chart.mapping' or a chart type maps them differently. Value cells are numbers; a string is read only in strict decimal syntax ('12', '-3.5', '1e6'), and anything else ('12%', '$5', '(5)', '1,234') is a gap and a 'chart-value-not-numeric' warning.
|
|
2778
2792
|
*
|
|
2779
2793
|
* This interface was referenced by `Presentation`'s JSON-Schema
|
|
2780
2794
|
* via the `definition` "ChartData".
|
|
2781
2795
|
*/
|
|
2782
2796
|
interface ChartData {
|
|
2783
2797
|
/**
|
|
2784
|
-
* Ordered column labels for the chart data table.
|
|
2798
|
+
* Ordered column labels for the chart data table. A label is a string or a DataColumn ({ "name", "format" }) whose number format the data labels, value axis and exported workbook use.
|
|
2785
2799
|
*
|
|
2786
2800
|
* @minItems 1
|
|
2787
2801
|
*/
|
|
2788
|
-
columns: [string, ...(string)[]];
|
|
2802
|
+
columns: [(string | DataColumn), ...((string | DataColumn))[]];
|
|
2789
2803
|
/**
|
|
2790
2804
|
* Tabular chart rows. Each row aligns by index with columns.
|
|
2791
2805
|
*
|
|
2792
2806
|
* @minItems 1
|
|
2793
2807
|
*/
|
|
2794
2808
|
rows: [ChartDataCell[], ...(ChartDataCell[])[]];
|
|
2809
|
+
source?: DataSourceRef;
|
|
2810
|
+
}
|
|
2811
|
+
/**
|
|
2812
|
+
* A named data column with an optional number format. Anywhere a chart or dataset column is a string it may be a DataColumn; the string form is { "name": value } with no format. A table column header may also be a DataColumn.
|
|
2813
|
+
*
|
|
2814
|
+
* This interface was referenced by `Presentation`'s JSON-Schema
|
|
2815
|
+
* via the `definition` "DataColumn".
|
|
2816
|
+
*/
|
|
2817
|
+
interface DataColumn {
|
|
2818
|
+
/**
|
|
2819
|
+
* Column label, used as the series name, the table header and the name 'fields' and 'chart.mapping' address.
|
|
2820
|
+
*/
|
|
2821
|
+
name: string;
|
|
2822
|
+
/**
|
|
2823
|
+
* Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form.
|
|
2824
|
+
*/
|
|
2825
|
+
format?: string;
|
|
2826
|
+
}
|
|
2827
|
+
/**
|
|
2828
|
+
* Optional provenance: where this inline data came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import.
|
|
2829
|
+
*/
|
|
2830
|
+
interface DataSourceRef {
|
|
2831
|
+
/**
|
|
2832
|
+
* Where the data came from: an 'asset:<id>' reference, a URL, or a relative or local path.
|
|
2833
|
+
*/
|
|
2834
|
+
src: string;
|
|
2835
|
+
/**
|
|
2836
|
+
* Sheet or table name inside a spreadsheet source.
|
|
2837
|
+
*/
|
|
2838
|
+
sheet?: string;
|
|
2839
|
+
/**
|
|
2840
|
+
* A1-style range inside a spreadsheet source.
|
|
2841
|
+
*/
|
|
2842
|
+
range?: string;
|
|
2843
|
+
/**
|
|
2844
|
+
* The source fields the data was taken from, in order.
|
|
2845
|
+
*/
|
|
2846
|
+
fields?: string[];
|
|
2847
|
+
/**
|
|
2848
|
+
* When the data was taken from the source: an ISO 8601 date or date-time.
|
|
2849
|
+
*/
|
|
2850
|
+
retrieved?: ({
|
|
2851
|
+
[k: string]: unknown;
|
|
2852
|
+
} & string);
|
|
2853
|
+
/**
|
|
2854
|
+
* Free-form note about the source.
|
|
2855
|
+
*/
|
|
2856
|
+
description?: string;
|
|
2795
2857
|
}
|
|
2796
2858
|
/**
|
|
2797
2859
|
* Chart data sourced from an asset reference, URL, data URI, relative path, or local path such as CSV, TSV, JSON, or XLSX. The source is interpreted as a table; optional columns select or order fields from that table.
|
|
@@ -2817,6 +2879,38 @@ interface ChartDataSource {
|
|
|
2817
2879
|
*/
|
|
2818
2880
|
columns?: string[];
|
|
2819
2881
|
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Chart data taken from a top-level dataset. Engines inline it before plotting; 'chart.mapping' names columns after the 'fields' selection.
|
|
2884
|
+
*
|
|
2885
|
+
* This interface was referenced by `Presentation`'s JSON-Schema
|
|
2886
|
+
* via the `definition` "DatasetRef".
|
|
2887
|
+
*/
|
|
2888
|
+
interface DatasetRef {
|
|
2889
|
+
/**
|
|
2890
|
+
* Id of the dataset. An unknown id is a 'dataset-unknown' error.
|
|
2891
|
+
*/
|
|
2892
|
+
dataset: string;
|
|
2893
|
+
fields?: DatasetFields;
|
|
2894
|
+
}
|
|
2895
|
+
/**
|
|
2896
|
+
* Optional series mapping by column name: which column is the category, which is the X column of a scatter chart, and which columns are plotted, in order. Absent keeps the positional rule (first column the category, then the X column for scatter, every other column a series).
|
|
2897
|
+
*/
|
|
2898
|
+
interface ChartMapping {
|
|
2899
|
+
/**
|
|
2900
|
+
* The label (category) column. Default: the first column.
|
|
2901
|
+
*/
|
|
2902
|
+
category?: string;
|
|
2903
|
+
/**
|
|
2904
|
+
* The X column of an XY (scatter) chart. Default: the second column (the first, when the category is the second column), and only when there are three or more columns: with two, the second column is the one series, plotted against row numbers. An X that leaves no series is plotted as the series with a 'chart-mapping-adapted' warning.
|
|
2905
|
+
*/
|
|
2906
|
+
x?: string;
|
|
2907
|
+
/**
|
|
2908
|
+
* The plotted columns, in order. Default: every column that is not the category or the X column.
|
|
2909
|
+
*
|
|
2910
|
+
* @minItems 1
|
|
2911
|
+
*/
|
|
2912
|
+
series?: [string, ...(string)[]];
|
|
2913
|
+
}
|
|
2820
2914
|
/**
|
|
2821
2915
|
* Optional axis titles. Absent keeps today's untitled axes. Supported on the chart types that have a category/value (or X/Y) axis pair (column, bar, line, area, scatter, and the histogram, pareto, waterfall and box-and-whisker constructs; the funnel construct takes a category title only); a title on a type without that axis (pie, doughnut, radar, treemap, map) is dropped with a 'chart-option-adapted' diagnostic by renderers and exporters.
|
|
2822
2916
|
*/
|
|
@@ -2857,13 +2951,18 @@ interface ChartDataLabels {
|
|
|
2857
2951
|
*/
|
|
2858
2952
|
interface Table {
|
|
2859
2953
|
/**
|
|
2860
|
-
* Optional column labels. Labels may be strings, rich runs
|
|
2954
|
+
* Optional column labels. Labels may be strings, rich runs, styled cell objects or DataColumn objects ({ "name", "format" }). A header's 'format' (DataColumn or StyledTableCell) is the column's number format; a body cell's own format wins. Null is an empty label or a placeholder covered by a preceding column span.
|
|
2861
2955
|
*/
|
|
2862
|
-
columns?: (string | TextRun[] | StyledTableCell | null)[];
|
|
2956
|
+
columns?: (string | TextRun[] | StyledTableCell | DataColumn | null)[];
|
|
2863
2957
|
/**
|
|
2864
2958
|
* Two-dimensional table row data; each row aligns by index with columns when columns are supplied.
|
|
2865
2959
|
*/
|
|
2866
|
-
rows
|
|
2960
|
+
rows?: TableCell[][];
|
|
2961
|
+
/**
|
|
2962
|
+
* Id of a top-level dataset that supplies this table's headers, rows and column formats. Excludes 'rows' and 'columns'. An unknown id is a 'dataset-unknown' error.
|
|
2963
|
+
*/
|
|
2964
|
+
dataset?: string;
|
|
2965
|
+
fields?: DatasetFields1;
|
|
2867
2966
|
}
|
|
2868
2967
|
/**
|
|
2869
2968
|
* A cell with explicit visual style or merged geometry. Its position remains its array column index; use null placeholders for every covered grid position.
|
|
@@ -2885,6 +2984,10 @@ interface StyledTableCell {
|
|
|
2885
2984
|
* Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1.
|
|
2886
2985
|
*/
|
|
2887
2986
|
rowSpan?: number;
|
|
2987
|
+
/**
|
|
2988
|
+
* Number format. On a body cell it formats that cell's number value (and wins over the column's format); on a header cell (in 'columns') it is the column's format, the same as a DataColumn header. Strings, booleans, null and rich runs display unchanged.
|
|
2989
|
+
*/
|
|
2990
|
+
format?: string;
|
|
2888
2991
|
}
|
|
2889
2992
|
/**
|
|
2890
2993
|
* Cell appearance. Sizes use reference pixels at a 720-pixel canvas short edge and scale with the slide.
|
|
@@ -3053,9 +3156,10 @@ interface Chart1 {
|
|
|
3053
3156
|
*/
|
|
3054
3157
|
type: string;
|
|
3055
3158
|
/**
|
|
3056
|
-
* Chart data. Inline data uses a tabular columns/rows shape; renderers convert rows to chart series internally.
|
|
3159
|
+
* Chart data. Inline data uses a tabular columns/rows shape; renderers convert rows to chart series internally. A DatasetRef ({ "dataset": "<id>" }) plots a top-level dataset instead. A ChartDataSource is not resolved by any engine (a 'chart-data-source-unresolved' warning; engines draw a placeholder); prefer inline data with a 'source'.
|
|
3057
3160
|
*/
|
|
3058
|
-
data: (ChartData | ChartDataSource);
|
|
3161
|
+
data: (ChartData | ChartDataSource | DatasetRef);
|
|
3162
|
+
mapping?: ChartMapping;
|
|
3059
3163
|
axisTitles?: ChartAxisTitles;
|
|
3060
3164
|
/**
|
|
3061
3165
|
* Optional legend position. 'none' hides the legend. Absent keeps today's behaviour exactly (a legend at the right of multi-series charts and of pie and doughnut charts, none for single-series charts). A named position shows the legend there even for a single-series chart. Of the Office 2016 constructs only box-and-whisker takes a legend; histogram, pareto, waterfall, funnel, treemap and map drop the option with a 'chart-option-adapted' diagnostic.
|
|
@@ -3071,13 +3175,18 @@ interface Chart1 {
|
|
|
3071
3175
|
*/
|
|
3072
3176
|
interface Table1 {
|
|
3073
3177
|
/**
|
|
3074
|
-
* Optional column labels. Labels may be strings, rich runs
|
|
3178
|
+
* Optional column labels. Labels may be strings, rich runs, styled cell objects or DataColumn objects ({ "name", "format" }). A header's 'format' (DataColumn or StyledTableCell) is the column's number format; a body cell's own format wins. Null is an empty label or a placeholder covered by a preceding column span.
|
|
3075
3179
|
*/
|
|
3076
|
-
columns?: (string | TextRun[] | StyledTableCell | null)[];
|
|
3180
|
+
columns?: (string | TextRun[] | StyledTableCell | DataColumn | null)[];
|
|
3077
3181
|
/**
|
|
3078
3182
|
* Two-dimensional table row data; each row aligns by index with columns when columns are supplied.
|
|
3079
3183
|
*/
|
|
3080
|
-
rows
|
|
3184
|
+
rows?: TableCell[][];
|
|
3185
|
+
/**
|
|
3186
|
+
* Id of a top-level dataset that supplies this table's headers, rows and column formats. Excludes 'rows' and 'columns'. An unknown id is a 'dataset-unknown' error.
|
|
3187
|
+
*/
|
|
3188
|
+
dataset?: string;
|
|
3189
|
+
fields?: DatasetFields1;
|
|
3081
3190
|
}
|
|
3082
3191
|
/**
|
|
3083
3192
|
* Arrangement within this group. Only minFontSize and overflow inherit from the parent; strict overflow cannot be weakened.
|
|
@@ -3350,6 +3459,70 @@ interface Reference {
|
|
|
3350
3459
|
*/
|
|
3351
3460
|
url?: string;
|
|
3352
3461
|
}
|
|
3462
|
+
/**
|
|
3463
|
+
* Optional shared data tables, keyed by id. A chart ('chart.data': { "dataset": "<id>" }) or a table ('table': { "dataset": "<id>" }) references one instead of holding its own copy; engines inline the reference before composing, rendering or exporting. A dataset nothing references is a lint warning (opf/unused-dataset). See docs/chart-table-data.md.
|
|
3464
|
+
*/
|
|
3465
|
+
interface Datasets {
|
|
3466
|
+
[k: string]: Dataset;
|
|
3467
|
+
}
|
|
3468
|
+
/**
|
|
3469
|
+
* One shared data table: named columns (strings or DataColumn objects with a number format) and rows of scalar cells. Column names are unique ('data-column-duplicate' error). Rich text and styling belong in an inline table.
|
|
3470
|
+
*
|
|
3471
|
+
* This interface was referenced by `Presentation`'s JSON-Schema
|
|
3472
|
+
* via the `definition` "Dataset".
|
|
3473
|
+
*/
|
|
3474
|
+
interface Dataset {
|
|
3475
|
+
/**
|
|
3476
|
+
* Human name of the dataset, shown by editors.
|
|
3477
|
+
*/
|
|
3478
|
+
title?: string;
|
|
3479
|
+
/**
|
|
3480
|
+
* What the dataset holds.
|
|
3481
|
+
*/
|
|
3482
|
+
description?: string;
|
|
3483
|
+
/**
|
|
3484
|
+
* Ordered, uniquely named columns.
|
|
3485
|
+
*
|
|
3486
|
+
* @minItems 1
|
|
3487
|
+
*/
|
|
3488
|
+
columns: [(string | DataColumn), ...((string | DataColumn))[]];
|
|
3489
|
+
/**
|
|
3490
|
+
* Rows of scalar cells (string, number, boolean, null); each row aligns by index with columns.
|
|
3491
|
+
*/
|
|
3492
|
+
rows: ChartDataCell[][];
|
|
3493
|
+
source?: DataSourceRef1;
|
|
3494
|
+
}
|
|
3495
|
+
/**
|
|
3496
|
+
* Optional provenance. Engines never read, fetch or refresh it.
|
|
3497
|
+
*/
|
|
3498
|
+
interface DataSourceRef1 {
|
|
3499
|
+
/**
|
|
3500
|
+
* Where the data came from: an 'asset:<id>' reference, a URL, or a relative or local path.
|
|
3501
|
+
*/
|
|
3502
|
+
src: string;
|
|
3503
|
+
/**
|
|
3504
|
+
* Sheet or table name inside a spreadsheet source.
|
|
3505
|
+
*/
|
|
3506
|
+
sheet?: string;
|
|
3507
|
+
/**
|
|
3508
|
+
* A1-style range inside a spreadsheet source.
|
|
3509
|
+
*/
|
|
3510
|
+
range?: string;
|
|
3511
|
+
/**
|
|
3512
|
+
* The source fields the data was taken from, in order.
|
|
3513
|
+
*/
|
|
3514
|
+
fields?: string[];
|
|
3515
|
+
/**
|
|
3516
|
+
* When the data was taken from the source: an ISO 8601 date or date-time.
|
|
3517
|
+
*/
|
|
3518
|
+
retrieved?: ({
|
|
3519
|
+
[k: string]: unknown;
|
|
3520
|
+
} & string);
|
|
3521
|
+
/**
|
|
3522
|
+
* Free-form note about the source.
|
|
3523
|
+
*/
|
|
3524
|
+
description?: string;
|
|
3525
|
+
}
|
|
3353
3526
|
/**
|
|
3354
3527
|
* Optional reusable asset registry for images, data files, videos, documents, fonts, and other resources referenced elsewhere in the deck via 'asset:<id>' strings.
|
|
3355
3528
|
*/
|