handoff-app 1.2.2-5 → 1.2.2-6

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": "handoff-app",
3
- "version": "1.2.2-5",
3
+ "version": "1.2.2-6",
4
4
  "description": "Automated documentation toolchain for building client side documentation from figma",
5
5
  "author ": {
6
6
  "name": "Convertiv",
@@ -42,7 +42,7 @@ export const ComponentList = ({
42
42
  const [groupedList, setGroupedList] = React.useState<Record<string, PreviewObject[]>>({});
43
43
 
44
44
  const categories = React.useMemo(() => {
45
- const categories = new Set(components.map((component) => component.group).flat());
45
+ const categories = new Set(components.map((component) => component.group).flat().filter((g): g is string => !!g));
46
46
  return Array.from(categories);
47
47
  }, [components]);
48
48
 
@@ -78,10 +78,12 @@ export const ComponentDisplay: React.FC<{
78
78
  const variantMap: Record<string, Set<string>> = {};
79
79
  Object.values(component.previews).forEach((preview: any) => {
80
80
  Object.entries(preview.values).forEach(([key, value]) => {
81
+ const strValue = String(value);
82
+ if (!strValue) return;
81
83
  if (!variantMap[key]) {
82
84
  variantMap[key] = new Set();
83
85
  }
84
- variantMap[key].add(String(value));
86
+ variantMap[key].add(strValue);
85
87
  });
86
88
  });
87
89
 
@@ -33,13 +33,13 @@ function groupVariantProperties(items: Record<string, string>[]): Record<string,
33
33
 
34
34
  for (const item of items) {
35
35
  for (const [key, value] of Object.entries(item)) {
36
+ if (typeof value !== 'string' || value === '') continue;
36
37
  (grouped[key] ||= new Set()).add(value);
37
38
  }
38
39
  }
39
40
 
40
41
  return Object.fromEntries(
41
42
  Object.entries(grouped).map(([key, set]) => [key, Array.from(set)])
42
- // .filter((i) => i[1].length > 1)
43
43
  );
44
44
  }
45
45