Pablo Alba c9c9a574a0
🐛 Repair variant property set when removing a property (#12960)
* 🐛 Repair variant property set when removing a property

Removing a property could leave two variants with the same value
combination. The remaining property vectors now go through
ctv/sanitize-properties-set, and each main's variant name is refreshed, so
the set stays valid, as the 0038 migration leaves it.

On a clash, the variant higher in the layers panel keeps its values and
the lower one gets a " (n)" suffix. The plugin docs for removeProperty
say so.

The rename-in-layers path removes properties that are empty in every
variant. That cannot make two variants equal, so it skips the clean-up:
a duplicate made by the rename stays and its warning shows.

Closes #12959

AI-assisted-by: claude-opus-5-5

* 🐛 Keep the top variant on a clash in migration 0038

Migration 0038 cleaned the members of a set in :shapes order, so on a
value clash the bottom variant in the layers panel kept its values and
the top one got a " (n)" suffix. The top variant is the primary one, and
removing a property already keeps it. update-variant-container-properties
now passes the members top first, so both paths agree: the primary
variant keeps its values and its property names lead the set. 0038 is
not in a release yet, so it changes in place.

The removeProperty plugin docs now cover three or more clashing variants
and all-blank values, and the plugins CHANGELOG has an entry for the fix.

AI-assisted-by: claude-opus-5-5
2026-11-20 15:35:40 +01:00
..
2025-12-30 14:56:15 +01:00
2025-12-30 14:56:15 +01:00

Penpot plugin-types

The @penpot/plugin-types package provides TypeScript type definitions for the Penpot Plugin API, making it easier to develop plugins for the Penpot design platform with full type safety and IDE support. It streamlines the development process by ensuring that your code is well-typed and less prone to errors.

Getting started

Installation

To add penpot's plugin-types to your project, use the following command:

npm install @penpot/plugin-types

Configuration

To ensure the typings work correctly in your project, update your tsconfig.json as follows:

"typeRoots": [
  "./node_modules/@types",
  "./node_modules/@penpot"
],
"types": ["plugin-types"],

Learn more

For more information on how to build plugins using the Penpot PLugin API, refer to the official documentation. You can also explore practical examples in the samples repository to see real-world implementations.