@penpair/marwes-ui 0.1.2 → 0.1.3
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/dist/tokens.d.ts +1 -1
- package/dist/tokens.js +4 -1
- package/package.json +2 -2
package/dist/tokens.d.ts
CHANGED
|
@@ -71,5 +71,5 @@ export interface SnapshotInput {
|
|
|
71
71
|
* so a Marwes update changes the Marwes sets and never silently loses the project's choices.
|
|
72
72
|
*/
|
|
73
73
|
export declare function buildSnapshot(input: SnapshotInput): TokenSnapshot;
|
|
74
|
-
/** The value of a token as it compares in Penpot: strings are exact, typography
|
|
74
|
+
/** The value of a token as it compares in Penpot: strings are exact, font families and typography are normalised the way Penpot stores them. */
|
|
75
75
|
export declare function normalizeValue(type: string, value: unknown): string;
|
package/dist/tokens.js
CHANGED
|
@@ -165,7 +165,7 @@ export function buildSnapshot(input) {
|
|
|
165
165
|
];
|
|
166
166
|
return { schemaVersion: 1, marwesVersion: version, generatedBy: input.generatedBy, project: name, hash: hashOf({ marwesVersion: version, project: name, sets, themes, unmapped }), unmapped, sets, themes };
|
|
167
167
|
}
|
|
168
|
-
/** The value of a token as it compares in Penpot: strings are exact, typography
|
|
168
|
+
/** The value of a token as it compares in Penpot: strings are exact, font families and typography are normalised the way Penpot stores them. */
|
|
169
169
|
export function normalizeValue(type, value) {
|
|
170
170
|
if (type === "typography" && typeof value === "object" && value !== null) {
|
|
171
171
|
const entry = {};
|
|
@@ -179,5 +179,8 @@ export function normalizeValue(type, value) {
|
|
|
179
179
|
}
|
|
180
180
|
if (type === "color" && typeof value === "string" && /^#[0-9a-f]+$/i.test(value))
|
|
181
181
|
return value.toUpperCase();
|
|
182
|
+
// Penpot stores a font family token as a list (["Inter"]) whatever it was given.
|
|
183
|
+
if (type === "fontFamilies" || type === "fontFamily")
|
|
184
|
+
return (Array.isArray(value) ? value : [value]).map(String).join(",");
|
|
182
185
|
return typeof value === "string" ? value : canonical(value);
|
|
183
186
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penpair/marwes-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The Marwes UI adapter for penpair: Marwes tokens (and your own theme) in your Penpot file, with drift checks against the installed Marwes: snapshot, check, diff, push.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"jiti": "^2.4.2",
|
|
47
|
-
"@penpair/core": "0.1.
|
|
47
|
+
"@penpair/core": "0.1.3"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsc -p tsconfig.json",
|