@openpresentation/opf 0.26.3 → 0.26.4

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 (36) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.js +13 -11
  3. package/dist/{chunk-34LIUOT7.js → chunk-6IXSHIAL.js} +6 -6
  4. package/dist/{chunk-PXOXTJTN.js → chunk-6NBTZYYD.js} +1 -1
  5. package/dist/{chunk-FXNUM2PN.js → chunk-EDCRBTJF.js} +4 -4
  6. package/dist/chunk-GWJBZ4LC.js +639 -0
  7. package/dist/{chunk-YVNFACTC.js → chunk-H5QC3X3K.js} +1 -1
  8. package/dist/{chunk-WASENX2R.js → chunk-MN7DRK57.js} +40 -648
  9. package/dist/{chunk-GLLR3AQ5.js → chunk-NZLW6FBQ.js} +1 -1
  10. package/dist/{chunk-7RY7QWWJ.js → chunk-O6BY3AU2.js} +1 -1
  11. package/dist/{chunk-PB5X2VSV.js → chunk-PIO73BQ6.js} +4 -3
  12. package/dist/{chunk-DEI2M2H6.js → chunk-QAEBYDKY.js} +2 -4
  13. package/dist/{chunk-54OV2WQC.js → chunk-QH2W6HIM.js} +1 -1
  14. package/dist/chunk-RYZPBJLB.js +4 -0
  15. package/dist/{chunk-NJWI6MPT.js → chunk-XFOOKVRI.js} +16 -1
  16. package/dist/{chunk-2ZQBMZTZ.js → chunk-ZSZDVIDV.js} +2 -2
  17. package/dist/{conversion-BjsKgxBZ.d.ts → conversion-DSafOGzh.d.ts} +2 -2
  18. package/dist/conversion-QIAJM6DQ.js +20 -0
  19. package/dist/convert.js +5 -5
  20. package/dist/deck.js +9 -7
  21. package/dist/diff.js +2 -2
  22. package/dist/docs.js +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +17 -15
  25. package/dist/markdown.js +7 -5
  26. package/dist/node-engine.d.ts +2 -2
  27. package/dist/node-engine.js +17 -15
  28. package/dist/pagination.js +2 -2
  29. package/dist/patch.js +1 -1
  30. package/dist/schema.js +1 -1
  31. package/dist/source.d.ts +102 -4
  32. package/dist/source.js +388 -9
  33. package/dist/validator.js +1 -1
  34. package/dist/yaml.js +5 -4
  35. package/package.json +5 -5
  36. package/dist/conversion-F4UCOGR7.js +0 -18
package/README.md CHANGED
@@ -99,7 +99,7 @@ The layout engine's names are not on the root. `composeSlide`, `fitText`, `layou
99
99
 
100
100
  ### Source editing: schema field queries, text addressing and syntax recovery
101
101
 
