0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

refactor(table-plugin): adapt to type refactor

This commit is contained in:
alonso.torres 2024-09-04 09:15:17 +02:00 committed by Alonso Torres
parent f48aa68e99
commit 3bfa2a5c22

View file

@ -1,4 +1,4 @@
import { PenpotGridLayout } from '@penpot/plugin-types'; import { GridLayout } from '@penpot/plugin-types';
import { PluginMessageEvent, TablePluginEvent } from './app/model'; import { PluginMessageEvent, TablePluginEvent } from './app/model';
penpot.ui.open('TABLE PLUGIN', `?theme=${penpot.getTheme()}`, { penpot.ui.open('TABLE PLUGIN', `?theme=${penpot.getTheme()}`, {
@ -20,7 +20,7 @@ penpot.ui.onMessage<PluginMessageEvent>((message) => {
numCols = message.content.new.column; numCols = message.content.new.column;
} }
const frame = penpot.createFrame(); const frame = penpot.createBoard();
frame.name = 'Table'; frame.name = 'Table';
const viewport = penpot.viewport; const viewport = penpot.viewport;
@ -60,7 +60,7 @@ penpot.ui.onMessage<PluginMessageEvent>((message) => {
}); });
function createGroupCell( function createGroupCell(
grid: PenpotGridLayout, grid: GridLayout,
numRows: number, numRows: number,
numCols: number, numCols: number,
row: number, row: number,
@ -140,14 +140,14 @@ function createGroupCell(
} }
function createFlexCell( function createFlexCell(
grid: PenpotGridLayout, grid: GridLayout,
numRows: number, numRows: number,
numCols: number, numCols: number,
row: number, row: number,
col: number, col: number,
message: TablePluginEvent message: TablePluginEvent
) { ) {
const board = penpot.createFrame(); const board = penpot.createBoard();
if (col === 0 && row === 0) { if (col === 0 && row === 0) {
board.borderRadiusTopLeft = 8; board.borderRadiusTopLeft = 8;