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

Merge pull request #18 from Runroom/feature/upgrade-penpot-2.0

Upgrade library to 2.0 (staging)
This commit is contained in:
Alex Sánchez 2024-04-15 12:04:06 +02:00 committed by GitHub
commit 2487979f45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6731 additions and 7071 deletions

View file

@ -16,14 +16,14 @@ export const PenpotExporter = () => {
};
const onMessage = (event: MessageEvent<{ pluginMessage: { type: string; data: unknown } }>) => {
if (event.data.pluginMessage.type == 'FIGMAFILE') {
if (event.data.pluginMessage?.type == 'FIGMAFILE') {
const document = event.data.pluginMessage.data as PenpotDocument;
const file = createPenpotFile(document);
file.export();
setExporting(false);
} else if (event.data.pluginMessage.type == 'FONT_NAME') {
} else if (event.data.pluginMessage?.type == 'FONT_NAME') {
const fontName = event.data.pluginMessage.data as string;
if (!validateFont(fontName)) {

File diff suppressed because one or more lines are too long