@openpresentation/opf 0.32.1 → 0.34.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 +9 -0
- package/dist/browser.js +22 -21
- package/dist/catalog-refs-CoIrOdAw.d.ts +937 -0
- package/dist/{catalog-schemas-LdqOPebq.d.ts → catalog-schemas-FjLRPtjB.d.ts} +10 -4
- package/dist/{chart-data-oIZQlFGi.d.ts → chart-data-B_k-WTex.d.ts} +7 -4
- package/dist/{chunk-PB7ME64J.js → chunk-244OPLAV.js} +1 -1
- package/dist/{chunk-IT7FQKED.js → chunk-2HX4BGAS.js} +6 -6
- package/dist/{chunk-2E6CDYL2.js → chunk-36DLVJGW.js} +19 -16
- package/dist/{chunk-XQO2CT6Q.js → chunk-3THGTDL2.js} +2 -2
- package/dist/{chunk-CLRYHWQN.js → chunk-42JBXJKW.js} +187 -25
- package/dist/chunk-BLCDUM7B.js +7 -0
- package/dist/{chunk-NVAJASOD.js → chunk-CJVKOJ6B.js} +10195 -2036
- package/dist/{chunk-XFHXQCXL.js → chunk-DQ7QYOUV.js} +99 -13
- package/dist/{chunk-NEJ32O7X.js → chunk-F6BXO4AI.js} +1 -1
- package/dist/{chunk-OXLA4HXQ.js → chunk-FAXO3SUE.js} +1196 -313
- package/dist/{chunk-J63CIRIV.js → chunk-FIQMAIZV.js} +4 -4
- package/dist/{chunk-PJSPHHRK.js → chunk-FK5XG742.js} +3 -16
- package/dist/{chunk-HKUV7NEN.js → chunk-HHVQ2SDT.js} +1 -1
- package/dist/{chunk-SZFO3MAJ.js → chunk-HUGVYHZ2.js} +4 -4
- package/dist/{chunk-LEF4X4KI.js → chunk-LCT5ZV3Q.js} +2400 -222
- package/dist/chunk-NLJFNCZ4.js +1560 -0
- package/dist/{chunk-GM7WFPGG.js → chunk-PRXZD2II.js} +6 -1
- package/dist/{chunk-YFJIIIOL.js → chunk-QGJVOPLG.js} +3 -3
- package/dist/{chunk-F7DN33UL.js → chunk-QGTJF7HV.js} +16 -14
- package/dist/{chunk-ONVFUVQ5.js → chunk-RUV7CCE6.js} +136 -31
- package/dist/{chunk-SW676APJ.js → chunk-U7TYSPYM.js} +2 -2
- package/dist/chunk-UJZN2ZH6.js +1 -0
- package/dist/chunk-VDZXNNZF.js +221 -0
- package/dist/{chunk-UJSAR6GF.js → chunk-W4DYDRV2.js} +21 -0
- package/dist/chunk-WCPDN7AY.js +642 -0
- package/dist/{chunk-BBVW5ZC2.js → chunk-WMFT5R7I.js} +2 -2
- package/dist/{chunk-AQEAZDL2.js → chunk-XJUMFH33.js} +2 -1
- package/dist/{composition-Ds6WHyO7.d.ts → composition-CvtvgBDE.d.ts} +2783 -873
- package/dist/composition.d.ts +4 -3
- package/dist/composition.js +3 -2
- package/dist/{conversion-CdzrTxib.d.ts → conversion-B_5AKTYQ.d.ts} +39 -10
- package/dist/conversion-CMBGOTAC.js +25 -0
- package/dist/convert.d.ts +5 -4
- package/dist/convert.js +17 -13
- package/dist/data.d.ts +2 -2
- package/dist/data.js +4 -3
- package/dist/{deck-report-CKDNQ2t4.d.ts → deck-report-BVlQZ42f.d.ts} +3 -3
- package/dist/deck.d.ts +7 -6
- package/dist/deck.js +13 -12
- package/dist/diagram-engine-eager.js +6 -2
- package/dist/diagram-engine-lazy.js +14 -1
- package/dist/diagram-plantuml-XRZ6VAOL.js +3 -0
- package/dist/diff.js +6 -5
- package/dist/docs.js +88 -52
- package/dist/examples.js +28745 -18393
- package/dist/font-policy.js +2 -2
- package/dist/format.js +3 -3
- package/dist/ids.js +6 -5
- package/dist/index.d.ts +19 -16
- package/dist/index.js +37 -26
- package/dist/markdown.d.ts +3 -2
- package/dist/markdown.js +10 -9
- package/dist/node-engine.d.ts +44 -11
- package/dist/node-engine.js +47 -28
- package/dist/{pagination-DRZ_JNFY.d.ts → pagination-CZQQYk7L.d.ts} +22 -4
- package/dist/pagination.d.ts +5 -4
- package/dist/pagination.js +6 -5
- package/dist/patch.js +5 -4
- package/dist/precompiled.js +3 -3
- package/dist/{presentation-DnD7mfmf.d.ts → presentation-s9262acV.d.ts} +1172 -208
- package/dist/repo-readme.js +2 -2
- package/dist/schema-engine-ajv.js +2 -2
- package/dist/schema-engine-precompiled.js +3 -3
- package/dist/schema.d.ts +3 -3
- package/dist/schema.js +5 -4
- package/dist/schemas.d.ts +56 -4
- package/dist/schemas.js +2 -2
- package/dist/shape-catalog.d.ts +98 -0
- package/dist/shape-catalog.js +302 -0
- package/dist/shape-engine-eager.js +9 -0
- package/dist/shape-engine-lazy.js +12 -0
- package/dist/shape-engine-module-N74FCHGY.js +3 -0
- package/dist/shape-geometry.d.ts +126 -0
- package/dist/shape-geometry.js +2 -0
- package/dist/source.d.ts +10 -5
- package/dist/source.js +12 -11
- package/dist/spec/README.md +1 -1
- package/dist/spec/reference/engine-vocabularies.json +135 -0
- package/dist/spec/reference/font-policy.json +3 -16
- package/dist/spec/reference/preset-geometry.json +10699 -0
- package/dist/spec/reference/preset-geometry.schema.json +126 -0
- package/dist/spec/schemas/catalog-index.schema.json +1 -0
- package/dist/spec/schemas/chart-type.schema.json +4 -4
- package/dist/spec/schemas/icon-set.schema.json +75 -0
- package/dist/spec/schemas/layout.schema.json +82 -23
- package/dist/spec/schemas/opf.schema.json +1616 -296
- package/dist/spec/schemas/theme.schema.json +11 -5
- package/dist/spec-files.d.ts +1 -1
- package/dist/spec-files.js +2 -2
- package/dist/symbol-font-encodings.js +1 -1
- package/dist/types.d.ts +83 -71
- package/dist/{validation-types-DxyYPebs.d.ts → validation-types-CYbsUuZ9.d.ts} +8 -5
- package/dist/validator.d.ts +35 -7
- package/dist/validator.js +5 -4
- package/dist/yaml.d.ts +3 -2
- package/dist/yaml.js +9 -8
- package/package.json +22 -6
- package/dist/catalog-refs-kAefsZWT.d.ts +0 -129
- package/dist/chunk-DGS47ONG.js +0 -1
- package/dist/conversion-5FUDQPED.js +0 -24
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OPF 0.15 content references and their one resolution rule (FA-20). Catalog-free: this module reads the document's
|
|
3
|
-
* own `catalogs` groups and the catalogs a host registers, never any bundled data, and it never fetches.
|
|
4
|
-
*
|
|
5
|
-
* A reference is a bare `id` or `name:id`. A bare id resolves in `catalogs.custom`, then in the records embedded
|
|
6
|
-
* under `catalogs.default`, then in the registered catalog for `default.source` (the first registered catalog when
|
|
7
|
-
* the document omits `default`; nothing when `default` is false). `name:id` resolves in `catalogs.<name>`, then in
|
|
8
|
-
* the registered catalog for its source. A reference written inside an embedded record resolves in that record's
|
|
9
|
-
* own group first.
|
|
10
|
-
*/
|
|
11
|
-
/** The content kinds a catalog group holds, keyed by id. */
|
|
12
|
-
declare const catalogKinds: readonly ["layouts", "themes", "colorSchemes", "fontSchemes", "narratives", "audiences", "purposes", "tones"];
|
|
13
|
-
type CatalogKind = (typeof catalogKinds)[number];
|
|
14
|
-
/** A content reference: a bare id or `name:id`. */
|
|
15
|
-
declare const CATALOG_REFERENCE_PATTERN: RegExp;
|
|
16
|
-
/** A catalog group name. `default` and `custom` are reserved. */
|
|
17
|
-
declare const CATALOG_GROUP_PATTERN: RegExp;
|
|
18
|
-
/** Records of one kind, keyed by id. */
|
|
19
|
-
type CatalogRecordMap = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
20
|
-
/** A catalog's records by kind, then by id: the shape of a document's `catalogs.<group>` without `source`. */
|
|
21
|
-
type CatalogRecords = {
|
|
22
|
-
readonly [K in CatalogKind]?: CatalogRecordMap;
|
|
23
|
-
};
|
|
24
|
-
/** A catalog a host registers. `source` is matched against `catalogs.<group>.source`. */
|
|
25
|
-
interface Catalog extends CatalogRecords {
|
|
26
|
-
/** The catalog's identity: an HTTPS URL or a `pkg:` reference. Never fetched. */
|
|
27
|
-
readonly source: string;
|
|
28
|
-
}
|
|
29
|
-
/** The one option every entry point that resolves references accepts. */
|
|
30
|
-
interface CatalogOptions {
|
|
31
|
-
/**
|
|
32
|
-
* Catalogs the host registered, matched by `source`. The first is the host default: bare ids use it when the
|
|
33
|
-
* document omits `catalogs.default`. Omitted or empty: only the records the document embeds resolve.
|
|
34
|
-
*/
|
|
35
|
-
catalogs?: readonly Catalog[];
|
|
36
|
-
}
|
|
37
|
-
/** A reference that resolved. */
|
|
38
|
-
interface ResolvedReference {
|
|
39
|
-
kind: CatalogKind;
|
|
40
|
-
/** The reference as written. */
|
|
41
|
-
reference: string;
|
|
42
|
-
/** The record's key. */
|
|
43
|
-
id: string;
|
|
44
|
-
/** The group it resolved in: `custom`, `default` or a named group. */
|
|
45
|
-
group: string;
|
|
46
|
-
/** That group's source (the host default's source for an omitted `default`). */
|
|
47
|
-
source?: string;
|
|
48
|
-
/** `document` when the record is embedded, `host` when it came from a registered catalog. */
|
|
49
|
-
origin: 'document' | 'host';
|
|
50
|
-
record: Record<string, unknown>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Where a resolved record came from, without the record itself: what an engine records as provenance
|
|
54
|
-
* (`resolveSlideContext().resolved.provenance`, `resolveDesignRecords().provenance`).
|
|
55
|
-
*/
|
|
56
|
-
type RecordProvenance = Omit<ResolvedReference, 'record'>;
|
|
57
|
-
/** Reported when a reference resolves nowhere. Never thrown, except under `strictReferences`. */
|
|
58
|
-
interface UnresolvedReferenceDiagnostic {
|
|
59
|
-
code: 'unresolved-reference';
|
|
60
|
-
kind: CatalogKind;
|
|
61
|
-
/** The reference as written, such as `acme:hero`. */
|
|
62
|
-
reference: string;
|
|
63
|
-
/** Where it is written, dotted: `slides.3.layout`, `design.theme`, `catalogs.acme.themes.brand.colorScheme`. */
|
|
64
|
-
path: string;
|
|
65
|
-
/** The group the reference names: its prefix, or `default` for a bare id. */
|
|
66
|
-
group: string;
|
|
67
|
-
/** That group's source, when one is known. */
|
|
68
|
-
source?: string;
|
|
69
|
-
/** What the engine uses instead: automatic composition (layouts) or the engine default record. */
|
|
70
|
-
fallback: 'automatic' | 'engine-default';
|
|
71
|
-
message: string;
|
|
72
|
-
}
|
|
73
|
-
/** Thrown by `resolveSlideContext` and `paginate` under `strictReferences` when a reference resolves nowhere. */
|
|
74
|
-
/**
|
|
75
|
-
* Thrown by every entry point that takes the `catalogs` option when it is not an array of registered catalogs
|
|
76
|
-
* (`{ source: string, <kind>: { <id>: record } }` with known kinds). `code` is always `invalid-catalogs`.
|
|
77
|
-
*/
|
|
78
|
-
declare class OPFCatalogsOptionError extends TypeError {
|
|
79
|
-
readonly code = "invalid-catalogs";
|
|
80
|
-
constructor(entry: string, detail: string);
|
|
81
|
-
}
|
|
82
|
-
declare class OPFUnresolvedReferenceError extends Error {
|
|
83
|
-
readonly diagnostics: UnresolvedReferenceDiagnostic[];
|
|
84
|
-
constructor(diagnostics: UnresolvedReferenceDiagnostic[]);
|
|
85
|
-
}
|
|
86
|
-
/** Split a reference into its group prefix and id; undefined for anything that is not a reference. */
|
|
87
|
-
declare function parseReference(reference: unknown): {
|
|
88
|
-
group?: string;
|
|
89
|
-
id: string;
|
|
90
|
-
} | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* The source of group `name` as resolution uses it: the group's own `source`, or for an omitted (or source-less)
|
|
93
|
-
* `default` the first registered catalog's source. Undefined for `custom`, for `default: false` and for an
|
|
94
|
-
* undeclared named group.
|
|
95
|
-
*/
|
|
96
|
-
declare function catalogGroupSource(document: unknown, name: string, options?: CatalogOptions): string | undefined;
|
|
97
|
-
/**
|
|
98
|
-
* Resolve one reference. `group` is the group of the record the reference is written in, which is searched first.
|
|
99
|
-
* Undefined when the reference is malformed, names an undeclared group or resolves nowhere.
|
|
100
|
-
*/
|
|
101
|
-
declare function resolveReference(document: unknown, kind: CatalogKind, reference: unknown, options?: CatalogOptions & {
|
|
102
|
-
group?: string;
|
|
103
|
-
}): ResolvedReference | undefined;
|
|
104
|
-
/** The diagnostic for a reference that resolves nowhere, naming the reference and the source it was looked for in. */
|
|
105
|
-
declare function unresolvedReference(document: unknown, kind: CatalogKind, reference: string, path: string, options?: CatalogOptions): UnresolvedReferenceDiagnostic;
|
|
106
|
-
/** One place a document writes a content reference. */
|
|
107
|
-
interface CatalogReferenceSite {
|
|
108
|
-
kind: CatalogKind;
|
|
109
|
-
/** The reference as written. */
|
|
110
|
-
reference: string;
|
|
111
|
-
/** JSON Pointer segments of the string. */
|
|
112
|
-
path: readonly (string | number)[];
|
|
113
|
-
/** For a reference written inside an embedded record: that record's group, searched first. */
|
|
114
|
-
group?: string;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Every content reference a document writes, in document order: the root narrative, audience, purpose and tone, the
|
|
118
|
-
* language's font schemes, the deck and slide designs, each slide's layout, and (with `records`) the references
|
|
119
|
-
* inside embedded records. Free-form audience and purpose text is not a reference and is not listed.
|
|
120
|
-
*/
|
|
121
|
-
declare function catalogReferenceSites(document: unknown, options?: {
|
|
122
|
-
records?: boolean;
|
|
123
|
-
slides?: boolean;
|
|
124
|
-
}): CatalogReferenceSite[];
|
|
125
|
-
/** Records a picker can offer for `kind`: the document's embedded records, then those of the registered catalogs its groups name, with the reference to write for each. */
|
|
126
|
-
declare function catalogRecords(document: unknown, kind: CatalogKind, options?: CatalogOptions): ResolvedReference[];
|
|
127
|
-
|
|
128
|
-
export { OPFCatalogsOptionError as O, CATALOG_GROUP_PATTERN as c, CATALOG_REFERENCE_PATTERN as d, OPFUnresolvedReferenceError as h, catalogGroupSource as j, catalogKinds as k, catalogRecords as l, catalogReferenceSites as m, parseReference as p, resolveReference as r, unresolvedReference as u };
|
|
129
|
-
export type { Catalog as C, RecordProvenance as R, UnresolvedReferenceDiagnostic as U, CatalogKind as a, CatalogOptions as b, CatalogRecordMap as e, CatalogRecords as f, CatalogReferenceSite as g, ResolvedReference as i };
|