2024-04-12 09:52:36 -05:00
|
|
|
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
|
|
|
}
|
2024-04-08 04:43:30 -05:00
|
|
|
if (msg.type === 'cancel') {
|
2024-04-09 04:23:06 -05:00
|
|
|
handleCancelMessage();
|
2022-10-11 08:55:08 -05:00
|
|
|
}
|
2024-04-08 04:43:30 -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
|
|
|
}
|
|
|
|
};
|