0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-18 05:22:28 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotArtboard.ts
2024-05-27 13:04:42 +02:00

22 lines
598 B
TypeScript

import { PenpotFile } from '@ui/lib/types/penpotFile';
import { FrameShape } from '@ui/lib/types/shapes/frameShape';
import { translateFillGradients, translateUiBlendMode } from '@ui/translators';
import { createPenpotItem } from '.';
export const createPenpotArtboard = (
file: PenpotFile,
{ type, fills, blendMode, children = [], ...rest }: FrameShape
) => {
file.addArtboard({
fills: translateFillGradients(fills),
blendMode: translateUiBlendMode(blendMode),
...rest
});
for (const child of children) {
createPenpotItem(file, child);
}
file.closeArtboard();
};