mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-09 08:30:08 -05:00
26 lines
931 B
TypeScript
26 lines
931 B
TypeScript
|
import {
|
||
|
translateLayoutFlexDir,
|
||
|
translateLayoutGap,
|
||
|
translateLayoutJustifyContent,
|
||
|
translateLayoutJustifyItems,
|
||
|
translateLayoutPadding,
|
||
|
translateLayoutWrapType
|
||
|
} from '@plugin/translators';
|
||
|
|
||
|
import { LayoutAttributes } from '@ui/lib/types/shapes/layout';
|
||
|
|
||
|
export const transformAutoLayout = (node: BaseFrameMixin): LayoutAttributes => {
|
||
|
console.log(node);
|
||
|
return {
|
||
|
layout: node.layoutMode !== 'NONE' ? 'flex' : undefined,
|
||
|
layoutFlexDir: translateLayoutFlexDir(node.layoutMode),
|
||
|
layoutGap: translateLayoutGap(node.layoutMode, node.itemSpacing),
|
||
|
layoutWrapType: translateLayoutWrapType(node.layoutWrap),
|
||
|
layoutPadding: translateLayoutPadding(node),
|
||
|
layoutJustifyContent: translateLayoutJustifyContent(node),
|
||
|
layoutJustifyItems: translateLayoutJustifyItems(node),
|
||
|
layoutAlignContent: translateLayoutJustifyContent(node),
|
||
|
layoutAlignItems: translateLayoutJustifyItems(node)
|
||
|
};
|
||
|
};
|