mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
3ee244db92
* add figma-create-plugin ui * first attempt * more changes * update packages * fix stuff * implement reload action * simplify code * create wrapper * fix logo * adjust sizes * add changelog * update design again * temporary fix --------- Co-authored-by: Alex Sánchez <sion333@gmail.com>
15 lines
488 B
TypeScript
15 lines
488 B
TypeScript
import { transformDocumentNode } from '@plugin/transformers';
|
|
import { setCustomFontId } from '@plugin/translators/text/font/custom';
|
|
|
|
export const handleExportMessage = async (missingFontIds: Record<string, string>) => {
|
|
await figma.loadAllPagesAsync();
|
|
|
|
Object.entries(missingFontIds).forEach(([fontFamily, fontId]) => {
|
|
setCustomFontId(fontFamily, fontId);
|
|
});
|
|
|
|
figma.ui.postMessage({
|
|
type: 'PENPOT_DOCUMENT',
|
|
data: await transformDocumentNode(figma.root)
|
|
});
|
|
};
|