mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-08 16:10:07 -05:00
fixes
This commit is contained in:
parent
3ec79dab48
commit
2744930ada
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build:ui && npm run build:main -- --minify",
|
"build": "npm run build:ui && npm run build:main -- --minify",
|
||||||
"build:main": "esbuild plugin-src/code.ts --bundle --outfile=dist/code.js",
|
"build:main": "esbuild plugin-src/code.ts --bundle --outfile=dist/code.js --target=es2016",
|
||||||
"build:ui": "vite build --minify esbuild --emptyOutDir=false",
|
"build:ui": "vite build --minify esbuild --emptyOutDir=false",
|
||||||
"build:watch": "concurrently -n widget,iframe \"npm run build:main -- --watch\" \"npm run build:ui -- --watch\"",
|
"build:watch": "concurrently -n widget,iframe \"npm run build:main -- --watch\" \"npm run build:ui -- --watch\"",
|
||||||
"dev": "concurrently -n tsc,build,vite 'npm:tsc:watch' 'npm:build:watch' 'vite'",
|
"dev": "concurrently -n tsc,build,vite 'npm:tsc:watch' 'npm:build:watch' 'vite'",
|
||||||
|
|
|
@ -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)) {
|
||||||
|
|
Loading…
Reference in a new issue