0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-05 06:10:52 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotItem.ts

32 lines
824 B
TypeScript
Raw Normal View History

2024-05-13 03:12:58 -05:00
import { PenpotFile } from '@ui/lib/types/penpotFile';
import { PenpotNode } from '@ui/lib/types/penpotNode';
2024-04-08 10:50:01 -05:00
import {
createPenpotArtboard,
createPenpotBool,
2024-04-08 10:50:01 -05:00
createPenpotCircle,
createPenpotGroup,
createPenpotPath,
2024-04-08 10:50:01 -05:00
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);
case 'bool':
return createPenpotBool(file, node);
2024-04-08 10:50:01 -05:00
}
};