0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-06 23:00:55 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformTextNode.ts
2024-06-11 09:26:38 +02:00

31 lines
833 B
TypeScript

import {
transformBlend,
transformConstraints,
transformDimensionAndPosition,
transformEffects,
transformFigmaIds,
transformLayoutSizing,
transformProportion,
transformSceneNode,
transformStrokes,
transformText
} from '@plugin/transformers/partials';
import { TextShape } from '@ui/lib/types/shapes/textShape';
export const transformTextNode = (node: TextNode, baseX: number, baseY: number): TextShape => {
return {
type: 'text',
name: node.name,
...transformFigmaIds(node),
...transformText(node),
...transformDimensionAndPosition(node, baseX, baseY),
...transformEffects(node),
...transformSceneNode(node),
...transformBlend(node),
...transformProportion(node),
...transformLayoutSizing(node),
...transformStrokes(node),
...transformConstraints(node)
};
};