102
- Two browser-safe subpaths for source editors, the CLI and agents. `@openpresentation/opf/schema` reads the field model of a document from the JSON Schemas: `describeField(path, document?)` returns the types, description, enum values, default, examples, whether the parent requires it, the `oneOf` variants (and `primary`, the form a template should use), the ranked `children` of an object (required first, then the curated `COMMON_KEYS` order, then alphabetical; promoted regions, `extensions` and `$schema` are `advanced`), the item schema of an array (`itemInfo`) or map (`entryInfo`), `requiredChildren` and `freeText`, and `{ known: false }` for a path the schema does not describe; `catalogKindAt(path, document?)` names the catalog a reference field points into (`layouts`, `themes`, `colorSchemes`, `fontSchemes`, `narratives`, `audiences`, `purposes`, `tones`) from `schemaCatalogKinds` (also exported), core-side metadata keyed by schema name and JSON Pointer; the published schemas carry no vendor keyword and compile under strict Ajv, so a new reference field is one entry there and needs no editor change. The navigation helpers it is built on are exported too (`resolveSchema`, `schemaVariants`, `activeSchema`, `schemaAtPath`, `createSchemaValue`, `listSchemaFields`, `splitOpfPath`). `@openpresentation/opf/source` turns text into positions and back: `locate(text, "json", pointer, { part })` is the range of a JSON Pointer (`value`, `key`, `entry`, `open` or `colon`; the nearest ancestor with `exact: false` when the node is missing), `pathAt(text, "json", offset)` the path under a caret, and `analyzeJsonSyntax(text, { limit })` the root cause of each JSON syntax error, once, in position order (at most five), with a range, a message, a hint and the fixes that repair it (`Insert comma`, `Add { }`, `Remove "design"`, `Insert }`, `Use double quotes`, ...); `validate(text)` reports the same causes as `opf/json-syntax` findings. YAML and Markdown addressing is not there yet and returns `undefined`. See [validate](../../docs/validate.md).
102
+ Two browser-safe subpaths for source editors, the CLI and agents. `@openpresentation/opf/schema` reads the field model of a document from the JSON Schemas: `describeField(path, document?)` returns the types, description, enum values, default, examples, whether the parent requires it, the `oneOf` variants (and `primary`, the form a template should use), the ranked `children` of an object (required first, then the curated `COMMON_KEYS` order, then alphabetical; promoted regions, `extensions` and `$schema` are `advanced`), the item schema of an array (`itemInfo`) or map (`entryInfo`), `requiredChildren` and `freeText`, and `{ known: false }` for a path the schema does not describe; `catalogKindAt(path, document?)` names the catalog a reference field points into (`layouts`, `themes`, `colorSchemes`, `fontSchemes`, `narratives`, `audiences`, `purposes`, `tones`) from `schemaCatalogKinds` (also exported), core-side metadata keyed by schema name and JSON Pointer; the published schemas carry no vendor keyword and compile under strict Ajv, so a new reference field is one entry there and needs no editor change. The navigation helpers it is built on are exported too (`resolveSchema`, `schemaVariants`, `activeSchema`, `schemaAtPath`, `createSchemaValue`, `listSchemaFields`, `splitOpfPath`). `@openpresentation/opf/source` turns text into positions and back: `locate(text, format, pointer, { part })` is the range of a JSON Pointer in JSON, YAML or Markdown (`value`, `key`, `entry`, `open` or `colon`; the nearest ancestor with `exact: false` when the node is missing; a Markdown slide field is located by the same ranges its findings use: the `layout=` token of an options comment, the text after `# ` or `- `), `pathAt(text, format, offset)` the path under a caret, `scanMarkdown(text)` the regions of a Markdown deck (front matter, slides, option comments, fences, notes) with the dialect's vocabulary (`SLIDE_OPTION_KEYS`, `BLOCK_OPTION_KEYS`, `FENCE_KINDS`, `METRIC_KEYS`), and `analyzeJsonSyntax(text, { limit })` the root cause of each JSON syntax error, once, in position order (at most five), with a range, a message, a hint and the fixes that repair it (`Insert comma`, `Add { }`, `Remove "design"`, `Insert }`, `Use double quotes`, ...); `validate(text)` reports the same causes as `opf/json-syntax` findings. See [validate](../../docs/validate.md).
103
103
 
104
104
  ### Validate (0.14.0)
105
105
 
package/dist/browser.js CHANGED
@@ -1,17 +1,19 @@
1
- import { OPFApiError } from './chunk-GLLR3AQ5.js';
2
- export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-GLLR3AQ5.js';
1
+ import { OPFApiError } from './chunk-NZLW6FBQ.js';
2
+ export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-NZLW6FBQ.js';
3
3
  export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
4
4
  export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-PJSPHHRK.js';
5
5
  export { OPFDataImportError, ingest, parseTabularData } from './chunk-TKQ2VFV5.js';
6
- export { OPFPaginationError, paginate, paginateSlide } from './chunk-54OV2WQC.js';
7
- export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-FXNUM2PN.js';
8
- export { fromMarkdown, toMarkdown } from './chunk-WASENX2R.js';
9
- import './chunk-7RY7QWWJ.js';
10
- import './chunk-PB5X2VSV.js';
11
- export { OPFMarkdownError } from './chunk-DEI2M2H6.js';
12
- import './chunk-PXOXTJTN.js';
13
- export { diff, merge } from './chunk-YVNFACTC.js';
14
- export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-NJWI6MPT.js';
6
+ export { OPFPaginationError, paginate, paginateSlide } from './chunk-QH2W6HIM.js';
7
+ export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-EDCRBTJF.js';
8
+ export { fromMarkdown, toMarkdown } from './chunk-GWJBZ4LC.js';
9
+ import './chunk-PIO73BQ6.js';
10
+ import './chunk-RYZPBJLB.js';
11
+ import './chunk-MN7DRK57.js';
12
+ import './chunk-O6BY3AU2.js';
13
+ export { OPFMarkdownError } from './chunk-QAEBYDKY.js';
14
+ import './chunk-6NBTZYYD.js';
15
+ export { diff, merge } from './chunk-H5QC3X3K.js';
16
+ export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-XFOOKVRI.js';
15
17
  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';
16
18
  export { OPFFormatError, format } from './chunk-EQ6S5SEZ.js';
17
19
  export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-F4HFDP6I.js';
@@ -1,8 +1,8 @@
1
- import { defaultCatalogs } from './chunk-2ZQBMZTZ.js';
2
- import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-GLLR3AQ5.js';
3
- import { paginate } from './chunk-54OV2WQC.js';
4
- import { deckFormatOf, readDeckReport, stringify } from './chunk-FXNUM2PN.js';
5
- import { validate, OPFValidationError } from './chunk-NJWI6MPT.js';
1
+ import { defaultCatalogs } from './chunk-ZSZDVIDV.js';
2
+ import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-NZLW6FBQ.js';
3
+ import { paginate } from './chunk-QH2W6HIM.js';
4
+ import { deckFormatOf, readDeckReport, stringify } from './chunk-EDCRBTJF.js';
5
+ import { validate, OPFValidationError } from './chunk-XFOOKVRI.js';
6
6
  import { link, stat, readdir, lstat, readFile, open, unlink, mkdir, rename } from 'fs/promises';
7
7
  import path6 from 'path';
8
8
  import { readFileSync, statSync, realpathSync } from 'fs';
@@ -117,7 +117,7 @@ function localAssetProblems(deck, root) {
117
117
  }
118
118
  var RENDER_PACKAGE = "@openpresentation/opf-render";
119
119
  var PPTX_PACKAGE = "@openpresentation/opf-pptx";
120
- var PEER_RANGES = { [RENDER_PACKAGE]: "^0.26.3", [PPTX_PACKAGE]: "^0.26.3" };
120
+ var PEER_RANGES = { [RENDER_PACKAGE]: "^0.26.4", [PPTX_PACKAGE]: "^0.26.4" };
121
121
  var PPTX_TEXT_OPTIONS_FROM = "0.22.0";
122
122
  var numbers = (version) => version.replace(/[-+].*$/, "").split(".").map((part) => Number.parseInt(part, 10) || 0);
123
123
  function atLeast(version, minimum) {
@@ -1,4 +1,4 @@
1
- import { validate } from './chunk-NJWI6MPT.js';
1
+ import { validate } from './chunk-XFOOKVRI.js';
2
2
 
3
3
  // src/convert/shared.ts
4
4
  var CONTENT_KEYS = ["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline"];
@@ -1,7 +1,7 @@
1
- import { fromMarkdown, toMarkdown } from './chunk-WASENX2R.js';
2
- import { fromYaml, toYaml } from './chunk-PB5X2VSV.js';
3
- import { NOT_CHECKED } from './chunk-DEI2M2H6.js';
4
- import { parseSource, validate, OPFValidationError } from './chunk-NJWI6MPT.js';
1
+ import { fromMarkdown, toMarkdown } from './chunk-GWJBZ4LC.js';
2
+ import { fromYaml, toYaml } from './chunk-PIO73BQ6.js';
3
+ import { NOT_CHECKED } from './chunk-RYZPBJLB.js';
4
+ import { parseSource, validate, OPFValidationError } from './chunk-XFOOKVRI.js';
5
5
  import { checkCatalogsOption } from './chunk-XRMV2GMB.js';
6
6
 
7
7
  // src/deck-report.ts