brand-intent 0.23.0 → 0.24.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
package/parser/brandParser.ts
CHANGED
|
@@ -55,8 +55,6 @@ export interface ParsedBrand {
|
|
|
55
55
|
name: string;
|
|
56
56
|
language: string;
|
|
57
57
|
locale: string;
|
|
58
|
-
/** Canonical domain for this brand (used for OG meta, favicon paths, share links). */
|
|
59
|
-
domain?: string;
|
|
60
58
|
/** Named font primitives: name → font definition. First entry is the brand default. */
|
|
61
59
|
fonts?: Record<string, ParsedFontDef>;
|
|
62
60
|
/** Token source type: 'figma' | 'inline' */
|
|
@@ -1166,7 +1164,6 @@ export function parseBrandFile(content: string, fileName: string): ParsedBrand {
|
|
|
1166
1164
|
case 'name': result.name = value; break;
|
|
1167
1165
|
case 'language': result.language = value; break;
|
|
1168
1166
|
case 'locale': result.locale = value; break;
|
|
1169
|
-
case 'domain': result.domain = value; break;
|
|
1170
1167
|
case 'tokens':
|
|
1171
1168
|
if (value === 'figma' || value === 'inline') {
|
|
1172
1169
|
result.tokensSource = value;
|
package/parser/dateWindows.ts
CHANGED
|
@@ -30,5 +30,5 @@ export function isInDateWindow(ranges: DateWindowRange[], date: Date): boolean {
|
|
|
30
30
|
return ranges.some(({ from, to }) => (from <= to ? key >= from && key <= to : key >= from || key <= to));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/** Trailing window marker on a sample line: `
|
|
33
|
+
/** Trailing window marker on a sample line: `Stollen ab Advent @christmas`. */
|
|
34
34
|
export const SAMPLE_WINDOW_MARKER = /\s+@([a-z][a-z0-9-]*)\s*$/;
|
package/parser/formatParser.ts
CHANGED
|
@@ -35,8 +35,6 @@ export interface ParsedFormat {
|
|
|
35
35
|
gridCrop: ZoneInsets | null;
|
|
36
36
|
comfort: number; // px (0 if comfortMm is used)
|
|
37
37
|
comfortMm?: number; // mm (print/signage)
|
|
38
|
-
/** Capability restrictions from the `no:` field (e.g. ['motion', 'video', 'photo']). */
|
|
39
|
-
restrictions?: string[];
|
|
40
38
|
/** Allowed purpose IDs from the `purposes:` field. Absent = all purposes allowed. */
|
|
41
39
|
purposes?: string[];
|
|
42
40
|
}
|
|
@@ -110,7 +108,6 @@ export function parseFormatFile(content: string, fileName: string): ParsedFormat
|
|
|
110
108
|
let gridCrop: ZoneInsets | null = null;
|
|
111
109
|
let comfortRaw: number | undefined; // px for screen, mm for print/signage
|
|
112
110
|
let comfortIsMm = false;
|
|
113
|
-
let restrictions: string[] | undefined;
|
|
114
111
|
let purposes: string[] | undefined;
|
|
115
112
|
|
|
116
113
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -217,11 +214,6 @@ export function parseFormatFile(content: string, fileName: string): ParsedFormat
|
|
|
217
214
|
break;
|
|
218
215
|
}
|
|
219
216
|
|
|
220
|
-
case 'no': {
|
|
221
|
-
restrictions = value.split(/\s+/).filter(Boolean);
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
217
|
case 'purposes': {
|
|
226
218
|
purposes = value.split(/[\s,]+/).filter(Boolean);
|
|
227
219
|
break;
|
|
@@ -277,7 +269,6 @@ export function parseFormatFile(content: string, fileName: string): ParsedFormat
|
|
|
277
269
|
grid,
|
|
278
270
|
danger, gridCrop,
|
|
279
271
|
comfort, comfortMm,
|
|
280
|
-
restrictions,
|
|
281
272
|
purposes,
|
|
282
273
|
};
|
|
283
274
|
}
|
package/parser/icons.ts
CHANGED
|
@@ -132,7 +132,7 @@ export function resolveIconRef(ref: IconRef, icons: ParsedIconDef[] | undefined)
|
|
|
132
132
|
return resolved;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
/** Split an optional `[id]` prefix off a list item: "[
|
|
135
|
+
/** Split an optional `[id]` prefix off a list item: "[shop] Laden am Markt". */
|
|
136
136
|
export function parseListItem(item: string): { icon?: IconRef; text: string } {
|
|
137
137
|
const m = item.match(/^\[([^\]]+)\]\s*(.*)$/s);
|
|
138
138
|
if (!m) return { text: item };
|
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
}
|
|
536
536
|
},
|
|
537
537
|
"string-field": {
|
|
538
|
-
"match": "^(language|locale|
|
|
538
|
+
"match": "^(language|locale|app-icon|favicon|og-image|figma-file-key|figma-collection|tokens-file|spacing):?\\s*(.+)?",
|
|
539
539
|
"captures": {
|
|
540
540
|
"1": { "name": "support.type.property-name.brand-intent-brand" },
|
|
541
541
|
"2": { "name": "string.unquoted.brand-intent-brand" }
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
},
|
|
544
544
|
"keyword-partial": {
|
|
545
545
|
"comment": "Fallback: color the keyword token on incomplete lines (while typing)",
|
|
546
|
-
"match": "^(id:|name:|language:|locale:|
|
|
546
|
+
"match": "^(id:|name:|language:|locale:|app-icon:|favicon:|og-image:|tokens:|figma-file-key:|figma-collection:|tokens-file:|spacing:|label:|cta:|color-mode:|color-strategy:|color-adherence:|brand-colors|state-colors|color-bounds|color-rules|color-families|theme|divider|font|typography|logo|photo|video|illustration|icons|counter|framing|windows)(?=\\s|$)",
|
|
547
547
|
"captures": {
|
|
548
548
|
"1": { "name": "keyword.control.brand-intent-brand" }
|
|
549
549
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
{ "include": "#id-field" },
|
|
7
7
|
{ "include": "#name-field" },
|
|
8
8
|
{ "include": "#category" },
|
|
9
|
-
{ "include": "#no" },
|
|
10
9
|
{ "include": "#purposes" },
|
|
11
10
|
{ "include": "#size" },
|
|
12
11
|
{ "include": "#grid" },
|
|
@@ -41,13 +40,6 @@
|
|
|
41
40
|
"2": { "name": "entity.name.tag.brand-intent-format" }
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
|
-
"no": {
|
|
45
|
-
"match": "^(no:)\\s+(.*)",
|
|
46
|
-
"captures": {
|
|
47
|
-
"1": { "name": "keyword.control.brand-intent-format" },
|
|
48
|
-
"2": { "name": "string.unquoted.brand-intent-format" }
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
43
|
"purposes": {
|
|
52
44
|
"match": "^(purposes:)\\s+(.*)",
|
|
53
45
|
"captures": {
|
|
@@ -94,7 +86,7 @@
|
|
|
94
86
|
},
|
|
95
87
|
"keyword-partial": {
|
|
96
88
|
"comment": "Fallback: color the keyword token on incomplete lines (while typing)",
|
|
97
|
-
"match": "^(id:|name:|category:|
|
|
89
|
+
"match": "^(id:|name:|category:|purposes:|size:|grid:|dpi:|bleed:|comfort:|danger:|crop:|label:|sublabel:)(?=\\s|$)",
|
|
98
90
|
"captures": {
|
|
99
91
|
"1": { "name": "keyword.control.brand-intent-format" }
|
|
100
92
|
}
|