@openpresentation/opf 0.26.1 → 0.26.3

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.
Files changed (52) hide show
  1. package/README.md +4 -0
  2. package/dist/browser.js +13 -14
  3. package/dist/{catalog-refs-CSHevLn1.d.ts → catalog-refs-BSfGELpt.d.ts} +1 -1
  4. package/dist/catalog-schemas-DoxA2BgY.d.ts +19 -0
  5. package/dist/{chunk-IC6OPLMU.js → chunk-2ZQBMZTZ.js} +2 -2
  6. package/dist/{chunk-JIHHLV47.js → chunk-34LIUOT7.js} +6 -6
  7. package/dist/{chunk-FITOGMR3.js → chunk-54OV2WQC.js} +1 -1
  8. package/dist/{chunk-IWFXFWGD.js → chunk-7RY7QWWJ.js} +1 -1
  9. package/dist/{chunk-GS37EBPQ.js → chunk-DEI2M2H6.js} +1 -1
  10. package/dist/{chunk-3OE6PZIC.js → chunk-FXNUM2PN.js} +4 -4
  11. package/dist/{chunk-WW62PPYV.js → chunk-GLLR3AQ5.js} +1 -2
  12. package/dist/{chunk-P7S3ORB4.js → chunk-NJWI6MPT.js} +1827 -68
  13. package/dist/{chunk-F5ABHDUX.js → chunk-PB5X2VSV.js} +4 -4
  14. package/dist/{chunk-LU6XM5JQ.js → chunk-PXOXTJTN.js} +1 -1
  15. package/dist/{chunk-MJ57RSYO.js → chunk-WASENX2R.js} +4 -4
  16. package/dist/{chunk-X7RANZWP.js → chunk-YVNFACTC.js} +1 -1
  17. package/dist/{composition-Daqvi-GV.d.ts → composition-DIftf6iP.d.ts} +1 -1
  18. package/dist/composition.d.ts +2 -2
  19. package/dist/{conversion-BFr5USlh.d.ts → conversion-BjsKgxBZ.d.ts} +5 -5
  20. package/dist/conversion-F4UCOGR7.js +18 -0
  21. package/dist/convert.d.ts +3 -3
  22. package/dist/convert.js +5 -5
  23. package/dist/{deck-report-DHaboWbM.d.ts → deck-report-5vwMGcQz.d.ts} +2 -2
  24. package/dist/deck.d.ts +5 -5
  25. package/dist/deck.js +8 -8
  26. package/dist/diff.js +2 -3
  27. package/dist/docs.js +6 -6
  28. package/dist/index.d.ts +13 -12
  29. package/dist/index.js +17 -18
  30. package/dist/markdown.d.ts +3 -3
  31. package/dist/markdown.js +5 -5
  32. package/dist/node-engine.d.ts +7 -7
  33. package/dist/node-engine.js +17 -18
  34. package/dist/{pagination-R8YFwVj7.d.ts → pagination-D_kJe4jH.d.ts} +2 -2
  35. package/dist/pagination.d.ts +3 -3
  36. package/dist/pagination.js +2 -2
  37. package/dist/patch.js +1 -2
  38. package/dist/repo-readme.js +1 -1
  39. package/dist/schema.d.ts +165 -0
  40. package/dist/schema.js +3 -0
  41. package/dist/source.d.ts +97 -0
  42. package/dist/source.js +90 -0
  43. package/dist/types.d.ts +1 -1
  44. package/dist/{validation-types-JW8e06ee.d.ts → validation-types-3ARvTsB0.d.ts} +2 -2
  45. package/dist/validator.d.ts +54 -6
  46. package/dist/validator.js +1 -1
  47. package/dist/yaml.d.ts +3 -3
  48. package/dist/yaml.js +5 -5
  49. package/package.json +13 -5
  50. package/dist/chunk-IY5SCRTV.js +0 -261
  51. package/dist/conversion-ETAHLWAH.js +0 -19
  52. package/dist/validator-Dym2zYVK.d.ts +0 -67
