From 044b09207b48aa3b2ac8dcb86f6c6d04db88b645 Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Mon, 27 May 2024 18:13:19 +0200 Subject: [PATCH 1/2] Fix empty text layers (#120) * Fix empty texts * add changelog --- .changeset/gorgeous-rings-compete.md | 5 +++++ .../transformers/partials/transformText.ts | 22 ++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .changeset/gorgeous-rings-compete.md diff --git a/.changeset/gorgeous-rings-compete.md b/.changeset/gorgeous-rings-compete.md new file mode 100644 index 0000000..6392f94 --- /dev/null +++ b/.changeset/gorgeous-rings-compete.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fix text layers without text content diff --git a/plugin-src/transformers/partials/transformText.ts b/plugin-src/transformers/partials/transformText.ts index ef00123..5d00a55 100644 --- a/plugin-src/transformers/partials/transformText.ts +++ b/plugin-src/transformers/partials/transformText.ts @@ -22,19 +22,21 @@ export const transformText = async (node: TextNode): Promise> content: { type: 'root', verticalAlign: translateVerticalAlign(node.textAlignVertical), - children: [ - { - type: 'paragraph-set', - children: [ + children: styledTextSegments.length + ? [ { - type: 'paragraph', - children: await translateStyleTextSegments(node, styledTextSegments), - ...(styledTextSegments.length ? transformTextStyle(node, styledTextSegments[0]) : {}), - ...(await transformFills(node)) + type: 'paragraph-set', + children: [ + { + type: 'paragraph', + children: await translateStyleTextSegments(node, styledTextSegments), + ...transformTextStyle(node, styledTextSegments[0]), + ...(await transformFills(node)) + } + ] } ] - } - ] + : undefined }, growType: translateGrowType(node) }; From fa1d25aeaba2a4c0d9e48711f0e3f00eb52f1fa4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 18:22:04 +0200 Subject: [PATCH 2/2] Version Packages (#119) Co-authored-by: github-actions[bot] --- .changeset/gorgeous-rings-compete.md | 5 ----- .changeset/serious-wolves-help.md | 5 ----- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 .changeset/gorgeous-rings-compete.md delete mode 100644 .changeset/serious-wolves-help.md diff --git a/.changeset/gorgeous-rings-compete.md b/.changeset/gorgeous-rings-compete.md deleted file mode 100644 index 6392f94..0000000 --- a/.changeset/gorgeous-rings-compete.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": patch ---- - -Fix text layers without text content diff --git a/.changeset/serious-wolves-help.md b/.changeset/serious-wolves-help.md deleted file mode 100644 index 28189a1..0000000 --- a/.changeset/serious-wolves-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": patch ---- - -Fix frames fills and blendModes diff --git a/CHANGELOG.md b/CHANGELOG.md index af6dc21..7296c34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # penpot-exporter +## 0.4.1 + +### Patch Changes + +- [#120](https://github.com/penpot/penpot-exporter-figma-plugin/pull/120) [`044b092`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/044b09207b48aa3b2ac8dcb86f6c6d04db88b645) Thanks [@jordisala1991](https://github.com/jordisala1991)! - Fix text layers without text content + +- [#118](https://github.com/penpot/penpot-exporter-figma-plugin/pull/118) [`35d9d47`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/35d9d47e2afb0fa3db09a51803de5549230ba2c4) Thanks [@Cenadros](https://github.com/Cenadros)! - Fix frames fills and blendModes + ## 0.4.0 ### Minor Changes diff --git a/package.json b/package.json index 24a1f14..4782e6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "penpot-exporter", - "version": "0.4.0", + "version": "0.4.1", "description": "Penpot exporter", "type": "module", "scripts": {