@openpresentation/opf 0.34.1 → 0.35.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.
Files changed (105) hide show
  1. package/README.md +6 -6
  2. package/dist/browser.js +19 -19
  3. package/dist/{catalog-refs-CoIrOdAw.d.ts → catalog-refs-BgotJhR5.d.ts} +117 -98
  4. package/dist/{catalog-schemas-FjLRPtjB.d.ts → catalog-schemas-BX-VEc5Q.d.ts} +1 -1
  5. package/dist/{chunk-MUILZGRY.js → chunk-2GCTKQDD.js} +4 -4
  6. package/dist/{chunk-LCT5ZV3Q.js → chunk-3KPTVK77.js} +92 -284
  7. package/dist/{chunk-SR6T4LKI.js → chunk-3ZTKRX7F.js} +4 -6
  8. package/dist/{chunk-MAFJ5O2D.js → chunk-4UMZDDJG.js} +11 -29
  9. package/dist/{chunk-NLJFNCZ4.js → chunk-6JHV2K67.js} +6 -6
  10. package/dist/{chunk-FK5XG742.js → chunk-6VGLE7C5.js} +114 -2
  11. package/dist/{chunk-AAWHOCXS.js → chunk-7KUUIL7W.js} +8 -8
  12. package/dist/{chunk-FCSYIBVR.js → chunk-ARPMSD7V.js} +1 -1
  13. package/dist/{chunk-244OPLAV.js → chunk-GGN3NQDK.js} +1 -1
  14. package/dist/{chunk-L3MCLD3X.js → chunk-GKUAVSXU.js} +3 -10
  15. package/dist/{chunk-6PMXVP5G.js → chunk-HORPH6O7.js} +202 -21
  16. package/dist/{chunk-XLSWZSQS.js → chunk-JQNT37IO.js} +4 -13
  17. package/dist/{chunk-AEHDXNZX.js → chunk-KNMMEE67.js} +1433 -916
  18. package/dist/{chunk-CJVKOJ6B.js → chunk-LDLLZQPP.js} +1094 -472
  19. package/dist/{chunk-HHVQ2SDT.js → chunk-MS2LPR7F.js} +1 -5
  20. package/dist/{chunk-AGYPRTEC.js → chunk-MVPQEMCP.js} +97 -15
  21. package/dist/{chunk-2B6GLT2O.js → chunk-NPRNWPP4.js} +1 -1
  22. package/dist/{chunk-X72WPTST.js → chunk-P2ACZJUL.js} +6 -6
  23. package/dist/chunk-SEC4IOOS.js +1 -0
  24. package/dist/{chunk-CQXBGZQP.js → chunk-VMPOCXTE.js} +5 -17
  25. package/dist/{chunk-ABA2D6X5.js → chunk-ZZWX4W2G.js} +2 -2
  26. package/dist/{composition-CvtvgBDE.d.ts → composition-BmJfljJl.d.ts} +345 -242
  27. package/dist/composition.d.ts +2 -2
  28. package/dist/composition.js +1 -1
  29. package/dist/{conversion-CyNRlWGw.d.ts → conversion-BbXhlurO.d.ts} +10 -8
  30. package/dist/conversion-VWCH3NKR.js +25 -0
  31. package/dist/convert.d.ts +11 -11
  32. package/dist/convert.js +61 -86
  33. package/dist/data.d.ts +1 -1
  34. package/dist/data.js +2 -2
  35. package/dist/{deck-report-BVlQZ42f.d.ts → deck-report-BYkbL7uT.d.ts} +3 -3
  36. package/dist/deck.d.ts +6 -6
  37. package/dist/deck.js +11 -11
  38. package/dist/diagram-engine-eager.js +1 -1
  39. package/dist/diagram-engine-lazy.js +1 -1
  40. package/dist/{diagram-plantuml-XRZ6VAOL.js → diagram-plantuml-GWXGKY7R.js} +1 -1
  41. package/dist/diff.d.ts +2 -2
  42. package/dist/diff.js +4 -4
  43. package/dist/docs.js +40 -40
  44. package/dist/example-files/technical/assets/alice.png +0 -0
  45. package/dist/example-files/technical/assets/context-photo.png +0 -0
  46. package/dist/example-files/technical/assets/cover-image.png +0 -0
  47. package/dist/example-files/technical/assets/cover.png +0 -0
  48. package/dist/example-files/technical/assets/diagram.svg +1 -0
  49. package/dist/example-files/technical/assets/icon.svg +1 -0
  50. package/dist/example-files/technical/assets/logo-dark.svg +1 -0
  51. package/dist/example-files/technical/assets/logo-light.svg +1 -0
  52. package/dist/example-files/technical/assets/logo.svg +1 -0
  53. package/dist/example-files/technical/assets/primary-logo.svg +1 -0
  54. package/dist/example-files/technical/assets/product-shot.png +0 -0
  55. package/dist/example-files/technical/assets/watermark.png +0 -0
  56. package/dist/example-files/technical/assets/wordmark.svg +1 -0
  57. package/dist/examples.js +6383 -8169
  58. package/dist/{finding-l9dlQ2NF.d.ts → finding-mcHslZLA.d.ts} +6 -2
  59. package/dist/font-policy.d.ts +16 -2
  60. package/dist/font-policy.js +1 -1
  61. package/dist/format.js +2 -2
  62. package/dist/ids.d.ts +2 -2
  63. package/dist/ids.js +4 -4
  64. package/dist/index.d.ts +125 -27
  65. package/dist/index.js +24 -23
  66. package/dist/markdown.d.ts +1 -1
  67. package/dist/markdown.js +8 -8
  68. package/dist/node-engine.d.ts +22 -8
  69. package/dist/node-engine.js +38 -22
  70. package/dist/{pagination-CZQQYk7L.d.ts → pagination-C0FPjO29.d.ts} +4 -4
  71. package/dist/pagination.d.ts +3 -3
  72. package/dist/pagination.js +4 -4
  73. package/dist/patch.d.ts +4 -4
  74. package/dist/patch.js +3 -3
  75. package/dist/precompiled.js +2 -2
  76. package/dist/{presentation-s9262acV.d.ts → presentation-Dx-kZC8Y.d.ts} +33 -81
  77. package/dist/repo-readme.js +1 -1
  78. package/dist/schema-engine-ajv.js +1 -1
  79. package/dist/schema-engine-precompiled.js +2 -2
  80. package/dist/schema.d.ts +5 -7
  81. package/dist/schema.js +3 -3
  82. package/dist/schemas.js +1 -1
  83. package/dist/source.d.ts +5 -0
  84. package/dist/source.js +10 -10
  85. package/dist/spec/reference/engine-defaults.json +1 -1
  86. package/dist/spec/reference/engine-vocabularies.json +43 -43
  87. package/dist/spec/reference/font-policy.json +114 -2
  88. package/dist/spec/reference/font-policy.schema.json +45 -1
  89. package/dist/spec/schemas/color-scheme.schema.json +2 -2
  90. package/dist/spec/schemas/finding.schema.json +2 -1
  91. package/dist/spec/schemas/icon-set.schema.json +5 -0
  92. package/dist/spec/schemas/layout.schema.json +27 -85
  93. package/dist/spec/schemas/opf.schema.json +35 -176
  94. package/dist/spec/schemas/theme.schema.json +10 -10
  95. package/dist/symbol-font-encodings.d.ts +2 -2
  96. package/dist/symbol-font-encodings.js +12695 -12736
  97. package/dist/types.d.ts +74 -86
  98. package/dist/{validation-types-CYbsUuZ9.d.ts → validation-types-DKIe1RQW.d.ts} +5 -5
  99. package/dist/validator.d.ts +5 -7
  100. package/dist/validator.js +3 -3
  101. package/dist/yaml.d.ts +1 -1
  102. package/dist/yaml.js +7 -7
  103. package/package.json +7 -7
  104. package/dist/chunk-UJZN2ZH6.js +0 -1
  105. package/dist/conversion-CSQ5EHD2.js +0 -25