package/dist/index.d.ts CHANGED
@@ -1,20 +1,21 @@
1
1
  export { SchemaEntry, SchemaName, audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './schemas.js';
2
- import { C as ConvertInput, a as ConvertOptions, b as ConvertResult, c as ConvertFormat, O as OpenOptions, S as SaveOptions, d as SaveResult } from './conversion-BFr5USlh.js';
3
- export { e as ConvertedFile, E as ExportFormat, F as FontsHandle, f as OPFApiError, g as OPFExportError, h as OPFImportError, i as SlideSelection, p as parseSlideSelection } from './conversion-BFr5USlh.js';
4
- import { v as validate$1 } from './validator-Dym2zYVK.js';
5
- export { C as CATALOG_SCHEMA, a as CatalogDisplayKind, b as CatalogRecordKind, D as DEFAULT_VALIDATION_THRESHOLDS, O as OPFValidationError, c as assertValid, d as assertValidCatalogRecord, e as catalogDisplayKinds, f as catalogSchemaNames, g as findValidationRule, h as validateCatalogRecord, i as validationRules } from './validator-Dym2zYVK.js';
6
- import { R as ResolveVariablesOptions, h as VariableDiagnostic } from './validation-types-JW8e06ee.js';
7
- export { B as BuiltinVariableInfo, C as Contract, D as DEFAULT_VARIABLE_DATE_FORMAT, O as OPFVariableError, i as ResolveVariablesResult, j as VARIABLE_KINDS, d as ValidateFonts, a as ValidateOptions, e as ValidationCategory, f as ValidationChecks, V as ValidationReport, g as ValidationRuleCost, c as ValidationRuleInfo, b as ValidationThresholds, k as VariableDeclaration, l as VariableDiagnosticCode, m as VariableDiagnosticSeverity, n as VariableInfo, o as VariableKind, p as VariableUse, q as VariableUseForm, r as VariableValues, s as coerceVariableValue, t as formatVariableNumber, u as hasContentVariables, w as isTemplate, x as listBuiltinVariables, y as listVariables, z as resolveVariables, v as validationCategories, A as variableDeclarations } from './validation-types-JW8e06ee.js';
8
- export { a as CHART_TYPES, C as ComposeSlideOptions, E as ENGINE_DEFAULT_CHART_TYPES, b as ENGINE_DEFAULT_COLOR_SCHEME, c as ENGINE_DEFAULT_FONT_SCHEME, d as ENGINE_DEFAULT_THEME, e as FontFamilies, F as Fonts, f as LANGUAGES, g as LOGO_SHAPES, h as LanguageFamilyName, i as LanguageVocabulary, L as LayoutDiagnostic, j as LogoShape, k as LogoVariant, M as MeasureTextWidth, l as ResolveLogoOptions, m as ResolvedLogo, S as SOCIAL_PLATFORMS, n as SocialPlatformVocabulary, T as TextMeasurement, o as TextStyle, p as normalizeLanguageFamily } from './composition-Daqvi-GV.js';
2
+ import { C as ConvertInput, a as ConvertOptions, b as ConvertResult, c as ConvertFormat, O as OpenOptions, S as SaveOptions, d as SaveResult } from './conversion-BjsKgxBZ.js';
3
+ export { e as ConvertedFile, E as ExportFormat, F as FontsHandle, f as OPFApiError, g as OPFExportError, h as OPFImportError, i as SlideSelection, p as parseSlideSelection } from './conversion-BjsKgxBZ.js';
4
+ import { validate as validate$1 } from './validator.js';
5
+ export { DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, validateCatalogRecord, validationRules } from './validator.js';
6
+ import { R as ResolveVariablesOptions, h as VariableDiagnostic } from './validation-types-3ARvTsB0.js';
7
+ export { B as BuiltinVariableInfo, C as Contract, D as DEFAULT_VARIABLE_DATE_FORMAT, O as OPFVariableError, i as ResolveVariablesResult, j as VARIABLE_KINDS, d as ValidateFonts, a as ValidateOptions, e as ValidationCategory, f as ValidationChecks, V as ValidationReport, g as ValidationRuleCost, c as ValidationRuleInfo, b as ValidationThresholds, k as VariableDeclaration, l as VariableDiagnosticCode, m as VariableDiagnosticSeverity, n as VariableInfo, o as VariableKind, p as VariableUse, q as VariableUseForm, r as VariableValues, s as coerceVariableValue, t as formatVariableNumber, u as hasContentVariables, w as isTemplate, x as listBuiltinVariables, y as listVariables, z as resolveVariables, v as validationCategories, A as variableDeclarations } from './validation-types-3ARvTsB0.js';
8
+ export { a as CHART_TYPES, C as ComposeSlideOptions, E as ENGINE_DEFAULT_CHART_TYPES, b as ENGINE_DEFAULT_COLOR_SCHEME, c as ENGINE_DEFAULT_FONT_SCHEME, d as ENGINE_DEFAULT_THEME, e as FontFamilies, F as Fonts, f as LANGUAGES, g as LOGO_SHAPES, h as LanguageFamilyName, i as LanguageVocabulary, L as LayoutDiagnostic, j as LogoShape, k as LogoVariant, M as MeasureTextWidth, l as ResolveLogoOptions, m as ResolvedLogo, S as SOCIAL_PLATFORMS, n as SocialPlatformVocabulary, T as TextMeasurement, o as TextStyle, p as normalizeLanguageFamily } from './composition-DIftf6iP.js';
9
9
  export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
10
10
  import { P as Presentation } from './presentation-Bwo8Ko6D.js';
11
11
  export { Audience, ChartType, ColorScheme, FontScheme, Language, Layout, Narrative, Purpose, SocialPlatform, Theme, Tone } from './types.js';
12
- import { b as CatalogKind, U as UnresolvedReferenceDiagnostic, a as CatalogOptions, C as Catalog, R as RecordProvenance } from './catalog-refs-CSHevLn1.js';
13
- export { c as CATALOG_GROUP_PATTERN, d as CATALOG_REFERENCE_PATTERN, e as CatalogRecordMap, f as CatalogRecords, g as CatalogReferenceSite, O as OPFCatalogsOptionError, h as OPFUnresolvedReferenceError, i as ResolvedReference, j as catalogGroupSource, k as catalogKinds, l as catalogRecords, m as catalogReferenceSites, p as parseReference, r as resolveReference, u as unresolvedReference } from './catalog-refs-CSHevLn1.js';
12
+ import { C as CatalogKind, U as UnresolvedReferenceDiagnostic, b as CatalogOptions, a as Catalog, R as RecordProvenance } from './catalog-refs-BSfGELpt.js';
13
+ export { c as CATALOG_GROUP_PATTERN, d as CATALOG_REFERENCE_PATTERN, e as CatalogRecordMap, f as CatalogRecords, g as CatalogReferenceSite, O as OPFCatalogsOptionError, h as OPFUnresolvedReferenceError, i as ResolvedReference, j as catalogGroupSource, k as catalogKinds, l as catalogRecords, m as catalogReferenceSites, p as parseReference, r as resolveReference, u as unresolvedReference } from './catalog-refs-BSfGELpt.js';
14
14
  import { a as Finding, J as JsonPatchOperation } from './finding-l9dlQ2NF.js';
15
15
  export { d as FindingCategory, e as FindingFix, f as FindingFocus, b as FindingLocation, F as FindingReport, c as FindingSeverity, g as FindingSuggestion, V as ValidationIssue } from './finding-l9dlQ2NF.js';
16
- import { p as paginate$1 } from './pagination-R8YFwVj7.js';
17
- export { O as OPFPaginationError, P as PaginatedPage, b as PaginationMapping, c as PaginationOptions, d as PaginationResult, a as PresentationPaginationOptions, e as PresentationPaginationResult, S as SlideContext, f as SlideContextDiagnostic, g as SlideContextOptions, h as paginateSlide, r as resolveSlideContext } from './pagination-R8YFwVj7.js';
16
+ export { a as CATALOG_SCHEMA, b as CatalogDisplayKind, C as CatalogRecordKind, c as catalogDisplayKinds, d as catalogSchemaNames } from './catalog-schemas-DoxA2BgY.js';
17
+ import { p as paginate$1 } from './pagination-D_kJe4jH.js';
18
+ export { O as OPFPaginationError, P as PaginatedPage, b as PaginationMapping, c as PaginationOptions, d as PaginationResult, a as PresentationPaginationOptions, e as PresentationPaginationResult, S as SlideContext, f as SlideContextDiagnostic, g as SlideContextOptions, h as paginateSlide, r as resolveSlideContext } from './pagination-D_kJe4jH.js';
18
19
  export { ApplyPatchOptions, OPFPatchError, OPFPatchValidationError, PatchResult, applyPatch } from './patch.js';
19
20
  export { DiffOptions, MergeConflict, MergeOptions, MergeResult, PresentationDiff, diff, merge } from './diff.js';
20
21
  export { FormatOptions, OPFFormatError, format } from './format.js';
@@ -23,7 +24,7 @@ export { StringifyOptions, parse, stringify } from './deck.js';
23
24
  export { DataCell, DataImportOptions, ImportedChart, ImportedChartData, ImportedChartType, ImportedTable, IngestOptions, OPFDataImportError, TabularData, ingest, parseTabularData } from './data.js';
24
25
  export { I as ChartComboSeries, C as ChartMapping, a as ChartNumberFix, b as ChartNumberFixOperation, c as ChartNumberFixOptions, D as DataCellValue, d as DataColumn, e as DataDiagnostic, f as DataDiagnosticCode, g as DataResolveOptions, h as DataSourceRef, i as DataStyledCell, j as DataTableCell, k as DataTableHeader, l as DataTableValue, m as DataTextRun, n as Dataset, o as DatasetRef, R as ResolvedChartData, p as ResolvedTableData, q as chartNumber, r as datasetDiagnostics, s as formatDataNumber, t as fromExcelNumberFormat, u as inlineChartData, v as inlineDatasets, w as inlineTableData, x as isDatasetRef, y as isXYChartType, z as numberFormatError, A as resolveChartData, B as resolveTableData, E as suggestChartNumberFix, F as tableCellDisplayValue, G as toExcelNumberFormat, H as unusedDatasets } from './chart-data-BnNqgnC-.js';
25
26
  export { FONT_POLICY, FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './font-policy.js';
26
- export { a as DECK_FORMATS, D as DeckFormat, P as ParseOptions, d as deckFormatOf } from './deck-report-DHaboWbM.js';
27
+ export { a as DECK_FORMATS, D as DeckFormat, P as ParseOptions, d as deckFormatOf } from './deck-report-5vwMGcQz.js';
27
28
  import './json-BFSdESOE.js';
28
29
 
29
30
  /**
package/dist/index.js CHANGED
@@ -1,24 +1,23 @@
1
- import { defaultCatalogs } from './chunk-IC6OPLMU.js';
2
- import { stats, embed, edit, OPFApiError, asApiError } from './chunk-WW62PPYV.js';
3
- export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, updateFromCatalog } from './chunk-WW62PPYV.js';
1
+ import { defaultCatalogs } from './chunk-2ZQBMZTZ.js';
2
+ import { stats, embed, edit, OPFApiError, asApiError } from './chunk-GLLR3AQ5.js';
3
+ export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, updateFromCatalog } from './chunk-GLLR3AQ5.js';
4
4
  export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
5
+ export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-PJSPHHRK.js';
5
6
  export { OPFDataImportError, ingest, parseTabularData } from './chunk-TKQ2VFV5.js';
6
- export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-3OE6PZIC.js';
7
- export { fromMarkdown, toMarkdown } from './chunk-MJ57RSYO.js';
8
- import './chunk-F5ABHDUX.js';
9
- export { OPFMarkdownError } from './chunk-GS37EBPQ.js';
10
- export { diff, merge } from './chunk-X7RANZWP.js';
11
- export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-IY5SCRTV.js';
12
- export { OPFFormatError, format } from './chunk-EQ6S5SEZ.js';
13
- import { paginate } from './chunk-FITOGMR3.js';
14
- export { OPFPaginationError, paginateSlide } from './chunk-FITOGMR3.js';
15
- import './chunk-IWFXFWGD.js';
16
- import './chunk-LU6XM5JQ.js';
17
- import { validate, OPFValidationError } from './chunk-P7S3ORB4.js';
18
- export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validateCatalogRecord, validationCategories, validationRules } from './chunk-P7S3ORB4.js';
7
+ import { paginate } from './chunk-54OV2WQC.js';
8
+ export { OPFPaginationError, paginateSlide } from './chunk-54OV2WQC.js';
9
+ export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-FXNUM2PN.js';
10
+ export { fromMarkdown, toMarkdown } from './chunk-WASENX2R.js';
11
+ import './chunk-7RY7QWWJ.js';
12
+ import './chunk-PB5X2VSV.js';
13
+ export { OPFMarkdownError } from './chunk-DEI2M2H6.js';
14
+ import './chunk-PXOXTJTN.js';
15
+ export { diff, merge } from './chunk-YVNFACTC.js';
16
+ import { validate, OPFValidationError } from './chunk-NJWI6MPT.js';
17
+ export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validateCatalogRecord, validationCategories, validationRules } from './chunk-NJWI6MPT.js';
19
18
  export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-XRMV2GMB.js';
19
+ export { OPFFormatError, format } from './chunk-EQ6S5SEZ.js';
20
20
  export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-F4HFDP6I.js';
21
- export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-PJSPHHRK.js';
22
21
 
23
22
  // src/index.ts
24
23
  var withDefaultCatalog = (options) => {
@@ -31,7 +30,7 @@ var stats2 = (presentation2, options) => stats(presentation2, withDefaultCatalog
31
30
  var paginate2 = (input, options) => paginate(input, withDefaultCatalog(options));
32
31
  var embed2 = (document, options) => embed(document, withDefaultCatalog(options));
33
32
  var edit2 = (deck, patch, options) => edit(deck, patch, withDefaultCatalog(options));
34
- var engine = () => import('./conversion-ETAHLWAH.js');
33
+ var engine = () => import('./conversion-F4UCOGR7.js');
35
34
  var rethrow = (error, fallback) => {
36
35
  if (error instanceof OPFValidationError) throw error;
37
36
  throw asApiError(OPFApiError, error, fallback);
@@ -1,8 +1,8 @@
1
- import { C as Catalog } from './catalog-refs-CSHevLn1.js';
1
+ import { a as Catalog } from './catalog-refs-BSfGELpt.js';
2
2
  import { P as Presentation } from './presentation-Bwo8Ko6D.js';
3
3
  import { a as Finding, b as FindingLocation } from './finding-l9dlQ2NF.js';
4
- import { a as ValidateOptions, V as ValidationReport } from './validation-types-JW8e06ee.js';
5
- import './composition-Daqvi-GV.js';
4
+ import { a as ValidateOptions, V as ValidationReport } from './validation-types-3ARvTsB0.js';
5
+ import './composition-DIftf6iP.js';
6
6
  import './chart-data-BnNqgnC-.js';
7
7
  import './json-BFSdESOE.js';
8
8
 
package/dist/markdown.js CHANGED
@@ -1,7 +1,7 @@
1
- export { fromMarkdown, toMarkdown } from './chunk-MJ57RSYO.js';
2
- export { OPFMarkdownError } from './chunk-GS37EBPQ.js';
3
- import './chunk-IWFXFWGD.js';
4
- import './chunk-LU6XM5JQ.js';
5
- import './chunk-P7S3ORB4.js';
1
+ export { fromMarkdown, toMarkdown } from './chunk-WASENX2R.js';
2
+ import './chunk-7RY7QWWJ.js';
3
+ export { OPFMarkdownError } from './chunk-DEI2M2H6.js';
4
+ import './chunk-PXOXTJTN.js';
5
+ import './chunk-NJWI6MPT.js';
6
6
  import './chunk-XRMV2GMB.js';
7
7
  import './chunk-F4HFDP6I.js';
@@ -1,11 +1,11 @@
1
- export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-DHaboWbM.js';
2
- import { F as FontsHandle, j as EmbeddedFace, R as Renderer, k as Reporter, P as Peer, l as PptxModule, f as OPFApiError } from './conversion-BFr5USlh.js';
3
- export { m as ConversionPlan, D as Diagnostic, n as EXPORT_FORMATS, o as EXPORT_TEXT, q as ExportContext, r as ExportFile, s as ExportFontSummary, E as ExportFormat, t as ExportOptions, u as ExportResult, v as ExportRun, w as ExportText, I as ImportOptions, x as ImportResult, g as OPFExportError, h as OPFImportError, y as PEER_RANGES, z as PPTX_PACKAGE, A as PreparedExport, B as RENDER_EXTRAS, G as RENDER_PACKAGE, H as ReportFinding, J as ResolvedExportOptions, i as SlideSelection, K as Source, V as VERSIONS, L as asApiError, M as assetRoot, N as checkDate, Q as checkOptions, T as checkRenamedOptions, U as checkScale, W as deckFileFormat, X as exportFormatOf, Y as finishReport, Z as importPresentation, _ as loadPptx, $ as loadRenderer, a0 as locatePackage, a1 as missingPeerFrom, p as parseSlideSelection, a2 as planConversion, a3 as prepareExport, a4 as reaches, a5 as readInput, a6 as reportThrown, a7 as resolveExportOptions, a8 as runExport, a9 as runPreparedExport, aa as writePlanned } from './conversion-BFr5USlh.js';
4
- import { C as Catalog } from './catalog-refs-CSHevLn1.js';
5
- import { e as PresentationPaginationResult } from './pagination-R8YFwVj7.js';
1
+ export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-5vwMGcQz.js';
2
+ import { F as FontsHandle, j as EmbeddedFace, R as Renderer, k as Reporter, P as Peer, l as PptxModule, f as OPFApiError } from './conversion-BjsKgxBZ.js';
3
+ export { m as ConversionPlan, D as Diagnostic, n as EXPORT_FORMATS, o as EXPORT_TEXT, q as ExportContext, r as ExportFile, s as ExportFontSummary, E as ExportFormat, t as ExportOptions, u as ExportResult, v as ExportRun, w as ExportText, I as ImportOptions, x as ImportResult, g as OPFExportError, h as OPFImportError, y as PEER_RANGES, z as PPTX_PACKAGE, A as PreparedExport, B as RENDER_EXTRAS, G as RENDER_PACKAGE, H as ReportFinding, J as ResolvedExportOptions, i as SlideSelection, K as Source, V as VERSIONS, L as asApiError, M as assetRoot, N as checkDate, Q as checkOptions, T as checkRenamedOptions, U as checkScale, W as deckFileFormat, X as exportFormatOf, Y as finishReport, Z as importPresentation, _ as loadPptx, $ as loadRenderer, a0 as locatePackage, a1 as missingPeerFrom, p as parseSlideSelection, a2 as planConversion, a3 as prepareExport, a4 as reaches, a5 as readInput, a6 as reportThrown, a7 as resolveExportOptions, a8 as runExport, a9 as runPreparedExport, aa as writePlanned } from './conversion-BjsKgxBZ.js';
4
+ import { a as Catalog } from './catalog-refs-BSfGELpt.js';
5
+ import { e as PresentationPaginationResult } from './pagination-D_kJe4jH.js';
6
6
  import './presentation-Bwo8Ko6D.js';
7
- import './validation-types-JW8e06ee.js';
8
- import './composition-Daqvi-GV.js';
7
+ import './validation-types-3ARvTsB0.js';
8
+ import './composition-DIftf6iP.js';
9
9
  import './chart-data-BnNqgnC-.js';
10
10
  import './finding-l9dlQ2NF.js';
11
11
  import './json-BFSdESOE.js';
@@ -1,25 +1,24 @@
1
- import { loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts } from './chunk-JIHHLV47.js';
2
- export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-JIHHLV47.js';
3
- import { defaultCatalogs } from './chunk-IC6OPLMU.js';
4
- export { defaultCatalogs, galleryMismatch } from './chunk-IC6OPLMU.js';
5
- import { OPFApiError } from './chunk-WW62PPYV.js';
6
- export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-WW62PPYV.js';
1
+ import { loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts } from './chunk-34LIUOT7.js';
2
+ export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-34LIUOT7.js';
3
+ import { defaultCatalogs } from './chunk-2ZQBMZTZ.js';
4
+ export { defaultCatalogs, galleryMismatch } from './chunk-2ZQBMZTZ.js';
5
+ import { OPFApiError } from './chunk-GLLR3AQ5.js';
6
+ export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-GLLR3AQ5.js';
7
7
  import './chunk-UJSAR6GF.js';
8
+ import './chunk-PJSPHHRK.js';
8
9
  import './chunk-TKQ2VFV5.js';
9
- export { readDeckReport } from './chunk-3OE6PZIC.js';
10
- import './chunk-MJ57RSYO.js';
11
- import './chunk-F5ABHDUX.js';
12
- import './chunk-GS37EBPQ.js';
13
- import './chunk-X7RANZWP.js';
14
- import './chunk-IY5SCRTV.js';
15
- import './chunk-EQ6S5SEZ.js';
16
- import { paginate } from './chunk-FITOGMR3.js';
17
- import './chunk-IWFXFWGD.js';
18
- import './chunk-LU6XM5JQ.js';
19
- import './chunk-P7S3ORB4.js';
10
+ import { paginate } from './chunk-54OV2WQC.js';
11
+ export { readDeckReport } from './chunk-FXNUM2PN.js';
12
+ import './chunk-WASENX2R.js';
13
+ import './chunk-7RY7QWWJ.js';
14
+ import './chunk-PB5X2VSV.js';
15
+ import './chunk-DEI2M2H6.js';
16
+ import './chunk-PXOXTJTN.js';
17
+ import './chunk-YVNFACTC.js';
18
+ import './chunk-NJWI6MPT.js';
20
19
  import './chunk-XRMV2GMB.js';
20
+ import './chunk-EQ6S5SEZ.js';
21
21
  import './chunk-F4HFDP6I.js';
22
- import './chunk-PJSPHHRK.js';
23
22
 
24
23
  // src/node/paginate.ts
25
24
  async function paginateDeck(deck, options) {
@@ -1,5 +1,5 @@
1
- import { C as ComposeSlideOptions, R as ResolvedColorRoles, F as Fonts, L as LayoutDiagnostic } from './composition-Daqvi-GV.js';
2
- import { U as UnresolvedReferenceDiagnostic, R as RecordProvenance, a as CatalogOptions, C as Catalog } from './catalog-refs-CSHevLn1.js';
1
+ import { C as ComposeSlideOptions, R as ResolvedColorRoles, F as Fonts, L as LayoutDiagnostic } from './composition-DIftf6iP.js';
2
+ import { U as UnresolvedReferenceDiagnostic, R as RecordProvenance, b as CatalogOptions, a as Catalog } from './catalog-refs-BSfGELpt.js';
3
3
 
4
4
  /**
5
5
  * One slide's composition context: the layout, canvas, theme and font families that `composeSlide` needs,
@@ -1,4 +1,4 @@
1
- import './composition-Daqvi-GV.js';
2
- import './catalog-refs-CSHevLn1.js';
3
- export { O as OPFPaginationError, P as PaginatedPage, b as PaginationMapping, c as PaginationOptions, d as PaginationResult, a as PresentationPaginationOptions, e as PresentationPaginationResult, p as paginate, h as paginateSlide } from './pagination-R8YFwVj7.js';
1
+ import './composition-DIftf6iP.js';
2
+ import './catalog-refs-BSfGELpt.js';
3
+ export { O as OPFPaginationError, P as PaginatedPage, b as PaginationMapping, c as PaginationOptions, d as PaginationResult, a as PresentationPaginationOptions, e as PresentationPaginationResult, p as paginate, h as paginateSlide } from './pagination-D_kJe4jH.js';
4
4
  import './chart-data-BnNqgnC-.js';
@@ -1,4 +1,4 @@
1
- export { OPFPaginationError, paginate, paginateSlide } from './chunk-FITOGMR3.js';
2
- import './chunk-P7S3ORB4.js';
1
+ export { OPFPaginationError, paginate, paginateSlide } from './chunk-54OV2WQC.js';
2
+ import './chunk-NJWI6MPT.js';
3
3
  import './chunk-XRMV2GMB.js';
4
4
  import './chunk-F4HFDP6I.js';
package/dist/patch.js CHANGED
@@ -1,4 +1,3 @@
1
- export { OPFPatchError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-IY5SCRTV.js';
2
- import './chunk-P7S3ORB4.js';
1
+ export { OPFPatchError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-NJWI6MPT.js';
3
2
  import './chunk-XRMV2GMB.js';
4
3
  import './chunk-F4HFDP6I.js';
@@ -1,5 +1,5 @@
1
1
  // src/generated/repo-readme.ts
2
- var repoReadmeRaw = '# Open Presentation Format (OPF)\n\n[![npm version](https://img.shields.io/npm/v/@openpresentation/opf?label=npm)](https://www.npmjs.com/package/@openpresentation/opf)\n[![npm downloads](https://img.shields.io/npm/dw/@openpresentation/opf)](https://www.npmjs.com/package/@openpresentation/opf)\n[![license](https://img.shields.io/npm/l/@openpresentation/opf)](./LICENSE)\n[![CI](https://github.com/OpenPresentation/opf/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/OpenPresentation/opf/actions/workflows/ci.yml)\n[![nightly](https://github.com/OpenPresentation/opf/actions/workflows/nightly.yml/badge.svg?branch=main)](https://github.com/OpenPresentation/opf/actions/workflows/nightly.yml)\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 integration docs for the 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\nPublished CLI 0.18.0 installs all six skills into your project with `npx @openpresentation/cli@0.18.0 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 source development.\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 currently recorded registry pin set: core 0.25.0, renderer 0.25.0, PPTX 0.25.0, editor 0.25.3, CLI 0.25.0 and Gallery 5.0.0. The default catalog is supplied by `@openpresentation/gallery@5.0.0`; see the [compatibility matrix](docs/compatibility-matrix.md) for feature and native limits.\n2. **Author, validate, paginate, preview and export.** New to OPF? Run the [first deck](docs/first-deck/README.md) end to end first. Copy [`docs/quickstart/developer-quickstart.opf.json`](./docs/quickstart/developer-quickstart.opf.json) and run the commands in that guide. From code, `convert("deck.opf.md", "deck.pdf")` of `@openpresentation/opf` is the simple path to a PDF, PNG, SVG or PPTX file. `validate` / `opf validate` is one local checker for format, references, accessibility, layout and content ([guide](docs/validate.md)), not visual verification.\n3. **Know the limits.** PPTX export writes one text box per wrapped line, so text edited in PowerPoint or Keynote does not reflow (see [rich text](docs/rich-text.md)) unless you opt in to `--body-text native` (opf-pptx and CLI 0.22.0 or later), and fonts are named, not embedded. 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 can live in git from the first commit. After installing dependencies and supplying referenced assets, these commands run locally without a model provider, account or hosted OPF API.\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- register the pptx.gallery catalog of [`@openpresentation/gallery`](./packages/gallery) (a dependency, released with core at the same version) as the Node defaults, as the CLI does; a browser host registers it itself\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\nIn Node (and Bun and Deno) its root also reads and writes files (`convert`, `open`, `save`) and draws them through the optional engines below; in a browser or a worker the same import is a browser-safe build with the same names, where those three reject with `node-only`. Every other entry runs in a browser. It does not generate content with AI, fetch remote catalogs, call hosted APIs, or provide managed services. Render/edit/convert packages live in this repository as separate MIT packages that depend on `@openpresentation/opf`. The format package also exposes pure composition geometry so those packages share layout behavior.\n\n## Toolkit libraries\n\nOPF is six packages. **Core** (`@openpresentation/opf`) is the format and its API: it reads and writes the text formats (JSON, YAML, Markdown) and validates, and in Node reads and writes files, through the same import. **The gallery** (`@openpresentation/gallery`) is the pptx.gallery catalog of layouts, themes, colour and font schemes and the other records, released with the other packages; core depends on it and registers it in Node. **The CLI** (`@openpresentation/cli`) is the `opf` command. **Render** (`opf-render`), **PPTX** (`opf-pptx`) and **the editor** (`opf-editor`) are the engines: drawing, PowerPoint and editing, installed as needed. All six live in this repository (`packages/`) and are released together at one version. See [ecosystem development](docs/ecosystem-development.md) for local builds and verification, and [dynamic composition](docs/dynamic-composition.md) for portable layout rules.\n\n| Package | Role | Boundary |\n|---|---|---|\n| [`packages/javascript`](./packages/javascript) (`@openpresentation/opf`) | Core: format, schemas, validation, composition | The format and its API; reads and writes files in Node and draws through the optional engines |\n| [`packages/gallery`](./packages/gallery) (`@openpresentation/gallery`) | The pptx.gallery catalog | Catalog records only, no runtime dependency; records are authored by pull request here, and a changed drawing or a removed record needs a minor release |\n| [`packages/cli`](./packages/cli) (`@openpresentation/cli`) | `opf` command | Runs core\'s Node engine: reads and writes files and calls the engines below as optional peers |\n| [`packages/render`](./packages/render) (`@openpresentation/opf-render`) | OPF to SVG/PNG/PDF | Local and embeddable rendering library |\n| [`packages/editor`](./packages/editor) (`@openpresentation/opf-editor`) | WYSIWYG bindings/components | Headless editor primitives plus optional UI components |\n| [`packages/pptx`](./packages/pptx) (`@openpresentation/opf-pptx`) | OPF to PPTX and PPTX to OPF | Pure local import/export library for browser and server use where supported |\n\nThese packages 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 packages, clone this repo and build the workspace (all six packages are in `packages/`; see [CONTRIBUTING](./CONTRIBUTING.md)):\n\n```sh\npnpm install\npnpm build\n```\n\nUse the format package from JavaScript or TypeScript:\n\n```ts\nimport { presentation, validate } from "@openpresentation/opf";\nimport { gallery } from "@openpresentation/gallery";\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 report = validate(deck);\nconsole.log(report.valid); // no finding has severity "error"\nconsole.log(report.findings); // every finding: rule id, severity, category, JSON Pointer path, message, fixes\n// Core ships no catalog records; in Node, validate registers the gallery when a call names no catalogs, and a host may name its own.\nconsole.log(validate({ ...deck, design: { theme: "classic" } }, { catalogs: [gallery] }).valid);\nconsole.log(Object.keys(gallery.audiences).length);\n```\n\nConvert, open and save files in Node with `@openpresentation/opf`, the same import a browser uses (the engines `@openpresentation/opf-render` and `@openpresentation/opf-pptx` are optional peers, installed as needed; see [OPF files in Node](docs/node.md)):\n\n```ts\nimport * as opf from "@openpresentation/opf";\n\nawait opf.convert("deck.opf.md", "deck.pdf");\nconst deck = await opf.open("deck.opf.md");\ndeck.slides.push({ title: "Q4" });\nawait opf.save(deck, "deck.opf.md");\nconst { files } = await opf.convert(deck, { format: "pptx" }); // bytes, nothing written\n```\n\nUse focused imports when you only need one surface:\n\n```ts\nimport { presentation } from "@openpresentation/opf/schemas";\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, and [content conversions](./docs/conversions.md) for the pure converters (`@openpresentation/opf/convert`) that change a block\'s kind, nest list items, restructure a slide and split or merge slides, and [Markdown and outlines](./docs/markdown.md) for the deterministic Markdown dialect (`@openpresentation/opf/markdown`, `opf convert deck.md deck.opf.json`) that reads and writes a whole deck as text.\n\n[OPF as YAML](./docs/yaml.md) describes the strict YAML form of a deck (`@openpresentation/opf/yaml`, `opf convert deck.opf.json deck.opf.yaml`, `.opf.yaml` files in every command, editor autocomplete); JSON stays the canonical form. A deck can equally be a Markdown file, `deck.opf.md`: every command reads and writes it (see [Markdown decks in every command](./docs/markdown.md#markdown-decks-in-every-command)), and `parse` / `stringify` read and write a deck in JSON, YAML or Markdown with one call.\n\nSee [Templates and variables](./docs/templates-and-variables.md) for fillable OPF templates: typed variables, `{{id}}` tokens, `opf fill` and `resolveVariables`.\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/slide-design-principles.md`](./docs/slide-design-principles.md) | Timeless principles for slide layout, typography, spacing, visual balance, and reviewing layout defaults. |\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/slide-sizes.md`](./docs/slide-sizes.md) | OPF\'s slide-size presets in inches, points and EMU, how they compare with PowerPoint\'s presets, and what PPTX export and import do with them. |\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/footnotes-citations-captions.md`](./docs/footnotes-citations-captions.md) | Citations (`cite`), inline footnotes, the deck `references` list, captions on images, charts, tables and videos, and how every engine draws them. |\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, published packages, and current fidelity limits. |\n| [`docs/release-process.md`](./docs/release-process.md) | Maintainer runbook for the one-click release: gate, tag, trusted npm publishing of all six packages, verification, GitHub release notes, and the site bumps. |\n| [`spec/schemas/*.schema.json`](./spec/schemas) | Companion schemas for catalog records and sub-objects. |\n| [`packages/gallery`](./packages/gallery) (`@openpresentation/gallery`) | The default catalog and layout previews, released with the other packages. |\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[![npm version](https://img.shields.io/npm/v/@openpresentation/opf?label=npm)](https://www.npmjs.com/package/@openpresentation/opf)\n[![npm downloads](https://img.shields.io/npm/dw/@openpresentation/opf)](https://www.npmjs.com/package/@openpresentation/opf)\n[![license](https://img.shields.io/npm/l/@openpresentation/opf)](./LICENSE)\n[![CI](https://github.com/OpenPresentation/opf/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/OpenPresentation/opf/actions/workflows/ci.yml)\n[![nightly](https://github.com/OpenPresentation/opf/actions/workflows/nightly.yml/badge.svg?branch=main)](https://github.com/OpenPresentation/opf/actions/workflows/nightly.yml)\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 integration docs for the 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\nPublished CLI 0.18.0 installs all six skills into your project with `npx @openpresentation/cli@0.18.0 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 source development.\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 currently recorded registry pin set: core, renderer, PPTX, editor, CLI and Gallery, all at the shared version 0.26.1. The default catalog is supplied by `@openpresentation/gallery@0.26.1`; see the [compatibility matrix](docs/compatibility-matrix.md) for feature and native limits.\n2. **Author, validate, paginate, preview and export.** New to OPF? Run the [first deck](docs/first-deck/README.md) end to end first. Copy [`docs/quickstart/developer-quickstart.opf.json`](./docs/quickstart/developer-quickstart.opf.json) and run the commands in that guide. From code, `convert("deck.opf.md", "deck.pdf")` of `@openpresentation/opf` is the simple path to a PDF, PNG, SVG or PPTX file. `validate` / `opf validate` is one local checker for format, references, accessibility, layout and content ([guide](docs/validate.md)), not visual verification.\n3. **Know the limits.** PPTX export writes one text box per wrapped line, so text edited in PowerPoint or Keynote does not reflow (see [rich text](docs/rich-text.md)) unless you opt in to `--body-text native` (opf-pptx and CLI 0.22.0 or later), and fonts are named, not embedded. 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 can live in git from the first commit. After installing dependencies and supplying referenced assets, these commands run locally without a model provider, account or hosted OPF API.\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- register the pptx.gallery catalog of [`@openpresentation/gallery`](./packages/gallery) (a dependency, released with core at the same version) as the Node defaults, as the CLI does; a browser host registers it itself\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\nIn Node (and Bun and Deno) its root also reads and writes files (`convert`, `open`, `save`) and draws them through the optional engines below; in a browser or a worker the same import is a browser-safe build with the same names, where those three reject with `node-only`. Every other entry runs in a browser. It does not generate content with AI, fetch remote catalogs, call hosted APIs, or provide managed services. Render/edit/convert packages live in this repository as separate MIT packages that depend on `@openpresentation/opf`. The format package also exposes pure composition geometry so those packages share layout behavior.\n\n## Toolkit libraries\n\nOPF is six packages. **Core** (`@openpresentation/opf`) is the format and its API: it reads and writes the text formats (JSON, YAML, Markdown) and validates, and in Node reads and writes files, through the same import. **The gallery** (`@openpresentation/gallery`) is the pptx.gallery catalog of layouts, themes, colour and font schemes and the other records, released with the other packages; core depends on it and registers it in Node. **The CLI** (`@openpresentation/cli`) is the `opf` command. **Render** (`opf-render`), **PPTX** (`opf-pptx`) and **the editor** (`opf-editor`) are the engines: drawing, PowerPoint and editing, installed as needed. All six live in this repository (`packages/`) and are released together at one version. See [ecosystem development](docs/ecosystem-development.md) for local builds and verification, and [dynamic composition](docs/dynamic-composition.md) for portable layout rules.\n\n| Package | Role | Boundary |\n|---|---|---|\n| [`packages/javascript`](./packages/javascript) (`@openpresentation/opf`) | Core: format, schemas, validation, composition | The format and its API; reads and writes files in Node and draws through the optional engines |\n| [`packages/gallery`](./packages/gallery) (`@openpresentation/gallery`) | The pptx.gallery catalog | Catalog records only, no runtime dependency; records are authored by pull request here, and a changed drawing or a removed record needs a minor release |\n| [`packages/cli`](./packages/cli) (`@openpresentation/cli`) | `opf` command | Runs core\'s Node engine: reads and writes files and calls the engines below as optional peers |\n| [`packages/render`](./packages/render) (`@openpresentation/opf-render`) | OPF to SVG/PNG/PDF | Local and embeddable rendering library |\n| [`packages/editor`](./packages/editor) (`@openpresentation/opf-editor`) | WYSIWYG bindings/components | Headless editor primitives plus optional UI components |\n| [`packages/pptx`](./packages/pptx) (`@openpresentation/opf-pptx`) | OPF to PPTX and PPTX to OPF | Pure local import/export library for browser and server use where supported |\n\nThese packages 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 packages, clone this repo and build the workspace (all six packages are in `packages/`; see [CONTRIBUTING](./CONTRIBUTING.md)):\n\n```sh\npnpm install\npnpm build\n```\n\nUse the format package from JavaScript or TypeScript:\n\n```ts\nimport { presentation, validate } from "@openpresentation/opf";\nimport { gallery } from "@openpresentation/gallery";\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 report = validate(deck);\nconsole.log(report.valid); // no finding has severity "error"\nconsole.log(report.findings); // every finding: rule id, severity, category, JSON Pointer path, message, fixes\n// Core ships no catalog records; in Node, validate registers the gallery when a call names no catalogs, and a host may name its own.\nconsole.log(validate({ ...deck, design: { theme: "classic" } }, { catalogs: [gallery] }).valid);\nconsole.log(Object.keys(gallery.audiences).length);\n```\n\nConvert, open and save files in Node with `@openpresentation/opf`, the same import a browser uses (the engines `@openpresentation/opf-render` and `@openpresentation/opf-pptx` are optional peers, installed as needed; see [OPF files in Node](docs/node.md)):\n\n```ts\nimport * as opf from "@openpresentation/opf";\n\nawait opf.convert("deck.opf.md", "deck.pdf");\nconst deck = await opf.open("deck.opf.md");\ndeck.slides.push({ title: "Q4" });\nawait opf.save(deck, "deck.opf.md");\nconst { files } = await opf.convert(deck, { format: "pptx" }); // bytes, nothing written\n```\n\nUse focused imports when you only need one surface:\n\n```ts\nimport { presentation } from "@openpresentation/opf/schemas";\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, and [content conversions](./docs/conversions.md) for the pure converters (`@openpresentation/opf/convert`) that change a block\'s kind, nest list items, restructure a slide and split or merge slides, and [Markdown and outlines](./docs/markdown.md) for the deterministic Markdown dialect (`@openpresentation/opf/markdown`, `opf convert deck.md deck.opf.json`) that reads and writes a whole deck as text.\n\n[OPF as YAML](./docs/yaml.md) describes the strict YAML form of a deck (`@openpresentation/opf/yaml`, `opf convert deck.opf.json deck.opf.yaml`, `.opf.yaml` files in every command, editor autocomplete); JSON stays the canonical form. A deck can equally be a Markdown file, `deck.opf.md`: every command reads and writes it (see [Markdown decks in every command](./docs/markdown.md#markdown-decks-in-every-command)), and `parse` / `stringify` read and write a deck in JSON, YAML or Markdown with one call.\n\nSee [Templates and variables](./docs/templates-and-variables.md) for fillable OPF templates: typed variables, `{{id}}` tokens, `opf fill` and `resolveVariables`.\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/slide-design-principles.md`](./docs/slide-design-principles.md) | Timeless principles for slide layout, typography, spacing, visual balance, and reviewing layout defaults. |\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/slide-sizes.md`](./docs/slide-sizes.md) | OPF\'s slide-size presets in inches, points and EMU, how they compare with PowerPoint\'s presets, and what PPTX export and import do with them. |\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/footnotes-citations-captions.md`](./docs/footnotes-citations-captions.md) | Citations (`cite`), inline footnotes, the deck `references` list, captions on images, charts, tables and videos, and how every engine draws them. |\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, published packages, and current fidelity limits. |\n| [`docs/release-process.md`](./docs/release-process.md) | Maintainer runbook for the one-click release: gate, tag, trusted npm publishing of all six packages, verification, GitHub release notes, and the site bumps. |\n| [`spec/schemas/*.schema.json`](./spec/schemas) | Companion schemas for catalog records and sub-objects. |\n| [`packages/gallery`](./packages/gallery) (`@openpresentation/gallery`) | The default catalog and layout previews, released with the other packages. |\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;
@@ -0,0 +1,165 @@
1
+ import { C as CatalogRecordKind } from './catalog-schemas-DoxA2BgY.js';
2
+ import { SchemaName } from './schemas.js';
3
+ import './catalog-refs-BSfGELpt.js';
4
+ import './json-BFSdESOE.js';
5
+
6
+ /**
7
+ * Which catalog a reference field points into, kept beside the schemas rather than in them: the published schemas
8
+ * (spec/schemas, openpresentation.org/schema/...) carry no vendor keyword, so any Ajv in strict mode (the default) compiles
9
+ * them without `addKeyword`. `check:schema-strict` keeps it that way.
10
+ *
11
+ * Keys are `<schema name>#<JSON Pointer of the node in that schema document>` (the schema names of `@openpresentation/opf/schemas`);
12
+ * the node is the one at the pointer as written, a `$ref` and its siblings included. Values are the catalog record kind the
13
+ * field references. The annotation never changes validation: `describeField` and `catalogKindAt` read it, nothing else.
14
+ * A test fails when a pointer leaves its schema or a schema reference field is missing here.
15
+ */
16
+ type SchemaNodeKey = `${SchemaName}#/${string}`;
17
+ declare const schemaCatalogKinds: Readonly<Record<SchemaNodeKey, CatalogRecordKind>>;
18
+
19
+ /**
20
+ * `@openpresentation/opf/schema`: the field model of an OPF document, read from the JSON Schemas.
21
+ *
22
+ * Two layers. The navigation helpers (`resolveSchema`, `schemaVariants`, `activeSchema`, `schemaAtPath`, `createSchemaValue`,
23
+ * `listSchemaFields`, ...) move here from the editor so that the CLI, agents and every editor read the schemas one way. On top of
24
+ * them, `describeField(path, document?)` answers what a source editor needs at any position (the types, enum values,
25
+ * description, required members and ranked children of the node) and `catalogKindAt(path, document?)` names the catalog a
26
+ * reference field points into, from `schemaCatalogKinds`, core-side metadata kept beside the schemas (the published schemas carry
27
+ * no vendor keyword, so they compile under strict Ajv; the metadata never changes validation).
28
+ *
29
+ * Browser-safe: no `node:` imports. Types are deliberately loose (`JsonSchema`), the schemas being plain JSON.
30
+ */
31
+
32
+ type JsonSchema = {
33
+ [keyword: string]: any;
34
+ };
35
+ /** A path into a document: segments, a JSON Pointer (`/slides/0/title`) or a dotted path (`slides.0.title`). */
36
+ type OpfPath = string | readonly (string | number)[];
37
+ type SchemaRoot = JsonSchema;
38
+ /** The segments of a path: an array of segments, a JSON Pointer (starts with `/`, throws on a bad escape) or a dotted path. */
39
+ declare function splitOpfPath(path: OpfPath): string[];
40
+ /** Follow `$ref` (and merge `allOf`) until the schema is concrete. Siblings of a `$ref` (description, examples, `x-*`) win over the target. */
41
+ declare function resolveSchema(schema: JsonSchema | undefined, root?: SchemaRoot, seen?: Set<string>): JsonSchema;
42
+ /**
43
+ * The concrete forms of a schema: `oneOf` / `anyOf` branches and `type` arrays expanded, each branch merged over the shared
44
+ * base (properties and required lists are combined; a branch that only names required fields is labelled by them).
45
+ */
46
+ declare function schemaVariants(schema: JsonSchema | undefined, root?: SchemaRoot): JsonSchema[];
47
+ /** The JSON type of a schema, inferred from its members when `type` is absent (and from `value` for an open schema). */
48
+ declare function schemaType(schema: JsonSchema, value?: unknown): string;
49
+ /** The variant of a schema that best fits a value (the first one when the value does not decide). */
50
+ declare function activeSchema(schema: JsonSchema | undefined, value?: unknown, root?: SchemaRoot): JsonSchema;
51
+ /** The schema at a path of a document, resolved (`{}` for a path the schema does not describe). `path`: segments, a JSON Pointer or a dotted path. */
52
+ declare function schemaAtPath(presentation: unknown, path: OpfPath, root?: SchemaRoot): JsonSchema;
53
+ /** A short label for one variant of a union: its title, its `type` constant, its constant, or its type and first members. */
54
+ declare function schemaLabel(schema: JsonSchema, index?: number): string;
55
+ /** A minimal valid starting value for a schema: constants, defaults, the first enum value, required members, minimum items. */
56
+ declare function createSchemaValue(schema: JsonSchema | undefined, root?: SchemaRoot, depth?: number): unknown;
57
+ interface SchemaField {
58
+ /** The schema name in `schemas` (`presentation`, `theme`, ...). */
59
+ schema: string;
60
+ /** JSON Pointer of the property inside the schema document. */
61
+ path: string;
62
+ name: string;
63
+ description: string;
64
+ reference: string | null;
65
+ type: string | string[] | null;
66
+ values: unknown[] | null;
67
+ }
68
+ /** Every documented property of every schema, flattened (for search and documentation). */
69
+ declare function listSchemaFields(): SchemaField[];
70
+ /**
71
+ * The common keys of the objects an author writes most, in the order a source editor offers them (SPEC 4.4). A key's `priority`
72
+ * is its index here; every other key sorts after them, alphabetically. Keys that the schema does not have are skipped. This is
73
+ * the one place the order lives: change it here, not in an editor.
74
+ */
75
+ declare const COMMON_KEYS: Readonly<{
76
+ deck: readonly string[];
77
+ slide: readonly string[];
78
+ design: readonly string[];
79
+ }>;
80
+ /** The sort position of a key that is in no `COMMON_KEYS` list. */
81
+ declare const UNRANKED_PRIORITY = 1000000;
82
+ /** Whether a slide key is a promoted region (`left`, `top+middle`, `top+middle:left+center`, ...): 48 keys of the slide schema, all `advanced`. */
83
+ declare function isPromotedRegionKey(key: string): boolean;
84
+
85
+ interface EnumValue {
86
+ value: string | number | boolean | null;
87
+ description?: string;
88
+ }
89
+ interface VariantInfo {
90
+ type: string;
91
+ title?: string;
92
+ enum?: EnumValue[];
93
+ const?: unknown;
94
+ /** Required members of this variant. */
95
+ requiredChildren: string[];
96
+ /** Names of this variant's properties, in schema order. */
97
+ properties: string[];
98
+ /** For an array: the types of its items joined with " | " (`string`, `object`, `string | object`). */
99
+ itemsType?: string;
100
+ /** For an array whose items are one `$defs` entry: that name (`Slide`). */
101
+ itemsDefinition?: string;
102
+ }
103
+ interface FieldChild {
104
+ key: string;
105
+ types: string[];
106
+ /** `string`, `number`, `enum`, `Design` (a single `$defs` object), `array of Slide`, `array of string`, `choice` (several forms), ... */
107
+ typeLabel: string;
108
+ required: boolean;
109
+ /** Hidden until the typed prefix matches: promoted regions, `extensions`, `$schema`. */
110
+ advanced: boolean;
111
+ /** Lower sorts first: the index in `COMMON_KEYS` for the object, `UNRANKED_PRIORITY` (1e6) otherwise. */
112
+ priority: number;
113
+ description?: string;
114
+ catalogKind?: CatalogRecordKind;
115
+ deprecated?: boolean;
116
+ hasEnum: boolean;
117
+ }
118
+ interface FieldInfo {
119
+ known: boolean;
120
+ path: (string | number)[];
121
+ pointer: string;
122
+ /** The last segment when it names a property (not an array index). */
123
+ key?: string;
124
+ types: string[];
125
+ /** First paragraph of the description, plain text. */
126
+ description?: string;
127
+ fullDescription?: string;
128
+ /** The `$defs` name when the schema is a `$ref` (`Design`). */
129
+ definition?: string;
130
+ required: boolean;
131
+ deprecated?: boolean;
132
+ examples: unknown[];
133
+ default?: unknown;
134
+ /** The union of all variants' enum values and constants. */
135
+ enum?: EnumValue[];
136
+ catalogKind?: CatalogRecordKind;
137
+ variants: VariantInfo[];
138
+ /** Index in `variants` of the form a template uses: a string, enum, boolean or number over an object over an array; else 0. */
139
+ primary: number;
140
+ /** Properties of the active object variant (all object variants merged when the document does not decide), ranked. */
141
+ children: FieldChild[];
142
+ /** For an array: the item schema described at `path + [next index]`. */
143
+ itemInfo?: FieldInfo;
144
+ /** For a map (`datasets`, `assets`, `variables`, `catalogs.<group>.layouts`, ...): the entry schema described at `path + ["*"]`. */
145
+ entryInfo?: FieldInfo;
146
+ /** Required members of the object form (those every candidate object variant requires). */
147
+ requiredChildren: string[];
148
+ /** A free-text string: no pattern, enum, format or catalog. An editor never opens a value list there. */
149
+ freeText: boolean;
150
+ }
151
+ /**
152
+ * What the schema says about the node at `path`, for completion, hover and templates. `document` (optional) picks the active
153
+ * `oneOf` variant by the value that is already there (otherwise the first form is taken) and sizes the next array index. A path
154
+ * the schema does not describe returns `{ known: false, ... }`. Paths: segments, a JSON Pointer, or a dotted path; a trailing
155
+ * `-` or the next index describes the item an array would take.
156
+ */
157
+ declare function describeField(path: OpfPath, document?: unknown): FieldInfo;
158
+ /**
159
+ * The catalog kind a field references (`layouts`, `themes`, `colorSchemes`, `fontSchemes`, `narratives`, `audiences`,
160
+ * `purposes`, `tones`), read from `schemaCatalogKinds` for the schema node at `path`; undefined for every other field.
161
+ * Languages are an engine vocabulary, not a catalog: `language` is not a reference.
162
+ */
163
+ declare function catalogKindAt(path: OpfPath, document?: unknown): CatalogRecordKind | undefined;
164
+
165
+ export { COMMON_KEYS, CatalogRecordKind, type EnumValue, type FieldChild, type FieldInfo, type JsonSchema, type OpfPath, type SchemaField, type SchemaNodeKey, type SchemaRoot, UNRANKED_PRIORITY, type VariantInfo, activeSchema, catalogKindAt, createSchemaValue, describeField, isPromotedRegionKey, listSchemaFields, resolveSchema, schemaAtPath, schemaCatalogKinds, schemaLabel, schemaType, schemaVariants, splitOpfPath };
package/dist/schema.js ADDED
@@ -0,0 +1,3 @@
1
+ export { COMMON_KEYS, UNRANKED_PRIORITY, activeSchema, catalogKindAt, createSchemaValue, describeField, isPromotedRegionKey, listSchemaFields, resolveSchema, schemaAtPath, schemaCatalogKinds, schemaLabel, schemaType, schemaVariants, splitOpfPath } from './chunk-NJWI6MPT.js';
2
+ import './chunk-XRMV2GMB.js';
3
+ import './chunk-F4HFDP6I.js';
@@ -0,0 +1,97 @@
1
+ import { b as FindingLocation } from './finding-l9dlQ2NF.js';
2
+
3
+ /**
4
+ * A range of source text in the `Finding.location` convention: UTF-16 offset and length, 1-based line and column (a line break is
5
+ * `\r\n`, `\r` or `\n`). `exact: false` marks a range that is the nearest ancestor of a node the text does not have.
6
+ */
7
+ type TextRange = FindingLocation & {
8
+ exact?: boolean;
9
+ };
10
+ /** A replacement of `length` characters at `offset` by `insert`, in the offsets of the text it applies to. */
11
+ interface TextEdit {
12
+ offset: number;
13
+ length: number;
14
+ insert: string;
15
+ }
16
+ type SourceFormat = "json" | "yaml" | "md" | "markdown";
17
+ /** Apply edits (offsets in the original text, non-overlapping) and return the new text. */
18
+ declare function applyTextEdits(text: string, edits: readonly TextEdit[]): string;
19
+
20
+ interface SyntaxFix {
21
+ id: string;
22
+ /** What a menu shows: `Insert comma`, `Remove "design"`, `Add { }`. */
23
+ title: string;
24
+ /** Mechanical and unambiguous: an editor may offer to apply it without a second look. */
25
+ safe: boolean;
26
+ /** Replacements in the offsets of the analyzed text, non-overlapping. Empty for `action`. */
27
+ edits: TextEdit[];
28
+ /** Where the caret goes, as an offset in the NEW text. */
29
+ caret?: number;
30
+ /** `switch-format`: the editor converts the text to `format`; `edits` is empty. */
31
+ action?: "switch-format";
32
+ format?: "yaml" | "md";
33
+ }
34
+ interface SyntaxProblem {
35
+ /** The cause, in kebab-case. */
36
+ code: SyntaxProblemCode;
37
+ severity: "error";
38
+ /** The squiggle: the smallest text the message is about. */
39
+ range: TextRange;
40
+ /** What is wrong, one or two sentences, American spelling. */
41
+ message: string;
42
+ /** What to do, without a leading "Next:". */
43
+ next: string;
44
+ /** The document path of the node the problem is about, when it is known. */
45
+ path?: (string | number)[];
46
+ fixes: SyntaxFix[];
47
+ }
48
+ type SyntaxProblemCode = "missing-value" | "missing-comma" | "trailing-comma" | "double-comma" | "missing-colon" | "unclosed-object" | "unclosed-array" | "unclosed-string" | "unclosed-comment" | "content-after-root" | "single-quotes" | "typographic-quotes" | "bare-word" | "unquoted-key" | "comment" | "invalid-number" | "invalid-escape" | "invalid-unicode" | "control-character" | "looks-like-yaml" | "looks-like-markdown" | "empty-document" | "not-an-object" | "invalid-symbol";
49
+ interface AnalyzeOptions {
50
+ /** The most problems returned (default 5). */
51
+ limit?: number;
52
+ }
53
+ /**
54
+ * The root causes of the syntax errors in a JSON text, one problem per cause, in position order, at most `options.limit` (5).
55
+ * Each carries the range for a squiggle, a message, a hint and the fixes. Accepts any text and never throws. A text that is valid
56
+ * JSON returns `[]`, except that a top level which is not an object (`not-an-object`) is a problem for an OPF document.
57
+ */
58
+ declare function analyzeJsonSyntax(text: string, options?: AnalyzeOptions): SyntaxProblem[];
59
+
60
+ /** Which part of a node `locate` returns. */
61
+ type LocatePart =
62
+ /** The value node (the default). */
63
+ "value"
64
+ /** The property-name string token. */
65
+ | "key"
66
+ /** The key through the end of its value. */
67
+ | "entry"
68
+ /** The first character of the value (`{`, `[`, a quote, ...): where a "missing property" finding points. */
69
+ | "open"
70
+ /** The key through the colon. */
71
+ | "colon";
72
+ interface LocateOptions {
73
+ part?: LocatePart;
74
+ }
75
+ interface PathAtResult {
76
+ /** The document path of the node under the offset: a property's path at its key, the container's path between its members. */
77
+ path: (string | number)[];
78
+ /** `key`: on a property name. `value`: on a value (or a container's own bracket). `between`: whitespace, a comma or a colon inside a container. `none`: outside the root value. */
79
+ part: "key" | "value" | "between" | "none";
80
+ /** The range of the key or value token, or of the container for `between`. */
81
+ range?: TextRange;
82
+ }
83
+ /**
84
+ * The text range of the node a JSON Pointer (or a segment array) addresses, so that a finding about `/slides/2/design` can be
85
+ * underlined in the source. Tolerant: it reads text with syntax errors, comments and trailing commas as far as it can be read.
86
+ * When the node does not exist, the range is that of the nearest ancestor that does, with `exact: false`.
87
+ *
88
+ * Phase 1 reads JSON. YAML and Markdown return `undefined` (phase 2): no range is guessed.
89
+ */
90
+ declare function locate(text: string, format: SourceFormat, pointer: string | readonly (string | number)[], options?: LocateOptions): TextRange | undefined;
91
+ /**
92
+ * The document path and the kind of position at a character offset (a caret between characters). JSON only (phase 1); YAML and
93
+ * Markdown return `undefined`. Tolerant of broken text.
94
+ */
95
+ declare function pathAt(text: string, format: SourceFormat, offset: number): PathAtResult | undefined;
96
+
97
+ export { type AnalyzeOptions, type LocateOptions, type LocatePart, type PathAtResult, type SourceFormat, type SyntaxFix, type SyntaxProblem, type SyntaxProblemCode, type TextEdit, type TextRange, analyzeJsonSyntax, applyTextEdits, locate, pathAt };