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

33 lines
906 B
TypeScript

import {
transformAutoLayoutPosition,
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),
...transformAutoLayoutPosition(node),
...transformStrokes(node),
...transformConstraints(node)
};
};