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 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
@@ -80,7 +80,7 @@ var showHelp = function () {
80
80
  * Show the help message
81
81
  */
82
82
  var showVersion = function () {
83
- cliError('Handoff App - 0.12.0', 2);
83
+ cliError('Handoff App - 0.12.1', 2);
84
84
  };
85
85
  /**
86
86
  * Define a CLI error
@@ -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 (__assign(__assign({}, previous), (_a = {}, _a[current.id] = extractComponentPartTokenSets(rootNode, current, variantProperties), _a)));
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
  },
@@ -10,6 +10,7 @@ export interface IComponentSetMetadata {
10
10
  };
11
11
  replacements: IVariantPropValueReplacement[];
12
12
  sharedVariants: ISharedComponentVariant[];
13
+ cssRootClass?: string;
13
14
  }
14
15
  export interface IComponentPart {
15
16
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handoff-app",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Automated documentation toolchain for building client side documentation from figma",
5
5
  "author ": {
6
6
  "name": "Convertiv",
package/src/cli.ts CHANGED
@@ -55,7 +55,7 @@ const showHelp = () => {
55
55
  * Show the help message
56
56
  */
57
57
  const showVersion = () => {
58
- cliError('Handoff App - 0.12.0', 2);
58
+ cliError('Handoff App - 0.12.1', 2);
59
59
  };
60
60
 
61
61
  /**
@@ -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
- (previous, current) => ({
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
  },
@@ -10,6 +10,7 @@ export interface IComponentSetMetadata {
10
10
  defaults: { [variantProperty: string]: string };
11
11
  replacements: IVariantPropValueReplacement[];
12
12
  sharedVariants: ISharedComponentVariant[];
13
+ cssRootClass?: string;
13
14
  }
14
15
 
15
16
  export interface IComponentPart {