@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.
- package/dist/browser.js +19 -19
- package/dist/{catalog-refs-BgotJhR5.d.ts → catalog-refs-BeRgtpZS.d.ts} +4 -4
- package/dist/{catalog-schemas-BX-VEc5Q.d.ts → catalog-schemas-CwY-3cCP.d.ts} +1 -1
- package/dist/{chunk-OFL3WY6F.js → chunk-3A3PNYNP.js} +77 -15
- package/dist/{chunk-TJMESSBQ.js → chunk-44IS6ZU2.js} +109 -9
- package/dist/{chunk-J7FUSZZ5.js → chunk-4FA4ZABY.js} +6 -6
- package/dist/{chunk-F5SY7MSA.js → chunk-56BYOGIF.js} +1 -1
- package/dist/{chunk-MS2LPR7F.js → chunk-6WN6PRCI.js} +1 -1
- package/dist/{chunk-7JE3XTL7.js → chunk-BHRCWV6B.js} +4 -4
- package/dist/{chunk-4FA4AZXY.js → chunk-C5ACMFKB.js} +1392 -808
- package/dist/{chunk-2NIID3QD.js → chunk-CYGQY6HH.js} +6 -6
- package/dist/{chunk-SER6GJTT.js → chunk-EOMENOKY.js} +23 -6
- package/dist/{chunk-O65COLKF.js → chunk-HS2JQ3AO.js} +118 -19
- package/dist/chunk-IW4TXMJY.js +646 -0
- package/dist/{chunk-6WVPFWPD.js → chunk-JTNCBTEH.js} +4 -4
- package/dist/{chunk-3KPTVK77.js → chunk-KANQVJGK.js} +1244 -119
- package/dist/{chunk-VDZXNNZF.js → chunk-M4IPCFDV.js} +1 -1
- package/dist/{chunk-XRMYP4JD.js → chunk-ORVMHVOS.js} +86 -2
- package/dist/{chunk-HHQROUYC.js → chunk-QFT4R2IL.js} +4405 -2808
- package/dist/chunk-QQBOI5XI.js +86 -0
- package/dist/{chunk-GNKOQ6NA.js → chunk-TIVBO56G.js} +4 -4
- package/dist/{chunk-APCNAAA7.js → chunk-VD7WLE3C.js} +2 -2
- package/dist/{chunk-AZELWKG2.js → chunk-XJU2X5JM.js} +5 -4
- package/dist/chunk-YESKKKVE.js +1 -0
- package/dist/{chunk-BPSZ7OWD.js → chunk-YZ4WMB5C.js} +26 -21
- package/dist/{composition-CSM7YfBl.d.ts → composition-DiKC371V.d.ts} +707 -134
- package/dist/composition.d.ts +3 -3
- package/dist/composition.js +1 -1
- package/dist/{conversion-CL7ipVGO.d.ts → conversion-DF_HgknQ.d.ts} +6 -6
- package/dist/conversion-XIWN7FMW.js +25 -0
- package/dist/convert.d.ts +5 -5
- package/dist/convert.js +63 -23
- package/dist/data.d.ts +41 -3
- package/dist/data.js +2 -2
- package/dist/{deck-report-DhsB0SUz.d.ts → deck-report-BwgsIRAf.d.ts} +3 -3
- package/dist/deck.d.ts +6 -6
- package/dist/deck.js +11 -11
- package/dist/diff.js +4 -4
- package/dist/docs.js +43 -31
- package/dist/examples.js +2338 -392
- package/dist/font-policy.js +1 -1
- package/dist/format.js +2 -2
- package/dist/ids.d.ts +17 -4
- package/dist/ids.js +4 -4
- package/dist/index.d.ts +140 -23
- package/dist/index.js +22 -22
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +8 -8
- package/dist/metric-data-B4Q8RFRR.d.ts +382 -0
- package/dist/node-engine.d.ts +6 -6
- package/dist/node-engine.js +21 -21
- package/dist/{pagination-BSqq32xt.d.ts → pagination-C9qnH_n-.d.ts} +5 -5
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +4 -4
- package/dist/patch.js +3 -3
- package/dist/precompiled.js +2 -2
- package/dist/{presentation-Dx-kZC8Y.d.ts → presentation-DmOhusrX.d.ts} +541 -110
- package/dist/schema-engine-ajv.js +1 -1
- package/dist/schema-engine-precompiled.js +2 -2
- package/dist/schema.d.ts +2 -2
- package/dist/schema.js +3 -3
- package/dist/schemas.d.ts +46 -2
- package/dist/schemas.js +1 -1
- package/dist/shape-engine-eager.js +2 -2
- package/dist/shape-engine-lazy.js +1 -1
- package/dist/{shape-engine-module-N74FCHGY.js → shape-engine-module-YU2XGIQN.js} +2 -2
- package/dist/shape-geometry.js +1 -1
- package/dist/source.js +10 -10
- package/dist/spec/reference/engine-defaults.json +1 -1
- package/dist/spec/reference/engine-vocabularies.json +1 -0
- package/dist/spec/schemas/font-scheme.schema.json +5 -6
- package/dist/spec/schemas/layout.schema.json +5 -4
- package/dist/spec/schemas/narrative.schema.json +1 -0
- package/dist/spec/schemas/opf.schema.json +661 -98
- package/dist/types.d.ts +11 -12
- package/dist/{validation-types-bnrso0JL.d.ts → validation-types-CV-ngACL.d.ts} +49 -6
- package/dist/validator.d.ts +5 -5
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +2 -2
- package/dist/yaml.js +7 -7
- package/package.json +5 -5
- package/dist/chart-data-B_k-WTex.d.ts +0 -194
- package/dist/chunk-6VGLE7C5.js +0 -3983
- package/dist/chunk-SEC4IOOS.js +0 -1
- package/dist/chunk-WCPDN7AY.js +0 -642
- package/dist/conversion-FTGQLJK7.js +0 -25
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as Presentation } from './presentation-
|
|
2
|
-
export { a as CatalogKind } from './catalog-refs-
|
|
1
|
+
export { P as Presentation } from './presentation-DmOhusrX.js';
|
|
2
|
+
export { a as CatalogKind } from './catalog-refs-BeRgtpZS.js';
|
|
3
3
|
export { SchemaName } from './schemas.js';
|
|
4
4
|
export { a as Finding, e as FindingCategory, d as FindingFix, f as FindingFocus, b as FindingLocation, F as FindingReport, c as FindingSeverity, g as FindingSuggestion, J as JsonPatchOperation, V as ValidationIssue } from './finding-mcHslZLA.js';
|
|
5
5
|
import './json-BFSdESOE.js';
|
|
@@ -562,11 +562,11 @@ interface Region {
|
|
|
562
562
|
name: string;
|
|
563
563
|
size?: RegionSize;
|
|
564
564
|
/**
|
|
565
|
-
* Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A region that takes 'image' also takes a shape block. A group is also accepted where every one of its leaf kinds is. Omitted: every body content kind and 'group'.
|
|
565
|
+
* Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A region that takes 'image' also takes a shape block, and one that takes 'video' also takes an embed. A group is also accepted where every one of its leaf kinds is. Omitted: every body content kind and 'group'.
|
|
566
566
|
*
|
|
567
567
|
* @minItems 1
|
|
568
568
|
*/
|
|
569
|
-
accepts?: [("text" | "list" | "image" | "video" | "chart" | "table" | "code" | "metric" | "quote" | "timeline" | "diagram" | "shape" | "group"), ...(("text" | "list" | "image" | "video" | "chart" | "table" | "code" | "metric" | "quote" | "timeline" | "diagram" | "shape" | "group"))[]];
|
|
569
|
+
accepts?: [("text" | "list" | "image" | "video" | "embed" | "chart" | "table" | "code" | "metric" | "quote" | "timeline" | "diagram" | "shape" | "group"), ...(("text" | "list" | "image" | "video" | "embed" | "chart" | "table" | "code" | "metric" | "quote" | "timeline" | "diagram" | "shape" | "group"))[]];
|
|
570
570
|
/**
|
|
571
571
|
* Which content the region wants first. Binding gives a picture (image, video) to a media region first, then primary, supporting; every other kind to a primary region first, then supporting, media; of two equal regions the first in reading order fills first. A supporting region receives content only when no primary region that accepts it has room, or by a pin. Default 'primary'. OPF 0.35 removed 'secondary': write 'supporting' (or 'primary' for content that must be bound first); the old value fails the schema as opf/catalog-record.
|
|
572
572
|
*/
|
|
@@ -629,7 +629,7 @@ interface Split {
|
|
|
629
629
|
anchor?: ("top" | "middle" | "bottom");
|
|
630
630
|
}
|
|
631
631
|
/**
|
|
632
|
-
* Only 'gap', 'padding', '
|
|
632
|
+
* Only 'gap', 'padding', 'minFontSizePx' and 'overflow', with their 0.18 meaning. A template's regions replace composition.mode, columns and weights.
|
|
633
633
|
*/
|
|
634
634
|
interface Composition {
|
|
635
635
|
/**
|
|
@@ -643,7 +643,7 @@ interface Composition {
|
|
|
643
643
|
/**
|
|
644
644
|
* Minimum readable text size in reference pixels at a 720-pixel canvas short edge. Default 16. Overflow is diagnosed when text cannot fit at this size.
|
|
645
645
|
*/
|
|
646
|
-
|
|
646
|
+
minFontSizePx?: number;
|
|
647
647
|
/**
|
|
648
648
|
* warn returns diagnostics for content that does not fit; error rejects layout. Content is never silently removed. Default warn.
|
|
649
649
|
*/
|
|
@@ -942,7 +942,7 @@ interface Beat {
|
|
|
942
942
|
/**
|
|
943
943
|
* Default content kind for the beat's slide: the same values as Slide.type. Helps engines and planners choose a layout when only the beat is known.
|
|
944
944
|
*/
|
|
945
|
-
type?: ("text" | "list" | "image" | "video" | "chart" | "table" | "code" | "metric" | "quote" | "timeline" | "diagram");
|
|
945
|
+
type?: ("text" | "list" | "image" | "video" | "embed" | "chart" | "table" | "code" | "metric" | "quote" | "timeline" | "diagram");
|
|
946
946
|
/**
|
|
947
947
|
* Suggested layout id for the beat's slide, e.g. 'section-divider', 'title-slide', 'text-left'. Resolves the same way as Slide.layout — against catalogs.layouts and the default catalog at https://www.pptx.gallery/layouts.
|
|
948
948
|
*/
|
|
@@ -1236,7 +1236,7 @@ interface FontScheme {
|
|
|
1236
1236
|
*/
|
|
1237
1237
|
code?: string;
|
|
1238
1238
|
/**
|
|
1239
|
-
* East Asian script fonts. Maps to the OOXML a:ea element of majorFont (major) and minorFont (minor), and to run-level a:ea. When set, they fill the eastAsian slot for every language; when omitted, the slot comes from this scheme's own major/minor when
|
|
1239
|
+
* East Asian script fonts. Maps to the OOXML a:ea element of majorFont (major) and minorFont (minor), and to run-level a:ea. When set, they fill the eastAsian slot for every language; when omitted, the slot comes from this scheme's own major/minor when scriptGroup is 'eastAsian' and the scheme's languages list is empty or names the presentation language, then from the presentation language's font scheme for East Asian languages, and otherwise from the latin (major/minor) families. A missing 'major' or 'minor' falls back to the other.
|
|
1240
1240
|
*/
|
|
1241
1241
|
eastAsian?: {
|
|
1242
1242
|
/**
|
|
@@ -1249,7 +1249,7 @@ interface FontScheme {
|
|
|
1249
1249
|
minor?: string;
|
|
1250
1250
|
};
|
|
1251
1251
|
/**
|
|
1252
|
-
* Complex-script fonts (for example Arabic, Hebrew, Indic and Thai). Maps to the OOXML a:cs element of majorFont (major) and minorFont (minor), and to run-level a:cs. When set, they fill the complexScript slot for every language; when omitted, the slot comes from this scheme's own major/minor when
|
|
1252
|
+
* Complex-script fonts (for example Arabic, Hebrew, Indic and Thai). Maps to the OOXML a:cs element of majorFont (major) and minorFont (minor), and to run-level a:cs. When set, they fill the complexScript slot for every language; when omitted, the slot comes from this scheme's own major/minor when scriptGroup is 'complexScript' and the scheme's languages list is empty or names the presentation language, then from the presentation language's font scheme for complex-script languages, and otherwise from the latin (major/minor) families. A missing 'major' or 'minor' falls back to the other.
|
|
1253
1253
|
*/
|
|
1254
1254
|
complexScript?: {
|
|
1255
1255
|
/**
|
|
@@ -1270,9 +1270,9 @@ interface FontScheme {
|
|
|
1270
1270
|
*/
|
|
1271
1271
|
app?: ("powerpoint" | "google-slides");
|
|
1272
1272
|
/**
|
|
1273
|
-
*
|
|
1273
|
+
* The script group this scheme is intended for: 'latin' for Latin-script content and every script outside the other two groups (Cyrillic and Greek too), 'eastAsian' for East Asian scripts, 'complexScript' for Complex Scripts (Arabic, Hebrew, Indic, Thai). The names match the 'eastAsian' and 'complexScript' slot keys. As the design font scheme, an 'eastAsian' or 'complexScript' scheme also fills that script slot with its own major/minor families when its languages list is empty or names the presentation language.
|
|
1274
1274
|
*/
|
|
1275
|
-
|
|
1275
|
+
scriptGroup?: ("latin" | "eastAsian" | "complexScript");
|
|
1276
1276
|
/**
|
|
1277
1277
|
* Optional list of BCP-47 language tags this scheme is curated for. Useful for picker UIs that group fonts by language coverage. As the design font scheme, an 'ea' or 'cs' scheme fills its script slot only when this list is empty or names the presentation language: an entry matches a tag with the same language subtag (and the same script, when the entry names one).
|
|
1278
1278
|
*/
|
|
@@ -1311,7 +1311,6 @@ interface FontScheme {
|
|
|
1311
1311
|
vectorSrc?: string;
|
|
1312
1312
|
[k: string]: unknown;
|
|
1313
1313
|
};
|
|
1314
|
-
[k: string]: unknown;
|
|
1315
1314
|
}
|
|
1316
1315
|
|
|
1317
1316
|
export type { Audience, ChartType, ColorScheme, FontScheme, Language, Layout, Narrative, Purpose, SocialPlatform, Theme, Tone };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Catalog } from './catalog-refs-
|
|
2
|
-
import { T as TextMeasurement } from './composition-
|
|
1
|
+
import { C as Catalog } from './catalog-refs-BeRgtpZS.js';
|
|
2
|
+
import { T as TextMeasurement } from './composition-DiKC371V.js';
|
|
3
3
|
import { c as FindingSeverity, F as FindingReport } from './finding-mcHslZLA.js';
|
|
4
4
|
import { J as JsonPrimitive } from './json-BFSdESOE.js';
|
|
5
5
|
|
|
@@ -14,7 +14,7 @@ import { J as JsonPrimitive } from './json-BFSdESOE.js';
|
|
|
14
14
|
declare const VARIABLE_KINDS: readonly ["color", "text", "number", "date", "image", "url", "list"];
|
|
15
15
|
type VariableKind = (typeof VARIABLE_KINDS)[number];
|
|
16
16
|
type VariableValues = Record<string, unknown>;
|
|
17
|
-
/** Default display pattern of a date variable inserted inline. */
|
|
17
|
+
/** Default display pattern of a date variable inserted inline, in a deck that declares no language (or one the date-name table has no pattern for). */
|
|
18
18
|
declare const DEFAULT_VARIABLE_DATE_FORMAT = "MMMM d, yyyy";
|
|
19
19
|
interface VariableDeclaration {
|
|
20
20
|
id: string;
|
|
@@ -29,6 +29,22 @@ interface VariableDeclaration {
|
|
|
29
29
|
format?: string;
|
|
30
30
|
label?: string;
|
|
31
31
|
description?: string;
|
|
32
|
+
/** Text: the most characters (as a reader sees them) the value may have. */
|
|
33
|
+
maxLength?: number;
|
|
34
|
+
/** Text: the most lines the value may take where it is drawn (checked by composition, `opf/variable-overflow`). */
|
|
35
|
+
maxLines?: number;
|
|
36
|
+
/** List: the most entries the value may have. */
|
|
37
|
+
maxItems?: number;
|
|
38
|
+
/** FR-10: the value (a date: the display format) in other languages, in document order. Absent when the variable has none. */
|
|
39
|
+
translations?: VariableTranslation[];
|
|
40
|
+
}
|
|
41
|
+
/** One language's entry of a variable's `translations`: a `value` (a date: a display `format`), coerced to the variable's kind. */
|
|
42
|
+
interface VariableTranslation {
|
|
43
|
+
/** The language tag, as written. */
|
|
44
|
+
tag: string;
|
|
45
|
+
value?: unknown;
|
|
46
|
+
/** A date variable's display pattern in this language. */
|
|
47
|
+
format?: string;
|
|
32
48
|
}
|
|
33
49
|
type VariableUseForm = "token" | "reference";
|
|
34
50
|
interface VariableUse {
|
|
@@ -37,7 +53,7 @@ interface VariableUse {
|
|
|
37
53
|
path: string;
|
|
38
54
|
form: VariableUseForm;
|
|
39
55
|
}
|
|
40
|
-
type VariableDiagnosticCode = "variable-unfilled" | "variable-example-used" | "variable-invalid-value" | "variable-unknown" | "variable-unknown-value" | "variable-unknown-builtin" | "variable-builtin-missing" | "variable-unused" | "variable-rich-flattened" | "variable-format" | "variable-group-omitted";
|
|
56
|
+
type VariableDiagnosticCode = "variable-unfilled" | "variable-example-used" | "variable-invalid-value" | "variable-unknown" | "variable-unknown-value" | "variable-unknown-builtin" | "variable-builtin-missing" | "variable-unused" | "variable-rich-flattened" | "variable-format" | "variable-group-omitted" | "variable-overflow" | "variable-translation-duplicate" | "variable-translation-unused" | "variable-translations-removed";
|
|
41
57
|
type VariableDiagnosticSeverity = "error" | "warning" | "info";
|
|
42
58
|
interface VariableDiagnostic {
|
|
43
59
|
code: VariableDiagnosticCode;
|
|
@@ -96,8 +112,25 @@ declare function coerceVariableValue(kind: VariableKind, raw: unknown): {
|
|
|
96
112
|
ok: false;
|
|
97
113
|
message: string;
|
|
98
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* The translation a language selects (FR-10): the exact tag, then the tag with its last subtag removed, and so on, compared without regard
|
|
117
|
+
* to case. Two keys that differ only in case select the first in document order. Undefined with no language or no match.
|
|
118
|
+
*/
|
|
119
|
+
declare function pickTranslation<T extends {
|
|
120
|
+
tag: string;
|
|
121
|
+
}>(entries: readonly T[] | undefined, language: string | undefined): T | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The language a variable inserted at `path` is drawn in, for selecting a translation: the declared language of the slide the path is in,
|
|
124
|
+
* else the deck's. A language read from the text does not select a translation. Undefined when the deck declares none. The deck's header and
|
|
125
|
+
* footer (and any other place outside a slide) are drawn in the deck's language.
|
|
126
|
+
*/
|
|
127
|
+
declare function translationLanguageAt(presentation: unknown, path: string): string | undefined;
|
|
128
|
+
/** The translation of a declaration that applies at `path` of the document (the one its language there selects), undefined when none does. */
|
|
129
|
+
declare function translationAt(declaration: Pick<VariableDeclaration, "translations">, presentation: unknown, path: string): VariableTranslation | undefined;
|
|
99
130
|
/** The declarations of the document's `variables` map, in declaration order. Entries the schema rejects are skipped. */
|
|
100
131
|
declare function variableDeclarations(presentation: unknown): VariableDeclaration[];
|
|
132
|
+
/** The length of a text as a reader sees it: grapheme clusters, so an accented letter or an emoji counts once however it is encoded. */
|
|
133
|
+
declare function visibleLength(text: string): number;
|
|
101
134
|
/**
|
|
102
135
|
* True when the document declares a non-color variable, is marked as a template, or uses a built-in variable
|
|
103
136
|
* (`{{speaker.name}}`, `var:organization.logo`): the cases where resolveVariables changes the document.
|
|
@@ -258,6 +291,16 @@ interface ValidateOptions {
|
|
|
258
291
|
template?: boolean;
|
|
259
292
|
/** Values to fill variables with before checking, keyed by variable id. */
|
|
260
293
|
values?: VariableValues;
|
|
294
|
+
/**
|
|
295
|
+
* The date to check data freshness as of (an ISO 8601 date or date-time). Core has no clock, so a dataset is reported stale
|
|
296
|
+
* (`opf/dataset-stale`) only when the caller passes one: its `retrieved` is older than its data source's `refreshEvery`.
|
|
297
|
+
*/
|
|
298
|
+
asOf?: string;
|
|
299
|
+
/**
|
|
300
|
+
* For a value that is one part of a deck (a single slide checked on its own, with the rest of the deck elsewhere): `false` skips
|
|
301
|
+
* `opf/slide-link-unknown`, a list adds the ids of the deck's other slides that a `slide:<id>` link may name. Leave it out for a whole deck.
|
|
302
|
+
*/
|
|
303
|
+
slideLinks?: false | readonly string[];
|
|
261
304
|
}
|
|
262
305
|
interface ValidationChecks {
|
|
263
306
|
/** `checked` for text input (JSON syntax and duplicate keys), `not-applicable` for a parsed document. */
|
|
@@ -292,5 +335,5 @@ interface ValidationReport extends FindingReport {
|
|
|
292
335
|
unfilledVariables?: string[];
|
|
293
336
|
}
|
|
294
337
|
|
|
295
|
-
export {
|
|
296
|
-
export type { BuiltinVariableInfo as B, Contract as C, ResolveVariablesOptions as R, ValidationReport as V, ValidateOptions as a, ValidationThresholds as b, ValidationRuleInfo as c, ValidateFonts as d, ValidationCategory as e, ValidationChecks as f, ValidationRuleCost as g, VariableDiagnostic as h, ResolveVariablesResult as i, VariableDeclaration as k, VariableDiagnosticCode as l, VariableDiagnosticSeverity as m, VariableInfo as n, VariableKind as o,
|
|
338
|
+
export { pickTranslation as A, DEFAULT_VARIABLE_DATE_FORMAT as D, resolveVariables as E, translationAt as F, translationLanguageAt as G, variableDeclarations as H, visibleLength as I, OPFVariableError as O, VARIABLE_KINDS as j, coerceVariableValue as t, formatVariableNumber as u, validationCategories as v, hasContentVariables as w, isTemplate as x, listBuiltinVariables as y, listVariables as z };
|
|
339
|
+
export type { BuiltinVariableInfo as B, Contract as C, ResolveVariablesOptions as R, ValidationReport as V, ValidateOptions as a, ValidationThresholds as b, ValidationRuleInfo as c, ValidateFonts as d, ValidationCategory as e, ValidationChecks as f, ValidationRuleCost as g, VariableDiagnostic as h, ResolveVariablesResult as i, VariableDeclaration as k, VariableDiagnosticCode as l, VariableDiagnosticSeverity as m, VariableInfo as n, VariableKind as o, VariableTranslation as p, VariableUse as q, VariableUseForm as r, VariableValues as s };
|
package/dist/validator.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CatalogRecordKind } from './index.js';
|
|
2
2
|
import { Finding } from './index.js';
|
|
3
3
|
import { Presentation } from './index.js';
|
|
4
|
-
import { b as ValidationThresholds, c as ValidationRuleInfo, V as ValidationReport, a as ValidateOptions } from './validation-types-
|
|
5
|
-
export { C as Contract, d as ValidateFonts, e as ValidationCategory, f as ValidationChecks, g as ValidationRuleCost, v as validationCategories } from './validation-types-
|
|
6
|
-
export { g as gridCells } from './composition-
|
|
7
|
-
import './catalog-refs-
|
|
4
|
+
import { b as ValidationThresholds, c as ValidationRuleInfo, V as ValidationReport, a as ValidateOptions } from './validation-types-CV-ngACL.js';
|
|
5
|
+
export { C as Contract, d as ValidateFonts, e as ValidationCategory, f as ValidationChecks, g as ValidationRuleCost, v as validationCategories } from './validation-types-CV-ngACL.js';
|
|
6
|
+
export { g as gridCells } from './composition-DiKC371V.js';
|
|
7
|
+
import './catalog-refs-BeRgtpZS.js';
|
|
8
8
|
import './schemas.js';
|
|
9
9
|
import './json-BFSdESOE.js';
|
|
10
|
-
import './
|
|
10
|
+
import './metric-data-B4Q8RFRR.js';
|
|
11
11
|
import './shape-geometry.js';
|
|
12
12
|
|
|
13
13
|
interface ValidationCacheInfo {
|
package/dist/validator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, createValidator, findValidationRule, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-
|
|
1
|
+
export { DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, createValidator, findValidationRule, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-C5ACMFKB.js';
|
|
2
2
|
import './chunk-JBARNYFR.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
export { gridCells } from './chunk-
|
|
3
|
+
import './chunk-KANQVJGK.js';
|
|
4
|
+
export { gridCells } from './chunk-QFT4R2IL.js';
|
|
5
5
|
import './chunk-BLCDUM7B.js';
|
|
6
6
|
import './chunk-PRXZD2II.js';
|
package/dist/yaml.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { Catalog } from './composition.js';
|
|
|
2
2
|
import { Presentation } from './index.js';
|
|
3
3
|
import { ValidateOptions, ValidationReport } from './index.js';
|
|
4
4
|
import { Finding, FindingLocation } from './index.js';
|
|
5
|
-
import './composition-
|
|
6
|
-
import './
|
|
5
|
+
import './composition-DiKC371V.js';
|
|
6
|
+
import './metric-data-B4Q8RFRR.js';
|
|
7
7
|
import './shape-geometry.js';
|
|
8
8
|
import './json-BFSdESOE.js';
|
|
9
9
|
|
package/dist/yaml.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { OPFYamlError, YAML_SCHEMA_URL, fromYaml, parseYamlData, scanYamlComments, toYaml } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { OPFYamlError, YAML_SCHEMA_URL, fromYaml, parseYamlData, scanYamlComments, toYaml } from './chunk-4FA4ZABY.js';
|
|
2
|
+
import './chunk-6WN6PRCI.js';
|
|
3
3
|
import './chunk-RYZPBJLB.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
4
|
+
import './chunk-VD7WLE3C.js';
|
|
5
|
+
import './chunk-XJU2X5JM.js';
|
|
6
|
+
import './chunk-C5ACMFKB.js';
|
|
7
7
|
import './chunk-JBARNYFR.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
8
|
+
import './chunk-KANQVJGK.js';
|
|
9
|
+
import './chunk-QFT4R2IL.js';
|
|
10
10
|
import './chunk-BLCDUM7B.js';
|
|
11
11
|
import './chunk-PRXZD2II.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpresentation/opf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Canonical Open Presentation Format schemas, TypeScript types, local validation and composition; in Node, the file API and the CLI defaults register the pptx.gallery catalog of @openpresentation/gallery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Open Presentation",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"jsonc-parser": "3.3.1",
|
|
190
190
|
"pele": "1.13.0",
|
|
191
191
|
"yaml": "^2.9.1",
|
|
192
|
-
"@openpresentation/gallery": "^0.
|
|
192
|
+
"@openpresentation/gallery": "^0.37.0"
|
|
193
193
|
},
|
|
194
194
|
"devDependencies": {
|
|
195
195
|
"@expo-google-fonts/arimo": "0.4.3",
|
|
@@ -210,8 +210,8 @@
|
|
|
210
210
|
"workerd": "1.20261113.1"
|
|
211
211
|
},
|
|
212
212
|
"peerDependencies": {
|
|
213
|
-
"@openpresentation/opf-pptx": "^0.
|
|
214
|
-
"@openpresentation/opf-render": "^0.
|
|
213
|
+
"@openpresentation/opf-pptx": "^0.37.0",
|
|
214
|
+
"@openpresentation/opf-render": "^0.37.0"
|
|
215
215
|
},
|
|
216
216
|
"peerDependenciesMeta": {
|
|
217
217
|
"@openpresentation/opf-pptx": {
|
|
@@ -232,5 +232,5 @@
|
|
|
232
232
|
"test:packed": "node test/packed-install-smoke.mjs",
|
|
233
233
|
"pack:dry-run": "pnpm run build:deps && pnpm run build && npm pack --dry-run --cache /tmp/opf-npm-cache"
|
|
234
234
|
},
|
|
235
|
-
"gitHead": "
|
|
235
|
+
"gitHead": "e6aa9c9ce3109709b8b8f14171ce71af339c3004"
|
|
236
236
|
}
|
|
@@ -1,194 +0,0 @@
|
|
|
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
|
-
/** 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. */
|
|
37
|
-
interface ChartComboSeries {
|
|
38
|
-
role: 'bar' | 'line';
|
|
39
|
-
axis: 'primary' | 'secondary';
|
|
40
|
-
}
|
|
41
|
-
/** A text run as table cells and headers hold them (see the schema `TextRun`). */
|
|
42
|
-
type DataTextRun = string | {
|
|
43
|
-
text: string;
|
|
44
|
-
[key: string]: unknown;
|
|
45
|
-
};
|
|
46
|
-
/** A table cell's value: a scalar or rich runs. */
|
|
47
|
-
type DataTableValue = string | number | boolean | null | DataTextRun[];
|
|
48
|
-
/** A styled or spanning table cell, optionally with a number format. */
|
|
49
|
-
interface DataStyledCell {
|
|
50
|
-
value: DataTableValue;
|
|
51
|
-
style?: Record<string, unknown>;
|
|
52
|
-
colSpan?: number;
|
|
53
|
-
rowSpan?: number;
|
|
54
|
-
format?: string;
|
|
55
|
-
}
|
|
56
|
-
/** A table body cell. */
|
|
57
|
-
type DataTableCell = DataTableValue | DataStyledCell;
|
|
58
|
-
/** A table column header: a cell, or a DataColumn. */
|
|
59
|
-
type DataTableHeader = DataTableCell | DataColumn;
|
|
60
|
-
type DataDiagnosticCode = 'chart-value-not-numeric' | 'dataset-unknown' | 'dataset-field-unknown' | 'data-column-duplicate' | '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' | 'table-highlight-unknown-name' | 'number-format-invalid';
|
|
61
|
-
interface DataDiagnostic {
|
|
62
|
-
code: DataDiagnosticCode;
|
|
63
|
-
severity: 'error' | 'warning';
|
|
64
|
-
/** JSON Pointer of the offending value: below the `path` option for the chart or table, or into `/datasets/<id>`. */
|
|
65
|
-
path: string;
|
|
66
|
-
message: string;
|
|
67
|
-
}
|
|
68
|
-
interface DataResolveOptions {
|
|
69
|
-
/** JSON Pointer of the chart or table object, used as the base of diagnostic paths. Default: "" (paths start at `/data` or `/rows`). */
|
|
70
|
-
path?: string;
|
|
71
|
-
}
|
|
72
|
-
type ResolvedChartData = {
|
|
73
|
-
ok: true;
|
|
74
|
-
/** Column names in canonical order: category, then (scatter only) X, then every series. */
|
|
75
|
-
columns: string[];
|
|
76
|
-
/**
|
|
77
|
-
* True when `columns[1]` is the X column: an XY chart with three or more resolved columns. An XY chart with two
|
|
78
|
-
* columns has no X column; its second column is the one series, plotted against row numbers (the legacy rule).
|
|
79
|
-
*/
|
|
80
|
-
hasX: boolean;
|
|
81
|
-
/** The number format of each column (from its DataColumn), aligned with `columns`. */
|
|
82
|
-
formats: (string | undefined)[];
|
|
83
|
-
/** Category cells as authored; X and series cells (and a lone column, which has no category) passed through `chartNumber` (null is a gap). */
|
|
84
|
-
rows: DataCellValue[][];
|
|
85
|
-
source?: DataSourceRef;
|
|
86
|
-
/** The dataset id when the chart references one. */
|
|
87
|
-
dataset?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Combo charts only (FA-15): how each series is drawn, aligned with the series columns (`columns.slice(1)`). The series
|
|
90
|
-
* are ordered column series first, then the line series on the primary axis, then those on the secondary axis, each in
|
|
91
|
-
* plotted order, so every engine draws, exports and lists them in the legend alike.
|
|
92
|
-
*/
|
|
93
|
-
combo?: ChartComboSeries[];
|
|
94
|
-
diagnostics: DataDiagnostic[];
|
|
95
|
-
} | {
|
|
96
|
-
ok: false;
|
|
97
|
-
reason: 'dataset-unknown' | 'no-rows' | 'no-columns';
|
|
98
|
-
message: string;
|
|
99
|
-
diagnostics: DataDiagnostic[];
|
|
100
|
-
};
|
|
101
|
-
interface ResolvedTableData {
|
|
102
|
-
/** Headers as authored (dataset tables: the dataset's columns after `fields`), or undefined for a table without headers. */
|
|
103
|
-
columns?: DataTableHeader[];
|
|
104
|
-
rows: DataTableCell[][];
|
|
105
|
-
/** The column number formats (DataColumn or header StyledTableCell `format`), by column index. */
|
|
106
|
-
formats: (string | undefined)[];
|
|
107
|
-
/** The dataset id when the table references one. */
|
|
108
|
-
dataset?: string;
|
|
109
|
-
diagnostics: DataDiagnostic[];
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Strict chart number: finite numbers, and strings in strict decimal syntax (trimmed). Everything else is null (a gap):
|
|
113
|
-
* `"12%"`, `"$5"`, `"(5)"`, `"1,234"`, `"1.234,5"`, `"Q1"`, `""`, booleans and null. A plain digit string beyond the safe
|
|
114
|
-
* integer range is a gap too, as in data import (it is usually an identifier that would lose digits); a decimal or exponent
|
|
115
|
-
* form such as `"1e20"` is a number.
|
|
116
|
-
*/
|
|
117
|
-
declare function chartNumber(value: unknown): number | null;
|
|
118
|
-
/** Why a NumberFormat is invalid, or undefined for a valid one. An absent format is valid (General). */
|
|
119
|
-
declare function numberFormatError(format: unknown): string | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* Format a number with a NumberFormat; an absent or invalid format prints the General form (String(value)). LH-106: with `language`
|
|
122
|
-
* the text is in that language's numbering system (see `formatVariableNumber`); without it, Latin.
|
|
123
|
-
*/
|
|
124
|
-
declare function formatDataNumber(value: number, format?: string, language?: string): string;
|
|
125
|
-
/** NumberFormat -> Excel format code ("General" when absent or invalid). Literal prefix/suffix text is quoted or escaped; placeholders are written '#' before '0' ("0#" -> "#0"). */
|
|
126
|
-
declare function toExcelNumberFormat(format?: string): string;
|
|
127
|
-
/** 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"). */
|
|
128
|
-
declare function fromExcelNumberFormat(code: string): string | undefined;
|
|
129
|
-
/** True when the value is a dataset reference (`{ dataset: "<id>" }`). */
|
|
130
|
-
declare function isDatasetRef(value: unknown): value is DatasetRef;
|
|
131
|
-
/** Diagnostics of the top-level datasets themselves: duplicate column names and invalid column formats. */
|
|
132
|
-
declare function datasetDiagnostics(document: unknown): DataDiagnostic[];
|
|
133
|
-
/**
|
|
134
|
-
* Pure: a copy of the document where every chart and table DatasetRef is replaced by inline data (columns as
|
|
135
|
-
* DataColumn when a format applies, rows copied; a chart also takes the dataset's `source`). `datasets` stays in
|
|
136
|
-
* place. Unknown ids (and references naming an unknown field) are left as they are.
|
|
137
|
-
*/
|
|
138
|
-
declare function inlineDatasets<T>(document: T): T;
|
|
139
|
-
/** A table in inline form: a dataset-backed table is copied from the document's dataset; anything else is returned as is. */
|
|
140
|
-
declare function inlineTableData<T>(table: T, document?: unknown): T;
|
|
141
|
-
/** A chart in inline form: a dataset reference in `data` is copied from the document's dataset; anything else is returned as is. */
|
|
142
|
-
declare function inlineChartData<T>(chart: T, document?: unknown): T;
|
|
143
|
-
/** The ids of top-level datasets that no chart or table references, in declaration order. */
|
|
144
|
-
declare function unusedDatasets(document: unknown): string[];
|
|
145
|
-
/** True for a chart type with an X value axis (scatter). */
|
|
146
|
-
declare function isXYChartType(type: unknown): boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Resolve a chart's data to the canonical positional table: [category, (x,) ...series].
|
|
149
|
-
* Category cells are kept as authored; X and series cells pass through chartNumber.
|
|
150
|
-
* Inline ChartData, a DatasetRef (needs the document) and mapping are resolved here.
|
|
151
|
-
*/
|
|
152
|
-
declare function resolveChartData(chart: unknown, document?: unknown, options?: DataResolveOptions): ResolvedChartData;
|
|
153
|
-
/** One JSON Patch `replace` operation of a ChartNumberFix. */
|
|
154
|
-
interface ChartNumberFixOperation {
|
|
155
|
-
op: 'replace';
|
|
156
|
-
path: string;
|
|
157
|
-
value: unknown;
|
|
158
|
-
}
|
|
159
|
-
/** A fix for a chart value column whose text cells all share one display style (`"12%"`, `"$1,234"`, `"1,234.5"`). */
|
|
160
|
-
interface ChartNumberFix {
|
|
161
|
-
/**
|
|
162
|
-
* JSON Patch: one `replace` per text cell (with its number), then one for the column (a DataColumn with `format`).
|
|
163
|
-
* Paths are those of the `chart-value-not-numeric` diagnostics: below `options.path` for inline data, or into
|
|
164
|
-
* `/datasets/<id>` for a dataset (which every chart and table that uses it shares; their text is unchanged).
|
|
165
|
-
*/
|
|
166
|
-
patches: ChartNumberFixOperation[];
|
|
167
|
-
/** Index of the column in the authored columns (`chart.data.columns`, or the dataset's columns). */
|
|
168
|
-
column: number;
|
|
169
|
-
/** The column name. */
|
|
170
|
-
name: string;
|
|
171
|
-
/** The NumberFormat that displays every number of the column exactly as its text was written. */
|
|
172
|
-
format: string;
|
|
173
|
-
}
|
|
174
|
-
interface ChartNumberFixOptions extends DataResolveOptions {
|
|
175
|
-
/** The column to fix, by authored index or name. Default: the first value column that has a fix. */
|
|
176
|
-
column?: number | string;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Migration help for the strict number rule: when every text cell of a chart value column is written in one display
|
|
180
|
-
* style that a NumberFormat reproduces exactly (`"12%"`/`"8.5%"` -> 0.12/0.085 with `0.#%`; `"$1,234"` -> 1234 with
|
|
181
|
-
* `$#,##0`; `"1,234"` -> 1234 with `#,##0`), the patch that stores the numbers and gives the column that format.
|
|
182
|
-
* Undefined when there is nothing to fix or no exact fix: mixed styles, accounting negatives `(5)`, `1.234,5`, units,
|
|
183
|
-
* a column that already has a format, or any value the format would display differently (number cells included).
|
|
184
|
-
*/
|
|
185
|
-
declare function suggestChartNumberFix(chart: unknown, document?: unknown, options?: ChartNumberFixOptions): ChartNumberFix | undefined;
|
|
186
|
-
/** Resolve a table (inline or dataset-backed) to headers, rows and per-column formats. */
|
|
187
|
-
declare function resolveTableData(table: unknown, document?: unknown, options?: DataResolveOptions): ResolvedTableData;
|
|
188
|
-
/** 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. */
|
|
189
|
-
declare function tableKeyText(cell: unknown): string;
|
|
190
|
-
/** Display value of a table cell: a number with a format (cell, else column) becomes formatted text; anything else is returned unchanged. */
|
|
191
|
-
declare function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string, language?: string): DataTableCell;
|
|
192
|
-
|
|
193
|
-
export { resolveChartData as A, resolveTableData as B, suggestChartNumberFix as E, tableCellDisplayValue as F, toExcelNumberFormat as G, unusedDatasets as H, tableKeyText as J, chartNumber as q, datasetDiagnostics as r, formatDataNumber as s, fromExcelNumberFormat as t, inlineChartData as u, inlineDatasets as v, inlineTableData as w, isDatasetRef as x, isXYChartType as y, numberFormatError as z };
|
|
194
|
-
export type { ChartMapping as C, DataCellValue as D, ChartComboSeries as I, ResolvedChartData as R, ChartNumberFix as a, ChartNumberFixOperation as b, ChartNumberFixOptions as c, DataColumn as d, DataDiagnostic as e, DataDiagnosticCode as f, DataResolveOptions as g, DataSourceRef as h, DataStyledCell as i, DataTableCell as j, DataTableHeader as k, DataTableValue as l, DataTextRun as m, Dataset as n, DatasetRef as o, ResolvedTableData as p };
|