Giter Site home page Giter Site logo

penpot / penpot-exporter-figma-plugin Goto Github PK

View Code? Open in Web Editor NEW
216.0 14.0 24.0 6.9 MB

Penpot exporter Figma plugin

Home Page: https://www.figma.com/community/plugin/1362760353975083275/penpot-exporter

License: Mozilla Public License 2.0

TypeScript 93.61% CSS 4.06% HTML 0.47% JavaScript 1.86%
design-tools exporter figma-plugin penpot

penpot-exporter-figma-plugin's Introduction


PENPOT
PENPOT EXPORTER

License: MPL-2.0 Managed with Taiga.io Gitpod ready-to-code

Penpot WebsiteExport Figma to Penpot (penpot community)Penpot Community

Help us

This is a very early-stage Figma plugin to export Figma files to Penpot format. For now is little more than a proof of concept, or a first scaffolding, not a fully functional exporter.

Table of contents

Why a Penpot exporter

The aim of this plugin is to help people migrate their files from Figma to Penpot. Migrating work from one design tool to another was never an easy task due to the abundance of closed and non-standard formats, and this is not a different case. Our approach to better solve this situation is to release a code skeleton for the minimum version of a Figma plugin that can convert a Figma file into a Penpot annotated SVG file.

There is a sense of urgency for this capability because there is a feeling that Adobe might force Figma to limit exports and interoperability via plugins very soon.

Getting started

This plugin makes use of npm, webpack and react, and is written on TypeScript. It also includes a Penpot file builder library.

Pre-requisites

To use this plugin, you will need to have node and npm installed on your computer. If you don't already have these, you can download and install them from the official website (https://nodejs.org/en/).

Once you have node and npm installed, you will need to download the source code for this plugin. You can do this by clicking the "Clone or download" button on the GitHub page for this project and then selecting "Download ZIP". Extract the ZIP file to a location on your computer.

Building

For Windows users:

  1. Open the terminal by searching for "Command Prompt" in the start menu.
  2. Use the cd command to navigate to the folder where the repository has been extracted. For example, if the repository is located in the Downloads folder, you can use the following command: cd Downloads/penpot-exporter-figma-plugin.
  3. Once you are in the correct folder, you can run the npm install command to install the dependencies, and then the npm run build command to build the plugin.

For Mac users:

  1. Open the terminal by searching for "Terminal" in the Launchpad or by using the Command + Space keyboard shortcut and searching for "Terminal".
  2. Use the cd command to navigate to the folder where the repository has been extracted. For example, if the repository is located in the Downloads folder, you can use the following command: cd Downloads/penpot-exporter-figma-plugin.
  3. Once you are in the correct folder, you can run the npm install command to install the dependencies, and then the npm run build command to build the plugin.

For Linux users:

  1. Open the terminal by using the Ctrl + Alt + T keyboard shortcut.
  2. Use the cd command to navigate to the folder where the repository has been extracted. For example, if the repository is located in the Downloads folder, you can use the following command: cd Downloads/penpot-exporter-figma-plugin.
  3. Once you are in the correct folder, you can run the npm install command to install the dependencies, and then the npm run build command to build the plugin.

Add to Figma

Figma menu > Plugins > Development > Import plugin from manifest… To add the plugin to Figma, open Figma and go to the Plugins menu. Select Development and then choose Import plugin from manifest….

Screenshot of the Plugins > Development menus open showing the, "Import plugin from manifest" option.

Select the manifest.json file that is located in the folder where you extracted the source code for the plugin.

To use the plugin

  1. Select what you want to export
  2. Figma menu > Plugins > Development > Penpot Exporter go to the Plugins menu in Figma and select Development followed by Penpot Exporter.
  3. This will generate a .zip file that you can import into Penpot.

Call to the community

Answering to the interest expressed by community members to build the plugin by themselves, at the Penpot team we decided to help solve the need without having to depend on our current product priorities. That is why we have published this bare minimum version of the plugin, unsatisfactory in itself, but it unlocks the possibility for others to continue the task.

Yes, we are asking for help. 🤗

We have explained this approach in a community post. Feel free to join the conversation there.

What can this plugin currently import?

As mentioned above, this plugin gets you to a starting point. Things that are currently included in the import are:

  • Basic shapes (rectangles, ellipses).
  • Frames (Boards in Penpot).
  • Groups.
  • Fills (solid colors and linear gradients).
  • Texts (basic support. Only fonts available on Google fonts).
  • Images (basic support)

Limitations

