Version 1, Update 86
New:
- Add a
figma.createComponentFromNodefunction to create a component from an existing node, preserving all of its properties and children.
New:
figma.createComponentFromNode function to create a component from an existing node, preserving all of its properties and children.New:
null is now supported for the variable field in setBoundVariableForPaint, setBoundVariableForEffect, and setBoundVariableForLayoutGrid. Passing in null will detach the bound variables.
For plugins that can run in VSCode, we now recommend replacing alert() and confirm() dialogs in the plugin UI with custom UI, since VS Code blocks native dialogs.
The Working in Dev Mode page is updated accordingly.
Updates:
type property to go from an instance of BaseStyle to a child style type.boundVariables keyed by style type (effects or layoutGrids).This update includes changes to the Variables API to support binding variables to effects, layout grids, stroke weights, and layer opacity. We are also releasing support to run Dev Mode plugins in the Figma for VS Code extension.
Changes to the Variables API:
FLOAT and COLOR variables can be bound to Effects via the setBoundVariablesForEffect() helper.FLOAT variables can be bound to LayoutGrids via the setBoundVariablesForLayoutGrid() helper.FLOAT variables can be bound to layer opacity, stroke weights, and individual stroke weights.Dev Mode plugins can now run in the Figma for VS Code extension with some minor manifest and code changes:
vscode capabilityFixes:
fillGeometry and strokeGeometry properties are correctly marked as readonlyNew:
NEGATE as a Prototyping ExpressionFunction type!New:
variableIds are now returned in a similar order to the Figma Design UI. See VariableCollection#variableIdstextRangeFills to the boundVariables structure. This will be populated on text nodes which have color variables bound to substrings.The Plugin API runtime has been updated to ensure proper usage of figma.showUI.
It is unsafe to call figma.showUI within an event handler for the figma.codegen.on("generate") event. In development, figma.showUI will now throw an error when called as a result of a figma.codegen.on("generate")
If you need to trigger code inside an iframe as the result of a generate callback, you should instead move the call to showUI outside of the event handler and use figma.ui.postMessage to communicate with the iframe from within the callback. This will ensure that your plugin can to handle concurrent generate events. Here's a code example for how to do this.
We're introducing an improved way to attach straight connectors to nodes in FigJam with a new CENTER magnet. Starting in 2024, straight connectors will only be able to attach to CENTER and NONE magnets. The magnets for elbowed connectors will remain unchanged.
Notice of breaking change:
To support CENTER magnets as the improved way for straight connectors to attach to nodes, we are making a breaking change for plugins that set straight connector endpoint magnets to AUTO, TOP, LEFT, BOTTOM, or RIGHT.
Who is affected: Anyone with a plugin/widget that touches straight connectors and sets an endpoint magnet to AUTO, TOP, LEFT, BOTTOM, or RIGHT.
What you must do: Find and update the code that sets the endpoints of straight connectors to use the CENTER or NONE magnet.
What will happen now:
What will happen starting October 25, 2023:
What will happen in 2024:
New
node.isMask == true), maskType can be used to get/modify the masking type used (alpha, vector, or luminance) for the mask operation.