@openpresentation/opf 0.11.4 → 0.12.1
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 +16 -0
- package/dist/audit.d.ts +156 -0
- package/dist/audit.js +7 -0
- package/dist/{catalogs-CUClB3nl.d.ts → catalogs-BnI7JKcn.d.ts} +3 -3
- package/dist/catalogs.d.ts +2 -2
- package/dist/catalogs.js +2 -1
- package/dist/{chunk-KJKASEPE.js → chunk-4LAM3N6S.js} +753 -42
- package/dist/chunk-6LZK2IZB.js +1690 -0
- package/dist/{chunk-NSVVQ52O.js → chunk-AUM5MXBR.js} +8 -6
- package/dist/{chunk-AEUSVEUY.js → chunk-E34DJ5LL.js} +50 -14
- package/dist/chunk-FYLJVF7X.js +18448 -0
- package/dist/{chunk-HJL64ETN.js → chunk-GJKJL4YY.js} +14 -0
- package/dist/{chunk-3H2U7FDR.js → chunk-HOBSL7AJ.js} +1867 -247
- package/dist/chunk-JKVKYVWL.js +1332 -0
- package/dist/{chunk-3OJN7QAW.js → chunk-MWPMJE6P.js} +18 -4
- package/dist/chunk-RUC7L5DJ.js +261 -0
- package/dist/chunk-S5W34SIJ.js +1 -0
- package/dist/chunk-V2537ENL.js +198 -0
- package/dist/{chunk-RXNFDGPC.js → chunk-WXSPETQ6.js} +311 -40
- package/dist/{composition-Dl-d9FRj.d.ts → composition-DWbCiMwF.d.ts} +559 -10
- package/dist/composition.d.ts +1 -1
- package/dist/composition.js +2 -1
- package/dist/convert.d.ts +261 -0
- package/dist/convert.js +1107 -0
- package/dist/diff.d.ts +145 -0
- package/dist/diff.js +604 -0
- package/dist/docs.js +72 -18
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +112 -112
- package/dist/font-policy.d.ts +15 -0
- package/dist/font-policy.js +1 -1
- package/dist/format.d.ts +20 -0
- package/dist/format.js +83 -0
- package/dist/index.d.ts +173 -24
- package/dist/index.js +926 -262
- package/dist/lint.d.ts +4 -4
- package/dist/lint.js +6 -5
- package/dist/markdown.d.ts +74 -0
- package/dist/markdown.js +1941 -0
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +6 -5
- package/dist/patch.d.ts +99 -0
- package/dist/patch.js +6 -0
- package/dist/{presentation-j5PVrqfV.d.ts → presentation-DcF-MZcz.d.ts} +452 -17
- package/dist/repo-readme.js +1 -1
- package/dist/{schemas-X_NniU4A.d.ts → schemas-BSjlG8-R.d.ts} +28 -0
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/spec/catalogs/audiences/customers.json +5 -1
- package/dist/spec/catalogs/audiences/executives.json +5 -1
- package/dist/spec/catalogs/audiences/index.json +20 -8
- package/dist/spec/catalogs/audiences/investors.json +5 -1
- package/dist/spec/catalogs/audiences/marketing-team.json +5 -1
- package/dist/spec/catalogs/audiences/regulators.json +5 -1
- package/dist/spec/catalogs/audiences/sales-team.json +5 -1
- package/dist/spec/catalogs/manifest.json +2 -2
- package/dist/spec/reference/engine-defaults.json +1 -1
- package/dist/spec/reference/font-policy.json +311 -40
- package/dist/spec/reference/font-policy.schema.json +40 -0
- package/dist/spec/reference/symbol-font-encodings.json +18354 -0
- package/dist/spec/reference/symbol-font-encodings.schema.json +156 -0
- package/dist/spec/schemas/audience.schema.json +7 -7
- package/dist/spec/schemas/narrative.schema.json +1 -1
- package/dist/spec/schemas/opf.schema.json +597 -28
- package/dist/spec-files.d.ts +1 -1
- package/dist/spec-files.js +1 -1
- package/dist/symbol-font-encodings.d.ts +128 -0
- package/dist/symbol-font-encodings.js +1 -0
- package/dist/types.d.ts +4 -4
- package/dist/validator-DfG9yxba.d.ts +172 -0
- package/dist/validator.d.ts +4 -36
- package/dist/validator.js +5 -4
- package/package.json +32 -3
- package/dist/chunk-FDCWQHWO.js +0 -1366
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as TextMeasurement, C as ComposeSlideOptions, F as FontSchemeDiagnostic, L as LayoutDiagnostic } from './composition-DWbCiMwF.js';
|
|
2
2
|
|
|
3
3
|
interface PaginationOptions extends ComposeSlideOptions {
|
|
4
4
|
/** Readability floor used while choosing page breaks. Default 24 reference pixels. */
|
package/dist/pagination.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-AUM5MXBR.js';
|
|
2
|
+
import './chunk-JKVKYVWL.js';
|
|
3
|
+
import './chunk-HOBSL7AJ.js';
|
|
4
|
+
import './chunk-S5W34SIJ.js';
|
|
5
|
+
import './chunk-E34DJ5LL.js';
|
|
6
|
+
import './chunk-4LAM3N6S.js';
|
package/dist/patch.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
type JsonPointer = string;
|
|
2
|
+
type JsonPatchOperation = {
|
|
3
|
+
op: "add" | "replace" | "test";
|
|
4
|
+
path: JsonPointer;
|
|
5
|
+
value: unknown;
|
|
6
|
+
} | {
|
|
7
|
+
op: "remove";
|
|
8
|
+
path: JsonPointer;
|
|
9
|
+
} | {
|
|
10
|
+
op: "move" | "copy";
|
|
11
|
+
from: JsonPointer;
|
|
12
|
+
path: JsonPointer;
|
|
13
|
+
};
|
|
14
|
+
type PatchErrorCode = "invalid-patch" | "invalid-patch-operation" | "unsupported-patch-operation" | "invalid-json-pointer" | "patch-path-missing" | "patch-parent-missing" | "invalid-array-index" | "patch-test-failed" | "patch-invalid-move" | "patch-root-remove" | "patch-invalid-document";
|
|
15
|
+
declare class PatchError extends Error {
|
|
16
|
+
readonly code: PatchErrorCode;
|
|
17
|
+
/** The JSON Pointer the failing operation addressed, when known. */
|
|
18
|
+
path?: string;
|
|
19
|
+
/** The index of the failing operation within the patch, when known. */
|
|
20
|
+
index?: number;
|
|
21
|
+
/** The failing operation, when known. */
|
|
22
|
+
operation?: unknown;
|
|
23
|
+
constructor(code: PatchErrorCode, message: string, details?: {
|
|
24
|
+
path?: string;
|
|
25
|
+
index?: number;
|
|
26
|
+
operation?: unknown;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** Thrown when `validate` is requested and the patched document is not a valid OPF presentation. */
|
|
30
|
+
declare class PatchValidationError extends PatchError {
|
|
31
|
+
readonly validation: PatchValidationResult;
|
|
32
|
+
constructor(validation: PatchValidationResult);
|
|
33
|
+
}
|
|
34
|
+
interface PatchValidationResult {
|
|
35
|
+
valid: boolean;
|
|
36
|
+
errors?: unknown[];
|
|
37
|
+
warnings?: unknown[];
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
interface ApplyPatchOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Validate the whole patched document against the OPF schema (`true`) or a
|
|
43
|
+
* custom validator. An invalid result throws `PatchValidationError`; the
|
|
44
|
+
* input is never changed. Intermediate states are not validated.
|
|
45
|
+
*/
|
|
46
|
+
validate?: boolean | ((document: unknown) => PatchValidationResult);
|
|
47
|
+
/** With `validate`, also reject warnings. */
|
|
48
|
+
strict?: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface PatchResult {
|
|
51
|
+
document: unknown;
|
|
52
|
+
/** The patch that restores the input from `document`. Applying it to `document` yields the input. */
|
|
53
|
+
inverse: JsonPatchOperation[];
|
|
54
|
+
/** The normalised operations that were applied (values cloned, unknown members dropped). */
|
|
55
|
+
patch: JsonPatchOperation[];
|
|
56
|
+
validation?: PatchValidationResult;
|
|
57
|
+
}
|
|
58
|
+
/** JSON equality: member order is irrelevant, `-0` equals `0`, arrays compare in order. */
|
|
59
|
+
declare function jsonEqual(a: unknown, b: unknown): boolean;
|
|
60
|
+
declare function escapePointerToken(token: string | number): string;
|
|
61
|
+
declare function unescapePointerToken(token: string): string;
|
|
62
|
+
/** Split a JSON Pointer into unescaped tokens. Throws `invalid-json-pointer`. */
|
|
63
|
+
declare function parsePointer(pointer: unknown): string[];
|
|
64
|
+
/** Join tokens into a JSON Pointer, escaping `~` and `/`. */
|
|
65
|
+
declare function formatPointer(tokens: readonly (string | number)[]): JsonPointer;
|
|
66
|
+
/**
|
|
67
|
+
* Stable path normalisation. Accepts a JSON Pointer (`/slides/0/title`), an
|
|
68
|
+
* OPF dotted path (`slides.0.title`) or a segment array, and returns a JSON
|
|
69
|
+
* Pointer. Use pointers or segment arrays for keys that contain dots.
|
|
70
|
+
*/
|
|
71
|
+
declare function pointerFromPath(path: string | readonly (string | number)[]): JsonPointer;
|
|
72
|
+
/** Parent pointer and final token of a non-root pointer. */
|
|
73
|
+
declare function splitPointer(pointer: JsonPointer): {
|
|
74
|
+
parent: JsonPointer;
|
|
75
|
+
token: string;
|
|
76
|
+
};
|
|
77
|
+
/** Read a value without throwing: `found` is false for a missing path (including `-` and bad indices). */
|
|
78
|
+
declare function readPointer(document: unknown, pointer: JsonPointer | readonly string[]): {
|
|
79
|
+
found: true;
|
|
80
|
+
value: unknown;
|
|
81
|
+
} | {
|
|
82
|
+
found: false;
|
|
83
|
+
};
|
|
84
|
+
/** Read a value or throw `patch-path-missing`. */
|
|
85
|
+
declare function getAtPointer(document: unknown, pointer: JsonPointer | readonly string[]): unknown;
|
|
86
|
+
declare const hasPointer: (document: unknown, pointer: JsonPointer | readonly string[]) => boolean;
|
|
87
|
+
/** Normalise and structurally validate a patch (shape only; no document needed). Values are cloned. */
|
|
88
|
+
declare function normalizePatch(patch: unknown): JsonPatchOperation[];
|
|
89
|
+
/**
|
|
90
|
+
* Apply a patch to a clone of `document` and return the result with its
|
|
91
|
+
* inverse. Atomic: any failing operation throws and nothing is returned.
|
|
92
|
+
*/
|
|
93
|
+
declare function applyPatchWithInverse(document: unknown, patch: unknown, options?: ApplyPatchOptions): PatchResult;
|
|
94
|
+
/** Apply an RFC 6902 patch to a clone of `document`; the input is never changed. */
|
|
95
|
+
declare function applyPatch(document: unknown, patch: unknown, options?: ApplyPatchOptions): unknown;
|
|
96
|
+
/** The patch that undoes `patch` when applied to the result of `applyPatch(document, patch)`. */
|
|
97
|
+
declare function invertPatch(document: unknown, patch: unknown): JsonPatchOperation[];
|
|
98
|
+
|
|
99
|
+
export { type ApplyPatchOptions, type JsonPatchOperation, type JsonPointer, PatchError, type PatchErrorCode, type PatchResult, PatchValidationError, type PatchValidationResult, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken };
|
package/dist/patch.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PatchError, PatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-RUC7L5DJ.js';
|
|
2
|
+
import './chunk-JKVKYVWL.js';
|
|
3
|
+
import './chunk-HOBSL7AJ.js';
|
|
4
|
+
import './chunk-S5W34SIJ.js';
|
|
5
|
+
import './chunk-E34DJ5LL.js';
|
|
6
|
+
import './chunk-4LAM3N6S.js';
|