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

refactor(poc-state-plugin): adapt to type refactor

This commit is contained in:
alonso.torres 2024-09-04 09:14:27 +02:00 committed by Alonso Torres
parent 5c82cd335a
commit 4aed934b37
2 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
import { Component, effect, signal } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import type { PenpotShape } from '@penpot/plugin-types';
import type { Shape } from '@penpot/plugin-types';
@Component({
standalone: true,
@ -113,7 +113,7 @@ export class AppComponent {
#pageId: null | string = null;
#fileId = null;
#revn = 0;
#selection = signal<PenpotShape[]>([]);
#selection = signal<Shape[]>([]);
form = new FormGroup({
name: new FormControl(''),
@ -245,7 +245,7 @@ export class AppComponent {
this.projectName.set(name || 'Unknown');
}
#refreshSelection(selection: PenpotShape[]) {
#refreshSelection(selection: Shape[]) {
this.#selection.set(selection);
if (selection && selection.length > 0) {
this.form.get('name')?.setValue(this.#selection()[0].name);

View file

@ -221,7 +221,7 @@ function addIcon() {
}
function createGrid() {
const frame = penpot.createFrame();
const frame = penpot.createBoard();
frame.name = 'Frame Grid';
const viewport = penpot.viewport;
@ -263,7 +263,7 @@ function createGrid() {
}
function createColors() {
const frame = penpot.createFrame();
const frame = penpot.createBoard();
frame.name = 'Palette';
const viewport = penpot.viewport;
@ -337,7 +337,7 @@ function createColors() {
return;
}
const board = penpot.createFrame();
const board = penpot.createBoard();
grid.appendChild(board, row + 1, col + 1);
board.fills = [color.asFill()];
board.strokes = [