2024-05-29 12:52:21 +02:00
|
|
|
import { PenpotFile } from '@ui/lib/types/penpotFile';
|
|
|
|
import { BoolShape } from '@ui/lib/types/shapes/boolShape';
|
2024-05-30 17:54:37 +02:00
|
|
|
import { parseFigmaId } from '@ui/parser';
|
2024-06-28 12:17:56 +02:00
|
|
|
import {
|
|
|
|
symbolBoolType,
|
|
|
|
symbolFills,
|
|
|
|
symbolStrokes,
|
|
|
|
symbolTouched
|
|
|
|
} from '@ui/parser/creators/symbols';
|
2024-05-29 12:52:21 +02:00
|
|
|
|
|
|
|
import { createItems } from '.';
|
|
|
|
|
|
|
|
export const createBool = (
|
|
|
|
file: PenpotFile,
|
2024-06-18 11:20:51 +02:00
|
|
|
{ type, figmaId, figmaRelatedId, children = [], ...shape }: BoolShape
|
2024-05-29 12:52:21 +02:00
|
|
|
) => {
|
2024-06-18 11:20:51 +02:00
|
|
|
shape.id = parseFigmaId(file, figmaId);
|
|
|
|
shape.shapeRef = parseFigmaId(file, figmaRelatedId, true);
|
2024-06-19 15:58:13 +02:00
|
|
|
shape.fills = symbolFills(shape.fillStyleId, shape.fills);
|
2024-06-18 11:20:51 +02:00
|
|
|
shape.strokes = symbolStrokes(shape.strokes);
|
|
|
|
shape.boolType = symbolBoolType(shape.boolType);
|
2024-06-28 12:17:56 +02:00
|
|
|
shape.touched = symbolTouched(
|
|
|
|
!shape.hidden,
|
|
|
|
undefined,
|
|
|
|
shape.touched,
|
|
|
|
shape.componentPropertyReferences
|
|
|
|
);
|
2024-06-18 11:20:51 +02:00
|
|
|
|
|
|
|
file.addBool(shape);
|
2024-05-29 12:52:21 +02:00
|
|
|
|
|
|
|
createItems(file, children);
|
|
|
|
|
|
|
|
file.closeBool();
|
|
|
|
};
|