@@ -161,9 +161,13 @@ interface FindingFix {
161
161
  */
162
162
  kind?: ("patch" | "focus");
163
163
  /**
164
- * True when applying the fix cannot change what the content says or how it looks beyond the repair, such as switching a failing colour to the one the theme chose. False fixes need a deliberate choice.
164
+ * True when the fix is the one repair the finding needs and can be applied without a person: it loses no content, what it writes is valid, and it changes nothing beyond the repair except what `changesDrawing` says, such as a removed key's mechanical replacement. False fixes need a deliberate choice, such as a new text color. Only a `patch` fix is applied; a `focus` fix names a field to write whatever `safe` says.
165
165
  */
166
166
  safe?: boolean;
167
+ /**
168
+ * True when applying this patch can change how a slide draws: the repair does not keep the drawing of the release that wrote the deck, such as a removed layout's replacement whose title column is narrower. Absent or false when the fixed deck draws as before. Hosts list such fixes, even safe ones, as changing the drawing.
169
+ */
170
+ changesDrawing?: boolean;
167
171
  /**
168
172
  * RFC 6902 JSON Patch operations that apply the fix to the checked presentation.
169
173
  */
@@ -213,4 +217,4 @@ interface ValidationIssue {
213
217
  alternatives?: string[];
214
218
  }
215
219
 
216
- export type { FindingReport as F, JsonPatchOperation as J, ValidationIssue as V, Finding as a, FindingLocation as b, FindingSeverity as c, FindingCategory as d, FindingFix as e, FindingFocus as f, FindingSuggestion as g };
220
+ export type { FindingReport as F, JsonPatchOperation as J, ValidationIssue as V, Finding as a, FindingLocation as b, FindingSeverity as c, FindingFix as d, FindingCategory as e, FindingFocus as f, FindingSuggestion as g };
@@ -69,9 +69,23 @@ interface FontReplacement {
69
69
  sizeAdjustBasis?: string;
70
70
  /** Null when the reference font was not available to the measuring host. */
71
71
  measured: FontReplacementMeasurement | null;
72
+ /** Script replacements (v0.35), keyed by ISO 15924 script code: runs of that script in this family are measured and drawn with
73
+ * the entry's face at its own multiplier, while text of any other script keeps `family` (Arial: Latin text in Arimo at the composed
74
+ * size, Arabic-script runs in Noto Naskh Arabic at 0.96). The PPTX still names the row's family. */
75
+ scripts?: Record<string, FontScriptReplacement>;
72
76
  /** Upstream statement of compatibility, when one exists. */
73
77
  source?: string;
74
78
  }
79
+ /** The open face that previews one script of a family (`FontReplacement.scripts`). */
80
+ interface FontScriptReplacement {
81
+ /** Openly licensed family that measures and draws this script's runs. Never written to PPTX. */
82
+ family: string;
83
+ compatibility: FontReplacementCompatibility;
84
+ /** Preview-only font-size multiplier for this script's runs, as `FontReplacement.sizeAdjust`. Absent means 1. */
85
+ sizeAdjust?: number;
86
+ /** How `sizeAdjust` was measured. Present with `sizeAdjust`. */
87
+ sizeAdjustBasis?: string;
88
+ }
75
89
  interface FontPolicyEntry {
76
90
  family: string;
77
91
  licenseClass: FontLicenseClass;
@@ -92,7 +106,7 @@ interface FontPolicyDecision {
92
106
  replacement: string;
93
107
  compatibility: FontReplacementCompatibility;
94
108
  /** Metric-mode registries still preview with this visual replacement (reported as visual), so an
95
- * earlier metric behaviour does not regress. It never makes the replacement metric. */
109
+ * earlier metric behavior does not regress. It never makes the replacement metric. */
96
110
  metricModeFallback?: boolean;
97
111
  note?: string;
98
112
  }
@@ -140,4 +154,4 @@ interface FontAvailabilityDiagnostic {
140
154
  declare function fontAvailabilityDiagnostics(families: Iterable<string>): FontAvailabilityDiagnostic[];
141
155
 
142
156
  export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor };
143
- export type { FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement };
157
+ export type { FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement, FontScriptReplacement };
@@ -1,2 +1,2 @@
1
- export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-FK5XG742.js';
1
+ export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-6VGLE7C5.js';
2
2
  import './chunk-PRXZD2II.js';
package/dist/format.js CHANGED
@@ -1,3 +1,3 @@
1
- export { OPFFormatError, format, isFormatted, sortPresentationKeys } from './chunk-HHVQ2SDT.js';
2
- import './chunk-LCT5ZV3Q.js';
1
+ export { OPFFormatError, format, isFormatted, sortPresentationKeys } from './chunk-MS2LPR7F.js';
2
+ import './chunk-3KPTVK77.js';
3
3
  import './chunk-PRXZD2II.js';
package/dist/ids.d.ts CHANGED
@@ -10,7 +10,7 @@ declare class OPFIdError extends Error {
10
10
  constructor(code: IdErrorCode, message: string, path?: string);
11
11
  }
12
12
  interface AssignIdsContext {
13
- /** `slide` for an entry of `slides`; `block` for a content payload (a block, a nested group or a promoted region). */
13
+ /** `slide` for an entry of `slides`; `block` for a content payload (a block or a nested group). */
14
14
  kind: "slide" | "block";
15
15
  /** The JSON Pointer of the node, in index form (`/slides/2/blocks/0`). */
16
16
  pointer: string;
@@ -54,7 +54,7 @@ declare function assignIds(document: unknown, options?: AssignIdsOptions): Assig
54
54
  * - `document`: the whole document (the root);
55
55
  * - `slide-order`: the `slides` array, or a slide as a whole (added, removed, moved, copied);
56
56
  * - `slide`: a field of one slide, or a slide replaced or read as a whole;
57
- * - `block`: a content payload (a block, a nested group or a promoted region) or the `blocks` array that holds it, below a slide;
57
+ * - `block`: a content payload (a block or a nested group) or the `blocks` array that holds it, below a slide;
58
58
  * - `design`: the deck's `design` or a slide's `design`;
59
59
  * - `assets`, `catalogs`: the deck's `assets` and `catalogs`;
60
60
  * - `metadata`: every other deck field (`name`, `language`, `references`, `datasets`, `variables`, `narrative`, `extensions`, ...).
package/dist/ids.js CHANGED
@@ -1,7 +1,7 @@
1
- export { OPFIdError, assignIds, touches } from './chunk-XLSWZSQS.js';
2
- export { OPFPatchHashError, documentHash, idToken, isIdToken, resolveIdPatch, resolveIdPointer, toIdPatch, toIdPointer } from './chunk-AEHDXNZX.js';
1
+ export { OPFIdError, assignIds, touches } from './chunk-JQNT37IO.js';
2
+ export { OPFPatchHashError, documentHash, idToken, isIdToken, resolveIdPatch, resolveIdPointer, toIdPatch, toIdPointer } from './chunk-KNMMEE67.js';
3
3
  import './chunk-JBARNYFR.js';
4
- import './chunk-LCT5ZV3Q.js';
5
- import './chunk-CJVKOJ6B.js';
4
+ import './chunk-3KPTVK77.js';
5
+ import './chunk-LDLLZQPP.js';
6
6
  import './chunk-BLCDUM7B.js';
7
7
  import './chunk-PRXZD2II.js';
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
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 { a4 as ConvertInput, a5 as ConvertOptions, a6 as ConvertResult, a7 as ConvertFormat, a8 as OpenOptions, a9 as SaveOptions, aa as SaveResult } from './conversion-CyNRlWGw.js';
3
- export { ab as ConvertedFile, i as ExportFormat, F as FontsHandle, O as OPFApiError, o as OPFExportError, p as OPFImportError, S as SlideSelection, W as parseSlideSelection } from './conversion-CyNRlWGw.js';
2
+ import { a4 as ConvertInput, a5 as ConvertOptions, a6 as ConvertResult, a7 as ConvertFormat, a8 as OpenOptions, a9 as SaveOptions, aa as SaveResult } from './conversion-BbXhlurO.js';
3
+ export { ab as ConvertedFile, i as ExportFormat, F as FontsHandle, O as OPFApiError, o as OPFExportError, p as OPFImportError, S as SlideSelection, W as parseSlideSelection } from './conversion-BbXhlurO.js';
4
4
  export { R as RuleExplanation, e as explain } from './explain-iZeNOUc6.js';
5
5
  import { createValidator as createValidator$1, validate as validate$1 } from './validator.js';
6
6
  export { DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, ValidationCacheInfo, Validator, assertValid, assertValidCatalogRecord, findValidationRule, validateCatalogRecord, validationRules } from './validator.js';
7
- import { R as ResolveVariablesOptions, h as VariableDiagnostic } from './validation-types-CYbsUuZ9.js';
8
- 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-CYbsUuZ9.js';
9
- import { a as FontFamilies, T as TextMeasurement } from './composition-CvtvgBDE.js';
10
- export { b as CHART_TYPES, c as ChartDrawPlan, d as ChartFallback, C as ComposeSlideOptions, E as ENGINE_DEFAULT_CHART_TYPES, e as ENGINE_DEFAULT_COLOR_SCHEME, f as ENGINE_DEFAULT_FONT_SCHEME, g as ENGINE_DEFAULT_THEME, F as Fonts, h as LANGUAGES, i as LOGO_SHAPES, j as LanguageFamilyName, k as LanguageVocabulary, L as LayoutDiagnostic, l as LogoShape, m as LogoVariant, n as MeasureTextWidth, N as NumberLocale, R as ResolveLogoOptions, o as ResolvedLogo, S as SOCIAL_PLATFORMS, p as SocialPlatformVocabulary, q as TextStyle, r as asciiDigits, s as chartDrawDiagnostics, t as chartDrawPlan, u as diagramsPending, v as ensureDiagrams, w as ensureShapes, x as formatNumber, y as formatPercentNumber, z as isPlaceLabel, A as isSupportedNumberingSystem, B as languageInEffect, D as localizeDigits, G as markLabelColor, H as normalizeLanguageFamily, I as numberLocale, J as numberingSystemExtension, K as numberingSystemOf, O as numeralScripts, P as plainLanguageTag, Q as shapesPending, U as supportedNumberingSystems } from './composition-CvtvgBDE.js';
7
+ import { e as ValidationCategory, a as ValidateOptions, V as ValidationReport, R as ResolveVariablesOptions, h as VariableDiagnostic } from './validation-types-DKIe1RQW.js';
8
+ 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, f as ValidationChecks, 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-DKIe1RQW.js';
9
+ import { a as FontFamilies, T as TextMeasurement } from './composition-BmJfljJl.js';
10
+ export { b as CHART_TYPES, c as ChartDrawPlan, d as ChartFallback, C as ComposeSlideOptions, E as ENGINE_DEFAULT_CHART_TYPES, e as ENGINE_DEFAULT_COLOR_SCHEME, f as ENGINE_DEFAULT_FONT_SCHEME, h as ENGINE_DEFAULT_THEME, F as Fonts, i as LANGUAGES, j as LOGO_SHAPES, k as LanguageFamilyName, l as LanguageVocabulary, L as LayoutDiagnostic, m as LogoShape, n as LogoVariant, o as MeasureTextWidth, N as NumberLocale, R as ResolveLogoOptions, p as ResolvedLogo, S as SOCIAL_PLATFORMS, q as SocialPlatformVocabulary, r as TextStyle, s as asciiDigits, t as chartDrawDiagnostics, u as chartDrawPlan, v as diagramsPending, w as ensureDiagrams, x as ensureShapes, y as formatNumber, z as formatPercentNumber, A as isPlaceLabel, B as isSupportedNumberingSystem, D as languageInEffect, G as localizeDigits, H as markLabelColor, I as normalizeLanguageFamily, J as numberLocale, K as numberingSystemExtension, O as numberingSystemOf, P as numeralScripts, Q as plainLanguageTag, U as shapesPending, V as supportedNumberingSystems } from './composition-BmJfljJl.js';
11
11
  export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
12
- import { P as Presentation } from './presentation-s9262acV.js';
12
+ import { P as Presentation } from './presentation-Dx-kZC8Y.js';
13
13
  export { Audience, ChartType, ColorScheme, FontScheme, Language, Layout, Narrative, Purpose, SocialPlatform, Theme, Tone } from './types.js';
14
- import { a as CatalogKind, U as UnresolvedReferenceDiagnostic, d as CatalogOptions, C as Catalog, c as RecordProvenance } from './catalog-refs-CoIrOdAw.js';
15
- export { e as CATALOG_GROUP_PATTERN, f as CATALOG_REFERENCE_PATTERN, g as CatalogRecordMap, h as CatalogRecords, i as CatalogReferenceSite, I as IconOptions, j as IconReference, k as IconResolution, l as IconSetRecord, O as OPFCatalogsOptionError, m as OPFUnresolvedReferenceError, n as ResolvedIcon, o as ResolvedReference, p as catalogGroupSource, q as catalogKinds, r as catalogRecords, s as catalogReferenceSites, t as embedIcons, u as ensureIcons, v as iconsPending, w as nearIconNames, x as parseIconReference, y as parseReference, z as resolveIcon, A as resolveReference, B as unresolvedReference } from './catalog-refs-CoIrOdAw.js';
16
- import { a as Finding, J as JsonPatchOperation } from './finding-l9dlQ2NF.js';
17
- 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';
18
- export { a as CATALOG_SCHEMA, b as CatalogDisplayKind, C as CatalogRecordKind, c as catalogDisplayKinds, d as catalogIconKinds, e as catalogSchemaNames } from './catalog-schemas-FjLRPtjB.js';
14
+ import { a as CatalogKind, U as UnresolvedReferenceDiagnostic, d as CatalogOptions, C as Catalog, c as RecordProvenance } from './catalog-refs-BgotJhR5.js';
15
+ export { e as CATALOG_GROUP_PATTERN, f as CATALOG_REFERENCE_PATTERN, g as CatalogRecordMap, h as CatalogRecords, i as CatalogReferenceSite, I as IconOptions, j as IconReference, k as IconResolution, l as IconSetRecord, O as OPFCatalogsOptionError, m as OPFUnresolvedReferenceError, n as ResolvedIcon, o as ResolvedReference, p as catalogGroupSource, q as catalogKinds, r as catalogRecords, s as catalogReferenceSites, t as embedIcons, u as ensureIcons, v as iconsPending, w as nearIconNames, x as parseIconReference, y as parseReference, z as resolveIcon, A as resolveReference, B as unresolvedReference } from './catalog-refs-BgotJhR5.js';
16
+ import { a as Finding, J as JsonPatchOperation, d as FindingFix } from './finding-mcHslZLA.js';
17
+ export { e as FindingCategory, f as FindingFocus, b as FindingLocation, F as FindingReport, c as FindingSeverity, g as FindingSuggestion, V as ValidationIssue } from './finding-mcHslZLA.js';
18
+ export { a as CATALOG_SCHEMA, b as CatalogDisplayKind, C as CatalogRecordKind, c as catalogDisplayKinds, d as catalogIconKinds, e as catalogSchemaNames } from './catalog-schemas-BX-VEc5Q.js';
19
19
  import { continueOverfull as continueOverfull$1, paginate as paginate$1 } from './pagination.js';
20
- export { C as ContinuationResult, d as ContinuedSlide, O as OPFPaginationError, P as PaginatedPage, e as PaginationMapping, f as PaginationOptions, g as PaginationResult, a as PresentationPaginationOptions, b as PresentationPaginationResult, S as SlideContext, h as SlideContextDiagnostic, i as SlideContextOptions, j as blockUnits, k as continuationPages, l as paginateSlide, r as resolveSlideContext } from './pagination-CZQQYk7L.js';
20
+ export { C as ContinuationResult, d as ContinuedSlide, O as OPFPaginationError, P as PaginatedPage, e as PaginationMapping, f as PaginationOptions, g as PaginationResult, a as PresentationPaginationOptions, b as PresentationPaginationResult, S as SlideContext, h as SlideContextDiagnostic, i as SlideContextOptions, j as blockUnits, k as continuationPages, l as paginateSlide, r as resolveSlideContext } from './pagination-C0FPjO29.js';
21
21
  export { ApplyPatchOptions, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, PatchResult, applyPatch, documentHash, idToken, isIdToken, resolveIdPatch, resolveIdPointer, toIdPatch, toIdPointer } from './patch.js';
22
22
  export { AssignIdsContext, AssignIdsOptions, AssignIdsResult, AssignedId, IdErrorCode, OPFIdError, PatchScope, PatchScopeKind, PatchTouch, assignIds, touches } from './ids.js';
23
23
  export { DiffOptions, MergeConflict, MergeOptions, MergeResult, PresentationDiff, diff, merge } from './diff.js';
@@ -26,8 +26,8 @@ export { FromMarkdownOptions, FromMarkdownResult, OPFMarkdownError, ToMarkdownOp
26
26
  export { StringifyOptions, parse, stringify } from './deck.js';
27
27
  export { DataCell, DataImportOptions, ImportedChart, ImportedChartData, ImportedChartType, ImportedTable, IngestOptions, OPFDataImportError, TabularData, ingest, parseTabularData } from './data.js';
28
28
  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-B_k-WTex.js';
29
- export { FONT_POLICY, FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './font-policy.js';
30
- export { a as DECK_FORMATS, D as DeckFormat, P as ParseOptions, d as deckFormatOf } from './deck-report-BVlQZ42f.js';
29
+ export { FONT_POLICY, FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement, FontScriptReplacement, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './font-policy.js';
30
+ export { a as DECK_FORMATS, D as DeckFormat, P as ParseOptions, d as deckFormatOf } from './deck-report-BYkbL7uT.js';
31
31
  import './json-BFSdESOE.js';
32
32
  import './shape-geometry.js';
33
33
 
@@ -72,6 +72,21 @@ declare function resolveSlideVariables<T>(slide: T, values: {
72
72
  darkBackground?: boolean;
73
73
  }): T;
74
74
 
75
+ /** One stale copy `embed` replaced (refreshStaleLayouts). */
76
+ interface RefreshedRecord {
77
+ group: string;
78
+ kind: 'layouts';
79
+ id: string;
80
+ source?: string;
81
+ /** `current`: replaced by the current record; `renamed`: a layout 0.35 removed, its slides moved to `renamedTo` and the copy dropped. */
82
+ how: 'current' | 'renamed';
83
+ renamedTo?: string;
84
+ /** True when the record the slides draw on changed (FindingFix `changesDrawing`): the 0.35 engine draws them, which may look different. */
85
+ changesDrawing?: true;
86
+ /** JSON Pointers of the slide layouts and block pins rewritten so that every slide keeps its layout and every block its region. */
87
+ references: string[];
88
+ }
89
+
75
90
  /** Whether two records have the same content once embedded (`$schema`, `id` and `x-*` ignored). */
76
91
  declare function sameRecord(a: unknown, b: unknown): boolean;
77
92
  /** One record `embed` or `copySlides` added to a document. */
@@ -85,14 +100,23 @@ interface EmbedResult {
85
100
  document: Presentation;
86
101
  /** The records added, in the order they were embedded. */
87
102
  added: EmbeddedRecord[];
103
+ /**
104
+ * OPF 0.35: the embedded copies of built-in layout records from before 0.35 that failed the layout schema and were replaced
105
+ * (`how`: `current` or `renamed`; see refreshStaleLayouts), with `changesDrawing` when the record changed. Empty for any other
106
+ * deck. Take `document` whenever this or `added` is non-empty.
107
+ */
108
+ refreshed: RefreshedRecord[];
88
109
  /** The references that resolve nowhere: they stay as written. */
89
110
  unresolved: UnresolvedReferenceDiagnostic[];
90
111
  }
91
112
  /**
92
113
  * Embed every record the document references, once, in the group it resolves in, together with the records those
93
- * records reference (a theme's colour and font schemes). A bare id that resolves in the host's default catalog is
114
+ * records reference (a theme's color and font schemes). A bare id that resolves in the host's default catalog is
94
115
  * embedded under `catalogs.default` (whose `source` is set to that catalog's). Records already embedded are kept as
95
- * they are; catalog display metadata (`x-*`), `$schema` and `id` are stripped from the copies. Idempotent.
116
+ * they are, but for an embedded copy of a built-in layout record from before OPF 0.35 that fails the layout schema: `catalogs.default`
117
+ * mirrors the built-in records, so it is replaced first (`refreshed`): it takes the current record (and the pins of its slides the 0.35
118
+ * region names), or, for a layout 0.35 removed, its slides move to the replacement. Catalog display metadata (`x-*`), `$schema` and
119
+ * `id` are stripped from the copies. Idempotent.
96
120
  */
97
121
  declare function embed$1(document: unknown, options?: CatalogOptions): EmbedResult;
98
122
  /** A copied record that did not keep its reference. */
@@ -234,7 +258,7 @@ declare function moveToCustom(document: unknown, ref: CatalogRef, options?: Cata
234
258
  }): MoveToCustomResult;
235
259
 
236
260
  /**
237
- * The theme, colour scheme and font scheme one slide (or the deck) is drawn with, resolved the one way every engine
261
+ * The theme, color scheme and font scheme one slide (or the deck) is drawn with, resolved the one way every engine
238
262
  * resolves them: the slide's design, then the deck's design, then the theme, then the engine default, per field.
239
263
  * Catalog-free: records come from the document's catalogs groups and the catalogs the host registered.
240
264
  */
@@ -245,7 +269,7 @@ interface ResolvedDesignRecords {
245
269
  fontScheme: Rec;
246
270
  /** Where the theme reference is written, dotted (`design.theme`, `slides.2.design.theme`). */
247
271
  themePath: string;
248
- /** Where the colour-scheme reference that applies is written, dotted. */
272
+ /** Where the color-scheme reference that applies is written, dotted. */
249
273
  colorSchemePath: string;
250
274
  /** Where the font-scheme reference that applies is written, dotted. */
251
275
  fontSchemePath: string;
@@ -260,7 +284,7 @@ interface ResolvedDesignRecords {
260
284
  colorScheme?: RecordProvenance;
261
285
  fontScheme?: RecordProvenance;
262
286
  };
263
- /** Unresolved references, in the order theme, colour scheme, font scheme. */
287
+ /** Unresolved references, in the order theme, color scheme, font scheme. */
264
288
  diagnostics: UnresolvedReferenceDiagnostic[];
265
289
  }
266
290
  /**
@@ -331,7 +355,7 @@ interface SlideStats {
331
355
  layout: string | null;
332
356
  section: string | null;
333
357
  hidden: boolean;
334
- /** Content payload kinds present on the slide (root, blocks and regions), in a fixed order. */
358
+ /** Content payload kinds present on the slide (root and blocks), in a fixed order. */
335
359
  payloads: string[];
336
360
  words: {
337
361
  content: number;
@@ -403,7 +427,7 @@ interface PresentationStats {
403
427
  /** Slides whose own `design` object overrides the deck design. */
404
428
  withOwnDesign: number;
405
429
  };
406
- /** Content payloads by kind, counted across slide roots, blocks and promoted regions. */
430
+ /** Content payloads by kind, counted across slide roots and blocks. */
407
431
  payloads: {
408
432
  text: number;
409
433
  items: number;
@@ -419,9 +443,9 @@ interface PresentationStats {
419
443
  video: number;
420
444
  /** Block entries at any depth. */
421
445
  blocks: number;
422
- /** Promoted region payloads (`left`, `top:center`, ...). */
423
- regions: number;
424
- /** Blocks and regions that hold nested `blocks`. */
446
+ /** Root blocks placed in a cell of their slide's grid (`"region": "top:center"` on a slide without a layout). */
447
+ cells: number;
448
+ /** Blocks that hold nested `blocks`. */
425
449
  groups: number;
426
450
  /** Deepest block nesting; 0 when no slide has blocks. */
427
451
  maxDepth: number;
@@ -601,6 +625,78 @@ interface EditResult {
601
625
  /** Apply a JSON Patch (`add`, `remove`, `replace`, `move`, `copy`, `test`) to a deck and check the result's format and references. */
602
626
  declare function edit$1(deck: unknown, patch: unknown, options?: EditOptions): EditResult;
603
627
 
628
+ /** How many validate-and-fix rounds `fix` runs at most when `maxRounds` is not given. */
629
+ declare const DEFAULT_FIX_ROUNDS = 10;
630
+ /**
631
+ * The checks whose safe fixes `fix` applies by default: those that repair the document (is it well-formed OPF, does every reference
632
+ * resolve, does it keep the host's policy, does every pin name a region). The others are audits (accessibility, content, and the
633
+ * categories of other producers such as `narrative`): advice on how the deck reads or looks, applied only with `audits: true`.
634
+ */
635
+ declare const FIX_REPAIR_CATEGORIES: readonly ValidationCategory[];
636
+ interface FixOptions extends ValidateOptions {
637
+ /** The most rounds of fixes (each followed by a validation). Default `DEFAULT_FIX_ROUNDS`. */
638
+ maxRounds?: number;
639
+ /**
640
+ * Apply the safe fixes of the audits too (findings outside FIX_REPAIR_CATEGORIES: accessibility, content, ...). Default false: a
641
+ * migration repairs the document and never restyles its content. The findings are reported either way.
642
+ */
643
+ audits?: boolean;
644
+ }
645
+ /** One safe fix `fix` applied. */
646
+ interface AppliedFix {
647
+ /** The round it was applied in, from 1. */
648
+ round: number;
649
+ /** The finding it repaired: its rule and JSON Pointer, as validate reported them in that round. */
650
+ ruleId: string;
651
+ path: string;
652
+ /** The fix's `id` (its title when it has none) and title. */
653
+ fix: string;
654
+ title: string;
655
+ /**
656
+ * True when the fix can change how a slide draws (FindingFix `changesDrawing`): the fixed deck keeps every word and is valid, and the
657
+ * engine draws it in the new form, such as `rename-layout` from `agenda-split`, `use-current-record` or `remove:contentDirection`.
658
+ */
659
+ changesDrawing: boolean;
660
+ /** The JSON Patch that was applied (with the removal of a `design` object the fixes of its round emptied). */
661
+ patch: JsonPatchOperation[];
662
+ }
663
+ interface FixResult {
664
+ /** The fixed deck (a copy). */
665
+ document: Presentation;
666
+ /** The safe fixes applied, in order. */
667
+ applied: AppliedFix[];
668
+ /** The findings of the fixed deck: the last validation's. */
669
+ findings: Finding[];
670
+ /** The last validation's report (the fixed deck's). */
671
+ report: ValidationReport;
672
+ /** How many rounds applied fixes. */
673
+ rounds: number;
674
+ /**
675
+ * Why it stopped: `stable` when no safe fix is left; `max-rounds` when the findings still carried safe fixes after `maxRounds`
676
+ * rounds; `no-progress` when the safe fixes left no longer apply, or return the deck to a state it had.
677
+ */
678
+ stopped: "stable" | "max-rounds" | "no-progress";
679
+ }
680
+ type Patch = FindingFix & {
681
+ patch: JsonPatchOperation[];
682
+ };
683
+ /**
684
+ * A fix `fix` can apply: marked safe and a JSON Patch. A `focus` fix (`focus-language`, `focus-alt`: a field a person writes) is never
685
+ * applied nor counted, whatever its `safe`; neither is a fix with no operations.
686
+ */
687
+ declare const isSafePatch: (fix: FindingFix) => fix is Patch;
688
+ /**
689
+ * Apply the safe fixes of a deck's findings until none is left: validate, apply one safe fix per finding (fixes whose patches
690
+ * write overlapping parts of the deck wait for the next round, which validates again), and repeat, at most `maxRounds` times.
691
+ * Only the fixes of the repair checks (FIX_REPAIR_CATEGORIES) are applied unless `audits` is true. Fixes not marked `safe`, and
692
+ * `focus` fixes, are never applied. A `design` object that a round's fixes emptied (two removed keys of one slide) is removed with
693
+ * them. Each applied fix says whether it can change how a slide draws (`changesDrawing`). Takes a parsed deck (not text); the input
694
+ * is never changed.
695
+ * Validation takes `options` as `validate` does (in Node the default catalog is registered when `catalogs` is omitted). Load the
696
+ * icon sets the deck names first (`ensureIcons`), so a renamed icon is reported with its fix.
697
+ */
698
+ declare function fix$1(document: unknown, options?: FixOptions): FixResult;
699
+
604
700
  /** The values of one deck, keyed by variable id. */
605
701
  type FillRecord = Record<string, unknown>;
606
702
  interface FillOptions extends Pick<ResolveVariablesOptions, "partial" | "examples"> {
@@ -681,6 +777,8 @@ declare const paginate: typeof paginate$1;
681
777
  declare const continueOverfull: typeof continueOverfull$1;
682
778
  /** `embed` with the gallery registered when `catalogs` is omitted, as `opf embed` does. */
683
779
  declare const embed: typeof embed$1;
780
+ /** `fix` with the gallery registered when `catalogs` is omitted, as `opf fix` does. */
781
+ declare const fix: typeof fix$1;
684
782
  /** `edit` with the gallery registered for the check when `catalogs` is omitted, as `opf edit` does. */
685
783
  declare const edit: typeof edit$1;
686
784
  /**
@@ -724,5 +822,5 @@ declare function open(input: string | Uint8Array | ArrayBuffer, options?: OpenOp
724
822
  */
725
823
  declare function save(deck: Presentation, path: string, options?: SaveOptions): Promise<SaveResult>;
726
824
 
727
- export { Catalog, CatalogKind, CatalogOptions, ConvertFormat, ConvertInput, ConvertOptions, ConvertResult, Finding, FontFamilies, JsonPatchOperation, OPFMoveToCustomError, OpenOptions, Presentation, RecordProvenance, ResolveVariablesOptions, SLIDE_SCOPED_BUILTINS, SaveOptions, SaveResult, TextMeasurement, UnresolvedReferenceDiagnostic, VariableDiagnostic, continueOverfull, convert, copySlides, createValidator, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, open, paginate, resolveDesignRecords, resolveDrawnFontFamilies, resolveFontScheme, resolveSlideVariables, sameRecord, save, stats, updateFromCatalog, validate };
728
- export type { CatalogPatchOperation, CatalogRecordChange, CatalogRef, CatalogUpdate, CopiedRecordRename, CopySlidesResult, DatasetFact, EditOptions, EditResult, EmbedResult, EmbeddedRecord, FillOptions, FillRecord, FillResult, FilledDeck, HeaderFooterFact, MoveToCustomErrorCode, MoveToCustomPatchOperation, MoveToCustomResult, MovedRecord, PresentationStats, ReferenceFact, ResolvedDesignRecords, SlideScopedBuiltin, SlideSizeFact, SlideStats, StatsOptions, StatsSlideRef, TableFact };
825
+ export { Catalog, CatalogKind, CatalogOptions, ConvertFormat, ConvertInput, ConvertOptions, ConvertResult, DEFAULT_FIX_ROUNDS, FIX_REPAIR_CATEGORIES, Finding, FindingFix, FontFamilies, JsonPatchOperation, OPFMoveToCustomError, OpenOptions, Presentation, RecordProvenance, ResolveVariablesOptions, SLIDE_SCOPED_BUILTINS, SaveOptions, SaveResult, TextMeasurement, UnresolvedReferenceDiagnostic, ValidateOptions, ValidationCategory, ValidationReport, VariableDiagnostic, continueOverfull, convert, copySlides, createValidator, edit, embed, fill, fillRecords, fix, isSafePatch, localAssetSources, moveToCustom, open, paginate, resolveDesignRecords, resolveDrawnFontFamilies, resolveFontScheme, resolveSlideVariables, sameRecord, save, stats, updateFromCatalog, validate };
826
+ export type { AppliedFix, CatalogPatchOperation, CatalogRecordChange, CatalogRef, CatalogUpdate, CopiedRecordRename, CopySlidesResult, DatasetFact, EditOptions, EditResult, EmbedResult, EmbeddedRecord, FillOptions, FillRecord, FillResult, FilledDeck, FixOptions, FixResult, HeaderFooterFact, MoveToCustomErrorCode, MoveToCustomPatchOperation, MoveToCustomResult, MovedRecord, PresentationStats, ReferenceFact, RefreshedRecord, ResolvedDesignRecords, SlideScopedBuiltin, SlideSizeFact, SlideStats, StatsOptions, StatsSlideRef, TableFact };
package/dist/index.js CHANGED
@@ -1,28 +1,28 @@
1
1
  import { defaultCatalogs } from './chunk-XJUMFH33.js';
2
- import { stats, embed, edit, OPFApiError, asApiError } from './chunk-AGYPRTEC.js';
3
- export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, updateFromCatalog } from './chunk-AGYPRTEC.js';
2
+ import { stats, embed, fix, edit, OPFApiError, asApiError } from './chunk-MVPQEMCP.js';
3
+ export { DEFAULT_FIX_ROUNDS, FIX_REPAIR_CATEGORIES, OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, fill, fillRecords, isSafePatch, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, updateFromCatalog } from './chunk-MVPQEMCP.js';
4
4
  export { specFileEntries, specFileKinds, specFilePaths } from './chunk-W4DYDRV2.js';
5
- export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-FK5XG742.js';
6
- export { OPFDataImportError, ingest, parseTabularData } from './chunk-244OPLAV.js';
7
- import { paginate, continueOverfull } from './chunk-L3MCLD3X.js';
8
- export { OPFPaginationError, blockUnits, continuationPages, paginateSlide } from './chunk-L3MCLD3X.js';
9
- export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-MUILZGRY.js';
10
- export { fromMarkdown, toMarkdown } from './chunk-MAFJ5O2D.js';
11
- import './chunk-X72WPTST.js';
12
- export { OPFFormatError, format } from './chunk-HHVQ2SDT.js';
5
+ export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-6VGLE7C5.js';
6
+ export { OPFDataImportError, ingest, parseTabularData } from './chunk-GGN3NQDK.js';
7
+ import { paginate, continueOverfull } from './chunk-GKUAVSXU.js';
8
+ export { OPFPaginationError, blockUnits, continuationPages, paginateSlide } from './chunk-GKUAVSXU.js';
9
+ export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-2GCTKQDD.js';
10
+ export { fromMarkdown, toMarkdown } from './chunk-4UMZDDJG.js';
11
+ import './chunk-P2ACZJUL.js';
12
+ export { OPFFormatError, format } from './chunk-MS2LPR7F.js';
13
13
  import './chunk-RYZPBJLB.js';
14
- export { explain } from './chunk-AAWHOCXS.js';
15
- import './chunk-CQXBGZQP.js';
16
- import './chunk-2B6GLT2O.js';
17
- export { OPFMarkdownError } from './chunk-ABA2D6X5.js';
18
- import './chunk-FCSYIBVR.js';
19
- export { OPFIdError, assignIds, touches } from './chunk-XLSWZSQS.js';
20
- export { diff, merge } from './chunk-SR6T4LKI.js';
21
- import { validate, createValidator, OPFValidationError } from './chunk-AEHDXNZX.js';
22
- export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogIconKinds, catalogSchemaNames, documentHash, findValidationRule, idToken, isIdToken, resolveDrawnFontFamilies, resolveIdPatch, resolveIdPointer, resolveSlideContext, toIdPatch, toIdPointer, validateCatalogRecord, validationCategories, validationRules } from './chunk-AEHDXNZX.js';
14
+ export { explain } from './chunk-7KUUIL7W.js';
15
+ import './chunk-VMPOCXTE.js';
16
+ import './chunk-NPRNWPP4.js';
17
+ export { OPFMarkdownError } from './chunk-ZZWX4W2G.js';
18
+ import './chunk-ARPMSD7V.js';
19
+ export { OPFIdError, assignIds, touches } from './chunk-JQNT37IO.js';
20
+ export { diff, merge } from './chunk-3ZTKRX7F.js';
21
+ import { validate, createValidator, OPFValidationError } from './chunk-KNMMEE67.js';
22
+ export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogIconKinds, catalogSchemaNames, documentHash, findValidationRule, idToken, isIdToken, resolveDrawnFontFamilies, resolveIdPatch, resolveIdPointer, resolveSlideContext, toIdPatch, toIdPointer, validateCatalogRecord, validationCategories, validationRules } from './chunk-KNMMEE67.js';
23
23
  import './chunk-JBARNYFR.js';
24
- export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-LCT5ZV3Q.js';
25
- 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, asciiDigits, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartDrawDiagnostics, chartDrawPlan, chartNumber, coerceVariableValue, datasetDiagnostics, diagramsPending, embedIcons, ensureDiagrams, ensureIcons, ensureShapes, formatDataNumber, formatNumber, formatPercentNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, iconsPending, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isPlaceLabel, isSupportedNumberingSystem, isTemplate, isXYChartType, languageInEffect, listBuiltinVariables, listVariables, localizeDigits, markLabelColor, nearIconNames, normalizeLanguageFamily, numberFormatError, numberLocale, numberingSystemExtension, numberingSystemOf, numeralScripts, parseIconReference, parseReference, plainLanguageTag, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveIcon, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, shapesPending, suggestChartNumberFix, supportedNumberingSystems, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-CJVKOJ6B.js';
24
+ export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-3KPTVK77.js';
25
+ 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, asciiDigits, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartDrawDiagnostics, chartDrawPlan, chartNumber, coerceVariableValue, datasetDiagnostics, diagramsPending, embedIcons, ensureDiagrams, ensureIcons, ensureShapes, formatDataNumber, formatNumber, formatPercentNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, iconsPending, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isPlaceLabel, isSupportedNumberingSystem, isTemplate, isXYChartType, languageInEffect, listBuiltinVariables, listVariables, localizeDigits, markLabelColor, nearIconNames, normalizeLanguageFamily, numberFormatError, numberLocale, numberingSystemExtension, numberingSystemOf, numeralScripts, parseIconReference, parseReference, plainLanguageTag, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveIcon, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, shapesPending, suggestChartNumberFix, supportedNumberingSystems, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-LDLLZQPP.js';
26
26
  import './chunk-BLCDUM7B.js';
27
27
  import './chunk-PRXZD2II.js';
28
28
 
@@ -47,8 +47,9 @@ var stats2 = (presentation2, options) => stats(presentation2, withDefaultCatalog
47
47
  var paginate2 = (input, options) => paginate(input, withDefaultCatalog(options));
48
48
  var continueOverfull2 = (input, options) => continueOverfull(input, withDefaultCatalog(options));
49
49
  var embed2 = (document, options) => embed(document, withDefaultCatalog(options));
50
+ var fix2 = (document, options) => fix(document, withDefaultCatalog(options));
50
51
  var edit2 = (deck, patch, options) => edit(deck, patch, withDefaultCatalog(options));
51
- var engine = () => import('./conversion-CSQ5EHD2.js');
52
+ var engine = () => import('./conversion-VWCH3NKR.js');
52
53
  var rethrow = (error, fallback) => {
53
54
  if (error instanceof OPFValidationError) throw error;
54
55
  throw asApiError(OPFApiError, error, fallback);
@@ -77,4 +78,4 @@ async function save(deck, path, options = {}) {
77
78
  }
78
79
  }
79
80
 
80
- export { continueOverfull2 as continueOverfull, convert, createValidator2 as createValidator, edit2 as edit, embed2 as embed, open, paginate2 as paginate, save, stats2 as stats, validate2 as validate };
81
+ export { continueOverfull2 as continueOverfull, convert, createValidator2 as createValidator, edit2 as edit, embed2 as embed, fix2 as fix, open, paginate2 as paginate, save, stats2 as stats, validate2 as validate };
@@ -2,7 +2,7 @@ import { Catalog } from './composition.js';
2
2
  import { Presentation } from './index.js';
3
3
  import { Finding, FindingLocation } from './index.js';
4
4
  import { ValidateOptions, ValidationReport } from './index.js';
5
- import './composition-CvtvgBDE.js';
5
+ import './composition-BmJfljJl.js';
6
6
  import './chart-data-B_k-WTex.js';
7
7
  import './shape-geometry.js';
8
8
  import './json-BFSdESOE.js';
package/dist/markdown.js CHANGED
@@ -1,12 +1,12 @@
1
- export { fromMarkdown, toMarkdown } from './chunk-MAFJ5O2D.js';
1
+ export { fromMarkdown, toMarkdown } from './chunk-4UMZDDJG.js';
2
2
  import './chunk-RYZPBJLB.js';
3
- import './chunk-CQXBGZQP.js';
4
- import './chunk-2B6GLT2O.js';
5
- export { OPFMarkdownError } from './chunk-ABA2D6X5.js';
6
- import './chunk-FCSYIBVR.js';
7
- import './chunk-AEHDXNZX.js';
3
+ import './chunk-VMPOCXTE.js';
4
+ import './chunk-NPRNWPP4.js';
5
+ export { OPFMarkdownError } from './chunk-ZZWX4W2G.js';
6
+ import './chunk-ARPMSD7V.js';
7
+ import './chunk-KNMMEE67.js';
8
8
  import './chunk-JBARNYFR.js';
9
- import './chunk-LCT5ZV3Q.js';
10
- import './chunk-CJVKOJ6B.js';
9
+ import './chunk-3KPTVK77.js';
10
+ import './chunk-LDLLZQPP.js';
11
11
  import './chunk-BLCDUM7B.js';
12
12
  import './chunk-PRXZD2II.js';
@@ -1,12 +1,12 @@
1
- export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-BVlQZ42f.js';
2
- import { F as FontsHandle, E as EmbeddedFace, R as Renderer, a as Reporter, P as Peer, b as PptxModule, O as OPFApiError } from './conversion-CyNRlWGw.js';
3
- export { C as ConversionPlan, D as Diagnostic, c as EXPORT_FORMATS, d as EXPORT_TEXT, e as ExportContext, f as ExportContinuedSlide, g as ExportFile, h as ExportFontSummary, i as ExportFormat, j as ExportOptions, k as ExportResult, l as ExportRun, m as ExportText, I as ImportOptions, n as ImportResult, o as OPFExportError, p as OPFImportError, q as PEER_RANGES, r as PPTX_PACKAGE, s as PreparedExport, t as RENDER_EXTRAS, u as RENDER_PACKAGE, v as ReportFinding, w as ResolvedExportOptions, S as SlideSelection, x as Source, V as VERSIONS, y as asApiError, z as assetRoot, A as checkDate, B as checkOptions, G as checkRenamedOptions, H as checkScale, J as deckFileFormat, K as exportFormatOf, L as finishReport, M as importPresentation, N as loadPptx, Q as loadRenderer, T as locatePackage, U as missingPeerFrom, W as parseSlideSelection, X as planConversion, Y as prepareExport, Z as reaches, _ as readInput, $ as reportThrown, a0 as resolveExportOptions, a1 as runExport, a2 as runPreparedExport, a3 as writePlanned } from './conversion-CyNRlWGw.js';
1
+ export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-BYkbL7uT.js';
2
+ import { F as FontsHandle, E as EmbeddedFace, R as Renderer, a as Reporter, P as Peer, b as PptxModule, O as OPFApiError } from './conversion-BbXhlurO.js';
3
+ export { C as ConversionPlan, D as Diagnostic, c as EXPORT_FORMATS, d as EXPORT_TEXT, e as ExportContext, f as ExportContinuedSlide, g as ExportFile, h as ExportFontSummary, i as ExportFormat, j as ExportOptions, k as ExportResult, l as ExportRun, m as ExportText, I as ImportOptions, n as ImportResult, o as OPFExportError, p as OPFImportError, q as PEER_RANGES, r as PPTX_PACKAGE, s as PreparedExport, t as RENDER_EXTRAS, u as RENDER_PACKAGE, v as ReportFinding, w as ResolvedExportOptions, S as SlideSelection, x as Source, V as VERSIONS, y as asApiError, z as assetRoot, A as checkDate, B as checkOptions, G as checkRenamedOptions, H as checkScale, J as deckFileFormat, K as exportFormatOf, L as finishReport, M as importPresentation, N as loadPptx, Q as loadRenderer, T as locatePackage, U as missingPeerFrom, W as parseSlideSelection, X as planConversion, Y as prepareExport, Z as reaches, _ as readInput, $ as reportThrown, a0 as resolveExportOptions, a1 as runExport, a2 as runPreparedExport, a3 as writePlanned } from './conversion-BbXhlurO.js';
4
4
  import { Catalog } from './composition.js';
5
5
  import { Fonts } from './composition.js';
6
6
  import { PresentationPaginationResult } from './index.js';
7
- import './presentation-s9262acV.js';
8
- import './validation-types-CYbsUuZ9.js';
9
- import './finding-l9dlQ2NF.js';
7
+ import './presentation-Dx-kZC8Y.js';
8
+ import './validation-types-DKIe1RQW.js';
9
+ import './finding-mcHslZLA.js';
10
10
  import './json-BFSdESOE.js';
11
11
  import './chart-data-B_k-WTex.js';
12
12
  import './shape-geometry.js';
@@ -87,6 +87,11 @@ declare function leaseSharedFonts(renderer: Renderer, presentation: unknown, use
87
87
  declare function embeddedFor(handle: FontsHandle, text?: "fonts" | "system" | "paths"): (EmbeddedFace & {
88
88
  embed?: "used";
89
89
  })[];
90
+ /**
91
+ * One `fonts/font-substituted` info finding per requested family that was drawn with another face (Aptos with Intos): which face
92
+ * stood in, how close it is, and why when the font policy says (a proprietary font OPF does not bundle). Not one per slide or weight.
93
+ */
94
+ declare function reportSubstitutions(reporter: Reporter, handle: FontsHandle): void;
90
95
 
91
96
  interface ImportRun {
92
97
  /** The imported presentation, undefined when `fromPptx` threw (the reporter then holds the error finding). */
@@ -186,7 +191,10 @@ interface MeasuringFontsOptions {
186
191
  interface MeasuringFonts {
187
192
  /** The fonts `opf convert` draws `deck` with; absent for an estimate or a rejected format. */
188
193
  fonts?: Fonts;
189
- /** Why there are no fonts: the missing or too old peer (`peer-not-installed`, `peer-too-old`) that measuring needs. */
194
+ /**
195
+ * Why there are no fonts: the missing or too old peer (`peer-not-installed`, `peer-too-old`) that measuring needs. A font package
196
+ * the deck's faces need is one too: its `details` then have `packages`, `faces` and `install` (see `missingFontPackages`).
197
+ */
190
198
  estimated?: OPFApiError;
191
199
  /** A real renderer format refusal; the caller must still validate the original source and return its report. */
192
200
  invalidDocument?: true;
@@ -199,9 +207,15 @@ interface MeasuringFonts {
199
207
  * fonts and says why in `estimated`. With `fontFolders` the fonts are required, so a missing renderer throws.
200
208
  */
201
209
  declare function measuringFonts(deck: unknown, options: MeasuringFontsOptions): Promise<MeasuringFonts>;
210
+ /** The font packages a measurement found missing: from `estimated` when it is a font package error, else undefined. */
211
+ declare function missingFontPackages(estimated: OPFApiError | undefined): {
212
+ packages: string[];
213
+ faces: string[];
214
+ install?: string;
215
+ } | undefined;
202
216
 
203
217
  /** The catalogs a call registers when it names none: `[gallery, galleryIconSets()]`. */
204
218
  declare function defaultCatalogs(): readonly Catalog[];
205
219
 
206
- export { FontsHandle, OPFApiError, Peer, PptxModule, Renderer, Reporter, checkDestinations, checkOutputPattern, createZip, deckStem, defaultCatalogs, embeddedFor, iconSourceReader, leaseSharedFonts, listFontDirectories, localAssetProblems, measuringFonts, padNumber, paginateDeck, pointerOf, prepareFonts, publishNew, runImport, stemOf, writeFiles };
220
+ export { FontsHandle, OPFApiError, Peer, PptxModule, Renderer, Reporter, checkDestinations, checkOutputPattern, createZip, deckStem, defaultCatalogs, embeddedFor, iconSourceReader, leaseSharedFonts, listFontDirectories, localAssetProblems, measuringFonts, missingFontPackages, padNumber, paginateDeck, pointerOf, prepareFonts, publishNew, reportSubstitutions, runImport, stemOf, writeFiles };
207
221
  export type { AssetProblem, ImportRun, MeasuringFonts, MeasuringFontsOptions, PaginateDeckOptions, PaginatedDeck, PlannedFile };