0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-23 14:14:05 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformBooleanNode.ts

40 lines
1 KiB
TypeScript
Raw Normal View History

import {
2024-06-11 03:41:06 -05:00
transformAutoLayoutPosition,
transformBlend,
transformChildren,
transformDimensionAndPosition,
transformEffects,
transformFigmaIds,
transformFills,
2024-06-11 02:26:38 -05:00
transformLayoutSizing,
transformProportion,
transformSceneNode,
transformStrokes
} from '@plugin/transformers/partials';
import { translateBoolType } from '@plugin/translators';
import { BoolShape } from '@ui/lib/types/shapes/boolShape';
export const transformBooleanNode = async (
node: BooleanOperationNode,
baseX: number,
baseY: number
): Promise<BoolShape> => {
return {
type: 'bool',
name: node.name,
boolType: translateBoolType(node.booleanOperation),
...transformFigmaIds(node),
...(await transformChildren(node, baseX, baseY)),
...transformFills(node),
...transformEffects(node),
...transformStrokes(node),
...transformDimensionAndPosition(node, baseX, baseY),
...transformSceneNode(node),
...transformBlend(node),
2024-06-11 02:26:38 -05:00
...transformProportion(node),
2024-06-11 03:41:06 -05:00
...transformLayoutSizing(node),
...transformAutoLayoutPosition(node)
};
};