brand-intent 0.13.0 → 0.14.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.
|
|
3
|
+
"version": "0.14.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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
37
|
"release": "./scripts/release.sh",
|
|
38
|
-
"test": "tsx tests/brandParser.test.ts && tsx tests/identityParser.test.ts && tsx tests/colorSystem.test.ts && tsx tests/icons.test.ts && tsx tests/realBrands.test.ts"
|
|
38
|
+
"test": "tsx tests/brandParser.test.ts && tsx tests/identityParser.test.ts && tsx tests/colorSystem.test.ts && tsx tests/icons.test.ts && tsx tests/purposeParser.test.ts && tsx tests/realBrands.test.ts"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"tsx": "^4.19.0"
|
package/parser/purposeParser.ts
CHANGED
|
@@ -96,7 +96,8 @@ export interface ParsedPurposeSlot {
|
|
|
96
96
|
autofitMin: number;
|
|
97
97
|
autofitMax: number;
|
|
98
98
|
textAlign: 'left' | 'center' | 'right' | 'justify';
|
|
99
|
-
hyphenate
|
|
99
|
+
/** true = hyphenate freely (body text); 'fit' = only when a word doesn't fit at autofit-min. */
|
|
100
|
+
hyphenate: boolean | 'fit';
|
|
100
101
|
}>;
|
|
101
102
|
}
|
|
102
103
|
|
|
@@ -419,6 +420,7 @@ export function parsePurposeFile(content: string, fileName: string): ParsedPurpo
|
|
|
419
420
|
if (prop === 'uppercase: false') { currentSlot.typographyOverrides.uppercase = false; continue; }
|
|
420
421
|
if (prop === 'hyphenate' || prop === 'hyphenate: true') { currentSlot.typographyOverrides.hyphenate = true; continue; }
|
|
421
422
|
if (prop === 'hyphenate: false') { currentSlot.typographyOverrides.hyphenate = false; continue; }
|
|
423
|
+
if (prop === 'hyphenate: fit') { currentSlot.typographyOverrides.hyphenate = 'fit'; continue; }
|
|
422
424
|
if (prop === 'autofit: none' || prop === 'autofit:none') {
|
|
423
425
|
currentSlot.typographyOverrides.autofitMin = -1;
|
|
424
426
|
currentSlot.typographyOverrides.autofitMax = -1;
|
|
@@ -165,7 +165,15 @@
|
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
|
-
"match": "^\\s{4,}(italic|uppercase
|
|
168
|
+
"match": "^\\s{4,}(italic|uppercase)(?:(:)\\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,}(hyphenate)(?:(:)\\s+(true|false|fit))?\\s*$",
|
|
169
177
|
"captures": {
|
|
170
178
|
"1": { "name": "support.type.property-name.brand-intent-purpose" },
|
|
171
179
|
"2": { "name": "punctuation.separator.brand-intent-purpose" },
|