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/src/ui/converters/createPenpotGroup.ts

21 lines
431 B
TypeScript
Raw Normal View History

2024-04-08 10:50:01 -05:00
import { createPenpotItem } from '.';
2024-04-09 01:51:34 -05:00
import { ExportFile, NodeData } from '../../common/interfaces';
2024-04-08 10:50:01 -05:00
export const createPenpotGroup = (
2024-04-09 01:51:34 -05:00
file: ExportFile,
2024-04-08 10:50:01 -05:00
node: NodeData,
baseX: number,
baseY: number
) => {
2024-04-10 06:14:12 -05:00
file.penpotFile.addGroup({
type: Symbol.for('group'),
name: node.name
});
2024-04-08 10:50:01 -05:00
for (const child of node.children) {
createPenpotItem(file, child, baseX, baseY);
}
2024-04-10 06:14:12 -05:00
2024-04-09 01:51:34 -05:00
file.penpotFile.closeGroup();
2024-04-08 10:50:01 -05:00
};