mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 21:53:27 -05:00
303cc833a0
* wip * wip * wip * wip * wip * fixes * fixes * fixes * fixes * fixes * fixes * fixes * fixes * fixes
28 lines
810 B
TypeScript
28 lines
810 B
TypeScript
import { PenpotFile } from '@ui/lib/types/penpotFile';
|
|
import { PathShape } from '@ui/lib/types/shapes/pathShape';
|
|
import { parseFigmaId } from '@ui/parser';
|
|
import {
|
|
symbolFills,
|
|
symbolPathContent,
|
|
symbolStrokes,
|
|
symbolTouched
|
|
} 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);
|
|
shape.touched = symbolTouched(
|
|
!shape.hidden,
|
|
undefined,
|
|
shape.touched,
|
|
shape.componentPropertyReferences
|
|
);
|
|
|
|
file.createPath(shape);
|
|
};
|