mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Cleanup: item->token
This commit is contained in:
@@ -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 -------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user