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
|
|
|
};
|