@openpresentation/opf 0.11.4 → 0.12.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 (62) hide show
  1. package/README.md +16 -0
  2. package/dist/audit.d.ts +156 -0
  3. package/dist/audit.js +7 -0
  4. package/dist/{catalogs-CUClB3nl.d.ts → catalogs-u6TEeMcz.d.ts} +1 -1
  5. package/dist/catalogs.d.ts +2 -2
  6. package/dist/catalogs.js +2 -1
  7. package/dist/{chunk-NSVVQ52O.js → chunk-32DIB5BN.js} +8 -6
  8. package/dist/chunk-4FWCY4ZV.js +198 -0
  9. package/dist/{chunk-3H2U7FDR.js → chunk-6TSDIPSH.js} +1861 -247
  10. package/dist/chunk-FYLJVF7X.js +18448 -0
  11. package/dist/{chunk-HJL64ETN.js → chunk-GJKJL4YY.js} +14 -0
  12. package/dist/chunk-JENJZR3F.js +1690 -0
  13. package/dist/{chunk-3OJN7QAW.js → chunk-JVTN3HPP.js} +18 -4
  14. package/dist/{chunk-KJKASEPE.js → chunk-RVN5C2FX.js} +737 -26
  15. package/dist/chunk-S5W34SIJ.js +1 -0
  16. package/dist/chunk-S667QI3M.js +261 -0
  17. package/dist/chunk-UQKJWHSS.js +1332 -0
  18. package/dist/{chunk-RXNFDGPC.js → chunk-WXSPETQ6.js} +311 -40
  19. package/dist/{composition-Dl-d9FRj.d.ts → composition-DWbCiMwF.d.ts} +559 -10
  20. package/dist/composition.d.ts +1 -1
  21. package/dist/composition.js +2 -1
  22. package/dist/convert.d.ts +261 -0
  23. package/dist/convert.js +1107 -0
  24. package/dist/diff.d.ts +145 -0
  25. package/dist/diff.js +604 -0
  26. package/dist/docs.js +68 -14
  27. package/dist/examples.d.ts +1 -1
  28. package/dist/font-policy.d.ts +15 -0
  29. package/dist/font-policy.js +1 -1
  30. package/dist/format.d.ts +20 -0
  31. package/dist/format.js +83 -0
  32. package/dist/index.d.ts +173 -24
  33. package/dist/index.js +926 -262
  34. package/dist/lint.d.ts +4 -4
  35. package/dist/lint.js +6 -5
  36. package/dist/markdown.d.ts +74 -0
  37. package/dist/markdown.js +1941 -0
  38. package/dist/pagination.d.ts +1 -1
  39. package/dist/pagination.js +6 -5
  40. package/dist/patch.d.ts +99 -0
  41. package/dist/patch.js +6 -0
  42. package/dist/{presentation-j5PVrqfV.d.ts → presentation-DRx4hpNZ.d.ts} +451 -16
  43. package/dist/repo-readme.js +1 -1
  44. package/dist/{schemas-X_NniU4A.d.ts → schemas-BSjlG8-R.d.ts} +28 -0
  45. package/dist/schemas.d.ts +1 -1
  46. package/dist/schemas.js +1 -1
  47. package/dist/spec/reference/font-policy.json +311 -40
  48. package/dist/spec/reference/font-policy.schema.json +40 -0
  49. package/dist/spec/reference/symbol-font-encodings.json +18354 -0
  50. package/dist/spec/reference/symbol-font-encodings.schema.json +156 -0
  51. package/dist/spec/schemas/opf.schema.json +591 -22
  52. package/dist/spec-files.d.ts +1 -1
  53. package/dist/spec-files.js +1 -1
  54. package/dist/symbol-font-encodings.d.ts +128 -0
  55. package/dist/symbol-font-encodings.js +1 -0
  56. package/dist/types.d.ts +4 -4
  57. package/dist/validator-bu396ffT.d.ts +172 -0
  58. package/dist/validator.d.ts +4 -36
  59. package/dist/validator.js +5 -4
  60. package/package.json +31 -2
  61. package/dist/chunk-FDCWQHWO.js +0 -1366
  62. /package/dist/{chunk-AEUSVEUY.js → chunk-3ZGSWEHK.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { validatePresentation, validationDefinition, validateCatalogRecord } from './chunk-FDCWQHWO.js';
2
- import { schemas, schemaEntries } from './chunk-KJKASEPE.js';
3
- import { catalogKinds, catalogEntries, catalogSchemaNames } from './chunk-AEUSVEUY.js';
1
+ import { validatePresentation, unusedReferenceWarnings, validationDefinition, validateCatalogRecord } from './chunk-UQKJWHSS.js';
2
+ import { catalogKinds, catalogEntries, catalogSchemaNames } from './chunk-3ZGSWEHK.js';
3
+ import { schemas, schemaEntries } from './chunk-RVN5C2FX.js';
4
4
  import { parseTree, printParseErrorCode, getNodePath } from 'jsonc-parser';
5
5
 
6
6
  var own = (value, key) => Object.hasOwn(value, key);
@@ -367,7 +367,9 @@ function distance(a, b) {
367
367
  }
368
368
  function lintPresentation(document, options = {}) {
369
369
  optionsChecked(options);
370
- const validation = validatePresentation(document), diagnostics = validation.errors.map((issue) => schemaDiagnostic(issue));
370
+ const validation = validatePresentation(document), diagnostics = validation.errors.map(
371
+ (issue) => typeof issue.params.code === "string" && issue.keyword === "opf" ? { ...schemaDiagnostic(issue), ruleId: `opf/${issue.params.code}` } : schemaDiagnostic(issue)
372
+ );
371
373
  const catalogs = catalogContext(document, options, diagnostics), seen = /* @__PURE__ */ new Set();
372
374
  const assetValues = object(document) && object(document.assets) ? document.assets : {};
373
375
  for (const field of fields(document)) {
@@ -515,6 +517,18 @@ function lintPresentation(document, options = {}) {
515
517
  }
516
518
  }
517
519
  }
520
+ for (const issue of unusedReferenceWarnings(document))
521
+ diagnostics.push({
522
+ ruleId: "opf/unused-reference",
523
+ severity: "warning",
524
+ scope: "document",
525
+ path: issue.path,
526
+ message: issue.message,
527
+ help: "Cite the reference from a text, bullet or list item run ({ text, cite: id }) so it is listed in that slide's footnote area, or remove the entry. Nothing is drawn for an uncited reference.",
528
+ definition: schemas.presentation.$id + "#/$defs/Reference",
529
+ lookup: ["opf", "schema", "presentation", "/$defs/Reference"],
530
+ validation: issue
531
+ });
518
532
  return report(diagnostics, validation.valid, "not-applicable");
519
533
  }
520
534
  function lintSource(source, options = {}) {