0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/plugin-src/handleExportMessage.ts
Jordi Sala Morales 88b3e5f69c
Implement progress bar (#126)
* Implement progress bar

* remove postmessage
2024-05-31 11:25:32 +02:00

13 lines
452 B
TypeScript

import { transformDocumentNode } from '@plugin/transformers';
import { setCustomFontId } from '@plugin/translators/text/font/custom';
export const handleExportMessage = async (missingFontIds: Record<string, string>) => {
Object.entries(missingFontIds).forEach(([fontFamily, fontId]) => {
setCustomFontId(fontFamily, fontId);
});
figma.ui.postMessage({
type: 'PENPOT_DOCUMENT',
data: await transformDocumentNode(figma.root)
});
};