mirror of
https://github.com/penpot/penpot.git
synced 2025-01-20 05:34:23 -05:00
✨ Add themes data to decoding
This commit is contained in:
parent
19ce9e8ce3
commit
d0ad149e20
1 changed files with 15 additions and 1 deletions
|
@ -902,6 +902,7 @@ When `before-set-name` is nil, move set to bottom")
|
|||
(decode-dtcg-json [_ parsed-json]
|
||||
(let [;; tokens-studio/plugin will add these meta properties, remove them for now
|
||||
sets-data (dissoc parsed-json "$themes" "$metadata")
|
||||
themes-data (get parsed-json "$themes")
|
||||
lib (make-tokens-lib)
|
||||
lib' (reduce
|
||||
(fn [lib [set-name tokens]]
|
||||
|
@ -909,7 +910,20 @@ When `before-set-name` is nil, move set to bottom")
|
|||
:name set-name
|
||||
:tokens (flatten-nested-tokens-json tokens ""))))
|
||||
lib sets-data)]
|
||||
lib'))
|
||||
(reduce
|
||||
(fn [lib {:strs [name
|
||||
group
|
||||
description
|
||||
is-source
|
||||
modified-at
|
||||
sets]}]
|
||||
(add-theme lib (TokenTheme. name
|
||||
group
|
||||
description
|
||||
is-source
|
||||
(dt/parse-instant modified-at)
|
||||
(set sets))))
|
||||
lib' themes-data)))
|
||||
|
||||
(get-all-tokens [this]
|
||||
(reduce
|
||||
|
|
Loading…
Add table
Reference in a new issue