@openpresentation/opf 0.8.0 → 0.10.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 +7 -1
- package/dist/{catalogs-BnnkUX9O.d.ts → catalogs-HCTav5Wv.d.ts} +1 -1
- package/dist/catalogs.d.ts +2 -2
- package/dist/chunk-BAWLYSUN.js +1326 -0
- package/dist/{chunk-HIY26FJV.js → chunk-GCB6LGJM.js} +47 -4
- package/dist/chunk-NPOKUFEX.js +595 -0
- package/dist/{chunk-X22DFHMW.js → chunk-TK3QHM3U.js} +3 -3
- package/dist/composition.d.ts +264 -5
- package/dist/composition.js +1 -1
- package/dist/docs.js +36 -6
- package/dist/examples.js +2284 -1417
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/lint.d.ts +70 -0
- package/dist/lint.js +5 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +3 -3
- package/dist/{schemas--QRVBhU1.d.ts → schemas-BYe5y8-i.d.ts} +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/validator.d.ts +2 -2
- package/dist/validator.js +2 -2
- package/package.json +11 -6
- package/dist/chunk-NEQAPMS2.js +0 -719
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { S as SchemaEntry, a as SchemaName, b as audience, c as chartType, d as colorScheme, f as fontScheme, l as language, e as layout, n as narrative, p as presentation, g as purpose, s as schemaEntries, h as schemaNames, i as schemas, j as socialPlatform, t as theme, k as tone } from './schemas
|
|
2
|
-
export { A as Audience, C as CatalogEntry, a as CatalogIndex, b as CatalogIndexRecord, c as CatalogKind, d as CatalogRecord, e as ChartType, f as ColorScheme, F as FontScheme, L as Language, g as Layout, N as Narrative, P as Purpose, S as SocialPlatform, T as Theme, h as Tone, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-
|
|
1
|
+
export { S as SchemaEntry, a as SchemaName, b as audience, c as chartType, d as colorScheme, f as fontScheme, l as language, e as layout, n as narrative, p as presentation, g as purpose, s as schemaEntries, h as schemaNames, i as schemas, j as socialPlatform, t as theme, k as tone } from './schemas-BYe5y8-i.js';
|
|
2
|
+
export { A as Audience, C as CatalogEntry, a as CatalogIndex, b as CatalogIndexRecord, c as CatalogKind, d as CatalogRecord, e as ChartType, f as ColorScheme, F as FontScheme, L as Language, g as Layout, N as Narrative, P as Purpose, S as SocialPlatform, T as Theme, h as Tone, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-HCTav5Wv.js';
|
|
3
3
|
export { OPFValidationError, ValidationIssue, ValidationResult, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './validator.js';
|
|
4
4
|
export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
|
|
5
5
|
export { LayoutPreviewIndex, LayoutPreviewRecord, getLayoutPreview, hasLayoutPreview, layoutPreviewIndex, layoutPreviewSlugs, layoutPreviews } from './previews.js';
|
|
6
6
|
export { P as Presentation } from './presentation-BMTdX6O1.js';
|
|
7
|
-
export {
|
|
7
|
+
export { LintContract, LintDiagnostic, LintLocation, LintOptions, LintReport, LintSeverity, LintSuggestion, lintPresentation, lintSource } from './lint.js';
|
|
8
|
+
export { CodeContent, CodeLayout, CodeLayoutDiagnostic, CodeLayoutOptions, CodeLineSegment, CodeLineSource, CodeTextFit, CodeTextPart, ComposeSlideOptions, ComposedFlow, ComposedGroup, ComposedItem, Composition, CompositionCandidate, CompositionDecision, CompositionExplanation, CompositionPenalties, CompositionTrack, FontFamilies, LayoutBox, LayoutDiagnostic, ListEntryLayout, ListFit, ListText, ListValue, MAX_COMPOSITION_DEPTH, MeasureTextWidth, MetricContent, MetricLayout, MetricLayoutDiagnostic, MetricLayoutOptions, MetricTextPart, MetricTextSource, OPFCompositionError, QuoteContent, QuoteLayout, QuoteLayoutDiagnostic, QuoteLayoutOptions, QuoteTextPart, QuoteTextSource, RichTextFit, RichTextFragment, RichTextLine, RichTextOptions, RichTextRun, SlideComposition, TextFit, TextLineInk, TextMeasurement, TextPlacement, TextPlacementLine, TextStyle, TimelineContent, TimelineEvent, TimelineLayout, TimelineLayoutDiagnostic, TimelineLayoutOptions, TimelineTextPart, chartColorForFill, colorContrast, composeSlide, fitList, fitRichText, fitText, layoutCode, layoutMetric, layoutQuote, layoutTimeline, measureText, measureTextOutline, placeTextLines, resolveCanvasDimensions, resolveFontFamilies, resolveTextStyle, textColorForFill, textWidthMeasurer, wrapText } from './composition.js';
|
|
8
9
|
export { OPFPaginationError, PaginatedPage, PaginationMapping, PaginationOptions, PaginationResult, PresentationPaginationOptions, PresentationPaginationResult, paginatePresentation, paginateSlide } from './pagination.js';
|
|
9
10
|
export { DataCell, DataContentOptions, DataImportOptions, OPFDataImportError, TabularData, createDataContent, parseTabularData } from './data.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-OZULJBSG.js';
|
|
2
2
|
export { getLayoutPreview, hasLayoutPreview, layoutPreviewIndex, layoutPreviewSlugs, layoutPreviews } from './chunk-PIQXLBBJ.js';
|
|
3
|
+
export { lintPresentation, lintSource } from './chunk-NPOKUFEX.js';
|
|
3
4
|
export { OPFDataImportError, createDataContent, parseTabularData } from './chunk-SOSOBKQ2.js';
|
|
4
|
-
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-
|
|
5
|
-
export { OPFValidationError, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './chunk-
|
|
6
|
-
export { MAX_COMPOSITION_DEPTH, OPFCompositionError, composeSlide, fitList, fitRichText, fitText, layoutQuote, measureText, resolveCanvasDimensions, resolveFontFamilies, resolveTextStyle, textWidthMeasurer, wrapText } from './chunk-
|
|
5
|
+
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-TK3QHM3U.js';
|
|
6
|
+
export { OPFValidationError, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './chunk-GCB6LGJM.js';
|
|
7
|
+
export { MAX_COMPOSITION_DEPTH, OPFCompositionError, chartColorForFill, colorContrast, composeSlide, fitList, fitRichText, fitText, layoutCode, layoutMetric, layoutQuote, layoutTimeline, measureText, measureTextOutline, placeTextLines, resolveCanvasDimensions, resolveFontFamilies, resolveTextStyle, textColorForFill, textWidthMeasurer, wrapText } from './chunk-BAWLYSUN.js';
|
|
7
8
|
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-GQSK3T7X.js';
|
|
8
9
|
export { audiences, catalogEntries, catalogIndexes, catalogKinds, catalogSchemaNames, catalogs, chartTypes, colorSchemes, fontSchemes, languages, layouts, narratives, purposes, socialPlatforms, themes, tones } from './chunk-TWMRZ43O.js';
|
package/dist/lint.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { c as CatalogKind } from './catalogs-HCTav5Wv.js';
|
|
2
|
+
import { ValidationIssue } from './validator.js';
|
|
3
|
+
import { J as JsonPrimitive } from './schemas-BYe5y8-i.js';
|
|
4
|
+
import './presentation-BMTdX6O1.js';
|
|
5
|
+
|
|
6
|
+
type LintSeverity = 'error' | 'warning' | 'info';
|
|
7
|
+
interface LintLocation {
|
|
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 };
|
package/dist/lint.js
ADDED
package/dist/pagination.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ declare class OPFPaginationError extends Error {
|
|
|
35
35
|
declare function paginateSlide(input: unknown, options?: PaginationOptions): PaginationResult;
|
|
36
36
|
interface PresentationPaginationOptions {
|
|
37
37
|
textMeasurement?: TextMeasurement;
|
|
38
|
+
/** Unscaled reference-pixel clearance for supplied vector text outlines. */
|
|
39
|
+
textRasterPadding?: number;
|
|
38
40
|
minFontSize?: number;
|
|
39
41
|
maxSlides?: number;
|
|
40
42
|
/** Optional host-resolved layout/canvas overrides for each source slide. */
|
package/dist/pagination.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-TK3QHM3U.js';
|
|
2
|
+
import './chunk-GCB6LGJM.js';
|
|
3
|
+
import './chunk-BAWLYSUN.js';
|
|
4
4
|
import './chunk-GQSK3T7X.js';
|
|
5
5
|
import './chunk-TWMRZ43O.js';
|
|
@@ -213,4 +213,4 @@ interface SchemaEntry {
|
|
|
213
213
|
}
|
|
214
214
|
declare const schemaEntries: readonly SchemaEntry[];
|
|
215
215
|
|
|
216
|
-
export { type
|
|
216
|
+
export { type JsonPrimitive as J, type SchemaEntry as S, type SchemaName as a, audience as b, chartType as c, colorScheme as d, layout as e, fontScheme as f, purpose as g, schemaNames as h, schemas as i, socialPlatform as j, tone as k, language as l, type JsonSchema as m, narrative as n, presentation as p, schemaEntries as s, theme as t };
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { S as SchemaEntry, a as SchemaName, b as audience, c as chartType, d as colorScheme, f as fontScheme, l as language, e as layout, n as narrative, p as presentation, g as purpose, s as schemaEntries, h as schemaNames, i as schemas, j as socialPlatform, t as theme, k as tone } from './schemas
|
|
1
|
+
export { S as SchemaEntry, a as SchemaName, b as audience, c as chartType, d as colorScheme, f as fontScheme, l as language, e as layout, n as narrative, p as presentation, g as purpose, s as schemaEntries, h as schemaNames, i as schemas, j as socialPlatform, t as theme, k as tone } from './schemas-BYe5y8-i.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { P as Presentation } from './presentation-BMTdX6O1.js';
|
|
2
|
-
export { A as Audience, c as CatalogKind, e as ChartType, f as ColorScheme, F as FontScheme, L as Language, g as Layout, N as Narrative, P as Purpose, S as SocialPlatform, T as Theme, h as Tone } from './catalogs-
|
|
3
|
-
export { a as SchemaName } from './schemas
|
|
2
|
+
export { A as Audience, c as CatalogKind, e as ChartType, f as ColorScheme, F as FontScheme, L as Language, g as Layout, N as Narrative, P as Purpose, S as SocialPlatform, T as Theme, h as Tone } from './catalogs-HCTav5Wv.js';
|
|
3
|
+
export { a as SchemaName } from './schemas-BYe5y8-i.js';
|
|
4
4
|
export { ValidationIssue, ValidationResult } from './validator.js';
|
package/dist/validator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Presentation } from './presentation-BMTdX6O1.js';
|
|
2
|
-
import { c as CatalogKind } from './catalogs-
|
|
3
|
-
import { a as SchemaName,
|
|
2
|
+
import { c as CatalogKind } from './catalogs-HCTav5Wv.js';
|
|
3
|
+
import { a as SchemaName, m as JsonSchema } from './schemas-BYe5y8-i.js';
|
|
4
4
|
|
|
5
5
|
interface ValidationIssue {
|
|
6
6
|
path: string;
|
package/dist/validator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { OPFValidationError, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { OPFValidationError, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './chunk-GCB6LGJM.js';
|
|
2
|
+
import './chunk-BAWLYSUN.js';
|
|
3
3
|
import './chunk-GQSK3T7X.js';
|
|
4
4
|
import './chunk-TWMRZ43O.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpresentation/opf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Canonical Open Presentation Format schemas, catalogs, TypeScript types, and local validation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Open Presentation",
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"./data": {
|
|
84
84
|
"types": "./dist/data.d.ts",
|
|
85
85
|
"import": "./dist/data.js"
|
|
86
|
+
},
|
|
87
|
+
"./lint": {
|
|
88
|
+
"types": "./dist/lint.d.ts",
|
|
89
|
+
"import": "./dist/lint.js"
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
"files": [
|
|
@@ -92,25 +96,26 @@
|
|
|
92
96
|
"package.json"
|
|
93
97
|
],
|
|
94
98
|
"engines": {
|
|
95
|
-
"node": "
|
|
99
|
+
"node": "24.x"
|
|
96
100
|
},
|
|
97
101
|
"scripts": {
|
|
98
102
|
"clean": "rm -rf dist src/generated",
|
|
99
103
|
"generate": "node scripts/generate.mjs && node scripts/generate-previews.mjs && node scripts/generate-content.mjs",
|
|
100
104
|
"build": "pnpm run generate && tsup && node scripts/copy-spec.mjs",
|
|
101
|
-
"typecheck": "pnpm run generate &&
|
|
105
|
+
"typecheck": "pnpm run generate && node ../../scripts/typecheck.mjs --noEmit",
|
|
102
106
|
"test": "pnpm run build && node ../../scripts/run-node-tests.mjs && node test/composition.mjs && node test/pagination.mjs && node test/data.mjs && node test/rich-text.mjs && node test/lists.mjs",
|
|
103
107
|
"test:packed": "node test/packed-install-smoke.mjs",
|
|
104
108
|
"pack:dry-run": "pnpm run build && npm pack --dry-run --cache /tmp/opf-npm-cache"
|
|
105
109
|
},
|
|
106
110
|
"dependencies": {
|
|
107
111
|
"ajv": "^8.17.1",
|
|
108
|
-
"ajv-formats": "^3.0.1"
|
|
112
|
+
"ajv-formats": "^3.0.1",
|
|
113
|
+
"jsonc-parser": "3.3.1"
|
|
109
114
|
},
|
|
110
115
|
"devDependencies": {
|
|
111
|
-
"@types/node": "^
|
|
116
|
+
"@types/node": "^24.13.4",
|
|
112
117
|
"json-schema-to-typescript": "^16.0.0",
|
|
113
118
|
"tsup": "^8.5.1",
|
|
114
|
-
"typescript": "
|
|
119
|
+
"typescript": "~5.9.3"
|
|
115
120
|
}
|
|
116
121
|
}
|