2024-05-29 05:52:21 -05:00
|
|
|
import { PenpotFile } from '@ui/lib/types/penpotFile';
|
|
|
|
import { PathShape } from '@ui/lib/types/shapes/pathShape';
|
2024-05-30 10:54:37 -05:00
|
|
|
import { parseFigmaId } from '@ui/parser';
|
2024-05-29 05:52:21 -05:00
|
|
|
import {
|
|
|
|
symbolBlendMode,
|
|
|
|
symbolFillGradients,
|
|
|
|
symbolPathContent
|
|
|
|
} from '@ui/parser/creators/symbols';
|
|
|
|
|
|
|
|
export const createPath = (
|
|
|
|
file: PenpotFile,
|
2024-05-30 10:54:37 -05:00
|
|
|
{ type, fills, blendMode, content, figmaId, figmaRelatedId, ...rest }: PathShape
|
2024-05-29 05:52:21 -05:00
|
|
|
) => {
|
|
|
|
file.createPath({
|
2024-05-30 10:54:37 -05:00
|
|
|
id: parseFigmaId(file, figmaId),
|
|
|
|
shapeRef: parseFigmaId(file, figmaRelatedId, true),
|
2024-05-29 05:52:21 -05:00
|
|
|
fills: symbolFillGradients(fills),
|
|
|
|
blendMode: symbolBlendMode(blendMode),
|
|
|
|
content: symbolPathContent(content),
|
|
|
|
...rest
|
|
|
|
});
|
|
|
|
};
|