0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-31 12:03:58 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformTextNode.ts
Alex Sánchez 02fa3363f5
Constraints translation (#142)
* constraints translation

* fix lint

* fixes

* fix vector constraints

* fix lint
2024-06-06 12:17:17 +02:00

29 lines
772 B
TypeScript

import {
transformBlend,
transformConstraints,
transformDimensionAndPosition,
transformEffects,
transformFigmaIds,
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),
...transformStrokes(node),
...transformConstraints(node)
};
};