mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-08 16:10:07 -05:00
25 lines
931 B
TypeScript
25 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)
|
|
};
|
|
};
|