0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/plugin-src/code.ts
2024-04-12 18:52:19 +02:00

19 lines
437 B
TypeScript

import {
handleCancelMessage,
handleExportMessage,
handleResizeMessage
} from '@plugin/messageHandlers';
figma.showUI(__html__, { themeColors: true, height: 200, width: 300 });
figma.ui.onmessage = async msg => {
if (msg.type === 'export') {
await handleExportMessage();
}
if (msg.type === 'cancel') {
handleCancelMessage();
}
if (msg.type === 'resize') {
handleResizeMessage(msg.width, msg.height);
}
};