0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00

Merge branch 'main' into hotfix/detect-collision-on-vectors

This commit is contained in:
Alex Sánchez 2024-05-27 16:27:59 +02:00
commit 0a1ea52ef6
No known key found for this signature in database
GPG key ID: 68A95170EEB87E16
3 changed files with 18 additions and 7 deletions

View file

@ -0,0 +1,5 @@
---
"penpot-exporter": patch
---
Fix frames fills and blendModes

View file

@ -1,13 +1,18 @@
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, children = [], ...rest }: FrameShape
{ type, fills, blendMode, children = [], ...rest }: FrameShape
) => {
file.addArtboard(rest);
file.addArtboard({
fills: translateFillGradients(fills),
blendMode: translateUiBlendMode(blendMode),
...rest
});
for (const child of children) {
createPenpotItem(file, child);

View file

@ -1,11 +1,14 @@
import { LayoutAttributes, LayoutChildAttributes } from '@ui/lib/types/shapes/layout';
import { ShapeBaseAttributes, ShapeGeomAttributes } from '@ui/lib/types/shapes/shape';
import {
ShapeAttributes,
ShapeBaseAttributes,
ShapeGeomAttributes
} from '@ui/lib/types/shapes/shape';
import { Children } from '@ui/lib/types/utils/children';
import { Fill } from '@ui/lib/types/utils/fill';
import { Stroke } from '@ui/lib/types/utils/stroke';
import { Uuid } from '@ui/lib/types/utils/uuid';
export type FrameShape = ShapeBaseAttributes &
ShapeAttributes &
ShapeGeomAttributes &
FrameAttributes &
LayoutAttributes &
@ -18,6 +21,4 @@ type FrameAttributes = {
hideFillOnExport?: boolean;
showContent?: boolean;
hideInViewer?: boolean;
fills?: Fill[];
strokes?: Stroke[];
};