mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
fix frames fills and blendModes (#118)
This commit is contained in:
parent
477291758e
commit
35d9d47e2a
3 changed files with 18 additions and 7 deletions
5
.changeset/serious-wolves-help.md
Normal file
5
.changeset/serious-wolves-help.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"penpot-exporter": patch
|
||||
---
|
||||
|
||||
Fix frames fills and blendModes
|
|
@ -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);
|
||||
|
|
|
@ -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[];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue