0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-03-13 08:12:08 -05:00
penpot-exporter-figma-plugin/plugin-src/code.ts

20 lines
437 B
TypeScript
Raw Normal View History

import {
handleCancelMessage,
handleExportMessage,
handleResizeMessage
} from '@plugin/messageHandlers';
2022-10-11 15:55:08 +02:00
figma.showUI(__html__, { themeColors: true, height: 200, width: 300 });
2024-04-08 17:03:34 +02:00
figma.ui.onmessage = async msg => {
if (msg.type === 'export') {
2024-04-09 11:23:06 +02:00
await handleExportMessage();
2024-04-08 17:03:34 +02:00
}
if (msg.type === 'cancel') {
2024-04-09 11:23:06 +02:00
handleCancelMessage();
2022-10-11 15:55:08 +02:00
}
if (msg.type === 'resize') {
2024-04-09 11:23:06 +02:00
handleResizeMessage(msg.width, msg.height);
2022-10-11 15:55:08 +02:00
}
};