0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 05:34:23 -05:00

🐛 Fix open border radius on token applied

This commit is contained in:
Eva Marco 2025-01-08 12:25:48 +01:00 committed by Andrés Moya
parent 791cb7e5fe
commit a5a1d3af3c
2 changed files with 19 additions and 1 deletions

View file

@ -7,7 +7,10 @@
[app.main.ui.components.numeric-input :refer [numeric-input*]]
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
[app.main.ui.ds.foundations.assets.icon :refer [icon*]]
[app.main.ui.hooks :as hooks]
[app.util.i18n :as i18n :refer [tr]]
[beicon.v2.core :as rx]
[potok.v2.core :as ptk]
[rumext.v2 :as mf]))
(defn all-equal?
@ -58,7 +61,19 @@
on-radius-r1-change #(on-radius-4-change % :r1)
on-radius-r2-change #(on-radius-4-change % :r2)
on-radius-r3-change #(on-radius-4-change % :r3)
on-radius-r4-change #(on-radius-4-change % :r4)]
on-radius-r4-change #(on-radius-4-change % :r4)
expand-stream
(mf/with-memo []
(->> st/stream
(rx/filter (ptk/type? :expand-border-radius))))]
(hooks/use-stream
expand-stream
#(reset! radius-expanded* true))
(mf/with-effect [ids]
(reset! radius-expanded* false))
[:div {:class (stl/css :radius)}
(if (not radius-expanded)

View file

@ -16,6 +16,7 @@
[app.main.data.workspace.state-helpers :as wsh]
[app.main.data.workspace.transforms :as dwt]
[app.main.data.workspace.undo :as dwu]
[app.main.store :as st]
[app.main.ui.workspace.tokens.style-dictionary :as sd]
[app.main.ui.workspace.tokens.tinycolor :as tinycolor]
[app.main.ui.workspace.tokens.token :as wtt]
@ -99,6 +100,8 @@
:attrs ctt/border-radius-keys}))
(defn update-shape-radius-single-corner [value shape-ids attributes]
;; NOTE: This key should be namespaced on data tokens, but these events are not there.
(st/emit! (ptk/data-event :expand-border-radius))
(dwsh/update-shapes shape-ids
(fn [shape]
(when (ctsr/can-get-border-radius? shape)