Beta changelog #
Epics and highlights #
- This marks the release of version 1.0, and from this point forward, we’ll do our best to avoid making any more breaking changes (or make deprecations backward compatible).
- We’ve redone the documentation. You can check the API here: https://penpot-plugins-api-doc.pages.dev/
- New samples repository with lots of samples to use the API: https://github.com/penpot/penpot-plugins-samples
Breaking changes & Deprecations #
- Changed types names to remove the Penpot prefix. So for example:
PenpotShape
becomesShape
;PenpotFile
becomesFile
, and so on. Check the API documentation for more details. - Changes on the
penpot.on
andpenpot.off
methods. Previously you had to send the original callback to the off method in order to remove an event listener. Now,penpot.on
will return an id that you can pass to thepenpot.off
method in order to remove the listener.
Previously:
penpot.on(‘pagechange’, myListener); // Register an event listener
penpot.off(‘pagechange’, myListener); // Remove previously registered listener
Now:
const id = penpot.on(‘pagechange’, myListener);
penpot.off(id);
We’ve deprecated the old behavior in favor of the new one, this means that the behavior will work in the next version, but will be removed further down the line.
- Change some names to better align with the names in Penpot's UI.
- type
frame
is nowboard
:PenpotFrame
is nowBoard
penpot.createFrame
changed topenpot.createBoard
shape.frameX
/shape.frameY
changed toshape.boardX
/shape.boardY
PenpotFrameGuideX
nowGuideX
- type
rect
isrectangle
PenpotRectangle
is nowRectangle
- type
circle
isellipse
PenpotCircle
is nowEllipse
penpot.createCircle
changed topenpot.createEllipse
- type
bool
isboolean
PenpotBool
is nowBoolean
- type
- Removed the following methods
getPage
, you can use now the propertycurrentPage
getFile
, you can use now the propertycurrentFile
getTheme
, you can use now the propertytheme
getSelected
, you can use the propertyselection
getSelectedShapes
, you can use the propertyselection
New features #
- Support for comments
- Support for export files
- Support for undo blocks
- Support for ruler guides
- Support for prototype functionality access
- New geometry utils:
- shape.bounds
- shape.center
- New events
- contentsave
- shapechange
- Adds property file.pages
- Adds parent reference to shape
- Add root shape reference to page
- Add detach shape to component method
- Adds method to createPage and openPage
- Adds shape.visible property
- Adds method penpot.viewport.zoomToShapes to change the viewport to the shapes.