0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-10 09:00: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 08:55:08 -05:00
figma.showUI(__html__, { themeColors: true, height: 200, width: 300 });
2024-04-08 10:03:34 -05:00
figma.ui.onmessage = async msg => {
if (msg.type === 'export') {
2024-04-09 04:23:06 -05:00
await handleExportMessage();
2024-04-08 10:03:34 -05:00
}
if (msg.type === 'cancel') {
2024-04-09 04:23:06 -05:00
handleCancelMessage();
2022-10-11 08:55:08 -05:00
}
if (msg.type === 'resize') {
2024-04-09 04:23:06 -05:00
handleResizeMessage(msg.width, msg.height);
2022-10-11 08:55:08 -05:00
}
};