@openpresentation/opf 0.10.0 → 0.11.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/{catalogs-HCTav5Wv.d.ts → catalogs-atkOF4Vy.d.ts} +7 -7
- package/dist/catalogs.d.ts +2 -2
- package/dist/catalogs.js +1 -1
- package/dist/{chunk-TWMRZ43O.js → chunk-6FU2KICU.js} +365 -327
- package/dist/{chunk-GCB6LGJM.js → chunk-CHKJ4QHQ.js} +225 -73
- package/dist/{chunk-NPOKUFEX.js → chunk-EQHZ3ZO4.js} +3 -3
- package/dist/{chunk-BAWLYSUN.js → chunk-FTWNWFIV.js} +180 -6
- package/dist/{chunk-TK3QHM3U.js → chunk-FWA5XB45.js} +54 -21
- package/dist/{chunk-GQSK3T7X.js → chunk-GN52EE3P.js} +146 -16
- package/dist/{chunk-OZULJBSG.js → chunk-RS5GZ5RW.js} +14 -0
- package/dist/composition-Tv9Wm3Oh.d.ts +691 -0
- package/dist/composition.d.ts +1 -624
- package/dist/composition.js +1 -1
- package/dist/docs.js +59 -11
- package/dist/examples.d.ts +1 -1
- package/dist/index.d.ts +65 -4
- package/dist/index.js +205 -7
- package/dist/lint.d.ts +3 -3
- package/dist/lint.js +5 -5
- package/dist/pagination.d.ts +4 -2
- package/dist/pagination.js +5 -5
- package/dist/{presentation-BMTdX6O1.d.ts → presentation-Ct42Mitb.d.ts} +51 -8
- package/dist/repo-readme.js +1 -1
- package/dist/{schemas-BYe5y8-i.d.ts → schemas-CiVmUT2p.d.ts} +6 -0
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/spec/catalogs/layouts/extract/canonical.json +45 -21
- package/dist/spec/catalogs/layouts/index.json +10 -0
- package/dist/spec/catalogs/layouts/number-1x.json +1 -1
- package/dist/spec/catalogs/layouts/number-2x.json +2 -2
- package/dist/spec/catalogs/layouts/number-3x.json +3 -3
- package/dist/spec/catalogs/layouts/number-4x.json +4 -4
- package/dist/spec/catalogs/layouts/number-5x.json +5 -5
- package/dist/spec/catalogs/layouts/number-6x.json +6 -6
- package/dist/spec/catalogs/layouts/quote-1x.json +13 -0
- package/dist/spec/catalogs/layouts/timeline-1x.json +13 -0
- package/dist/spec/catalogs/narratives/board-meeting.json +21 -21
- package/dist/spec/catalogs/narratives/business-narrative.json +8 -8
- package/dist/spec/catalogs/narratives/business-review.json +12 -12
- package/dist/spec/catalogs/narratives/capacity-planning.json +8 -8
- package/dist/spec/catalogs/narratives/challenge-resolution.json +7 -7
- package/dist/spec/catalogs/narratives/classic-story.json +7 -7
- package/dist/spec/catalogs/narratives/company-intro.json +9 -9
- package/dist/spec/catalogs/narratives/conference-talk.json +1 -1
- package/dist/spec/catalogs/narratives/early-startup-pitch.json +12 -12
- package/dist/spec/catalogs/narratives/educate.json +9 -9
- package/dist/spec/catalogs/narratives/employee-review.json +8 -8
- package/dist/spec/catalogs/narratives/failure-analysis.json +10 -10
- package/dist/spec/catalogs/narratives/focus.json +12 -12
- package/dist/spec/catalogs/narratives/golden-circle.json +1 -1
- package/dist/spec/catalogs/narratives/innovation.json +9 -9
- package/dist/spec/catalogs/narratives/justice.json +11 -11
- package/dist/spec/catalogs/narratives/marketing-strategy.json +11 -11
- package/dist/spec/catalogs/narratives/performance-improvement-plan.json +8 -8
- package/dist/spec/catalogs/narratives/performance-review.json +11 -11
- package/dist/spec/catalogs/narratives/persuade.json +7 -7
- package/dist/spec/catalogs/narratives/persuasive-sales.json +8 -8
- package/dist/spec/catalogs/narratives/pitch-deck.json +3 -3
- package/dist/spec/catalogs/narratives/problem-solution.json +2 -2
- package/dist/spec/catalogs/narratives/product-launch.json +10 -10
- package/dist/spec/catalogs/narratives/project-proposal.json +10 -10
- package/dist/spec/catalogs/narratives/qbr.json +3 -3
- package/dist/spec/catalogs/narratives/rags-to-riches.json +7 -7
- package/dist/spec/catalogs/narratives/reveal.json +8 -8
- package/dist/spec/catalogs/narratives/scqa.json +1 -1
- package/dist/spec/catalogs/narratives/status-update.json +6 -6
- package/dist/spec/catalogs/narratives/strategic-advisory.json +7 -7
- package/dist/spec/catalogs/narratives/strategic-narrative.json +1 -1
- package/dist/spec/catalogs/narratives/survey-analysis.json +10 -10
- package/dist/spec/catalogs/narratives/survival-story.json +10 -10
- package/dist/spec/catalogs/narratives/transformation-arc.json +1 -1
- package/dist/spec/catalogs/narratives/trend-analysis.json +7 -7
- package/dist/spec/catalogs/narratives/underdog-victory.json +8 -8
- package/dist/spec/catalogs/narratives/venture-pitch.json +12 -12
- package/dist/spec/catalogs/narratives/weekly-progress.json +10 -10
- package/dist/spec/openapi.yaml +5 -0
- package/dist/spec/schemas/layout.schema.json +12 -3
- package/dist/spec/schemas/narrative.schema.json +1 -1
- package/dist/spec/schemas/opf.schema.json +83 -12
- package/dist/spec-files.d.ts +1 -1
- package/dist/spec-files.js +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/validator.d.ts +7 -4
- package/dist/validator.js +4 -4
- package/package.json +1 -1
package/dist/examples.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,71 @@
|
|
|
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
|
-
|
|
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-CiVmUT2p.js';
|
|
2
|
+
import { C as CatalogKind } from './catalogs-atkOF4Vy.js';
|
|
3
|
+
export { A as Audience, a as CatalogEntry, b as CatalogIndex, c as CatalogIndexRecord, 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-atkOF4Vy.js';
|
|
3
4
|
export { OPFValidationError, ValidationIssue, ValidationResult, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './validator.js';
|
|
4
5
|
export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
|
|
5
6
|
export { LayoutPreviewIndex, LayoutPreviewRecord, getLayoutPreview, hasLayoutPreview, layoutPreviewIndex, layoutPreviewSlugs, layoutPreviews } from './previews.js';
|
|
6
|
-
export { P as Presentation } from './presentation-
|
|
7
|
+
export { P as Presentation } from './presentation-Ct42Mitb.js';
|
|
7
8
|
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';
|
|
9
|
+
export { C as CodeContent, a as CodeLayout, b as CodeLayoutDiagnostic, c as CodeLayoutOptions, d as CodeLineSegment, e as CodeLineSource, f as CodeTextFit, g as CodeTextPart, h as ComposeSlideOptions, i as ComposedFlow, j as ComposedGroup, k as ComposedItem, l as Composition, m as CompositionCandidate, n as CompositionDecision, o as CompositionExplanation, p as CompositionPenalties, q as CompositionTrack, F as FontFamilies, r as FurnitureImagePart, s as FurnitureLayout, t as FurniturePart, u as FurniturePartBase, v as FurnitureTextPart, L as LayoutBox, w as LayoutDiagnostic, x as ListEntryLayout, y as ListFit, z as ListText, A as ListValue, M as MAX_COMPOSITION_DEPTH, B as MeasureTextWidth, D as MetricContent, E as MetricLayout, G as MetricLayoutDiagnostic, H as MetricLayoutOptions, I as MetricTextPart, J as MetricTextSource, O as OPFCompositionError, Q as QuoteContent, K as QuoteLayout, N as QuoteLayoutDiagnostic, P as QuoteLayoutOptions, R as QuoteTextPart, S as QuoteTextSource, T as ResolveColorRefOptions, U as ResolveColorRefRoles, V as RichTextFit, W as RichTextFragment, X as RichTextLine, Y as RichTextOptions, Z as RichTextRun, _ as SlideComposition, $ as TextFit, a0 as TextLineInk, a1 as TextMeasurement, a2 as TextPlacement, a3 as TextPlacementLine, a4 as TextStyle, a5 as TimelineContent, a6 as TimelineEvent, a7 as TimelineLayout, a8 as TimelineLayoutDiagnostic, a9 as TimelineLayoutOptions, aa as TimelineTextPart, ab as chartColorForFill, ac as colorContrast, ad as composeSlide, ae as fitList, af as fitRichText, ag as fitText, ah as layoutCode, ai as layoutFurniture, aj as layoutMetric, ak as layoutQuote, al as layoutTimeline, am as measureText, an as measureTextOutline, ao as normalizeHexColor, ap as placeTextLines, aq as resolveCanvasDimensions, ar as resolveColorRef, as as resolveFontFamilies, at as resolveTextStyle, au as textColorForFill, av as textWidthMeasurer, aw as wrapText } from './composition-Tv9Wm3Oh.js';
|
|
9
10
|
export { OPFPaginationError, PaginatedPage, PaginationMapping, PaginationOptions, PaginationResult, PresentationPaginationOptions, PresentationPaginationResult, paginatePresentation, paginateSlide } from './pagination.js';
|
|
10
11
|
export { DataCell, DataContentOptions, DataImportOptions, OPFDataImportError, TabularData, createDataContent, parseTabularData } from './data.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Local catalog vendoring: resolve every catalog reference a presentation
|
|
15
|
+
* uses and inline the resolved records into `catalogs.<kind>.records`, so the
|
|
16
|
+
* document renders identically with no catalog lookups beyond itself.
|
|
17
|
+
*
|
|
18
|
+
* Resolution is local-only: inline records are kept as-is, ids that belong to
|
|
19
|
+
* a kind's custom `source` are left to that source, and everything else
|
|
20
|
+
* resolves against the bundled default catalogs. Every reference a record
|
|
21
|
+
* carries is chased in turn — whether the record came from the bundled
|
|
22
|
+
* catalogs or was already inline — so no inlined record dangles. Running the
|
|
23
|
+
* bundle twice is a no-op.
|
|
24
|
+
*/
|
|
25
|
+
interface BundleReport {
|
|
26
|
+
/** Record ids inlined by this run, per kind, in output order. */
|
|
27
|
+
added: Partial<Record<CatalogKind, string[]>>;
|
|
28
|
+
/** Referenced ids that were already inline in the document, per kind. */
|
|
29
|
+
alreadyInline: Partial<Record<CatalogKind, string[]>>;
|
|
30
|
+
/** Kinds left untouched because the document declares a custom source. */
|
|
31
|
+
keptSources: CatalogKind[];
|
|
32
|
+
/**
|
|
33
|
+
* Referenced bare ids that resolve nowhere locally, per kind — listed for
|
|
34
|
+
* exactly the positions the validator warns about, so `unresolved` means
|
|
35
|
+
* "the validator would warn about this": the string shorthand of
|
|
36
|
+
* `narrative`, the design references `themes`, `colorSchemes` and
|
|
37
|
+
* `fontSchemes` (string or `{ id }` form, at deck and slide level), and
|
|
38
|
+
* `chart.type`.
|
|
39
|
+
*
|
|
40
|
+
* Every other reference — tones, purposes, audiences, languages, layouts,
|
|
41
|
+
* social platforms, object-form narratives, and anything reached through a
|
|
42
|
+
* record rather than written by the author — is still resolved and inlined
|
|
43
|
+
* when it is found, and skipped in silence when it is not, because the
|
|
44
|
+
* validator does not warn there either.
|
|
45
|
+
*
|
|
46
|
+
* Informational: unknown ids are warnings, never errors.
|
|
47
|
+
*/
|
|
48
|
+
unresolved: Partial<Record<CatalogKind, string[]>>;
|
|
49
|
+
}
|
|
50
|
+
interface BundleResult {
|
|
51
|
+
presentation: unknown;
|
|
52
|
+
report: BundleReport;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolve every catalog reference `value` uses and inline the resolved
|
|
56
|
+
* records, returning a new document plus a report of what changed. The input
|
|
57
|
+
* document is not modified.
|
|
58
|
+
*
|
|
59
|
+
* Anything that is not an object, and any document whose `catalogs` is
|
|
60
|
+
* present but not an object, is returned unchanged with an all-empty report:
|
|
61
|
+
* bundling there would have to overwrite that field, and schema-invalid input
|
|
62
|
+
* deserves a defined no-op over silent data loss. The CLI validates before
|
|
63
|
+
* bundling, so only a direct library call can reach that case.
|
|
64
|
+
*
|
|
65
|
+
* Ids that resolve nowhere are reported as unresolved for the positions the
|
|
66
|
+
* validator warns about, and silently skipped elsewhere; see
|
|
67
|
+
* `BundleReport.unresolved`.
|
|
68
|
+
*/
|
|
69
|
+
declare function bundlePresentation(value: unknown): BundleResult;
|
|
70
|
+
|
|
71
|
+
export { type BundleReport, type BundleResult, CatalogKind, bundlePresentation };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,207 @@
|
|
|
1
|
-
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-
|
|
1
|
+
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-RS5GZ5RW.js';
|
|
2
2
|
export { getLayoutPreview, hasLayoutPreview, layoutPreviewIndex, layoutPreviewSlugs, layoutPreviews } from './chunk-PIQXLBBJ.js';
|
|
3
|
-
export { lintPresentation, lintSource } from './chunk-
|
|
3
|
+
export { lintPresentation, lintSource } from './chunk-EQHZ3ZO4.js';
|
|
4
4
|
export { OPFDataImportError, createDataContent, parseTabularData } from './chunk-SOSOBKQ2.js';
|
|
5
|
-
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
5
|
+
export { OPFPaginationError, paginatePresentation, paginateSlide } from './chunk-FWA5XB45.js';
|
|
6
|
+
import { isRecord, visitContentPayloads, bareIdPattern } from './chunk-CHKJ4QHQ.js';
|
|
7
|
+
export { OPFValidationError, assertValid, assertValidCatalogRecord, assertValidPresentation, validate, validateCatalogRecord, validatePresentation } from './chunk-CHKJ4QHQ.js';
|
|
8
|
+
export { MAX_COMPOSITION_DEPTH, OPFCompositionError, chartColorForFill, colorContrast, composeSlide, fitList, fitRichText, fitText, layoutCode, layoutFurniture, layoutMetric, layoutQuote, layoutTimeline, measureText, measureTextOutline, normalizeHexColor, placeTextLines, resolveCanvasDimensions, resolveColorRef, resolveFontFamilies, resolveTextStyle, textColorForFill, textWidthMeasurer, wrapText } from './chunk-FTWNWFIV.js';
|
|
9
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-GN52EE3P.js';
|
|
10
|
+
import { catalogEntries } from './chunk-6FU2KICU.js';
|
|
11
|
+
export { audiences, catalogEntries, catalogIndexes, catalogKinds, catalogSchemaNames, catalogs, chartTypes, colorSchemes, fontSchemes, languages, layouts, narratives, purposes, socialPlatforms, themes, tones } from './chunk-6FU2KICU.js';
|
|
12
|
+
|
|
13
|
+
// src/bundle.ts
|
|
14
|
+
function reportKey(kind, id) {
|
|
15
|
+
return `${kind}:${id}`;
|
|
16
|
+
}
|
|
17
|
+
function referenceId(value) {
|
|
18
|
+
if (typeof value === "string" && bareIdPattern.test(value)) return value;
|
|
19
|
+
if (isRecord(value) && typeof value.id === "string" && bareIdPattern.test(value.id)) return value.id;
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
function addReference(collector, kind, value, reportable) {
|
|
23
|
+
const id = referenceId(value);
|
|
24
|
+
if (!id) return;
|
|
25
|
+
if (reportable) collector.reportable.add(reportKey(kind, id));
|
|
26
|
+
let ids = collector.referenced.get(kind);
|
|
27
|
+
if (!ids) {
|
|
28
|
+
ids = /* @__PURE__ */ new Set();
|
|
29
|
+
collector.referenced.set(kind, ids);
|
|
30
|
+
}
|
|
31
|
+
if (ids.has(id)) return;
|
|
32
|
+
ids.add(id);
|
|
33
|
+
collector.queue.push({ kind, id });
|
|
34
|
+
}
|
|
35
|
+
function collectDesignReferences(collector, design) {
|
|
36
|
+
if (!isRecord(design)) return;
|
|
37
|
+
addReference(collector, "themes", design.theme, true);
|
|
38
|
+
addReference(collector, "colorSchemes", design.colorScheme, true);
|
|
39
|
+
addReference(collector, "fontSchemes", design.fontScheme, true);
|
|
40
|
+
if (isRecord(design.theme)) {
|
|
41
|
+
addReference(collector, "colorSchemes", design.theme.colorScheme, true);
|
|
42
|
+
addReference(collector, "fontSchemes", design.theme.fontScheme, true);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function collectChartReference(collector, payload) {
|
|
46
|
+
if (!isRecord(payload.chart)) return;
|
|
47
|
+
addReference(collector, "chartTypes", payload.chart.type, typeof payload.chart.type === "string");
|
|
48
|
+
}
|
|
49
|
+
function collectSocialReferences(collector, holder) {
|
|
50
|
+
const entries = Array.isArray(holder) ? holder : [holder];
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
if (!isRecord(entry) || !isRecord(entry.socials)) continue;
|
|
53
|
+
for (const key of Object.keys(entry.socials)) addReference(collector, "socialPlatforms", key, false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function collectBeatReferences(collector, narrative2) {
|
|
57
|
+
if (!isRecord(narrative2) || !Array.isArray(narrative2.beats)) return;
|
|
58
|
+
for (const beat of narrative2.beats) {
|
|
59
|
+
if (isRecord(beat)) addReference(collector, "layouts", beat.layoutHint, false);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function collectLanguageReferences(collector, language2) {
|
|
63
|
+
addReference(collector, "languages", language2, false);
|
|
64
|
+
if (!isRecord(language2)) return;
|
|
65
|
+
addReference(collector, "fontSchemes", language2.fontScheme, false);
|
|
66
|
+
addReference(collector, "fontSchemes", language2.googleFontScheme, false);
|
|
67
|
+
}
|
|
68
|
+
function collectDocumentReferences(collector, document) {
|
|
69
|
+
addReference(collector, "narratives", document.narrative, typeof document.narrative === "string");
|
|
70
|
+
collectBeatReferences(collector, document.narrative);
|
|
71
|
+
addReference(collector, "tones", document.tone, false);
|
|
72
|
+
addReference(collector, "purposes", document.purpose, false);
|
|
73
|
+
collectLanguageReferences(collector, document.language);
|
|
74
|
+
const audiences2 = Array.isArray(document.audience) ? document.audience : [document.audience];
|
|
75
|
+
for (const entry of audiences2) addReference(collector, "audiences", entry, false);
|
|
76
|
+
collectDesignReferences(collector, document.design);
|
|
77
|
+
collectSocialReferences(collector, document.organization);
|
|
78
|
+
collectSocialReferences(collector, document.speaker);
|
|
79
|
+
if (!Array.isArray(document.slides)) return;
|
|
80
|
+
for (const slide of document.slides) {
|
|
81
|
+
if (!isRecord(slide)) continue;
|
|
82
|
+
addReference(collector, "layouts", slide.layout, false);
|
|
83
|
+
collectDesignReferences(collector, slide.design);
|
|
84
|
+
collectChartReference(collector, slide);
|
|
85
|
+
visitContentPayloads(slide, "", (payload) => {
|
|
86
|
+
collectChartReference(collector, payload);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function collectRecordReferences(collector, kind, record) {
|
|
91
|
+
if (kind === "themes") {
|
|
92
|
+
addReference(collector, "colorSchemes", record.colorScheme, false);
|
|
93
|
+
addReference(collector, "fontSchemes", record.fontScheme, false);
|
|
94
|
+
} else if (kind === "narratives") {
|
|
95
|
+
collectBeatReferences(collector, record);
|
|
96
|
+
} else if (kind === "languages") {
|
|
97
|
+
addReference(collector, "fontSchemes", record.fontScheme, false);
|
|
98
|
+
addReference(collector, "fontSchemes", record.googleFontScheme, false);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
var bundledIndex;
|
|
102
|
+
function bundledCatalogIndex() {
|
|
103
|
+
if (bundledIndex) return bundledIndex;
|
|
104
|
+
const index = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const entry of catalogEntries) {
|
|
106
|
+
const records = /* @__PURE__ */ new Map();
|
|
107
|
+
for (const record of entry.records) {
|
|
108
|
+
if (isRecord(record) && typeof record.id === "string") records.set(record.id, record);
|
|
109
|
+
}
|
|
110
|
+
index.set(entry.kind, records);
|
|
111
|
+
}
|
|
112
|
+
bundledIndex = index;
|
|
113
|
+
return index;
|
|
114
|
+
}
|
|
115
|
+
function bundledRecord(kind, id) {
|
|
116
|
+
const record = bundledCatalogIndex().get(kind)?.get(id);
|
|
117
|
+
if (!record) return void 0;
|
|
118
|
+
const clone = structuredClone(record);
|
|
119
|
+
delete clone.$schema;
|
|
120
|
+
return clone;
|
|
121
|
+
}
|
|
122
|
+
function readKindState(catalogsField, kind) {
|
|
123
|
+
const entry = catalogsField[kind];
|
|
124
|
+
const inline = /* @__PURE__ */ new Map();
|
|
125
|
+
if (!isRecord(entry)) return { customSource: false, inline };
|
|
126
|
+
if (Array.isArray(entry.records)) {
|
|
127
|
+
for (const record of entry.records) {
|
|
128
|
+
if (isRecord(record) && typeof record.id === "string") inline.set(record.id, record);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const customSource = typeof entry.source === "string" || Array.isArray(entry.source) && entry.source.length > 0;
|
|
132
|
+
return { customSource, inline };
|
|
133
|
+
}
|
|
134
|
+
function kindState(states, catalogsField, kind) {
|
|
135
|
+
const cached = states.get(kind);
|
|
136
|
+
if (cached) return cached;
|
|
137
|
+
const state = readKindState(catalogsField, kind);
|
|
138
|
+
states.set(kind, state);
|
|
139
|
+
return state;
|
|
140
|
+
}
|
|
141
|
+
function pushReportId(map, kind, id) {
|
|
142
|
+
const list = map[kind];
|
|
143
|
+
if (list) list.push(id);
|
|
144
|
+
else map[kind] = [id];
|
|
145
|
+
}
|
|
146
|
+
function bundlePresentation(value) {
|
|
147
|
+
const report = { added: {}, alreadyInline: {}, keptSources: [], unresolved: {} };
|
|
148
|
+
if (!isRecord(value)) {
|
|
149
|
+
return { presentation: value, report };
|
|
150
|
+
}
|
|
151
|
+
const presentation2 = structuredClone(value);
|
|
152
|
+
if (presentation2.catalogs !== void 0 && !isRecord(presentation2.catalogs)) {
|
|
153
|
+
return { presentation: presentation2, report };
|
|
154
|
+
}
|
|
155
|
+
const catalogsField = isRecord(presentation2.catalogs) ? presentation2.catalogs : {};
|
|
156
|
+
const collector = { queue: [], referenced: /* @__PURE__ */ new Map(), reportable: /* @__PURE__ */ new Set() };
|
|
157
|
+
collectDocumentReferences(collector, presentation2);
|
|
158
|
+
const states = /* @__PURE__ */ new Map();
|
|
159
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
160
|
+
for (let index = 0; index < collector.queue.length; index += 1) {
|
|
161
|
+
const pending = collector.queue[index];
|
|
162
|
+
if (!pending) continue;
|
|
163
|
+
const { kind, id } = pending;
|
|
164
|
+
const state = kindState(states, catalogsField, kind);
|
|
165
|
+
const inlineRecord = state.inline.get(id);
|
|
166
|
+
if (inlineRecord) {
|
|
167
|
+
collectRecordReferences(collector, kind, inlineRecord);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (state.customSource) continue;
|
|
171
|
+
const record = bundledRecord(kind, id);
|
|
172
|
+
if (!record) continue;
|
|
173
|
+
let kindRecords = resolved.get(kind);
|
|
174
|
+
if (!kindRecords) {
|
|
175
|
+
kindRecords = /* @__PURE__ */ new Map();
|
|
176
|
+
resolved.set(kind, kindRecords);
|
|
177
|
+
}
|
|
178
|
+
kindRecords.set(id, record);
|
|
179
|
+
collectRecordReferences(collector, kind, record);
|
|
180
|
+
}
|
|
181
|
+
for (const [kind, ids] of collector.referenced) {
|
|
182
|
+
const state = kindState(states, catalogsField, kind);
|
|
183
|
+
if (state.customSource) report.keptSources.push(kind);
|
|
184
|
+
const kindResolved = resolved.get(kind);
|
|
185
|
+
const addedIds = [];
|
|
186
|
+
for (const id of [...ids].sort()) {
|
|
187
|
+
if (state.inline.has(id)) pushReportId(report.alreadyInline, kind, id);
|
|
188
|
+
else if (kindResolved?.has(id)) addedIds.push(id);
|
|
189
|
+
else if (!state.customSource && collector.reportable.has(reportKey(kind, id))) {
|
|
190
|
+
pushReportId(report.unresolved, kind, id);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (!addedIds.length) continue;
|
|
194
|
+
if (!isRecord(presentation2.catalogs)) presentation2.catalogs = {};
|
|
195
|
+
const catalogs2 = presentation2.catalogs;
|
|
196
|
+
if (!isRecord(catalogs2[kind])) catalogs2[kind] = {};
|
|
197
|
+
const entry = catalogs2[kind];
|
|
198
|
+
if (!Array.isArray(entry.records)) entry.records = [];
|
|
199
|
+
const records = entry.records;
|
|
200
|
+
for (const id of addedIds) records.push(kindResolved?.get(id));
|
|
201
|
+
report.added[kind] = addedIds;
|
|
202
|
+
}
|
|
203
|
+
report.keptSources.sort();
|
|
204
|
+
return { presentation: presentation2, report };
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export { bundlePresentation };
|
package/dist/lint.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CatalogKind } from './catalogs-atkOF4Vy.js';
|
|
2
2
|
import { ValidationIssue } from './validator.js';
|
|
3
|
-
import { J as JsonPrimitive } from './schemas-
|
|
4
|
-
import './presentation-
|
|
3
|
+
import { J as JsonPrimitive } from './schemas-CiVmUT2p.js';
|
|
4
|
+
import './presentation-Ct42Mitb.js';
|
|
5
5
|
|
|
6
6
|
type LintSeverity = 'error' | 'warning' | 'info';
|
|
7
7
|
interface LintLocation {
|
package/dist/lint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { lintPresentation, lintSource } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
export { lintPresentation, lintSource } from './chunk-EQHZ3ZO4.js';
|
|
2
|
+
import './chunk-CHKJ4QHQ.js';
|
|
3
|
+
import './chunk-FTWNWFIV.js';
|
|
4
|
+
import './chunk-GN52EE3P.js';
|
|
5
|
+
import './chunk-6FU2KICU.js';
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LayoutDiagnostic, ComposeSlideOptions, TextMeasurement } from './composition.js';
|
|
1
|
+
import { w as LayoutDiagnostic, h as ComposeSlideOptions, a1 as TextMeasurement } from './composition-Tv9Wm3Oh.js';
|
|
2
2
|
|
|
3
3
|
interface PaginationOptions extends ComposeSlideOptions {
|
|
4
4
|
/** Readability floor used while choosing page breaks. Default 24 reference pixels. */
|
|
5
5
|
minFontSize?: number;
|
|
6
6
|
/** All-or-nothing resource limit. Defaults to 100 output slides. */
|
|
7
7
|
maxSlides?: number;
|
|
8
|
-
/** Existing
|
|
8
|
+
/** Existing slide and content payload IDs to avoid when generating continuation IDs. */
|
|
9
9
|
reservedIds?: string[];
|
|
10
10
|
}
|
|
11
11
|
interface PaginationMapping {
|
|
@@ -21,6 +21,8 @@ interface PaginationMapping {
|
|
|
21
21
|
interface PaginatedPage {
|
|
22
22
|
slideIndex: number;
|
|
23
23
|
mappings: PaginationMapping[];
|
|
24
|
+
/** Repeated headings/furniture and their metadata sources; separate from body slices. */
|
|
25
|
+
repeatedMappings?: PaginationMapping[];
|
|
24
26
|
}
|
|
25
27
|
interface PaginationResult {
|
|
26
28
|
slides: Record<string, any>[];
|
package/dist/pagination.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-FWA5XB45.js';
|
|
2
|
+
import './chunk-CHKJ4QHQ.js';
|
|
3
|
+
import './chunk-FTWNWFIV.js';
|
|
4
|
+
import './chunk-GN52EE3P.js';
|
|
5
|
+
import './chunk-6FU2KICU.js';
|
|
@@ -273,6 +273,26 @@ type Asset = (string | {
|
|
|
273
273
|
*/
|
|
274
274
|
format?: string;
|
|
275
275
|
});
|
|
276
|
+
/**
|
|
277
|
+
* A single named variable. A hex string is shorthand for { "type": "color", "value": value }.
|
|
278
|
+
*
|
|
279
|
+
* This interface was referenced by `Presentation`'s JSON-Schema
|
|
280
|
+
* via the `definition` "Variable".
|
|
281
|
+
*/
|
|
282
|
+
type Variable = (HexColor | {
|
|
283
|
+
/**
|
|
284
|
+
* Variable kind. Only 'color' is defined today; other kinds may be added when content surfaces exist to consume them.
|
|
285
|
+
*/
|
|
286
|
+
type: "color";
|
|
287
|
+
/**
|
|
288
|
+
* Hex color shorthand accepted by selected string fields.
|
|
289
|
+
*/
|
|
290
|
+
value: string;
|
|
291
|
+
/**
|
|
292
|
+
* Optional prose describing what the variable is for, surfaced by pickers and agents.
|
|
293
|
+
*/
|
|
294
|
+
description?: string;
|
|
295
|
+
});
|
|
276
296
|
/**
|
|
277
297
|
* A contiguous run of text. Strings cover unformatted spans; object form adds character formatting.
|
|
278
298
|
*
|
|
@@ -301,7 +321,7 @@ type TextRun = (string | {
|
|
|
301
321
|
*/
|
|
302
322
|
strikethrough?: boolean;
|
|
303
323
|
/**
|
|
304
|
-
* Run text color
|
|
324
|
+
* Run text color. Documented forms: a hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), a color-scheme slot or role name resolved through the effective color scheme ('accent2', 'text'), or a 'var:<id>' reference into the top-level variables map. Prefer names over hex so runs survive re-theming. Any other string stays schema-valid so imported decks keep validating: validators warn and renderers fall back to the theme text color.
|
|
305
325
|
*/
|
|
306
326
|
color?: string;
|
|
307
327
|
/**
|
|
@@ -390,6 +410,16 @@ type TableCellValue = (string | number | boolean | null | TextRun[]);
|
|
|
390
410
|
* via the `definition` "ContentPayload".
|
|
391
411
|
*/
|
|
392
412
|
type ContentPayload = {
|
|
413
|
+
/**
|
|
414
|
+
* Optional stable identifier for this payload, unique among slide and payload ids in the document. Use when another system needs to address the payload across edits — patch-style agent edits, comments, review state, or generation provenance. Identity survives reordering where array indexes do not.
|
|
415
|
+
*/
|
|
416
|
+
id?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Custom data passthrough for agent workflows at payload scope; ignored by the engine but preserved across read/write round-trips.
|
|
419
|
+
*/
|
|
420
|
+
extensions?: {
|
|
421
|
+
[k: string]: unknown;
|
|
422
|
+
};
|
|
393
423
|
/**
|
|
394
424
|
* Optional content kind. When omitted, engines infer the kind from the fields present.
|
|
395
425
|
*/
|
|
@@ -520,7 +550,7 @@ type CatalogSource = string;
|
|
|
520
550
|
*
|
|
521
551
|
* Fields that reference catalog records (narrative, language, tone, audience, purpose, design.theme / design.theme.id, design.colorScheme / design.colorScheme.id, design.fontScheme / design.fontScheme.id, Slide.layout, Chart.type, Organization.socials / Speaker.socials) resolve through the catalog system: inline 'catalogs.<kind>.records[]' on the document → 'catalogs.<kind>.source' on the document → engine defaults → the default catalog at https://www.pptx.gallery/<kind>. Every reference resolves to the catalog record's 'id' field. When an OPF document omits a reference entirely, the engine falls back to engine defaults (see /spec/reference/engine-defaults.json for a reference example). The defaults file is engine configuration; it is not part of the OPF document contract and has no JSON Schema.
|
|
522
552
|
*
|
|
523
|
-
* Most catalog references accept the bare 'id' as a string for the common case (e.g. narrative = 'classic-story', design.colorScheme = 'cool-horizon'). Audience, purpose, tone, design, and language object forms use 'id' as a base catalog reference plus inline overrides. Asset references use 'asset:<id>' strings that point into the top-level assets registry.
|
|
553
|
+
* Most catalog references accept the bare 'id' as a string for the common case (e.g. narrative = 'classic-story', design.colorScheme = 'cool-horizon'). Audience, purpose, tone, design, and language object forms use 'id' as a base catalog reference plus inline overrides. Asset references use 'asset:<id>' strings that point into the top-level assets registry, and content color fields (rich-text runs, styled table cells) accept hex values, color-scheme slot/role names, or 'var:<id>' references into the top-level variables map.
|
|
524
554
|
*/
|
|
525
555
|
interface Presentation {
|
|
526
556
|
/**
|
|
@@ -596,6 +626,7 @@ interface Presentation {
|
|
|
596
626
|
*/
|
|
597
627
|
tags?: string[];
|
|
598
628
|
design?: Design;
|
|
629
|
+
variables?: Variables;
|
|
599
630
|
/**
|
|
600
631
|
* Structured storyline describing the deck's arc and beats. Resolves to the 'id' of a 'narratives' catalog record.
|
|
601
632
|
*
|
|
@@ -1870,6 +1901,12 @@ interface HeaderFooterItem2 {
|
|
|
1870
1901
|
section?: boolean;
|
|
1871
1902
|
[k: string]: unknown;
|
|
1872
1903
|
}
|
|
1904
|
+
/**
|
|
1905
|
+
* Optional named color variables for values the deck uses in more than one place or wants to name for intent (e.g. a risk red, a brand highlight). Content color fields reference entries as 'var:<id>' strings. Variables complement the color scheme: scheme slots and roles stay the primary vocabulary; variables cover deck-specific named colors that have no scheme slot.
|
|
1906
|
+
*/
|
|
1907
|
+
interface Variables {
|
|
1908
|
+
[k: string]: Variable;
|
|
1909
|
+
}
|
|
1873
1910
|
/**
|
|
1874
1911
|
* Structured storyline used by AI to shape generated content. Mirrors the OPF Narrative Template record at https://openpresentation.org/schema/opf-narrative/v1 (sans '$schema'), so a library record and an inline narrative are interchangeable.
|
|
1875
1912
|
*
|
|
@@ -2188,6 +2225,12 @@ interface Slide {
|
|
|
2188
2225
|
*/
|
|
2189
2226
|
hidden?: boolean;
|
|
2190
2227
|
composition?: Composition1;
|
|
2228
|
+
/**
|
|
2229
|
+
* Custom data passthrough for agent workflows at slide scope; ignored by the engine but preserved across read/write round-trips. Use for review state, generation provenance, or authoring conventions such as { "authoring": { "locked": true } }.
|
|
2230
|
+
*/
|
|
2231
|
+
extensions?: {
|
|
2232
|
+
[k: string]: unknown;
|
|
2233
|
+
};
|
|
2191
2234
|
}
|
|
2192
2235
|
/**
|
|
2193
2236
|
* Full-slide chart payload. Presence of this field infers type 'chart'.
|
|
@@ -2288,13 +2331,13 @@ interface StyledTableCell {
|
|
|
2288
2331
|
*/
|
|
2289
2332
|
interface TableCellStyle {
|
|
2290
2333
|
/**
|
|
2291
|
-
*
|
|
2334
|
+
* Cell background: a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference. Eight-digit hex colors include alpha; #00000000 is transparent.
|
|
2292
2335
|
*/
|
|
2293
|
-
fill?: string;
|
|
2336
|
+
fill?: (HexColor | ("accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "dark1" | "dark2" | "light1" | "light2" | "hyperlink" | "followedHyperlink" | "primary" | "secondary" | "accent" | "background" | "surface" | "text" | "textSecondary") | string);
|
|
2294
2337
|
/**
|
|
2295
|
-
* Default text color, overridden by individual rich run colors.
|
|
2338
|
+
* Default text color, overridden by individual rich run colors. Accepts a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference.
|
|
2296
2339
|
*/
|
|
2297
|
-
color?: string;
|
|
2340
|
+
color?: (HexColor | ("accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "dark1" | "dark2" | "light1" | "light2" | "hyperlink" | "followedHyperlink" | "primary" | "secondary" | "accent" | "background" | "surface" | "text" | "textSecondary") | string);
|
|
2298
2341
|
/**
|
|
2299
2342
|
* Horizontal text alignment inside the cell.
|
|
2300
2343
|
*/
|
|
@@ -2334,9 +2377,9 @@ interface TableCellPadding {
|
|
|
2334
2377
|
*/
|
|
2335
2378
|
interface TableCellBorder {
|
|
2336
2379
|
/**
|
|
2337
|
-
*
|
|
2380
|
+
* Border color: a hex color, a color-scheme slot or role name, or a 'var:<id>' variable reference. Eight-digit hex colors include alpha; #00000000 is transparent.
|
|
2338
2381
|
*/
|
|
2339
|
-
color: string;
|
|
2382
|
+
color: (HexColor | ("accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "dark1" | "dark2" | "light1" | "light2" | "hyperlink" | "followedHyperlink" | "primary" | "secondary" | "accent" | "background" | "surface" | "text" | "textSecondary") | string);
|
|
2340
2383
|
/**
|
|
2341
2384
|
* Border width in reference pixels; 0 removes this edge.
|
|
2342
2385
|
*/
|
package/dist/repo-readme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/generated/repo-readme.ts
|
|
2
|
-
var repoReadmeRaw = '# Open Presentation Format (OPF)\n\n[](https://www.npmjs.com/package/@openpresentation/opf)\n[](https://www.npmjs.com/package/@openpresentation/opf)\n[](./LICENSE)\n\nPublic npm package: [`@openpresentation/opf`](https://www.npmjs.com/package/@openpresentation/opf) (`npm install @openpresentation/opf`).\n\nOpen Presentation Format is the portable, human-readable JSON document format for slide decks.\n\nThis repository is the canonical home for the OPF **spec**, **JSON Schemas**, **catalog presets**, examples, generated developer types, local validation tooling, and planning docs for the future render/edit/convert toolkit. OpenPresentation publishes open-source code and documentation only; it does not provide hosted APIs, hosted rendering functions, queues, storage, authentication, jobs, previews, SLAs, telemetry, or managed infrastructure.\n\nFor AI agents, use the [OPF skill set](docs/agent-skills.md) for authoring, layout, presets, editing, export, and schema inspection.\n\nCLI 0.5.0 installs all six skills into your project with `npx @openpresentation/cli@latest skills install`. It uses local copies, preserves existing instructions and refuses to overwrite customized skills. See the [installation and update guide](docs/agent-skills.md) for personal or agent-specific targets and pre-release testing.\n\nFor LLM authoring, start with [the authoring guide](docs/llm-authoring.md), [dynamic composition](docs/dynamic-composition.md), and [local ecosystem verification](docs/ecosystem-development.md).\n\n## File naming\n\nOpen Presentation Format documents are JSON files. Use `*.opf.json` for complete OPF presentation documents, for example `board-review.opf.json` or `deck.opf.json`.\n\nAvoid using bare `*.opf` for OPF JSON. The `.opf` extension is already used by other document and project formats, while `.opf.json` keeps the OPF identity and still makes the underlying JSON format clear to editors, validators, agents, and version-control tooling.\n\n## Naming and reuse\n\nThe format name is **Open Presentation Format**. The schemas, catalogs, packages, and local tooling in this repository are free and open source under the MIT license, so third-party tools may read, write, validate, render, convert, and describe support for Open Presentation Format without adopting any product-specific branding.\n\n## Why OPF\n\n`.pptx` is a zipped bundle of XML. Humans can\'t diff it, LLMs can\'t read or write it reliably, and git can\'t track it meaningfully. Every change looks like a binary blob.\n\nOPF is plain JSON. A human can open it in an editor. A model can read and write it without guessing at schema-by-example. Decks live in git like the rest of your work.\n\nThat\'s the shift that lets LLMs actually *author* decks. When the format stops fighting them, models can do the work that matters \u2014 narrative structure, persuasive framing, data analysis, chart recommendations, ruthless revision passes \u2014 instead of wrestling with `<p:sp>` tags.\n\nAnd they don\'t start from a blank canvas. [pptx.gallery](https://pptx.gallery) is the human-browsable reference for OPF catalog presets: layouts, themes, color schemes, font schemes, chart types, narratives, audiences, purposes, tones, languages, and social platforms.\n\n## Start in three steps\n\n1. **Install the format package.** `npm install @openpresentation/opf`.\n2. **Author and validate a deck.** Write a `*.opf.json` file \u2014 start from [`docs/how-opf-works.md`](./docs/how-opf-works.md) or copy [`examples/technical/full-feature-tour.opf.json`](./examples/technical/full-feature-tour.opf.json) \u2014 and run `validatePresentation` on it.\n3. **Build on it.** Browse presets at [pptx.gallery](https://pptx.gallery), pin the schemas in your pipeline, and track the [toolkit libraries](#toolkit-libraries) for the render and convert libraries.\n\nYour deck lives in git from the first commit. Nothing in these steps calls a hosted service, and nothing ever will \u2014 that boundary is the point.\n\n## JavaScript and TypeScript\n\nThe canonical JavaScript/TypeScript package is published at [`packages/javascript`](./packages/javascript) as [`@openpresentation/opf`](https://www.npmjs.com/package/@openpresentation/opf). The schema is pre-stable (0.x \u2014 expect breaking changes between minor versions until 1.0). Its responsibility is local and format-level only:\n\n- export the canonical schemas from [`spec/`](./spec)\n- export bundled catalog records from [`spec/`](./spec)\n- export a typed raw spec file manifest for package-addressable `spec/` content\n- generate TypeScript types, with `Presentation` as the top-level type\n- validate OPF JSON and catalog records locally\n\nIt does not render `.pptx`, parse `.pptx`, generate content with AI, fetch remote catalogs, call hosted APIs, or provide managed services. Render/edit/convert packages live in separate MIT repos that depend on `@openpresentation/opf`. The format package also exposes pure composition geometry so those packages share layout behavior.\n\n## Toolkit libraries\n\nThe local toolkit lives in sibling repositories. See [ecosystem development](docs/ecosystem-development.md) for coordinated builds and verification, and [dynamic composition](docs/dynamic-composition.md) for portable layout rules.\n\n| Repo | Role | Boundary |\n|---|---|---|\n| `opf-render` | OPF to SVG/PNG/PDF | Local and embeddable rendering library |\n| `opf-editor` | WYSIWYG bindings/components | Headless editor primitives plus optional UI components |\n| `opf-pptx` | OPF to PPTX and PPTX to OPF | Pure local import/export library for browser and server use where supported |\n\nThese repos provide OSS primitives only. Downstream applications own hosting, auth, storage, collaboration, queues, previews, analytics, support, and workflow UX.\n\n## Usage\n\nInstall from npm:\n\n```sh\npnpm add @openpresentation/opf\n# or: npm install @openpresentation/opf\n```\n\nTo work on the package itself, clone this repo and build the workspace:\n\n```sh\npnpm install\npnpm build\n```\n\nUse the format package from JavaScript or TypeScript:\n\n```ts\nimport {\n presentation,\n audiences,\n purposes,\n tones,\n validatePresentation,\n} from "@openpresentation/opf";\n\nimport type { Presentation } from "@openpresentation/opf";\n\nconst deck: Presentation = {\n name: "Quarterly Review",\n slides: [{ title: "Quarterly Review", items: ["Revenue", "Product", "Hiring"] }],\n};\n\nconst result = validatePresentation(deck);\nconsole.log(result.valid); // schema correctness\nconsole.log(result.warnings); // advisory issues, e.g. unknown catalog ids\nconsole.log(audiences.length, purposes.length, tones.length);\n```\n\nUse focused imports when you only need one surface:\n\n```ts\nimport { presentation } from "@openpresentation/opf/schemas";\nimport { audiences, purposes } from "@openpresentation/opf/catalogs";\nimport { specFileEntries } from "@openpresentation/opf/spec-files";\nimport { validate } from "@openpresentation/opf/validator";\nimport type { Presentation } from "@openpresentation/opf/types";\n```\n\nUse raw JSON when an engine or resolver needs package-addressable files:\n\n```ts\nimport presentationSchema from "@openpresentation/opf/spec/schemas/opf.schema.json" with {\n type: "json",\n};\n```\n\nUse the [installable OPF CLI](./packages/cli/README.md) to create, validate, and edit files locally:\n\n```sh\npnpm --filter @openpresentation/cli build\nnode packages/cli/dist/index.js create deck.opf.json --title "Decision brief"\nnode packages/cli/dist/index.js validate deck.opf.json\nnode packages/cli/dist/index.js edit deck.opf.json --patch changes.json --in-place\n```\n\nSee [CSV and JSON data import](./docs/data-import.md) for editable tables and charts in the editor, CLI, and package API.\n\n## Layout\n\n| Path | Contents |\n|---|---|\n| [`spec/schemas/opf.schema.json`](./spec/schemas/opf.schema.json) | Canonical JSON Schema for top-level OPF `Presentation` documents. |\n| [`docs/how-opf-works.md`](./docs/how-opf-works.md) | Conceptual introduction: the document model, content shapes, catalog resolution, and the validation philosophy. Start here. |\n| [`docs/design-resolution.md`](./docs/design-resolution.md) | The design precedence algorithm (slide design \u2192 deck design \u2192 resolved theme \u2192 engine defaults) with worked examples. |\n| [`docs/schema-reference.md`](./docs/schema-reference.md) | Author-facing reference for top-level OPF fields and every presentation schema `$defs` object/type. |\n| [`docs/catalog-schema-reference.md`](./docs/catalog-schema-reference.md) | Author-facing reference for every companion catalog schema. |\n| [`docs/content-payloads.md`](./docs/content-payloads.md) | Author-facing notes for slide and region content payloads, including chart and table object shapes. |\n| [`docs/examples.md`](./docs/examples.md) | Guide to the expanded scenario-oriented examples under `examples/gallery/`. |\n| [`docs/live-editor.md`](./docs/live-editor.md) | Browser canvas, live OPF editing, font loading, installable preview packages, and current fidelity limits. |\n| [`docs/release-process.md`](./docs/release-process.md) | Maintainer runbook for tagging, trusted npm publishing, verification, and GitHub release notes. |\n| [`spec/schemas/*.schema.json`](./spec/schemas) | Companion schemas for catalog records and sub-objects. |\n| [`spec/catalogs/<catalog-kind>/`](./spec/catalogs) | Canonical bundled catalog records. |\n| [`spec/openapi.yaml`](./spec/openapi.yaml) | Optional reference OpenAPI contract for downstream services that choose to expose OPF over HTTP. OpenPresentation does not host this API. |\n| [`examples/technical/`](./examples/technical) | Focused OPF fixtures for validator, renderer, catalog-resolution, design, content-payload, and region behavior. |\n| [`examples/gallery/`](./examples/gallery) | Broader OPF example decks organized by industry, function, education, government, presentation type, international, and design/media scenarios. |\n| [`packages/javascript/`](./packages/javascript) | Public pre-stable source for `@openpresentation/opf`. |\n| [`packages/cli/`](./packages/cli) | Installable local CLI for creating, validating, editing, and inspecting OPF. |\n| [`legacy/`](./legacy) | Tombstone for service-specific clients, CLIs, tool integrations, and workflows removed from the OpenPresentation OSS repo. |\n\n## OpenPresentation Boundary\n\nOpenPresentation defines the format, bundled presets, local validation, examples, docs, and planned local render/edit/convert libraries. It does not provide hosted functions or managed product surfaces.\n\nFuture non-JavaScript OPF packages should follow the same local-first boundary: Python and Go packages should expose schemas, types/models, catalogs, validation, and package-addressable assets. Future toolkit packages should expose embeddable library APIs with no required network calls, hosted callbacks, hidden telemetry, or managed infrastructure assumptions.\n\nThe published JavaScript package copies package-addressable OPF schemas, catalogs, reference assets, and the optional reference `spec/openapi.yaml` from `spec/`. It intentionally remains `@openpresentation/opf` instead of introducing a separate `@openpresentation/opf-spec` package so downstream imports can advance by semver-pinning one canonical package.\n\n## License\n\nMIT. See [LICENSE](./LICENSE).\n';
|
|
2
|
+
var repoReadmeRaw = '# Open Presentation Format (OPF)\n\n[](https://www.npmjs.com/package/@openpresentation/opf)\n[](https://www.npmjs.com/package/@openpresentation/opf)\n[](./LICENSE)\n\nPublic npm package: [`@openpresentation/opf`](https://www.npmjs.com/package/@openpresentation/opf) (`npm install @openpresentation/opf`).\n\nOpen Presentation Format is the portable, human-readable JSON document format for slide decks.\n\nThis repository is the canonical home for the OPF **spec**, **JSON Schemas**, **catalog presets**, examples, generated developer types, local validation tooling, and planning docs for the future render/edit/convert toolkit. OpenPresentation publishes open-source code and documentation only; it does not provide hosted APIs, hosted rendering functions, queues, storage, authentication, jobs, previews, SLAs, telemetry, or managed infrastructure.\n\nFor AI agents, use the [OPF skill set](docs/agent-skills.md) for authoring, layout, presets, editing, export, and schema inspection.\n\nCLI 0.5.0 installs all six skills into your project with `npx @openpresentation/cli@latest skills install`. It uses local copies, preserves existing instructions and refuses to overwrite customized skills. See the [installation and update guide](docs/agent-skills.md) for personal or agent-specific targets and pre-release testing.\n\nFor a fresh Node 24 project that installs **published** packages (not this\ncheckout), follow the [developer quickstart](docs/quickstart.md) and the\n[compatibility matrix](docs/compatibility-matrix.md).\n\nFor LLM authoring, start with [the authoring guide](docs/llm-authoring.md), [dynamic composition](docs/dynamic-composition.md), and [local ecosystem verification](docs/ecosystem-development.md).\n\n## File naming\n\nOpen Presentation Format documents are JSON files. Use `*.opf.json` for complete OPF presentation documents, for example `board-review.opf.json` or `deck.opf.json`.\n\nAvoid using bare `*.opf` for OPF JSON. The `.opf` extension is already used by other document and project formats, while `.opf.json` keeps the OPF identity and still makes the underlying JSON format clear to editors, validators, agents, and version-control tooling.\n\n## Naming and reuse\n\nThe format name is **Open Presentation Format**. The schemas, catalogs, packages, and local tooling in this repository are free and open source under the MIT license, so third-party tools may read, write, validate, render, convert, and describe support for Open Presentation Format without adopting any product-specific branding.\n\n## Why OPF\n\n`.pptx` is a zipped bundle of XML. Humans can\'t diff it, LLMs can\'t read or write it reliably, and git can\'t track it meaningfully. Every change looks like a binary blob.\n\nOPF is plain JSON. A human can open it in an editor. A model can read and write it without guessing at schema-by-example. Decks live in git like the rest of your work.\n\nThat\'s the shift that lets LLMs actually *author* decks. When the format stops fighting them, models can do the work that matters \u2014 narrative structure, persuasive framing, data analysis, chart recommendations, ruthless revision passes \u2014 instead of wrestling with `<p:sp>` tags.\n\nAnd they don\'t start from a blank canvas. [pptx.gallery](https://pptx.gallery) is the human-browsable reference for OPF catalog presets: layouts, themes, color schemes, font schemes, chart types, narratives, audiences, purposes, tones, languages, and social platforms.\n\n## Start in three steps\n\n1. **Install the coordinated published packages** on Node 24. See [the developer quickstart](docs/quickstart.md) for the current pin set (`@openpresentation/opf@0.10.1` plus renderer, editor, PPTX and CLI 0.8.1 / 0.7.1).\n2. **Author, lint, paginate, preview and export.** Copy [`docs/quickstart/developer-quickstart.opf.json`](./docs/quickstart/developer-quickstart.opf.json) and run the commands in that guide. `validatePresentation` / `opf validate` is local schema checking, not visual verification.\n3. **Know the limits.** The [compatibility matrix](docs/compatibility-matrix.md) lists shipped APIs versus renderer issue 24, native PowerPoint issue 87, and other deferred work. Browse presets at [pptx.gallery](https://pptx.gallery).\n\nYour deck lives in git from the first commit. Nothing in these steps calls a hosted service, and nothing ever will \u2014 that boundary is the point.\n\n## JavaScript and TypeScript\n\nThe canonical JavaScript/TypeScript package is published at [`packages/javascript`](./packages/javascript) as [`@openpresentation/opf`](https://www.npmjs.com/package/@openpresentation/opf). The schema is pre-stable (0.x \u2014 expect breaking changes between minor versions until 1.0). Its responsibility is local and format-level only:\n\n- export the canonical schemas from [`spec/`](./spec)\n- export bundled catalog records from [`spec/`](./spec)\n- export a typed raw spec file manifest for package-addressable `spec/` content\n- generate TypeScript types, with `Presentation` as the top-level type\n- validate OPF JSON and catalog records locally\n\nIt does not render `.pptx`, parse `.pptx`, generate content with AI, fetch remote catalogs, call hosted APIs, or provide managed services. Render/edit/convert packages live in separate MIT repos that depend on `@openpresentation/opf`. The format package also exposes pure composition geometry so those packages share layout behavior.\n\n## Toolkit libraries\n\nThe local toolkit lives in sibling repositories. See [ecosystem development](docs/ecosystem-development.md) for coordinated builds and verification, and [dynamic composition](docs/dynamic-composition.md) for portable layout rules.\n\n| Repo | Role | Boundary |\n|---|---|---|\n| `opf-render` | OPF to SVG/PNG/PDF | Local and embeddable rendering library |\n| `opf-editor` | WYSIWYG bindings/components | Headless editor primitives plus optional UI components |\n| `opf-pptx` | OPF to PPTX and PPTX to OPF | Pure local import/export library for browser and server use where supported |\n\nThese repos provide OSS primitives only. Downstream applications own hosting, auth, storage, collaboration, queues, previews, analytics, support, and workflow UX.\n\n## Usage\n\nInstall from npm:\n\n```sh\npnpm add @openpresentation/opf\n# or: npm install @openpresentation/opf\n```\n\nTo work on the package itself, clone this repo and build the workspace:\n\n```sh\npnpm install\npnpm build\n```\n\nUse the format package from JavaScript or TypeScript:\n\n```ts\nimport {\n presentation,\n audiences,\n purposes,\n tones,\n validatePresentation,\n} from "@openpresentation/opf";\n\nimport type { Presentation } from "@openpresentation/opf";\n\nconst deck: Presentation = {\n name: "Quarterly Review",\n slides: [{ title: "Quarterly Review", items: ["Revenue", "Product", "Hiring"] }],\n};\n\nconst result = validatePresentation(deck);\nconsole.log(result.valid); // schema correctness\nconsole.log(result.warnings); // advisory issues, e.g. unknown catalog ids\nconsole.log(audiences.length, purposes.length, tones.length);\n```\n\nUse focused imports when you only need one surface:\n\n```ts\nimport { presentation } from "@openpresentation/opf/schemas";\nimport { audiences, purposes } from "@openpresentation/opf/catalogs";\nimport { specFileEntries } from "@openpresentation/opf/spec-files";\nimport { validate } from "@openpresentation/opf/validator";\nimport type { Presentation } from "@openpresentation/opf/types";\n```\n\nUse raw JSON when an engine or resolver needs package-addressable files:\n\n```ts\nimport presentationSchema from "@openpresentation/opf/spec/schemas/opf.schema.json" with {\n type: "json",\n};\n```\n\nUse the [installable OPF CLI](./packages/cli/README.md) to create, validate, and edit files locally:\n\n```sh\npnpm --filter @openpresentation/cli build\nnode packages/cli/dist/index.js create deck.opf.json --title "Decision brief"\nnode packages/cli/dist/index.js validate deck.opf.json\nnode packages/cli/dist/index.js edit deck.opf.json --patch changes.json --in-place\n```\n\nSee [CSV and JSON data import](./docs/data-import.md) for editable tables and charts in the editor, CLI, and package API.\n\n## Layout\n\n| Path | Contents |\n|---|---|\n| [`spec/schemas/opf.schema.json`](./spec/schemas/opf.schema.json) | Canonical JSON Schema for top-level OPF `Presentation` documents. |\n| [`docs/how-opf-works.md`](./docs/how-opf-works.md) | Conceptual introduction: the document model, content shapes, catalog resolution, and the validation philosophy. Start here. |\n| [`docs/design-resolution.md`](./docs/design-resolution.md) | The design precedence algorithm (slide design \u2192 deck design \u2192 resolved theme \u2192 engine defaults) with worked examples. |\n| [`docs/schema-reference.md`](./docs/schema-reference.md) | Author-facing reference for top-level OPF fields and every presentation schema `$defs` object/type. |\n| [`docs/catalog-schema-reference.md`](./docs/catalog-schema-reference.md) | Author-facing reference for every companion catalog schema. |\n| [`docs/content-payloads.md`](./docs/content-payloads.md) | Author-facing notes for slide and region content payloads, including chart and table object shapes. |\n| [`docs/examples.md`](./docs/examples.md) | Guide to the expanded scenario-oriented examples under `examples/gallery/`. |\n| [`docs/live-editor.md`](./docs/live-editor.md) | Browser canvas, live OPF editing, font loading, installable preview packages, and current fidelity limits. |\n| [`docs/release-process.md`](./docs/release-process.md) | Maintainer runbook for tagging, trusted npm publishing, verification, and GitHub release notes. |\n| [`spec/schemas/*.schema.json`](./spec/schemas) | Companion schemas for catalog records and sub-objects. |\n| [`spec/catalogs/<catalog-kind>/`](./spec/catalogs) | Canonical bundled catalog records. |\n| [`spec/openapi.yaml`](./spec/openapi.yaml) | Optional reference OpenAPI contract for downstream services that choose to expose OPF over HTTP. OpenPresentation does not host this API. |\n| [`examples/technical/`](./examples/technical) | Focused OPF fixtures for validator, renderer, catalog-resolution, design, content-payload, and region behavior. |\n| [`examples/gallery/`](./examples/gallery) | Broader OPF example decks organized by industry, function, education, government, presentation type, international, and design/media scenarios. |\n| [`packages/javascript/`](./packages/javascript) | Public pre-stable source for `@openpresentation/opf`. |\n| [`packages/cli/`](./packages/cli) | Installable local CLI for creating, validating, editing, and inspecting OPF. |\n| [`legacy/`](./legacy) | Tombstone for service-specific clients, CLIs, tool integrations, and workflows removed from the OpenPresentation OSS repo. |\n\n## OpenPresentation Boundary\n\nOpenPresentation defines the format, bundled presets, local validation, examples, docs, and planned local render/edit/convert libraries. It does not provide hosted functions or managed product surfaces.\n\nFuture non-JavaScript OPF packages should follow the same local-first boundary: Python and Go packages should expose schemas, types/models, catalogs, validation, and package-addressable assets. Future toolkit packages should expose embeddable library APIs with no required network calls, hosted callbacks, hidden telemetry, or managed infrastructure assumptions.\n\nThe published JavaScript package copies package-addressable OPF schemas, catalogs, reference assets, and the optional reference `spec/openapi.yaml` from `spec/`. It intentionally remains `@openpresentation/opf` instead of introducing a separate `@openpresentation/opf-spec` package so downstream imports can advance by semver-pinning one canonical package.\n\n## License\n\nMIT. See [LICENSE](./LICENSE).\n';
|
|
3
3
|
|
|
4
4
|
// src/repo-readme.ts
|
|
5
5
|
var repoReadme = repoReadmeRaw;
|
|
@@ -39,6 +39,9 @@ declare const presentation: JsonSchemaDocument & {
|
|
|
39
39
|
readonly "Dimensions": JsonObject;
|
|
40
40
|
readonly "ThemeBackgroundSlot": JsonObject;
|
|
41
41
|
readonly "HexColor": JsonObject;
|
|
42
|
+
readonly "ColorRef": JsonObject;
|
|
43
|
+
readonly "Variables": JsonObject;
|
|
44
|
+
readonly "Variable": JsonObject;
|
|
42
45
|
readonly "BackgroundShortcut": JsonObject;
|
|
43
46
|
readonly "Background": JsonObject;
|
|
44
47
|
readonly "ThemeBackground": JsonObject;
|
|
@@ -132,6 +135,9 @@ declare const schemas: {
|
|
|
132
135
|
readonly "Dimensions": JsonObject;
|
|
133
136
|
readonly "ThemeBackgroundSlot": JsonObject;
|
|
134
137
|
readonly "HexColor": JsonObject;
|
|
138
|
+
readonly "ColorRef": JsonObject;
|
|
139
|
+
readonly "Variables": JsonObject;
|
|
140
|
+
readonly "Variable": JsonObject;
|
|
135
141
|
readonly "BackgroundShortcut": JsonObject;
|
|
136
142
|
readonly "Background": JsonObject;
|
|
137
143
|
readonly "ThemeBackground": JsonObject;
|
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-CiVmUT2p.js';
|
package/dist/schemas.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-
|
|
1
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-GN52EE3P.js';
|