The obvious limitations are the features that are in Figma but not in Penpot or work differently in both tools so they can not be easily converted. We leave some comments below about the ones that are commonly considered more important:

  • Autolayout: Not in Penpot yet but in a very advanced state of development. There will be news soon.
  • Components: Currently very different from their counterparts at Figma. However, Penpot components are under a rework that we expect will make the conversion easier.
  • Variants: Not expected in the short term. Also, we are thinking of different solutions to solve component states, things that eventually could make it difficult to import.

Contributing

If you want to make many people very happy and help us build this code skeleton for the minimum version of the Figma plugin, a further effort will be needed to have a satisfactory import experience.

For instance, it will be interesting to add:

  • Strokes
  • Fills with radial gradients
  • Paths
  • Images (full support)
  • Texts (full support)
  • Rotations
  • Constraints
  • ...

Motivated to contribute? Take a look at our Contributing Guide that explains our guidelines (they're for the Penpot Core, but are mostly of application here too).

License

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright (c) KALEIDOS INC

Penpot and the Penpot exporter plugin are Kaleidos’ open source projects

penpot-exporter-figma-plugin's People

Contributors

candideu avatar cenadros avatar diacritica avatar elhombretecla avatar github-actions[bot] avatar hirunatan avatar jordisala1991 avatar kkhyroe avatar micahchoo avatar pabloalba avatar pablolizardo avatar planetabhi avatar ryanbreen avatar superalex avatar vchapellu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

penpot-exporter-figma-plugin's Issues

penpot.js v0.0.1 is missing named exports for adding components, instances and colors

I tried to extend the functionality of the plugin to also include components, instances and colors but faced the limitation that their functions are not exported

it would be great if https://github.com/penpot/penpot/blob/develop/frontend/src/app/libs/file_builder.cljs would also be included in penpot.js from https://github.com/penpot/penpot/blob/6a296a3e526a2f8ea186599b79e3abd5c61eb3a5/frontend/src/app/main/data/workspace/libraries_helpers.cljs#L62 as well as https://github.com/penpot/penpot/blob/5463671db13441ba3f730a34118547d34a5a36f1/common/src/app/common/types/colors_list.cljc#L13

:bug: fill type IMAGE ignored on non-page nodes

Images in Figma are shapes with a single IMAGE fill, and they can exist at any point in the tree. The exporter is not currently importing them properly at anything but the top level.

Exporting this figma doc (node tree screenshot below) only adds the "Frontend graphic" image, not the screenshot nested in the frame.

image

Symbol Unwrapping failure during initialization

Hello! I am currently attempting to use this project to import some of my most important files in Figma and i'm still getting the same error as issue #2 (albeit, from what it looks like - different causes?), even after the latest #3 PR that worked around the multi-glyph typography issue.

I am using the latest commit as of this message ( 881a13f ) and no noticeable warnings were given during the build process itself.

Exception goes as follows:

Error: in postMessage: Cannot unwrap symbol
    at <anonymous> (PLUGIN_3_SOURCE:91)
    at <anonymous> (PLUGIN_3_SOURCE:101)
    at call (native)
    at <eval> (PLUGIN_3_SOURCE:105)

Thanks for making this! Hope to hear more about this issue soon.

Support simple lines

Working our way up to more complex shapes, let's at least support simple lines with strokes, fills, and colors.

vector support > svg

Hello, I find the plugin very helpful so far. However, in order to efficiently transfer more complex layouts, the embedded vectors such as icons/graphics SVG would also need to be exported. This would allow wireframes to be fully transferred already.

Gracefully handle unmatched fonts

The set of fonts supported by Figma doesn't perfectly match the fonts supported out-of-the-box by Penpot. In the attachment, the font "Jeju Gothic" reverts to a default while the other 3 import cleanly.

We need to figure out the right way to handle this, perhaps prompting the user in the plugin dialog that they'll need to add a font to Penpot before import will succeed.

font_test.zip

Exported Penpot File Shows Blank Page When Using Figma Library Components

Description

I've encountered a problem with the Figma to Penpot export plugin. Specifically, when I use components from a library in Figma and export them to a Penpot file, the resulting page in Penpot is blank. This issue prevents me from using the plugin effectively for designs that rely on Figma library components.

Steps to Reproduce

  1. Create a design in Figma that includes components from a Figma library.
  2. Use the Figma to Penpot export plugin to export the design to a Penpot file.
  3. Open the exported Penpot file.

Expected Behavior

The exported Penpot file should accurately reflect the design from Figma, including the components used from the Figma library.

Actual Behavior

The Penpot page is blank, with none of the design elements visible.

Screenshots

  • Screenshot of the design in Figma:
    2024-02-12-094235_screenshot

  • Screenshot of the blank page in Penpot:
    2024-02-12-094352_screenshot

Thank you for looking into this issue. I hope we can find a resolution soon.

TypeError: cannot read property 'fontName' of undefined

Hi guys

I have the "TypeError: cannot read property 'fontName' of undefined" error when I try to export my Figma project to Penpot

Error

I have the following error on clic Penpot Exporter

  1. Select what you want to export
  2. Got to Figma menu > Plugins > Development > Penpot Exporter
figma_app.min.js.br:1651 Console was cleared
figma_app.min.js.br:5 ------- Clearing and silencing console.log from Figma -------
figma_app.min.js.br:5 TypeError: cannot read property 'fontName' of undefined
    at traverse (PLUGIN_13_SOURCE:59)
    at traverse (PLUGIN_13_SOURCE:25)
    at traverse (PLUGIN_13_SOURCE:25)
    at <anonymous> (PLUGIN_13_SOURCE:77)
    at <anonymous> (PLUGIN_13_SOURCE:88)
    at call (native)
    at <eval> (PLUGIN_13_SOURCE:92)

(anonymous) @ figma_app.min.js.br:5
evalCodeInternal @ figma_app.min.js.br:581
evalTopLevelCode @ figma_app.min.js.br:582
(anonymous) @ figma_app.min.js.br:1653
r @ figma_app.min.js.br:16
setTimeout (async)
(anonymous) @ figma_app.min.js.br:16
runResult @ figma_app.min.js.br:1653
dSl @ figma_app.min.js.br:1651
await in dSl (async)
rsr @ figma_app.min.js.br:1678
(anonymous) @ figma_app.min.js.br:1808
await in (anonymous) (async)
$do @ figma_app.min.js.br:1808
W9f @ figma_app.min.js.br:1808
await in W9f (async)
(anonymous) @ figma_app.min.js.br:1808
enqueue @ figma_app.min.js.br:1678
QW @ figma_app.min.js.br:2207
(anonymous) @ figma_app.min.js.br:2207
(anonymous) @ figma_app.min.js.br:2453
tuf @ figma_app.min.js.br:1379
user @ figma_app.min.js.br:1379
Qre.onSelectItem @ figma_app.min.js.br:2453
(anonymous) @ figma_app.min.js.br:1621
(anonymous) @ figma_app.min.js.br:1621
ihm @ figma_app.min.js.br:22
ahm @ figma_app.min.js.br:22
lhm @ figma_app.min.js.br:22
CJi @ figma_app.min.js.br:22
JZi @ figma_app.min.js.br:22
(anonymous) @ figma_app.min.js.br:22
YXr @ figma_app.min.js.br:25
AZi @ figma_app.min.js.br:22
c$r @ figma_app.min.js.br:22
AXr @ figma_app.min.js.br:22
Thm @ figma_app.min.js.br:22
r @ figma_app.min.js.br:16
figma_app.min.js.br:5 ------- Restoring console.log functionality in Figma --------
figma_app.min.js.br:5 [Realtime] Disconnected. Will attempt reconnect in 4 seconds.
figma_app.min.js.br:5 [Realtime] Attempting reconnect now after waiting 4 seconds.
figma_app.min.js.br:5 [Realtime] Connected to wss://www.figma.com/api/realtime_v2?release_git_tag=release-2023-07-27&user_id=1154267608100497710.

My installation

  • OS: Windows 10 Pro
  • Node: v18.17.0
  • NPM: 9.6.7
  • Figma Desktop: 116.11.1

Unable to load error

Hi!
When I try to run the plugin it shows me this error
image

Here's how i'm trying to use it
image

Import to penpot develop branch fails due to missing profile_id

I know tracking Penpot develop may be aggressive for testing the exporter , but it looks like recent changes broke import due to a missing profile_id:

TRACE:
 →  org.postgresql.util.PSQLException: ERROR: null value in column "profile_id" of relation "file_profile_rel" violates not-null constraint (QueryExecutorImpl.java:2676)

I believe the line triggering this error is https://github.com/penpot/penpot/blob/9c44cd343f8aa8417b8ec5d2b14b8000bc7e6f79/backend/src/app/rpc/commands/files/create.clj#L32

I'm not sure whether this is something that should be fixed on the Penpot side to be more forgiving or whether we need a new export of penpot.js.

Support of boolean objects

Please add the support of boolean objects from Figma. I'm using a lot of boolean operations to combine or subtract base shape to new nondestructive shapes. Penpot support the same boolean operations too, but the Figma exporter ignores all those objects.

At the moment, I have to flatten all shapes in Figma to be able to import them in Penpot. But then I would lose the nondestructive structure of my icons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.