mirror of
https://github.com/penpot/penpot.git
synced 2026-11-18 08:01:21 +00:00
toggle-token and apply-token-from-input each worked out inside the event which attributes a token goes on, and repeated most of it. The decision now lives in pure helpers both events share: `toggle-action` (remove the token or apply it), `apply-action` (on which attributes) and `target-shapes` (a selected group stands for its children). `action->event` turns the result into the event to run. Nothing changes in behavior; apply-spacing-token-separated loses its `attr` option, which every caller left empty. Unit tests cover the decision, with the cases the store tests lacked: a color token comes off the stroke too, a shape without the token completes the others, and a spacing token on chosen attributes. Store tests cover what had none: applying from the fill and stroke rows, the opacity, position and size fields, the min width of a flex child and the selection colors, choosing the token a shape already has, and toggling a token on a group. Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>