brand-intent 0.30.0 → 0.31.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brand-intent",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "An open file format specification for making brand intent machine-readable.",
5
5
  "author": "Christophe Stoll <christophe@stoll.studio>",
6
6
  "license": "MIT",
@@ -40,8 +40,9 @@ export interface ParsedStoryPage {
40
40
  composition?: string;
41
41
  /** Illustration ids; implementations pick one per story date, the same one every time for that date. */
42
42
  illustrations?: string[];
43
- /** Photo id; overrides the purpose's `photo:` default for this page. */
44
- photo?: string;
43
+ /** Photo ids; override the purpose's `photo:` default for this page. Implementations pick one per
44
+ * story date, the same one every time for that date. */
45
+ photos?: string[];
45
46
  /** Page topic: what this page adds to the story. */
46
47
  topic?: string;
47
48
  /** Fixed slot texts, may contain `{variable}`s. A slot the page doesn't name is open. */
@@ -198,7 +199,7 @@ export function parseStoryFile(content: string, fileName: string): ParsedStory {
198
199
  if (read && 'multi' in read) { multiKey = read.multi; multiIndent = 4; }
199
200
  else if (read?.key === 'purpose') currentPage.purpose = read.value;
200
201
  else if (read?.key === 'illustration') currentPage.illustrations = read.value.split(',').map(id => id.trim()).filter(Boolean);
201
- else if (read?.key === 'photo') currentPage.photo = read.value;
202
+ else if (read?.key === 'photo') currentPage.photos = read.value.split(',').map(id => id.trim()).filter(Boolean);
202
203
  else if (read) currentPage.composition = read.value;
203
204
  continue;
204
205
  }
@@ -317,7 +318,9 @@ export function checkStory(
317
318
  for (const id of page.illustrations ?? []) {
318
319
  if (brand.illustrations && !brand.illustrations.includes(id)) say(`${where}: illustration "${id}" does not exist`);
319
320
  }
320
- if (page.photo && brand.photos && !brand.photos.includes(page.photo)) say(`${where}: photo "${page.photo}" does not exist`);
321
+ for (const id of page.photos ?? []) {
322
+ if (brand.photos && !brand.photos.includes(id)) say(`${where}: photo "${id}" does not exist`);
323
+ }
321
324
  checkTexts(where, purpose, page.texts);
322
325
  });
323
326
  story.examples.forEach((ex, i) => {