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/parser/creators/createGroup.ts

23 lines
626 B
TypeScript
Raw Normal View History

2024-05-13 03:12:58 -05:00
import { PenpotFile } from '@ui/lib/types/penpotFile';
2024-05-06 01:06:14 -05:00
import { GroupShape } from '@ui/lib/types/shapes/groupShape';
import { parseFigmaId } from '@ui/parser';
import { symbolBlendMode } from '@ui/parser/creators/symbols';
import { createItems } from '.';
2024-04-08 10:50:01 -05:00
export const createGroup = (
file: PenpotFile,
{ type, blendMode, children = [], figmaId, figmaRelatedId, ...rest }: GroupShape
2024-04-08 10:50:01 -05:00
) => {
file.addGroup({
id: parseFigmaId(file, figmaId),
shapeRef: parseFigmaId(file, figmaRelatedId, true),
blendMode: symbolBlendMode(blendMode),
...rest
2024-04-10 06:14:12 -05:00
});
createItems(file, children);
2024-04-10 06:14:12 -05:00
file.closeGroup();
2024-04-08 10:50:01 -05:00
};