mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 14:51:40 +02:00
Add token theme data scaffold
This commit is contained in:
parent
35759792a3
commit
3695ba3438
4 changed files with 86 additions and 0 deletions
|
@ -88,6 +88,20 @@
|
|||
(update [_ state]
|
||||
(wtts/assoc-selected-token-set-id state id))))
|
||||
|
||||
(defn create-token-theme [token-theme]
|
||||
(let [new-token-theme (merge
|
||||
{:id (uuid/next)
|
||||
:sets #{}
|
||||
:selected :enabled}
|
||||
token-theme)]
|
||||
(ptk/reify ::create-token-theme
|
||||
ptk/WatchEvent
|
||||
(watch [it _ _]
|
||||
(let [changes (-> (pcb/empty-changes it)
|
||||
(pcb/add-token-theme new-token-theme))]
|
||||
(rx/of
|
||||
(dch/commit-changes changes)))))))
|
||||
|
||||
(defn create-token-set [token-set]
|
||||
(let [new-token-set (merge
|
||||
{:id (uuid/next)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue