mirror of
https://github.com/penpot/penpot.git
synced 2026-05-16 05:23:39 +00:00
* 💄 Removed forgotten print (#8594) * 🐛 Fix number token applying rotation when line-height attr is specified toggle-token always used the on-update-shape from token-properties, which for :number tokens is unconditionally update-rotation. So calling applyToken(token, ["line-height"]) on a :number token would correctly set the line-height text attribute but also invoke update-rotation with the token value, silently rotating the shape. Added an :on-update-shape-per-attr map to the :number token properties entry mapping each valid attribute subset to its correct update function. toggle-token now resolves the update function from that map when explicit attrs are provided, falling back to the default on-update-shape otherwise. Signed-off-by: Andrey Antukh <niwi@niwi.nz> * ♻️ Centralise attr->update-fn map and use it generically in toggle-token The attributes->shape-update map was only defined in propagation.cljs. Move it to application.cljs (where all the update functions live) and have propagation.cljs reference it via dwta/attributes->shape-update, eliminating the duplication. Build a private flattened attr->shape-update map (one entry per individual keyword) from that same source of truth. toggle-token now uses it to resolve the correct on-update-shape when explicit attrs are passed, instead of always taking the default from token-properties. This fixes the :number token side-effect without any per-type special casing: any token type whose explicit attrs map to a different update function than the type default will now dispatch correctly. Signed-off-by: Andrey Antukh <niwi@niwi.nz> * ✨ Backport obj/reify changes from develop * ✨ Add missing error handler on shape proxy on plugins objects --------- Signed-off-by: Andrey Antukh <niwi@niwi.nz> Co-authored-by: Alonso Torres <alonso.torres@kaleidos.net>