From 92e0b6f026c8f05d1581bd6d3774e20f6992cb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Wed, 24 Apr 2024 16:29:24 +0200 Subject: [PATCH 1/5] Fixed arrows strokecaps (#68) * fixed arrows strokecaps * fixed arrows strokecaps --- .changeset/nervous-camels-reflect.md | 5 +++++ plugin-src/translators/translateStrokes.ts | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/nervous-camels-reflect.md diff --git a/.changeset/nervous-camels-reflect.md b/.changeset/nervous-camels-reflect.md new file mode 100644 index 00000000..2911c64a --- /dev/null +++ b/.changeset/nervous-camels-reflect.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fixed strokecaps for arrows that were showing even when not configured in figma diff --git a/plugin-src/translators/translateStrokes.ts b/plugin-src/translators/translateStrokes.ts index e380213d..14df601f 100644 --- a/plugin-src/translators/translateStrokes.ts +++ b/plugin-src/translators/translateStrokes.ts @@ -18,7 +18,7 @@ export const translateStrokes = ( strokeStyle: nodeStrokes.dashPattern.length ? 'dashed' : 'solid' }; - if (!hasFillGeometry && index === 0 && vectorNetwork && vectorNetwork.vertices.length) { + if (!hasFillGeometry && index === 0 && vectorNetwork && vectorNetwork.vertices.length > 0) { stroke.strokeCapStart = translateStrokeCap(vectorNetwork.vertices[0]); stroke.strokeCapEnd = translateStrokeCap( vectorNetwork.vertices[vectorNetwork.vertices.length - 1] @@ -64,8 +64,6 @@ const translateStrokeAlignment = ( const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => { switch (vertex.strokeCap as StrokeCap | ConnectorStrokeCap) { - case 'NONE': - return; case 'ROUND': return 'round'; case 'ARROW_EQUILATERAL': @@ -78,7 +76,9 @@ const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => { case 'DIAMOND_FILLED': return 'diamond-marker'; case 'ARROW_LINES': - default: return 'line-arrow'; + case 'NONE': + default: + return; } }; From e42ff510aae5a0d388f973ce47cab5c4d82c3c6f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:19:36 +0200 Subject: [PATCH 2/5] Version Packages (#59) Co-authored-by: github-actions[bot] --- .changeset/flat-balloons-exercise.md | 5 ----- .changeset/nervous-camels-reflect.md | 5 ----- .changeset/perfect-masks-kneel.md | 5 ----- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 .changeset/flat-balloons-exercise.md delete mode 100644 .changeset/nervous-camels-reflect.md delete mode 100644 .changeset/perfect-masks-kneel.md diff --git a/.changeset/flat-balloons-exercise.md b/.changeset/flat-balloons-exercise.md deleted file mode 100644 index 553dc29b..00000000 --- a/.changeset/flat-balloons-exercise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": minor ---- - -Shadows diff --git a/.changeset/nervous-camels-reflect.md b/.changeset/nervous-camels-reflect.md deleted file mode 100644 index 2911c64a..00000000 --- a/.changeset/nervous-camels-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": patch ---- - -Fixed strokecaps for arrows that were showing even when not configured in figma diff --git a/.changeset/perfect-masks-kneel.md b/.changeset/perfect-masks-kneel.md deleted file mode 100644 index fcfaabae..00000000 --- a/.changeset/perfect-masks-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": minor ---- - -Added support for corner radius diff --git a/CHANGELOG.md b/CHANGELOG.md index 560fd22e..caba69f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # penpot-exporter +## 0.2.0 + +### Minor Changes + +- [#58](https://github.com/penpot/penpot-exporter-figma-plugin/pull/58) [`e732887`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/e73288739987d67135dc20ebb97fd165b3da0c79) Thanks [@jordisala1991](https://github.com/jordisala1991)! - Shadows + +- [#57](https://github.com/penpot/penpot-exporter-figma-plugin/pull/57) [`c464ff9`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/c464ff9bda24ef1660f2a58ecb39f76f1e8151a8) Thanks [@Cenadros](https://github.com/Cenadros)! - Added support for corner radius + +### Patch Changes + +- [#68](https://github.com/penpot/penpot-exporter-figma-plugin/pull/68) [`92e0b6f`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/92e0b6f026c8f05d1581bd6d3774e20f6992cb92) Thanks [@Cenadros](https://github.com/Cenadros)! - Fixed strokecaps for arrows that were showing even when not configured in figma + ## 0.1.0 ### Minor Changes diff --git a/package.json b/package.json index 5a410b56..782b638d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "penpot-exporter", - "version": "0.1.0", + "version": "0.2.0", "description": "Penpot exporter", "type": "module", "scripts": { From 3dec0a452079e1a1a3e64290e16b881a47a22876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Fri, 26 Apr 2024 08:11:52 +0200 Subject: [PATCH 3/5] fix blend modes translation (#71) --- .changeset/thick-wombats-float.md | 5 +++++ ui-src/translators/translateUiBlendMode.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/thick-wombats-float.md diff --git a/.changeset/thick-wombats-float.md b/.changeset/thick-wombats-float.md new file mode 100644 index 00000000..efed63c6 --- /dev/null +++ b/.changeset/thick-wombats-float.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fix blend mode 'color' translation diff --git a/ui-src/translators/translateUiBlendMode.ts b/ui-src/translators/translateUiBlendMode.ts index 0d45cf06..6c7939fc 100644 --- a/ui-src/translators/translateUiBlendMode.ts +++ b/ui-src/translators/translateUiBlendMode.ts @@ -1,4 +1,5 @@ import { + BLEND_MODE_COLOR, BLEND_MODE_COLOR_BURN, BLEND_MODE_COLOR_DODGE, BLEND_MODE_DARKEN, @@ -50,7 +51,7 @@ export const translateUiBlendMode = (blendMode?: BlendMode): BlendMode | undefin case 'saturation': return BLEND_MODE_SATURATION; case 'color': - return BLEND_MODE_COLOR_BURN; + return BLEND_MODE_COLOR; case 'luminosity': return BLEND_MODE_LUMINOSITY; default: From 7ed24ea0dd8e601a71a64285a659718af5b5dc3b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:20:22 +0200 Subject: [PATCH 4/5] Version Packages (#72) Co-authored-by: github-actions[bot] --- .changeset/thick-wombats-float.md | 5 ----- CHANGELOG.md | 6 ++++++ package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/thick-wombats-float.md diff --git a/.changeset/thick-wombats-float.md b/.changeset/thick-wombats-float.md deleted file mode 100644 index efed63c6..00000000 --- a/.changeset/thick-wombats-float.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": patch ---- - -Fix blend mode 'color' translation diff --git a/CHANGELOG.md b/CHANGELOG.md index caba69f5..48068315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # penpot-exporter +## 0.2.1 + +### Patch Changes + +- [#71](https://github.com/penpot/penpot-exporter-figma-plugin/pull/71) [`3dec0a4`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/3dec0a452079e1a1a3e64290e16b881a47a22876) Thanks [@Cenadros](https://github.com/Cenadros)! - Fix blend mode 'color' translation + ## 0.2.0 ### Minor Changes diff --git a/package.json b/package.json index 782b638d..d4c044e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "penpot-exporter", - "version": "0.2.0", + "version": "0.2.1", "description": "Penpot exporter", "type": "module", "scripts": { From 59d70d251094895b18bd6af7a8818a0b1de6abf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Fri, 26 Apr 2024 17:09:57 +0200 Subject: [PATCH 5/5] Fix vector shapes to be more precise with what you draw on figma (#76) * draft * Add changelog --------- Co-authored-by: Jordi Sala Morales --- .changeset/many-otters-mix.md | 5 +++++ plugin-src/transformers/partials/transformVectorPaths.ts | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .changeset/many-otters-mix.md diff --git a/.changeset/many-otters-mix.md b/.changeset/many-otters-mix.md new file mode 100644 index 00000000..2940460f --- /dev/null +++ b/.changeset/many-otters-mix.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fix vector shapes to be more precise with what you draw on figma diff --git a/plugin-src/transformers/partials/transformVectorPaths.ts b/plugin-src/transformers/partials/transformVectorPaths.ts index 931887a3..64bdeb5e 100644 --- a/plugin-src/transformers/partials/transformVectorPaths.ts +++ b/plugin-src/transformers/partials/transformVectorPaths.ts @@ -2,17 +2,13 @@ import { translateVectorPaths } from '@plugin/translators'; import { PathAttributes } from '@ui/lib/types/path/pathAttributes'; -const hasFillGeometry = (node: VectorNode | StarNode | LineNode | PolygonNode): boolean => { - return 'fillGeometry' in node && node.fillGeometry.length > 0; -}; - const getVectorPaths = (node: VectorNode | StarNode | LineNode | PolygonNode): VectorPaths => { switch (node.type) { case 'STAR': case 'POLYGON': return node.fillGeometry; case 'VECTOR': - return hasFillGeometry(node) ? node.fillGeometry : node.vectorPaths; + return node.vectorPaths; case 'LINE': return node.strokeGeometry; }