Skip to content

Commit adf500d

Browse files
authored
Issue 168 component sets (#170)
* fixed issue with component sets * fix linter issue
1 parent 6124a86 commit adf500d

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

packages/backend/src/altNodes/altConversion.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,21 @@ export const cloneNode = <T extends BaseNode>(
8484
// Create the cloned object with the correct prototype
8585
const cloned = {} as T;
8686
// Create a new object with only the desired descriptors (excluding 'parent' and 'children')
87-
const droppedProps = [
88-
"parent",
89-
"children",
90-
"horizontalPadding",
91-
"verticalPadding",
92-
"mainComponent",
93-
"masterComponent",
94-
"variantProperties",
95-
"get_annotations",
96-
"componentPropertyDefinitions",
97-
"exposedInstances",
98-
"componentProperties",
99-
"componenPropertyReferences",
100-
];
10187
for (const prop in node) {
102-
if (prop in droppedProps === false) {
88+
if (
89+
prop !== "parent" &&
90+
prop !== "children" &&
91+
prop !== "horizontalPadding" &&
92+
prop !== "verticalPadding" &&
93+
prop !== "mainComponent" &&
94+
prop !== "masterComponent" &&
95+
prop !== "variantProperties" &&
96+
prop !== "get_annotations" &&
97+
prop !== "componentPropertyDefinitions" &&
98+
prop !== "exposedInstances" &&
99+
prop !== "componentProperties" &&
100+
prop !== "componenPropertyReferences"
101+
) {
103102
cloned[prop as keyof T] = node[prop as keyof T];
104103
}
105104
}

packages/backend/src/common/nodeWidthHeight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const nodeSize = (node: SceneNode, optimizeLayout: boolean): Size => {
2020
// const parentLayoutMode = node.parent.layoutMode;
2121
const parentLayoutMode = optimizeLayout
2222
? node.parent.inferredAutoLayout?.layoutMode
23-
: (null ?? node.parent.layoutMode);
23+
: node.parent.layoutMode;
2424

2525
const isWidthFill =
2626
(parentLayoutMode === "HORIZONTAL" && nodeAuto.layoutGrow === 1) ||

packages/types/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import "@figma/plugin-typings";
12
// Settings
23
export type Framework = "Flutter" | "SwiftUI" | "HTML" | "Tailwind";
34
export interface HTMLSettings {

0 commit comments

Comments
 (0)