mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 21:53:27 -05:00
672567614b
* first commit * change esbuild * changeset
16 lines
592 B
TypeScript
16 lines
592 B
TypeScript
import { PenpotFile } from '@ui/lib/types/penpotFile';
|
|
import { RectShape } from '@ui/lib/types/shapes/rectShape';
|
|
import { parseFigmaId } from '@ui/parser';
|
|
import { symbolFills, symbolStrokes } from '@ui/parser/creators/symbols';
|
|
|
|
export const createRectangle = (
|
|
file: PenpotFile,
|
|
{ type, figmaId, figmaRelatedId, ...shape }: RectShape
|
|
) => {
|
|
shape.id = parseFigmaId(file, figmaId);
|
|
shape.shapeRef = parseFigmaId(file, figmaRelatedId, true);
|
|
shape.fills = symbolFills(shape.fillStyleId, shape.fills);
|
|
shape.strokes = symbolStrokes(shape.strokes);
|
|
|
|
file.createRect(shape);
|
|
};
|