tokens-lib refactor: Get collection of theme groups

This commit is contained in:
Florian Schroedl 2024-09-17 10:48:23 +02:00
parent 0697e69888
commit f0a9444ab6
3 changed files with 35 additions and 6 deletions

View file

@ -15,7 +15,8 @@
[app.main.data.workspace.state-helpers :as wsh]
[app.main.store :as st]
[app.main.ui.workspace.tokens.token-set :as wtts]
[okulary.core :as l]))
[okulary.core :as l]
[app.common.types.tokens-lib :as ctob]))
;; ---- Global refs
@ -240,13 +241,18 @@
st/state
=))
;; ---- Tokens
(def tokens-lib
(l/derived :tokens-lib workspace-data))
(def workspace-token-theme-groups
(l/derived #(some-> % ctob/get-theme-groups) tokens-lib))
(defn workspace-token-theme
[id]
(l/derived #(wtts/get-workspace-theme id %) st/state))
(def workspace-token-theme-groups
(l/derived wtts/get-workspace-theme-groups st/state))
(def workspace-active-theme-ids
(l/derived wtts/get-active-theme-ids st/state))