0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotItem.ts
Jordi Sala Morales 73ccf83657
Vectors - Pen & pencil (#35)
* path shapes

* add polygon node

* wip vector

* implement translation of commands and paths

* vectors and polygon

* strokes

* star

* deformed shapes

* simplify star

* simplify star

* fix transformers

---------

Co-authored-by: Alex Sánchez <sion333@gmail.com>
2024-04-16 16:08:39 +02:00

31 lines
817 B
TypeScript

import { PenpotFile } from '@ui/lib/penpot';
import { PenpotNode } from '@ui/lib/types/penpotNode';
import {
createPenpotArtboard,
createPenpotCircle,
createPenpotGroup,
createPenpotImage,
createPenpotPath,
createPenpotRectangle,
createPenpotText
} from '.';
export const createPenpotItem = (file: PenpotFile, node: PenpotNode) => {
switch (node.type) {
case 'rect':
return createPenpotRectangle(file, node);
case 'circle':
return createPenpotCircle(file, node);
case 'frame':
return createPenpotArtboard(file, node);
case 'group':
return createPenpotGroup(file, node);
case 'image':
return createPenpotImage(file, node);
case 'path':
return createPenpotPath(file, node);
case 'text':
return createPenpotText(file, node);
}
};