diff --git a/.changeset/serious-wolves-help.md b/.changeset/serious-wolves-help.md new file mode 100644 index 0000000..28189a1 --- /dev/null +++ b/.changeset/serious-wolves-help.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fix frames fills and blendModes diff --git a/ui-src/converters/createPenpotArtboard.ts b/ui-src/converters/createPenpotArtboard.ts index 7324fa9..f3b073f 100644 --- a/ui-src/converters/createPenpotArtboard.ts +++ b/ui-src/converters/createPenpotArtboard.ts @@ -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); diff --git a/ui-src/lib/types/shapes/frameShape.ts b/ui-src/lib/types/shapes/frameShape.ts index 1ff82bb..418c7be 100644 --- a/ui-src/lib/types/shapes/frameShape.ts +++ b/ui-src/lib/types/shapes/frameShape.ts @@ -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[]; };