brand-intent 0.12.0 → 0.13.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 +5 -3
- package/parser/brandParser.ts +125 -1
- package/parser/colorSystem.ts +2 -1
- package/parser/icons.ts +140 -0
- package/parser/index.ts +5 -2
- package/parser/purposeParser.ts +52 -26
- package/vscode-extension/syntaxes/brand.tmLanguage.json +454 -0
- package/vscode-extension/syntaxes/composition.tmLanguage.json +242 -0
- package/vscode-extension/syntaxes/format.tmLanguage.json +103 -0
- package/vscode-extension/syntaxes/identity.tmLanguage.json +83 -0
- package/vscode-extension/syntaxes/purpose.tmLanguage.json +251 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeName": "source.brand-intent-purpose",
|
|
3
|
+
"name": "Brand Intent Purpose",
|
|
4
|
+
"patterns": [
|
|
5
|
+
{ "include": "#comment" },
|
|
6
|
+
{ "include": "#id-field" },
|
|
7
|
+
{ "include": "#name-field" },
|
|
8
|
+
{ "include": "#compositions" },
|
|
9
|
+
{ "include": "#density" },
|
|
10
|
+
{ "include": "#default-icon" },
|
|
11
|
+
{ "include": "#scope-header" },
|
|
12
|
+
{ "include": "#voice-header" },
|
|
13
|
+
{ "include": "#voice-property" },
|
|
14
|
+
{ "include": "#palette-header" },
|
|
15
|
+
{ "include": "#asset-field" },
|
|
16
|
+
{ "include": "#camera-field" },
|
|
17
|
+
{ "include": "#analyze-field" },
|
|
18
|
+
{ "include": "#bg-prompt-field" },
|
|
19
|
+
{ "include": "#context-header" },
|
|
20
|
+
{ "include": "#slot-header" },
|
|
21
|
+
{ "include": "#override-header" },
|
|
22
|
+
{ "include": "#override-value" },
|
|
23
|
+
{ "include": "#list-property" },
|
|
24
|
+
{ "include": "#sample-item" },
|
|
25
|
+
{ "include": "#sample-icon-continuation" },
|
|
26
|
+
{ "include": "#property" },
|
|
27
|
+
{ "include": "#keyword-partial" }
|
|
28
|
+
],
|
|
29
|
+
"repository": {
|
|
30
|
+
"comment": {
|
|
31
|
+
"match": "^\\s*#.*$",
|
|
32
|
+
"name": "comment.line.number-sign.brand-intent-purpose"
|
|
33
|
+
},
|
|
34
|
+
"id-field": {
|
|
35
|
+
"match": "^(id:)\\s+(.*)",
|
|
36
|
+
"captures": {
|
|
37
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
38
|
+
"2": { "name": "entity.name.type.brand-intent-purpose" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"name-field": {
|
|
42
|
+
"match": "^(name:)\\s+(.*)",
|
|
43
|
+
"captures": {
|
|
44
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
45
|
+
"2": { "name": "string.unquoted.brand-intent-purpose" }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"compositions": {
|
|
49
|
+
"match": "^(compositions:)\\s+(.*)",
|
|
50
|
+
"captures": {
|
|
51
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
52
|
+
"2": { "name": "string.unquoted.brand-intent-purpose" }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"density": {
|
|
56
|
+
"match": "^(density:)\\s+(light|medium|full)",
|
|
57
|
+
"captures": {
|
|
58
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
59
|
+
"2": { "name": "support.constant.brand-intent-purpose" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"default-icon": {
|
|
63
|
+
"match": "^\\s*(defaultIcon:)\\s+((?:phosphor:)?[a-z][a-z0-9-]*)(?:\\s+(thin|light|regular|bold|fill|duotone))?",
|
|
64
|
+
"captures": {
|
|
65
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
66
|
+
"2": { "name": "entity.name.function.brand-intent-purpose" },
|
|
67
|
+
"3": { "name": "variable.parameter.brand-intent-purpose" }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"scope-header": {
|
|
71
|
+
"match": "^(scope)\\s*$",
|
|
72
|
+
"captures": {
|
|
73
|
+
"1": { "name": "keyword.control.brand-intent-purpose" }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"voice-header": {
|
|
77
|
+
"match": "^(voice)\\s*$",
|
|
78
|
+
"captures": {
|
|
79
|
+
"1": { "name": "keyword.control.brand-intent-purpose" }
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"voice-property": {
|
|
83
|
+
"match": "^\\s{2}(sentence-max|headline-pattern|number-format|[\\w-]+)(:)\\s+(.*)",
|
|
84
|
+
"comment": "Indented key: value pairs inside a voice block",
|
|
85
|
+
"captures": {
|
|
86
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
87
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
88
|
+
"3": { "name": "string.unquoted.brand-intent-purpose" }
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"palette-header": {
|
|
92
|
+
"patterns": [
|
|
93
|
+
{
|
|
94
|
+
"match": "^(palette:)\\s+(dynamic)",
|
|
95
|
+
"captures": {
|
|
96
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
97
|
+
"2": { "name": "support.constant.brand-intent-purpose" }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"match": "^(palette:)\\s+([\\w-]+)",
|
|
102
|
+
"captures": {
|
|
103
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
104
|
+
"2": { "name": "entity.name.type.brand-intent-purpose" }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"asset-field": {
|
|
110
|
+
"match": "^(logo:|photo:|video:)\\s+([\\w-]+)",
|
|
111
|
+
"captures": {
|
|
112
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
113
|
+
"2": { "name": "entity.name.type.brand-intent-purpose" }
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"camera-field": {
|
|
117
|
+
"match": "^(camera:)\\s+(true|false)",
|
|
118
|
+
"captures": {
|
|
119
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
120
|
+
"2": { "name": "constant.language.brand-intent-purpose" }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"analyze-field": {
|
|
124
|
+
"match": "^(analyze:)\\s+(true|false)",
|
|
125
|
+
"captures": {
|
|
126
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
127
|
+
"2": { "name": "constant.language.brand-intent-purpose" }
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"bg-prompt-field": {
|
|
131
|
+
"match": "^(bg-prompt:)\\s+(.*)",
|
|
132
|
+
"captures": {
|
|
133
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
134
|
+
"2": { "name": "string.unquoted.brand-intent-purpose" }
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"context-header": {
|
|
138
|
+
"match": "^(context)\\s*$",
|
|
139
|
+
"captures": {
|
|
140
|
+
"1": { "name": "keyword.control.brand-intent-purpose" }
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"slot-header": {
|
|
144
|
+
"match": "^(slot)\\s+(primary|secondary|detail|meta|cta|label)",
|
|
145
|
+
"captures": {
|
|
146
|
+
"1": { "name": "keyword.control.brand-intent-purpose" },
|
|
147
|
+
"2": { "name": "entity.name.tag.brand-intent-purpose" }
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"override-header": {
|
|
151
|
+
"match": "^\\s+(override:)\\s*$",
|
|
152
|
+
"captures": {
|
|
153
|
+
"1": { "name": "keyword.control.brand-intent-purpose" }
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"override-value": {
|
|
157
|
+
"comment": "Indented override sub-properties (double-indent under override:); italic/uppercase can be bare flags",
|
|
158
|
+
"patterns": [
|
|
159
|
+
{
|
|
160
|
+
"match": "^\\s{4,}(size|opsz|lineHeight|letterSpacing|weight)(:)\\s+(.*)",
|
|
161
|
+
"captures": {
|
|
162
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
163
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
164
|
+
"3": { "name": "constant.numeric.brand-intent-purpose" }
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"match": "^\\s{4,}(italic|uppercase|hyphenate)(?:(:)\\s+(true|false))?\\s*$",
|
|
169
|
+
"captures": {
|
|
170
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
171
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
172
|
+
"3": { "name": "constant.language.brand-intent-purpose" }
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"match": "^\\s{4,}(textAlign)(:)\\s+(left|center|right|justify)",
|
|
177
|
+
"captures": {
|
|
178
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
179
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
180
|
+
"3": { "name": "support.constant.brand-intent-purpose" }
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"match": "^\\s{4,}(autofit-min|autofit-max)(:)\\s+(.*)",
|
|
185
|
+
"captures": {
|
|
186
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
187
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
188
|
+
"3": { "name": "constant.numeric.brand-intent-purpose" }
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"match": "^\\s{4,}(autofit)(:)\\s+(none)",
|
|
193
|
+
"captures": {
|
|
194
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
195
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
196
|
+
"3": { "name": "string.unquoted.brand-intent-purpose" }
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"property": {
|
|
202
|
+
"match": "^\\s+(label|samples|value|maxLength|font|size|opsz|lineHeight|letterSpacing|align|typography|color|type|editable)(:)\\s+(.*)",
|
|
203
|
+
"captures": {
|
|
204
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
205
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
206
|
+
"3": { "name": "string.unquoted.brand-intent-purpose" }
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"list-property": {
|
|
210
|
+
"comment": "4-space indented properties under type: list blocks",
|
|
211
|
+
"match": "^\\s{4,}(marker|icons|iconOnly|iconGap|itemGap|maxItems|direction)(:)\\s+(.*)",
|
|
212
|
+
"captures": {
|
|
213
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
214
|
+
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|
|
215
|
+
"3": { "name": "constant.numeric.brand-intent-purpose" }
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"sample-item": {
|
|
219
|
+
"comment": "Multi-line sample entries -- dim only the dash, leave text unstyled",
|
|
220
|
+
"match": "^(\\s{4,})(-)(?=\\s)(?:\\s+(\\[[^\\]]+\\]))?",
|
|
221
|
+
"captures": {
|
|
222
|
+
"2": { "name": "comment.line.dash.brand-intent-purpose" },
|
|
223
|
+
"3": { "name": "entity.name.function.brand-intent-purpose" }
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"sample-icon-continuation": {
|
|
227
|
+
"comment": "[ID] icon prefix on list item continuation lines",
|
|
228
|
+
"match": "^(\\s{6,})(\\[[^\\]]+\\])",
|
|
229
|
+
"captures": {
|
|
230
|
+
"2": { "name": "entity.name.function.brand-intent-purpose" }
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"keyword-partial": {
|
|
234
|
+
"comment": "Fallback: color the keyword token on incomplete lines (while typing)",
|
|
235
|
+
"patterns": [
|
|
236
|
+
{
|
|
237
|
+
"match": "^(id:|name:|compositions:|density:|defaultIcon:|scope|voice|palette:|logo:|photo:|video:|camera:|analyze:|bg-prompt:|context|slot)(?=\\s|$)",
|
|
238
|
+
"captures": {
|
|
239
|
+
"1": { "name": "keyword.control.brand-intent-purpose" }
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"match": "^\\s+(label|samples|value|maxLength|font|size|opsz|lineHeight|letterSpacing|align|typography|color|type|override|audience|pillars|editable)(?=:|\\s|$)",
|
|
244
|
+
"captures": {
|
|
245
|
+
"1": { "name": "support.type.property-name.brand-intent-purpose" }
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|