mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
Cleanup: item->token
This commit is contained in:
parent
d097b5b179
commit
69cc9d02ba
1 changed files with 6 additions and 6 deletions
|
@ -25,16 +25,16 @@
|
||||||
|
|
||||||
(defn tokens->select-options [{:keys [shape tokens attributes selected-attributes]}]
|
(defn tokens->select-options [{:keys [shape tokens attributes selected-attributes]}]
|
||||||
(map
|
(map
|
||||||
(fn [{:keys [name] :as item}]
|
(fn [{:keys [name] :as token}]
|
||||||
(cond-> (assoc item :label name)
|
(cond-> (assoc token :label name)
|
||||||
(wtt/token-applied? item shape (or selected-attributes attributes)) (assoc :selected? true)))
|
(wtt/token-applied? token shape (or selected-attributes attributes)) (assoc :selected? true)))
|
||||||
tokens))
|
tokens))
|
||||||
|
|
||||||
(defn tokens-name-map->select-options [{:keys [shape tokens attributes selected-attributes]}]
|
(defn tokens-name-map->select-options [{:keys [shape tokens attributes selected-attributes]}]
|
||||||
(map
|
(map
|
||||||
(fn [[_k {:keys [name] :as item}]]
|
(fn [[_k {:keys [name] :as token}]]
|
||||||
(cond-> (assoc item :label name)
|
(cond-> (assoc token :label name)
|
||||||
(wtt/token-applied? item shape (or selected-attributes attributes)) (assoc :selected? true)))
|
(wtt/token-applied? token shape (or selected-attributes attributes)) (assoc :selected? true)))
|
||||||
tokens))
|
tokens))
|
||||||
|
|
||||||
;; JSON export functions -------------------------------------------------------
|
;; JSON export functions -------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue