@openpresentation/opf 0.32.1 → 0.34.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 +9 -0
  2. package/dist/browser.js +22 -21
  3. package/dist/catalog-refs-CoIrOdAw.d.ts +937 -0
  4. package/dist/{catalog-schemas-LdqOPebq.d.ts → catalog-schemas-FjLRPtjB.d.ts} +10 -4
  5. package/dist/{chart-data-oIZQlFGi.d.ts → chart-data-B_k-WTex.d.ts} +7 -4
  6. package/dist/{chunk-PB7ME64J.js → chunk-244OPLAV.js} +1 -1
  7. package/dist/{chunk-IT7FQKED.js → chunk-2HX4BGAS.js} +6 -6
  8. package/dist/{chunk-2E6CDYL2.js → chunk-36DLVJGW.js} +19 -16
  9. package/dist/{chunk-XQO2CT6Q.js → chunk-3THGTDL2.js} +2 -2
  10. package/dist/{chunk-CLRYHWQN.js → chunk-42JBXJKW.js} +187 -25
  11. package/dist/chunk-BLCDUM7B.js +7 -0
  12. package/dist/{chunk-NVAJASOD.js → chunk-CJVKOJ6B.js} +10195 -2036
  13. package/dist/{chunk-XFHXQCXL.js → chunk-DQ7QYOUV.js} +99 -13
  14. package/dist/{chunk-NEJ32O7X.js → chunk-F6BXO4AI.js} +1 -1
  15. package/dist/{chunk-OXLA4HXQ.js → chunk-FAXO3SUE.js} +1196 -313
  16. package/dist/{chunk-J63CIRIV.js → chunk-FIQMAIZV.js} +4 -4
  17. package/dist/{chunk-PJSPHHRK.js → chunk-FK5XG742.js} +3 -16
  18. package/dist/{chunk-HKUV7NEN.js → chunk-HHVQ2SDT.js} +1 -1
  19. package/dist/{chunk-SZFO3MAJ.js → chunk-HUGVYHZ2.js} +4 -4
  20. package/dist/{chunk-LEF4X4KI.js → chunk-LCT5ZV3Q.js} +2400 -222
  21. package/dist/chunk-NLJFNCZ4.js +1560 -0
  22. package/dist/{chunk-GM7WFPGG.js → chunk-PRXZD2II.js} +6 -1
  23. package/dist/{chunk-YFJIIIOL.js → chunk-QGJVOPLG.js} +3 -3
  24. package/dist/{chunk-F7DN33UL.js → chunk-QGTJF7HV.js} +16 -14
  25. package/dist/{chunk-ONVFUVQ5.js → chunk-RUV7CCE6.js} +136 -31
  26. package/dist/{chunk-SW676APJ.js → chunk-U7TYSPYM.js} +2 -2
  27. package/dist/chunk-UJZN2ZH6.js +1 -0
  28. package/dist/chunk-VDZXNNZF.js +221 -0
  29. package/dist/{chunk-UJSAR6GF.js → chunk-W4DYDRV2.js} +21 -0
  30. package/dist/chunk-WCPDN7AY.js +642 -0
  31. package/dist/{chunk-BBVW5ZC2.js → chunk-WMFT5R7I.js} +2 -2
  32. package/dist/{chunk-AQEAZDL2.js → chunk-XJUMFH33.js} +2 -1
  33. package/dist/{composition-Ds6WHyO7.d.ts → composition-CvtvgBDE.d.ts} +2783 -873
  34. package/dist/composition.d.ts +4 -3
  35. package/dist/composition.js +3 -2
  36. package/dist/{conversion-CdzrTxib.d.ts → conversion-B_5AKTYQ.d.ts} +39 -10
  37. package/dist/conversion-CMBGOTAC.js +25 -0
  38. package/dist/convert.d.ts +5 -4
  39. package/dist/convert.js +17 -13
  40. package/dist/data.d.ts +2 -2
  41. package/dist/data.js +4 -3
  42. package/dist/{deck-report-CKDNQ2t4.d.ts → deck-report-BVlQZ42f.d.ts} +3 -3
  43. package/dist/deck.d.ts +7 -6
  44. package/dist/deck.js +13 -12
  45. package/dist/diagram-engine-eager.js +6 -2
  46. package/dist/diagram-engine-lazy.js +14 -1
  47. package/dist/diagram-plantuml-XRZ6VAOL.js +3 -0
  48. package/dist/diff.js +6 -5
  49. package/dist/docs.js +88 -52
  50. package/dist/examples.js +28745 -18393
  51. package/dist/font-policy.js +2 -2
  52. package/dist/format.js +3 -3
  53. package/dist/ids.js +6 -5
  54. package/dist/index.d.ts +19 -16
  55. package/dist/index.js +37 -26
  56. package/dist/markdown.d.ts +3 -2
  57. package/dist/markdown.js +10 -9
  58. package/dist/node-engine.d.ts +44 -11
  59. package/dist/node-engine.js +47 -28
  60. package/dist/{pagination-DRZ_JNFY.d.ts → pagination-CZQQYk7L.d.ts} +22 -4
  61. package/dist/pagination.d.ts +5 -4
  62. package/dist/pagination.js +6 -5
  63. package/dist/patch.js +5 -4
  64. package/dist/precompiled.js +3 -3
  65. package/dist/{presentation-DnD7mfmf.d.ts → presentation-s9262acV.d.ts} +1172 -208
  66. package/dist/repo-readme.js +2 -2
  67. package/dist/schema-engine-ajv.js +2 -2
  68. package/dist/schema-engine-precompiled.js +3 -3
  69. package/dist/schema.d.ts +3 -3
  70. package/dist/schema.js +5 -4
  71. package/dist/schemas.d.ts +56 -4
  72. package/dist/schemas.js +2 -2
  73. package/dist/shape-catalog.d.ts +98 -0
  74. package/dist/shape-catalog.js +302 -0
  75. package/dist/shape-engine-eager.js +9 -0
  76. package/dist/shape-engine-lazy.js +12 -0
  77. package/dist/shape-engine-module-N74FCHGY.js +3 -0
  78. package/dist/shape-geometry.d.ts +126 -0
  79. package/dist/shape-geometry.js +2 -0
  80. package/dist/source.d.ts +10 -5
  81. package/dist/source.js +12 -11
  82. package/dist/spec/README.md +1 -1
  83. package/dist/spec/reference/engine-vocabularies.json +135 -0
  84. package/dist/spec/reference/font-policy.json +3 -16
  85. package/dist/spec/reference/preset-geometry.json +10699 -0
  86. package/dist/spec/reference/preset-geometry.schema.json +126 -0
  87. package/dist/spec/schemas/catalog-index.schema.json +1 -0
  88. package/dist/spec/schemas/chart-type.schema.json +4 -4
  89. package/dist/spec/schemas/icon-set.schema.json +75 -0
  90. package/dist/spec/schemas/layout.schema.json +82 -23
  91. package/dist/spec/schemas/opf.schema.json +1616 -296
  92. package/dist/spec/schemas/theme.schema.json +11 -5
  93. package/dist/spec-files.d.ts +1 -1
  94. package/dist/spec-files.js +2 -2
  95. package/dist/symbol-font-encodings.js +1 -1
  96. package/dist/types.d.ts +83 -71
  97. package/dist/{validation-types-DxyYPebs.d.ts → validation-types-CYbsUuZ9.d.ts} +8 -5
  98. package/dist/validator.d.ts +35 -7
  99. package/dist/validator.js +5 -4
  100. package/dist/yaml.d.ts +3 -2
  101. package/dist/yaml.js +9 -8
  102. package/package.json +22 -6
  103. package/dist/catalog-refs-kAefsZWT.d.ts +0 -129
  104. package/dist/chunk-DGS47ONG.js +0 -1
  105. package/dist/conversion-5FUDQPED.js +0 -24
