From e13bb79dc5446dc684707fe6bfa7cc465e795d49 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 4 Sep 2024 09:13:49 +0200 Subject: [PATCH] refactor(e2e): change types --- apps/e2e/src/plugins/create-flexlayout.ts | 2 +- .../e2e/src/plugins/create-frame-text-rect.ts | 30 ++++++++----------- apps/e2e/src/plugins/create-gridlayout.ts | 2 +- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/apps/e2e/src/plugins/create-flexlayout.ts b/apps/e2e/src/plugins/create-flexlayout.ts index a655483..9655bca 100644 --- a/apps/e2e/src/plugins/create-flexlayout.ts +++ b/apps/e2e/src/plugins/create-flexlayout.ts @@ -1,6 +1,6 @@ export default function () { function createFlexLayout(): void { - const frame = penpot.createFrame(); + const frame = penpot.createBoard(); frame.horizontalSizing = 'auto'; frame.verticalSizing = 'auto'; diff --git a/apps/e2e/src/plugins/create-frame-text-rect.ts b/apps/e2e/src/plugins/create-frame-text-rect.ts index 6aa994e..32717b3 100644 --- a/apps/e2e/src/plugins/create-frame-text-rect.ts +++ b/apps/e2e/src/plugins/create-frame-text-rect.ts @@ -1,11 +1,7 @@ -import type { - PenpotFrame, - PenpotRectangle, - PenpotText, -} from '@penpot/plugin-types'; +import type { Board, Rectangle, Text } from '@penpot/plugin-types'; export default function () { - function createText(text: string): PenpotText | undefined { + function createText(text: string): Text | undefined { const textNode = penpot.createText(text); if (!textNode) { @@ -18,7 +14,7 @@ export default function () { return textNode; } - function createRectangle(): PenpotRectangle { + function createRectangle(): Rectangle { const rectangle = penpot.createRectangle(); rectangle.setPluginData('customKey', 'customValue'); @@ -31,19 +27,19 @@ export default function () { return rectangle; } - function createFrame(): PenpotFrame { - const frame = penpot.createFrame(); + function createBoard(): Board { + const board = penpot.createBoard(); - frame.name = 'Frame name'; + board.name = 'Board name'; console.log(penpot.viewport.center.x); - frame.x = penpot.viewport.center.x; - frame.y = penpot.viewport.center.y; + board.x = penpot.viewport.center.x; + board.y = penpot.viewport.center.y; - frame.borderRadius = 8; + board.borderRadius = 8; - frame.resize(300, 300); + board.resize(300, 300); const text = penpot.createText('Hello from frame'); @@ -53,12 +49,12 @@ export default function () { text.x = 10; text.y = 10; - frame.appendChild(text); + board.appendChild(text); - return frame; + return board; } createText('Hello from plugin'); createRectangle(); - createFrame(); + createBoard(); } diff --git a/apps/e2e/src/plugins/create-gridlayout.ts b/apps/e2e/src/plugins/create-gridlayout.ts index d04a532..8ada8b2 100644 --- a/apps/e2e/src/plugins/create-gridlayout.ts +++ b/apps/e2e/src/plugins/create-gridlayout.ts @@ -1,6 +1,6 @@ export default function () { function createGridLayout(): void { - const frame = penpot.createFrame(); + const frame = penpot.createBoard(); const grid = frame.addGridLayout();