brand-intent 0.4.2 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brand-intent",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
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",
@@ -39,6 +39,8 @@ export interface ParsedPurpose {
39
39
  defaultIcon?: string;
40
40
  /** Default icon weight. */
41
41
  defaultIconWeight?: string;
42
+ /** Optional prompt text shown in the empty background placeholder. Default: "Select a background". */
43
+ bgPrompt?: string;
42
44
  }
43
45
 
44
46
  export interface ParsedPurposeSlot {
@@ -122,6 +124,7 @@ export function parsePurposeFile(content: string, fileName: string): ParsedPurpo
122
124
  let camera: boolean | undefined;
123
125
  let defaultIcon: string | undefined;
124
126
  let defaultIconWeight: string | undefined;
127
+ let bgPrompt: string | undefined;
125
128
  const slots: ParsedPurposeSlot[] = [];
126
129
  // For backward compat: track first # line text for fallback id
127
130
  let firstHashText = '';
@@ -293,6 +296,12 @@ export function parsePurposeFile(content: string, fileName: string): ParsedPurpo
293
296
  continue;
294
297
  }
295
298
 
299
+ // Background placeholder prompt: "bg-prompt: Mach dein Selfie"
300
+ if (line.startsWith('bg-prompt:')) {
301
+ bgPrompt = line.slice(10).trim().replace(/^["']|["']$/g, '');
302
+ continue;
303
+ }
304
+
296
305
  // Default icon: "defaultIcon: warning-circle" or "defaultIcon: warning-circle duotone"
297
306
  // Accepts kebab-case (natural for file format) and converts to PascalCase for Phosphor lookup.
298
307
  if (line.startsWith('defaultIcon:')) {
@@ -592,5 +601,5 @@ export function parsePurposeFile(content: string, fileName: string): ParsedPurpo
592
601
  context = contextLines.join('\n').trim();
593
602
  }
594
603
 
595
- return { id, name, description, preferredCompositions: compositions, slots, density, palette, scope, context, voice, defaultLogo, defaultPhoto, defaultVideo, camera, defaultIcon, defaultIconWeight };
604
+ return { id, name, description, preferredCompositions: compositions, slots, density, palette, scope, context, voice, defaultLogo, defaultPhoto, defaultVideo, camera, defaultIcon, defaultIconWeight, bgPrompt };
596
605
  }