package/README.md CHANGED
@@ -117,6 +117,15 @@ Added in 0.12.0 (not in 0.11.4 or earlier): `@openpresentation/opf/patch` is the
117
117
 
118
118
  `@openpresentation/opf/ids` (all of it also on the package root, the pointer and hash parts also on `/patch`) makes edits addressable and checkable. `assignIds(document, { generate? })` fills the missing `id` of slides and content payloads deterministically (`{ document, patch, assigned }`; existing ids are never changed). In an array, the pointer token `@intro` names the element whose `id` is `intro`, so `/slides/@intro/blocks/@kpi/text` survives reordering: `applyPatch` and `readPointer` resolve it, `resolveIdPointer` and `toIdPointer` convert a pointer, `resolveIdPatch` and `toIdPatch` a whole patch. `documentHash(document)` is `sha256:` and a SHA-256 of the key-sorted JSON (pure JavaScript, the same in Node, browsers and edge runtimes); `applyPatch(document, patch, { expectHash })` and `edit(deck, patch, { expectHash })` apply only to the document that hash was taken from, else throw `OPFPatchHashError` and change nothing. `touches(patch, document?)` returns the pointers (index and id form), ids, slide ids and kinds a patch reads and writes, for conflict detection and permission checks. See [the guide](../../docs/patch-diff-merge-format.md#ids-id-addressed-paths-hashes-and-patch-scope).
119
119
 
120
+ ### Shapes, icons, SmartArt layouts and diagrams
121
+
122
+ A slide can draw more than text, pictures and charts, with no extra package:
123
+
124
+ - **Shapes.** A `shape` block takes one of PowerPoint's 187 presets (`{ "shape": "chevron", "text": "Plan" }`) or a custom `path`, with fills, strokes and six effects; a slide's `shapes` list adds overlays and connectors between blocks. The preset table is `PRESET_SHAPES` of `@openpresentation/opf/shape-geometry`. See [shapes](https://github.com/OpenPresentation/opf/blob/main/docs/shapes.md) and [shape effects](https://github.com/OpenPresentation/opf/blob/main/docs/shape-effects.md).
125
+ - **Icons.** `icon` on a list entry, a metric or a group (`"lucide:truck"`, `"tabler:rocket"`) draws a chip, and a list of short icon entries draws icon cards. The sets live in `@openpresentation/gallery/icon-sets` as static files read one icon at a time: register `galleryIconSets()` beside `gallery` (in a browser, `galleryIconSets(fetchIcons("/opf-icons/"))` over the files you serve; in a Worker, an absolute URL and `env.ASSETS`) and await `ensureIcons(deck, { catalogs })` before synchronous drawing (`@openpresentation/opf/composition`). The Node build's defaults (`convert`, `open`, the CLI) register them with no setup, also in a bundled server deployed with its `node_modules`, and no bundle carries the icon data. An icon that cannot be loaded is an `opf/icon-unknown` finding; it never blocks drawing. See [icons](https://github.com/OpenPresentation/opf/blob/main/docs/icons.md).
126
+ - **SmartArt layouts.** The `pyramid`, `matrix`, `cycle`, `chevrons`, `flow` and `vertical-flow` layouts draw one diagram from a list; PowerPoint export writes live SmartArt where it holds the text, and native shapes elsewhere. See [SmartArt layouts](https://github.com/OpenPresentation/opf/blob/main/docs/smartart.md).
127
+ - **Diagrams.** A `diagram` payload accepts Mermaid (the string shorthand), Graphviz DOT (`syntax: "dot"`) or PlantUML (`syntax: "plantuml"`), is drawn in the deck's design and exports as native PowerPoint shapes by default (`--diagrams picture` for a picture). See [diagrams](https://github.com/OpenPresentation/opf/blob/main/docs/diagrams.md).
128
+
120
129
  ### Layout previews
121
130
 
122
131
  `@openpresentation/gallery/previews` ships pre-rendered SVG thumbnails for the
package/dist/browser.js CHANGED
@@ -1,26 +1,27 @@
1
- import { OPFApiError } from './chunk-SZFO3MAJ.js';
2
- export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-SZFO3MAJ.js';
3
- export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
4
- export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-PJSPHHRK.js';
5
- export { OPFDataImportError, ingest, parseTabularData } from './chunk-PB7ME64J.js';
6
- export { OPFPaginationError, blockUnits, continuationPages, continueOverfull, paginate, paginateSlide } from './chunk-CLRYHWQN.js';
7
- export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-J63CIRIV.js';
8
- export { fromMarkdown, toMarkdown } from './chunk-F7DN33UL.js';
9
- import './chunk-IT7FQKED.js';
10
- export { OPFFormatError, format } from './chunk-HKUV7NEN.js';
1
+ import { OPFApiError } from './chunk-HUGVYHZ2.js';
2
+ export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-HUGVYHZ2.js';
3
+ export { specFileEntries, specFileKinds, specFilePaths } from './chunk-W4DYDRV2.js';
4
+ export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-FK5XG742.js';
5
+ export { OPFDataImportError, ingest, parseTabularData } from './chunk-244OPLAV.js';
6
+ export { OPFPaginationError, blockUnits, continuationPages, continueOverfull, paginate, paginateSlide } from './chunk-42JBXJKW.js';
7
+ export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-FIQMAIZV.js';
8
+ export { fromMarkdown, toMarkdown } from './chunk-QGTJF7HV.js';
9
+ import './chunk-2HX4BGAS.js';
10
+ export { OPFFormatError, format } from './chunk-HHVQ2SDT.js';
11
11
  import './chunk-RYZPBJLB.js';
12
- export { explain } from './chunk-XFHXQCXL.js';
13
- import './chunk-2E6CDYL2.js';
14
- import './chunk-NEJ32O7X.js';
15
- export { OPFMarkdownError } from './chunk-BBVW5ZC2.js';
16
- import './chunk-XQO2CT6Q.js';
17
- export { OPFIdError, assignIds, touches } from './chunk-SW676APJ.js';
18
- export { diff, merge } from './chunk-YFJIIIOL.js';
19
- export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, documentHash, findValidationRule, idToken, isIdToken, resolveDrawnFontFamilies, resolveIdPatch, resolveIdPointer, resolveSlideContext, toIdPatch, toIdPointer, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-OXLA4HXQ.js';
12
+ export { explain } from './chunk-DQ7QYOUV.js';
13
+ import './chunk-36DLVJGW.js';
14
+ import './chunk-F6BXO4AI.js';
15
+ export { OPFMarkdownError } from './chunk-WMFT5R7I.js';
16
+ import './chunk-3THGTDL2.js';
17
+ export { OPFIdError, assignIds, touches } from './chunk-U7TYSPYM.js';
18
+ export { diff, merge } from './chunk-QGJVOPLG.js';
19
+ export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogIconKinds, catalogSchemaNames, createValidator, documentHash, findValidationRule, idToken, isIdToken, resolveDrawnFontFamilies, resolveIdPatch, resolveIdPointer, resolveSlideContext, toIdPatch, toIdPointer, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-FAXO3SUE.js';
20
20
  import './chunk-JBARNYFR.js';
21
- export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-LEF4X4KI.js';
22
- 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, chartDrawDiagnostics, chartDrawPlan, chartNumber, coerceVariableValue, datasetDiagnostics, diagramsPending, ensureDiagrams, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isPlaceLabel, isTemplate, isXYChartType, listBuiltinVariables, listVariables, markLabelColor, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-NVAJASOD.js';
23
- import './chunk-GM7WFPGG.js';
21
+ export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-LCT5ZV3Q.js';
22
+ 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';
23
+ import './chunk-BLCDUM7B.js';
24
+ import './chunk-PRXZD2II.js';
24
25
 
25
26
  // src/browser.ts
26
27
  var nodeOnly = (name, message) => new OPFApiError(`\`${name}\` ${message}`, "node-only", { details: { function: name, build: "browser" } });