mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 07:50:43 -05:00
Applying resolved token value
This commit is contained in:
parent
66b4b892df
commit
4fec7d5af2
1 changed files with 13 additions and 8 deletions
|
@ -14,7 +14,9 @@
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.shape-layout :as dwsl]
|
[app.main.data.workspace.shape-layout :as dwsl]
|
||||||
[app.main.data.workspace.transforms :as dwt]
|
[app.main.data.workspace.transforms :as dwt]
|
||||||
[app.main.store :as st]))
|
[app.main.store :as st]
|
||||||
|
[app.main.ui.workspace.tokens.style-dictionary :as sd]
|
||||||
|
[promesa.core :as p]))
|
||||||
|
|
||||||
;; Helpers ---------------------------------------------------------------------
|
;; Helpers ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -77,13 +79,16 @@
|
||||||
shape-ids (->> selected-shapes
|
shape-ids (->> selected-shapes
|
||||||
(eduction
|
(eduction
|
||||||
(remove #(tokens-applied? token % attributes))
|
(remove #(tokens-applied? token % attributes))
|
||||||
(map :id)))
|
(map :id)))]
|
||||||
token-value (resolve-token-value token)]
|
(p/let [sd-tokens (sd/resolve-workspace-tokens+ {:debug? true})]
|
||||||
|
(let [resolved-token (get sd-tokens (:id token))
|
||||||
|
resolved-token-value (resolve-token-value resolved-token)]
|
||||||
|
(js/console.log "resolved-token resolve-token-value" resolved-token resolve-token-value)
|
||||||
(doseq [shape selected-shapes]
|
(doseq [shape selected-shapes]
|
||||||
(st/emit! (on-apply {:token-id (:id token)
|
(st/emit! (on-apply {:token-id (:id token)
|
||||||
:shape-id (:id shape)
|
:shape-id (:id shape)
|
||||||
:attributes attributes}))
|
:attributes attributes}))
|
||||||
(on-update-shape token-value shape-ids attributes))))
|
(on-update-shape resolved-token-value shape-ids attributes))))))
|
||||||
|
|
||||||
(defn update-shape-radius [value shape-ids]
|
(defn update-shape-radius [value shape-ids]
|
||||||
(st/emit!
|
(st/emit!
|
||||||
|
|
Loading…
Reference in a new issue