0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-21 15:02:27 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformBooleanNode.ts

41 lines
1.1 KiB
TypeScript
Raw Normal View History

import {
transformBlend,
transformChildren,
transformDimensionAndPosition,
transformEffects,
transformFigmaIds,
transformFills,
2024-06-14 08:15:49 +02:00
transformLayoutAttributes,
transformLayoutItemZIndex,
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,
2024-06-14 08:15:49 +02:00
baseY: number,
zIndex: number
): Promise<BoolShape> => {
return {
type: 'bool',
name: node.name,
boolType: translateBoolType(node.booleanOperation),
2024-06-14 08:15:49 +02:00
...transformLayoutItemZIndex(zIndex),
...transformFigmaIds(node),
...(await transformChildren(node, baseX, baseY)),
...transformFills(node),
...transformEffects(node),
...transformStrokes(node),
...transformDimensionAndPosition(node, baseX, baseY),
...transformSceneNode(node),
...transformBlend(node),
2024-06-11 09:26:38 +02:00
...transformProportion(node),
2024-06-14 08:15:49 +02:00
...transformLayoutAttributes(node)
};
};