2024-05-29 05:52:21 -05:00
|
|
|
import { PenpotFile } from '@ui/lib/types/penpotFile';
|
|
|
|
import { BoolShape } from '@ui/lib/types/shapes/boolShape';
|
2024-05-30 10:54:37 -05:00
|
|
|
import { parseFigmaId } from '@ui/parser';
|
2024-06-03 10:29:33 -05:00
|
|
|
import { symbolBlendMode, symbolBoolType, symbolFills } from '@ui/parser/creators/symbols';
|
2024-05-29 05:52:21 -05:00
|
|
|
|
|
|
|
import { createItems } from '.';
|
|
|
|
|
|
|
|
export const createBool = (
|
|
|
|
file: PenpotFile,
|
2024-05-30 10:54:37 -05:00
|
|
|
{ type, fills, boolType, blendMode, figmaId, figmaRelatedId, children = [], ...rest }: BoolShape
|
2024-05-29 05:52:21 -05:00
|
|
|
) => {
|
|
|
|
file.addBool({
|
2024-05-30 10:54:37 -05:00
|
|
|
id: parseFigmaId(file, figmaId),
|
|
|
|
shapeRef: parseFigmaId(file, figmaRelatedId, true),
|
2024-06-03 10:29:33 -05:00
|
|
|
fills: symbolFills(fills),
|
2024-05-29 05:52:21 -05:00
|
|
|
blendMode: symbolBlendMode(blendMode),
|
|
|
|
boolType: symbolBoolType(boolType),
|
|
|
|
...rest
|
|
|
|
});
|
|
|
|
|
|
|
|
createItems(file, children);
|
|
|
|
|
|
|
|
file.closeBool();
|
|
|
|
};
|