0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-23 06:04:01 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformBooleanNode.ts
2024-06-11 10:41:06 +02:00

39 lines
1 KiB
TypeScript

import {
transformAutoLayoutPosition,
transformBlend,
transformChildren,
transformDimensionAndPosition,
transformEffects,
transformFigmaIds,
transformFills,
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),
...transformProportion(node),
...transformLayoutSizing(node),
...transformAutoLayoutPosition(node)
};
};