0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotGroup.ts
2024-05-13 10:12:58 +02:00

21 lines
516 B
TypeScript

import { PenpotFile } from '@ui/lib/types/penpotFile';
import { GroupShape } from '@ui/lib/types/shapes/groupShape';
import { translateUiBlendMode } from '@ui/translators';
import { createPenpotItem } from '.';
export const createPenpotGroup = (
file: PenpotFile,
{ type, blendMode, children = [], ...rest }: GroupShape
) => {
file.addGroup({
blendMode: translateUiBlendMode(blendMode),
...rest
});
for (const child of children) {
createPenpotItem(file, child);
}
file.closeGroup();
};