Skip to content

Commit 9103f7a

Browse files
committed
Rename InferredAutoLayoutResult that was changed by Figma.
1 parent c9ec835 commit 9103f7a

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

packages/backend/src/common/commonPadding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type PaddingType =
1212
};
1313

1414
export const commonPadding = (
15-
node: inferredAutoLayoutResult
15+
node: InferredAutoLayoutResult
1616
): PaddingType | null => {
1717
if ("layoutMode" in node && node.layoutMode !== "NONE") {
1818
const paddingLeft = parseFloat((node.paddingLeft ?? 0).toFixed(2));

packages/backend/src/flutter/builderImpl/flutterAutoLayout.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const getMainAxisAlignment = (
2-
node: inferredAutoLayoutResult
2+
node: InferredAutoLayoutResult
33
): string => {
44
switch (node.primaryAxisAlignItems) {
55
case "MIN":
@@ -14,7 +14,7 @@ export const getMainAxisAlignment = (
1414
};
1515

1616
export const getCrossAxisAlignment = (
17-
node: inferredAutoLayoutResult
17+
node: InferredAutoLayoutResult
1818
): string => {
1919
switch (node.counterAxisAlignItems) {
2020
case "MIN":
@@ -30,7 +30,7 @@ export const getCrossAxisAlignment = (
3030

3131
const getFlex = (
3232
node: SceneNode,
33-
autoLayout: inferredAutoLayoutResult
33+
autoLayout: InferredAutoLayoutResult
3434
): string =>
3535
node.parent &&
3636
"layoutMode" in node.parent &&

packages/backend/src/flutter/builderImpl/flutterPadding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
import { commonPadding } from "../../common/commonPadding";
77

88
// This must happen before Stack or after the Positioned, but not before.
9-
export const flutterPadding = (node: inferredAutoLayoutResult): string => {
9+
export const flutterPadding = (node: InferredAutoLayoutResult): string => {
1010
if (!("layoutMode" in node)) {
1111
return "";
1212
}

packages/backend/src/flutter/flutterMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const flutterFrame = (
191191
};
192192

193193
const makeRowColumn = (
194-
autoLayout: inferredAutoLayoutResult,
194+
autoLayout: InferredAutoLayoutResult,
195195
children: string
196196
): string => {
197197
const rowOrColumn = autoLayout.layoutMode === "HORIZONTAL" ? "Row" : "Column";

packages/backend/src/html/builderImpl/htmlAutoLayout.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { formatMultipleJSXArray } from "../../common/parseJSX";
22

3-
const getFlexDirection = (node: inferredAutoLayoutResult): string =>
3+
const getFlexDirection = (node: InferredAutoLayoutResult): string =>
44
node.layoutMode === "HORIZONTAL" ? "" : "column";
55

6-
const getJustifyContent = (node: inferredAutoLayoutResult): string => {
6+
const getJustifyContent = (node: InferredAutoLayoutResult): string => {
77
switch (node.primaryAxisAlignItems) {
88
case "MIN":
99
return "flex-start";
@@ -16,7 +16,7 @@ const getJustifyContent = (node: inferredAutoLayoutResult): string => {
1616
}
1717
};
1818

19-
const getAlignItems = (node: inferredAutoLayoutResult): string => {
19+
const getAlignItems = (node: InferredAutoLayoutResult): string => {
2020
switch (node.counterAxisAlignItems) {
2121
case "MIN":
2222
return "flex-start";
@@ -29,14 +29,14 @@ const getAlignItems = (node: inferredAutoLayoutResult): string => {
2929
}
3030
};
3131

32-
const getGap = (node: inferredAutoLayoutResult): string | number =>
32+
const getGap = (node: InferredAutoLayoutResult): string | number =>
3333
node.itemSpacing > 0 && node.primaryAxisAlignItems !== "SPACE_BETWEEN"
3434
? node.itemSpacing
3535
: "";
3636

3737
const getFlex = (
3838
node: SceneNode,
39-
autoLayout: inferredAutoLayoutResult
39+
autoLayout: InferredAutoLayoutResult
4040
): string =>
4141
node.parent &&
4242
"layoutMode" in node.parent &&
@@ -46,7 +46,7 @@ const getFlex = (
4646

4747
export const htmlAutoLayoutProps = (
4848
node: SceneNode,
49-
autoLayout: inferredAutoLayoutResult,
49+
autoLayout: InferredAutoLayoutResult,
5050
isJsx: boolean
5151
): string[] =>
5252
formatMultipleJSXArray(

packages/backend/src/html/builderImpl/htmlPadding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { commonPadding } from "../../common/commonPadding";
22
import { formatWithJSX } from "../../common/parseJSX";
33

44
export const htmlPadding = (
5-
node: inferredAutoLayoutResult,
5+
node: InferredAutoLayoutResult,
66
isJsx: boolean
77
): string[] => {
88
const padding = commonPadding(node);

packages/backend/src/swiftui/builderImpl/swiftuiPadding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { commonPadding } from "../../common/commonPadding";
33
import { Modifier } from "./swiftuiParser";
44

55
export const swiftuiPadding = (
6-
node: inferredAutoLayoutResult
6+
node: InferredAutoLayoutResult
77
): Modifier | null => {
88
if (!("layoutMode" in node)) {
99
return null;

packages/backend/src/swiftui/swiftuiMain.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ const swiftuiFrame = (
169169

170170
const createDirectionalStack = (
171171
children: string,
172-
inferredAutoLayout: inferredAutoLayoutResult
172+
inferredAutoLayout: InferredAutoLayoutResult
173173
): string => {
174174
if (inferredAutoLayout.layoutMode !== "NONE") {
175175
return generateSwiftViewCode(
@@ -186,7 +186,7 @@ const createDirectionalStack = (
186186
};
187187

188188
const getLayoutAlignment = (
189-
inferredAutoLayout: inferredAutoLayoutResult
189+
inferredAutoLayout: InferredAutoLayoutResult
190190
): string => {
191191
switch (inferredAutoLayout.counterAxisAlignItems) {
192192
case "MIN":
@@ -202,7 +202,7 @@ const getLayoutAlignment = (
202202
}
203203
};
204204

205-
const getSpacing = (inferredAutoLayout: inferredAutoLayoutResult): number => {
205+
const getSpacing = (inferredAutoLayout: InferredAutoLayoutResult): number => {
206206
const defaultSpacing = 10;
207207
return Math.round(inferredAutoLayout.itemSpacing) !== defaultSpacing
208208
? inferredAutoLayout.itemSpacing

packages/backend/src/tailwind/builderImpl/tailwindAutoLayout.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { pxToLayoutSize } from "../conversionTables";
22

3-
const getFlexDirection = (node: inferredAutoLayoutResult): string =>
3+
const getFlexDirection = (node: InferredAutoLayoutResult): string =>
44
node.layoutMode === "HORIZONTAL" ? "" : "flex-col";
55

6-
const getJustifyContent = (node: inferredAutoLayoutResult): string => {
6+
const getJustifyContent = (node: InferredAutoLayoutResult): string => {
77
switch (node.primaryAxisAlignItems) {
88
case "MIN":
99
return "justify-start";
@@ -16,7 +16,7 @@ const getJustifyContent = (node: inferredAutoLayoutResult): string => {
1616
}
1717
};
1818

19-
const getAlignItems = (node: inferredAutoLayoutResult): string => {
19+
const getAlignItems = (node: InferredAutoLayoutResult): string => {
2020
switch (node.counterAxisAlignItems) {
2121
case "MIN":
2222
return "items-start";
@@ -29,14 +29,14 @@ const getAlignItems = (node: inferredAutoLayoutResult): string => {
2929
}
3030
};
3131

32-
const getGap = (node: inferredAutoLayoutResult): string =>
32+
const getGap = (node: InferredAutoLayoutResult): string =>
3333
node.itemSpacing > 0 && node.primaryAxisAlignItems !== "SPACE_BETWEEN"
3434
? `gap-${pxToLayoutSize(node.itemSpacing)}`
3535
: "";
3636

3737
const getFlex = (
3838
node: SceneNode,
39-
autoLayout: inferredAutoLayoutResult
39+
autoLayout: InferredAutoLayoutResult
4040
): string =>
4141
node.parent &&
4242
"layoutMode" in node.parent &&
@@ -46,7 +46,7 @@ const getFlex = (
4646

4747
export const tailwindAutoLayoutProps = (
4848
node: SceneNode,
49-
autoLayout: inferredAutoLayoutResult
49+
autoLayout: InferredAutoLayoutResult
5050
): string =>
5151
Object.values({
5252
flexDirection: getFlexDirection(autoLayout),

packages/backend/src/tailwind/builderImpl/tailwindPadding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { commonPadding } from "../../common/commonPadding";
55
* https://tailwindcss.com/docs/margin/
66
* example: px-2 py-8
77
*/
8-
export const tailwindPadding = (node: inferredAutoLayoutResult): string[] => {
8+
export const tailwindPadding = (node: InferredAutoLayoutResult): string[] => {
99
const padding = commonPadding(node);
1010
if (!padding) {
1111
return [];

0 commit comments

Comments
 (0)