mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-18 05:22:28 -05:00
22 lines
598 B
TypeScript
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();
|
|
};
|