Skip to main content

Version 1, Update 22

New:

  • Added swapComponent to swap an instance's main component to a different main component. This function preserves overrrides using the same heuristics as instance swap in the Figma editor UI.

Version 1, Update 21

New:

  • Added commitUndo to commit new undo states to undo history. This does not trigger an undo.
  • Added triggerUndo to trigger an undo action. This reverts to the last state in undo history.

Version 1, Update 20

New:

  • Added moveLocalPaintStyleAfter, moveLocalTextStyleAfter, moveLocalEffectStyleAfter, and moveLocalGridStyleAfter to reorder local styles within folders.
  • Added moveLocalPaintFolderAfter, moveLocalTextFolderAfter, moveLocalEffectFolderAfter, and moveLocalGridFolderAfter to reorder style folders that share the same parent folder.

Version 1, Update 19

New:

  • Support for the new autolayout APIs! They are available on frame nodes.
  • The primaryAxisSizingMode, primaryAxisAlignItems, counterAxisAlignItems properties have been added on frame-like nodes.
  • The horizontalPadding and verticalPadding properties are now deprecated. Use paddingLeft, paddingRight, paddingTop and paddingBottom instead.
  • The layoutGrow property has been added on all nodes (except documents & page nodes).
  • The layoutAlign has changed. It now supports the values "STRETCH" | "INHERIT".

Fixed:

  • The getPluginData and getSharedPluginData APIs now properly inherit from components when accessed from an instance.
  • The setRelaunchData APIs is now able to override relaunch data on instances.

Version 1, Update 18

New:

Fixed:

  • Fixed a bug where instance.children would not return any children when the instance was invisible
  • Fixed a bug where setting a local style to private (by prepending _ to the style name) did not stop it from being published
  • Fixed a bug where accessing textNode.textAutoResize would crash
  • Fixed a bug where it was possible to give a node invalid coordinates by setting relativeTransform to some value where the two axes had zero dot product
  • Fixed a bug where components imported from the team library became writeable
  • Fixed a bug where figma.getLocal*Styles() would return an array containing null or invalid style nodes

Version 1, Update 17

New:

  • enablePrivatePluginApi option in manifest.json to enable Private Plugin specific APIs
  • For private plugins with the above option set, figma.fileKey will be set to the key of the current file.
  • The ui property in the plugin manifest can now either contain a filename in the form of a string. Or a list of filenames in the form of a map.
// either
"ui": "ui.html"

// or
"ui": {
"loginPage": "login.html",
"main": "ui.html",
}
  • If you use the former, the file is available through the __html__ property. If you use the latter, then the files are available through a new __uiFiles__ property (eg.__uiFiles__.loginPage, __uiFiles__.main etc)

Fixed:

  • InstanceNode.mainComponent now returns null instead of raising an exception if the underlying component doesn't actually exist.
  • setPluginData and setSharedPluginData now removes the the relevant entries when the value is set to the empty string "", which is the default value returned by getPluginData and getSharedPluginData.

Version 1, Update 16

New:

  • The newly released easing curves are now available in the API.
  • The existing reactions property returns multiple reactions to support this newly launched feature.
  • The spread property in ShadowEffect to match the newly released spread feature.
  • A rescale function to match to toolbar's Scale Tool.
  • The masterComponent property has been renamed to mainComponent

Fixed:

  • The QuickJS runtime used to sandbox plugin code has been upgraded to the latest version. Exceptions thrown will now contain a property stack trace (e.g. in the (new Error()).stack). Note that you could previously get stack traces using the Developer VM, which also supports the debugger keyword.
  • The setSharedPluginData namespace argument now supports the characters _, . and uppercase characters.
  • Fixed an issue where exportAsImage API would sometimes would fail to render nodes correctly due to instances not being updated.
  • Fixed an issue where plugins could sometimes set a non-invertible affine transform to relativeTransform.
  • Fixed an issue where cloning a component via .clone() would not trigger library updates for publishing.
  • Fixed an issue where very long plugin names would stretch the plugin window.