mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
Merge pull request #18 from Runroom/feature/upgrade-penpot-2.0
Upgrade library to 2.0 (staging)
This commit is contained in:
commit
2487979f45
2 changed files with 6731 additions and 7071 deletions
|
@ -16,14 +16,14 @@ export const PenpotExporter = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onMessage = (event: MessageEvent<{ pluginMessage: { type: string; data: unknown } }>) => {
|
const onMessage = (event: MessageEvent<{ pluginMessage: { type: string; data: unknown } }>) => {
|
||||||
if (event.data.pluginMessage.type == 'FIGMAFILE') {
|
if (event.data.pluginMessage?.type == 'FIGMAFILE') {
|
||||||
const document = event.data.pluginMessage.data as PenpotDocument;
|
const document = event.data.pluginMessage.data as PenpotDocument;
|
||||||
const file = createPenpotFile(document);
|
const file = createPenpotFile(document);
|
||||||
|
|
||||||
file.export();
|
file.export();
|
||||||
|
|
||||||
setExporting(false);
|
setExporting(false);
|
||||||
} else if (event.data.pluginMessage.type == 'FONT_NAME') {
|
} else if (event.data.pluginMessage?.type == 'FONT_NAME') {
|
||||||
const fontName = event.data.pluginMessage.data as string;
|
const fontName = event.data.pluginMessage.data as string;
|
||||||
|
|
||||||
if (!validateFont(fontName)) {
|
if (!validateFont(fontName)) {
|
||||||
|
|
13798
ui-src/lib/penpot.js
13798
ui-src/lib/penpot.js
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue