handoff-app 0.12.0 → 0.12.1
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/Changelog.md +10 -0
- package/dist/cli.js +1 -1
- package/dist/exporters/components/extractor.js +1 -1
- package/dist/exporters/components/index.js +1 -1
- package/dist/types/plugin.d.ts +1 -0
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/exporters/components/extractor.ts +7 -8
- package/src/exporters/components/index.ts +1 -1
- package/src/types/plugin.ts +1 -0
package/Changelog.md
CHANGED
|
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [0.12.1] - 2024-06-18
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
* Added support for the `cssRootClass` property in the Handoff Figma plugin metadata.
|
|
14
|
+
|
|
15
|
+
### Improvements
|
|
16
|
+
|
|
17
|
+
* Enhanced handling of unnamed parts, resolving visibility issues in the documentation previews.
|
|
18
|
+
|
|
9
19
|
## [0.12.0] - 2024-06-11
|
|
10
20
|
|
|
11
21
|
### Changes
|
package/dist/cli.js
CHANGED
|
@@ -59,7 +59,7 @@ function extractComponentInstances(components, definition, legacyDefinition) {
|
|
|
59
59
|
}
|
|
60
60
|
var parts = definition.parts.reduce(function (previous, current) {
|
|
61
61
|
var _a;
|
|
62
|
-
return
|
|
62
|
+
return __assign(__assign({}, previous), (_a = {}, _a[current.id || '$'] = extractComponentPartTokenSets(rootNode, current, variantProperties), _a));
|
|
63
63
|
}, {});
|
|
64
64
|
var instance = {
|
|
65
65
|
id: id,
|
|
@@ -114,7 +114,7 @@ var getComponentSetComponentDefinition = function (componentSet) {
|
|
|
114
114
|
sharedComponentVariants: metadata.sharedVariants,
|
|
115
115
|
},
|
|
116
116
|
transformer: {
|
|
117
|
-
cssRootClass: name,
|
|
117
|
+
cssRootClass: metadata.cssRootClass || name,
|
|
118
118
|
tokenNameSegments: metadata.tokenNameSegments,
|
|
119
119
|
replace: groupReplaceRules(metadata.replacements),
|
|
120
120
|
},
|
package/dist/types/plugin.d.ts
CHANGED
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -40,11 +40,11 @@ export default function extractComponentInstances(
|
|
|
40
40
|
isLayoutComponent = true;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
if (!isLayoutComponent) {
|
|
45
45
|
rootNode = findChildNodeWithType(component.node, 'INSTANCE');
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
if (!rootNode) {
|
|
49
49
|
throw new Error(`No instance node found for component ${component.node.name}`);
|
|
50
50
|
}
|
|
@@ -55,13 +55,12 @@ export default function extractComponentInstances(
|
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const parts = definition.parts.reduce(
|
|
59
|
-
|
|
58
|
+
const parts = definition.parts.reduce((previous, current) => {
|
|
59
|
+
return {
|
|
60
60
|
...previous,
|
|
61
|
-
...{ [current.id]: extractComponentPartTokenSets(rootNode, current, variantProperties) },
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
);
|
|
61
|
+
...{ [current.id || '$']: extractComponentPartTokenSets(rootNode, current, variantProperties) },
|
|
62
|
+
};
|
|
63
|
+
}, {});
|
|
65
64
|
|
|
66
65
|
const instance = {
|
|
67
66
|
id,
|
|
@@ -65,7 +65,7 @@ const getComponentSetComponentDefinition = (componentSet: FigmaTypes.ComponentSe
|
|
|
65
65
|
sharedComponentVariants: metadata.sharedVariants,
|
|
66
66
|
},
|
|
67
67
|
transformer: {
|
|
68
|
-
cssRootClass: name,
|
|
68
|
+
cssRootClass: metadata.cssRootClass || name,
|
|
69
69
|
tokenNameSegments: metadata.tokenNameSegments,
|
|
70
70
|
replace: groupReplaceRules(metadata.replacements),
|
|
71
71
|
},
|
package/src/types/plugin.ts
CHANGED