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

add artboard shape

This commit is contained in:
Jordi Sala Morales 2024-04-10 11:25:49 +00:00
parent 7383d87125
commit 3646113b00
No known key found for this signature in database
GPG key ID: C5127140107F55FD
4 changed files with 20 additions and 3 deletions

View file

@ -9,6 +9,7 @@ export const createPenpotBoard = (
baseY: number
) => {
file.penpotFile.addArtboard({
type: Symbol.for('frame'),
name: node.name,
x: node.x + baseX,
y: node.y + baseY,

View file

@ -1,4 +1,5 @@
import { CircleShape } from './types/circle/circleShape';
import { FrameShape } from './types/frame/frameShape';
import { GroupShape } from './types/group/groupShape';
import { ImageShape } from './types/image/imageShape';
import { RectShape } from './types/rect/rectShape';
@ -8,10 +9,10 @@ export interface PenpotFile {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
asMap(): any;
export(): void;
addPage(name: string, options?: object): void;
closePage(): void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
addArtboard(artboard: any): void;
addPage(name: string, options?: any): void;
closePage(): void;
addArtboard(artboard: FrameShape): void;
closeArtboard(): void;
addGroup(group: GroupShape): void;
closeGroup(): void;

View file

@ -0,0 +1,11 @@
export type FrameAttributes = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
id?: any;
type: symbol;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
shapes?: any[];
fileThumbnail?: boolean;
hideFillOnExport?: boolean;
showContent?: boolean;
hideInViewer?: boolean;
};

View file

@ -0,0 +1,4 @@
import { Shape } from '../shape';
import { FrameAttributes } from './frameAttributes';
export type FrameShape = Shape & FrameAttributes;