@openpresentation/opf 0.2.1 → 0.2.2

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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { SchemaName, audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './schemas.js';
2
2
  export { CatalogKind, audiences, catalogEntries, catalogIndexes, catalogKinds, catalogSchemaNames, catalogs, chartTypes, colorSchemes, fontSchemes, languages, layouts, narratives, purposes, socialPlatforms, themes, tones } from './catalogs.js';
3
- export { O as OPFValidationError, P as Presentation, V as ValidationIssue, a as ValidationResult, b as assertValid, c as assertValidCatalogRecord, d as assertValidPresentation, v as validate, e as validateCatalogRecord, f as validatePresentation } from './validator-D7WwzKyx.js';
3
+ export { O as OPFValidationError, P as Presentation, V as ValidationIssue, a as ValidationResult, b as assertValid, c as assertValidCatalogRecord, d as assertValidPresentation, v as validate, e as validateCatalogRecord, f as validatePresentation } from './validator-MwlR2F56.js';
4
4
  export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
5
5
  export { LayoutPreviewIndex, LayoutPreviewRecord, getLayoutPreview, hasLayoutPreview, layoutPreviewIndex, layoutPreviewSlugs, layoutPreviews } from './previews.js';
6
6
  export { Audience, ChartType, ColorScheme, FontScheme, Language, Layout, Narrative, Purpose, SocialPlatform, Theme, Tone } from './types.js';
package/dist/index.js CHANGED
@@ -95,20 +95,29 @@ var presentation = {
95
95
  ]
96
96
  },
97
97
  "audience": {
98
- "type": "array",
99
- "items": {
100
- "oneOf": [
101
- {
102
- "type": "string"
98
+ "oneOf": [
99
+ {
100
+ "type": "string"
101
+ },
102
+ {
103
+ "type": "array",
104
+ "items": {
105
+ "oneOf": [
106
+ {
107
+ "type": "string"
108
+ },
109
+ {
110
+ "$ref": "#/$defs/Audience"
111
+ }
112
+ ]
103
113
  },
104
- {
105
- "$ref": "#/$defs/Audience"
106
- }
107
- ]
108
- },
109
- "minItems": 1,
110
- "description": "Intended audiences for the presentation. Each item accepts either:\n- A string shorthand: free-form description ('Series B investors'), an audiences catalog id ('executives'), an HTTPS URL, or a 'pkg:' reference.\n- An inline Audience object for custom audience metadata or catalog-backed overrides. Object form mirrors https://openpresentation.org/schema/opf-audience/v1 without '$schema'.\n\nResolution order for catalog ids and references: inline catalogs.audiences.records[] \u2192 catalogs.audiences.source \u2192 default catalog at https://www.pptx.gallery/audiences.",
114
+ "minItems": 1
115
+ }
116
+ ],
117
+ "description": "Intended audiences for the presentation. Accepts either:\n- A single string shorthand: free-form description ('Series B investors'), an audiences catalog id ('executives'), an HTTPS URL, or a 'pkg:' reference.\n- An array of string shorthands and/or inline Audience objects for custom audience metadata or catalog-backed overrides. Object form mirrors https://openpresentation.org/schema/opf-audience/v1 without '$schema'.\n\nResolution order for catalog ids and references: inline catalogs.audiences.records[] \u2192 catalogs.audiences.source \u2192 default catalog at https://www.pptx.gallery/audiences.",
111
118
  "examples": [
119
+ "executives",
120
+ "Biology Students and Wildlife Enthusiasts",
112
121
  [
113
122
  "executives"
114
123
  ],
@@ -2463,7 +2472,7 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
2463
2472
  "items": {
2464
2473
  "$ref": "#/$defs/ListItem"
2465
2474
  },
2466
- "description": "Full-slide generic list payload. Presence of this field infers type 'list'."
2475
+ "description": "Full-slide generic list payload. Presence of this field infers type 'list'. At slide root, multiple content payload kinds with no explicit type, blocks, or regions are accepted as shorthand for layout-agnostic blocks."
2467
2476
  },
2468
2477
  "bullets": {
2469
2478
  "type": "array",
@@ -2533,7 +2542,7 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
2533
2542
  "items": {
2534
2543
  "$ref": "#/$defs/ContentPayload"
2535
2544
  },
2536
- "description": "Layout-agnostic content blocks rendered together as a composed payload when exact placement is unspecified."
2545
+ "description": "Layout-agnostic content blocks rendered together as a composed payload when exact placement is unspecified. At slide root, multiple content payload kinds with no explicit type, blocks, or regions are accepted as shorthand for equivalent blocks."
2537
2546
  },
2538
2547
  "design": {
2539
2548
  "$ref": "#/$defs/Design",
@@ -24997,6 +25006,12 @@ function inferredKinds(value) {
24997
25006
  if (hasOwn(value, "timeline")) kinds.push("timeline");
24998
25007
  return kinds;
24999
25008
  }
25009
+ function isImplicitBlocksComposition(value, inferred, options) {
25010
+ if (options.allowBlocks !== true || hasOwn(value, "blocks")) {
25011
+ return false;
25012
+ }
25013
+ return inferred.length > 1;
25014
+ }
25000
25015
  function validateContentPayload(value, path, options = {}) {
25001
25016
  const issues = [];
25002
25017
  const explicitType = value.type;
@@ -25023,6 +25038,9 @@ function validateContentPayload(value, path, options = {}) {
25023
25038
  return issues;
25024
25039
  }
25025
25040
  if (!kind && inferred.length > 1) {
25041
+ if (isImplicitBlocksComposition(value, inferred, options)) {
25042
+ return issues;
25043
+ }
25026
25044
  issues.push(semanticIssue(path, "content payload mixes fields from incompatible content types", {
25027
25045
  inferredTypes: inferred
25028
25046
  }));