0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotBool.ts

23 lines
688 B
TypeScript
Raw Permalink Normal View History

import { createPenpotItem } from '@ui/converters/createPenpotItem';
import { PenpotFile } from '@ui/lib/types/penpotFile';
import { BoolShape } from '@ui/lib/types/shapes/boolShape';
import { translateFillGradients, translateUiBlendMode, translateUiBoolType } from '@ui/translators';
export const createPenpotBool = (
file: PenpotFile,
{ type, fills, boolType, blendMode, children = [], ...rest }: BoolShape
) => {
file.addBool({
fills: translateFillGradients(fills),
blendMode: translateUiBlendMode(blendMode),
boolType: translateUiBoolType(boolType),
...rest
});
for (const child of children) {
createPenpotItem(file, child);
}
file.closeBool();
};