mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 21:53:27 -05:00
28 lines
744 B
TypeScript
28 lines
744 B
TypeScript
import { PenpotFile } from '@ui/lib/types/penpotFile';
|
|
import { PenpotNode } from '@ui/lib/types/penpotNode';
|
|
|
|
import {
|
|
createPenpotArtboard,
|
|
createPenpotCircle,
|
|
createPenpotGroup,
|
|
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 'path':
|
|
return createPenpotPath(file, node);
|
|
case 'text':
|
|
return createPenpotText(file, node);
|
|
}
|
|
};
|