0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-10 17:10:06 -05:00
penpot-exporter-figma-plugin/ui-src/parser/creators/createPath.ts

18 lines
658 B
TypeScript
Raw Normal View History

import { PenpotFile } from '@ui/lib/types/penpotFile';
import { PathShape } from '@ui/lib/types/shapes/pathShape';
import { parseFigmaId } from '@ui/parser';
import { symbolFills, symbolPathContent, symbolStrokes } from '@ui/parser/creators/symbols';
export const createPath = (
file: PenpotFile,
{ type, figmaId, figmaRelatedId, ...shape }: PathShape
) => {
shape.id = parseFigmaId(file, figmaId);
shape.shapeRef = parseFigmaId(file, figmaRelatedId, true);
shape.fills = symbolFills(shape.fillStyleId, shape.fills);
shape.strokes = symbolStrokes(shape.strokes);
shape.content = symbolPathContent(shape.content);
file.createPath(shape);
};