From 416297d298ad73fc67e396613074734a195c8cd7 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Mon, 23 Sep 2024 17:37:16 +0200 Subject: [PATCH 1/7] Implement active-themes --- common/src/app/common/types/tokens_lib.cljc | 131 ++++++++++++++---- .../common_tests/types/tokens_lib_test.cljc | 49 +++++++ 2 files changed, 153 insertions(+), 27 deletions(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 476bff524..7271b850a 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -12,6 +12,7 @@ [app.common.time :as dt] [app.common.transit :as t] [app.common.types.token :as cto] + [clojure.set :as set] [cuerdas.core :as str] #?(:clj [app.common.fressian :as fres]))) @@ -95,6 +96,14 @@ (group? group)) (seq group)) +(def theme-separator "/") + +(defn theme-path [group name] + (join-path [group name] theme-separator)) + +(defn token-theme->path [token-theme] + (theme-path (:group token-theme) (:name token-theme))) + ;; === Token (defrecord Token [name type value description modified-at]) @@ -316,7 +325,13 @@ (get-theme-tree [_] "get a nested tree of all themes in the library") (get-themes [_] "get an ordered sequence of all themes in the library") (get-theme [_ group name] "get one theme looking for name") - (get-theme-groups [_] "get a sequence of group names by order")) + (get-theme-groups [_] "get a sequence of group names by order") + (get-active-theme-paths [_] "get the active theme paths") + (get-active-themes [_] "get an ordered sequence of active themes in the library") + (active? [_ group name] "predicate if token theme is active") + (activate [_ group name] "adds theme from the active-themes") + (deactivate [_ group name] "removes theme from the active-themes") + (toggle-active? [_ group name] "toggles theme in the active-themes")) (def schema:token-themes [:and @@ -343,18 +358,25 @@ (toggle-set-in-theme [_ group-name theme-name set-name] "toggle a set used / not used in a theme") (validate [_])) -(deftype TokensLib [sets set-groups themes] +(deftype TokensLib [sets set-groups themes active-themes] ;; NOTE: This is only for debug purposes, pending to properly ;; implement the toString and alternative printing. #?@(:clj [clojure.lang.IDeref - (deref [_] {:sets sets :set-groups set-groups :themes themes})] + (deref [_] {:sets sets + :set-groups set-groups + :themes themes + :active-themes active-themes})] :cljs [cljs.core/IDeref - (-deref [_] {:sets sets :set-groups set-groups :themes themes})]) + (-deref [_] {:sets sets + :set-groups set-groups + :themes themes + :active-themes active-themes})]) #?@(:cljs [cljs.core/IEncodeJS (-clj->js [_] (js-obj "sets" (clj->js sets) "set-groups" (clj->js set-groups) - "themes" (clj->js themes)))]) + "themes" (clj->js themes) + "active-themes" (clj->js active-themes)))]) ITokenSets (add-set [_ token-set] @@ -365,7 +387,8 @@ (cond-> set-groups (not (str/empty? groups-str)) (assoc groups-str (make-token-set-group))) - themes))) + themes + active-themes))) (update-set [this set-name f] (let [path (split-path set-name "/") @@ -381,14 +404,16 @@ (d/oassoc-in-before path path' set') (d/dissoc-in path))) set-groups ;; TODO update set-groups as needed - themes)) + themes + active-themes)) this))) (delete-set [_ set-name] (let [path (split-path set-name "/")] (TokensLib. (d/dissoc-in sets path) set-groups ;; TODO remove set-group if needed - themes))) + themes + active-themes))) (get-set-tree [_] sets) @@ -412,7 +437,8 @@ (dm/assert! "expected valid token theme" (check-token-theme! token-theme)) (TokensLib. sets set-groups - (update themes (:group token-theme) d/oassoc (:name token-theme) token-theme))) + (update themes (:group token-theme) d/oassoc (:name token-theme) token-theme) + active-themes)) (update-theme [this group name f] (let [theme (dm/get-in themes [group name])] @@ -428,13 +454,15 @@ (update themes group' assoc name' theme') (-> themes (d/oassoc-in-before [group name] [group' name'] theme') - (d/dissoc-in [group name]))))) + (d/dissoc-in [group name]))) + active-themes)) this))) (delete-theme [_ group name] (TokensLib. sets set-groups - (d/dissoc-in themes [group name]))) + (d/dissoc-in themes [group name]) + (disj active-themes (theme-path group name)))) (get-theme-tree [_] themes) @@ -455,13 +483,56 @@ (get-theme [_ group name] (dm/get-in themes [group name])) + (activate [this group name] + (if (get-theme this group name) + (let [group-themes (->> (get themes group) + (map (comp token-theme->path val)) + (#(doto % println)) + (into #{})) + active-themes' (-> (set/difference active-themes group-themes) + (conj (theme-path group name)))] + (TokensLib. sets + set-groups + themes + active-themes')) + (TokensLib. sets + set-groups + themes + active-themes))) + + (deactivate [_ group name] + (TokensLib. sets + set-groups + themes + (disj active-themes (theme-path group name)))) + + (active? [_ group name] + (contains? active-themes (theme-path group name))) + + (toggle-active? [this group name] + (if (active? this group name) + (deactivate this group name) + (activate this group name))) + + (get-active-theme-paths [_] + active-themes) + + (get-active-themes [this] + (into + (list) + (comp + (filter (partial instance? TokenTheme)) + (filter #(active? this (:group %) (:name %)))) + (tree-seq d/ordered-map? vals themes))) + ITokensLib (add-token-in-set [this set-name token] (dm/assert! "expected valid token instance" (check-token! token)) (if (contains? sets set-name) (TokensLib. (update sets set-name add-token token) set-groups - themes) + themes + active-themes) this)) (update-token-in-set [this set-name token-name f] @@ -469,7 +540,8 @@ (TokensLib. (update sets set-name #(update-token % token-name f)) set-groups - themes) + themes + active-themes) this)) (delete-token-from-set [this set-name token-name] @@ -477,7 +549,8 @@ (TokensLib. (update sets set-name #(delete-token % token-name)) set-groups - themes) + themes + active-themes) this)) (toggle-set-in-theme [this theme-group theme-name set-name] @@ -485,7 +558,8 @@ (TokensLib. sets set-groups (d/oupdate-in themes [theme-group theme-name] - #(toggle-set % set-name))) + #(toggle-set % set-name)) + active-themes) this)) (validate [_] @@ -513,10 +587,11 @@ ;; with pages and pages-index. (make-tokens-lib :sets (d/ordered-map) :set-groups {} - :themes (d/ordered-map))) + :themes (d/ordered-map) + :active-themes #{})) - ([& {:keys [sets set-groups themes]}] - (let [tokens-lib (TokensLib. sets set-groups themes)] + ([& {:keys [sets set-groups themes active-themes]}] + (let [tokens-lib (TokensLib. sets set-groups themes (or active-themes #{}))] (dm/assert! "expected valid tokens lib" @@ -541,16 +616,16 @@ :class TokensLib :wfn deref :rfn #(make-tokens-lib %)} - + {:id "penpot/token-set" :class TokenSet :wfn #(into {} %) - :rfn #(make-token-set %)} - + :rfn #(make-token-set %)} + {:id "penpot/token-theme" :class TokenTheme :wfn #(into {} %) - :rfn #(make-token-theme %)} + :rfn #(make-token-theme %)} {:id "penpot/token" :class Token @@ -592,9 +667,11 @@ (fres/write-tag! w n 3) (fres/write-object! w (.-sets o)) (fres/write-object! w (.-set-groups o)) - (fres/write-object! w (.-themes o))) + (fres/write-object! w (.-themes o)) + (fres/write-object! w (.-active-themes o))) :rfn (fn [r] - (let [sets (fres/read-object! r) - set-groups (fres/read-object! r) - themes (fres/read-object! r)] - (->TokensLib sets set-groups themes)))})) + (let [sets (fres/read-object! r) + set-groups (fres/read-object! r) + themes (fres/read-object! r) + active-themes (fres/read-object! r)] + (->TokensLib sets set-groups themes active-themes)))})) diff --git a/common/test/common_tests/types/tokens_lib_test.cljc b/common/test/common_tests/types/tokens_lib_test.cljc index 8efed001b..e0abee489 100644 --- a/common/test/common_tests/types/tokens_lib_test.cljc +++ b/common/test/common_tests/types/tokens_lib_test.cljc @@ -392,6 +392,54 @@ (t/is (dt/is-after? (:modified-at token-theme') (:modified-at token-theme)))))) +(t/testing "theme activation in a lib" + (t/deftest get-theme-collections + (let [tokens-lib (-> (ctob/make-tokens-lib) + (ctob/add-theme (ctob/make-token-theme :group "" :name "other-theme")) + (ctob/add-theme (ctob/make-token-theme :group "" :name "theme-1")) + (ctob/activate "" "theme-1") + (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-2")) + (ctob/activate "group-1" "theme-2")) + expected-active-themes (->> (ctob/get-active-themes tokens-lib) + (map #(select-keys % [:name :group])))] + + (t/is (= #{"/theme-1" "group-1/theme-2"} + (ctob/get-active-theme-paths tokens-lib)) + "should be set of active theme paths") + + (t/is (= (list {:group "group-1" :name "theme-2"} {:group "" :name "theme-1"}) + expected-active-themes)))) + + (t/deftest toggle-theme-activity-in-group + (let [tokens-lib (-> (ctob/make-tokens-lib) + (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-1")) + (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-2"))) + + tokens-lib' (-> tokens-lib + (ctob/activate "group-1" "theme-1") + (ctob/activate "group-1" "theme-2"))] + + (t/is (not (ctob/active? tokens-lib' "group-1" "theme-1")) "theme-1 should be de-activated") + (t/is (ctob/active? tokens-lib' "group-1" "theme-2") "theme-1 should be activated"))) + + (t/deftest toggle-theme-activity + (let [tokens-lib (-> (ctob/make-tokens-lib) + (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-1")) + (ctob/toggle-active? "group-1" "theme-1")) + + tokens-lib' (-> tokens-lib + (ctob/toggle-active? "group-1" "theme-1"))] + + (t/is (ctob/active? tokens-lib "group-1" "theme-1") "theme-1 should be activated") + (t/is (not (ctob/active? tokens-lib' "group-1" "theme-2")) "theme-1 got deactivated by toggling"))) + + (t/deftest activating-missing-theme-noop + (let [tokens-lib (-> (ctob/make-tokens-lib) + (ctob/toggle-active? "group-1" "theme-1"))] + + (t/is (= #{} (ctob/get-active-theme-paths tokens-lib)) "Should not non-existing theme to the active-themes")))) + + (t/testing "serialization" (t/deftest transit-serialization (let [tokens-lib (-> (ctob/make-tokens-lib) @@ -423,6 +471,7 @@ (t/is (= (ctob/set-count tokens-lib') 1)) (t/is (= (ctob/theme-count tokens-lib') 1))))) + (t/testing "grouping" (t/deftest split-and-join (let [name "group/subgroup/name" From 5e39f33bff37ee7e4cc572095ace1e4f744d7d33 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 11:06:12 +0200 Subject: [PATCH 2/7] Rename with theme prefix --- common/src/app/common/types/tokens_lib.cljc | 24 +++++++++---------- .../common_tests/types/tokens_lib_test.cljc | 22 ++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 7271b850a..41ccce46e 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -328,10 +328,10 @@ (get-theme-groups [_] "get a sequence of group names by order") (get-active-theme-paths [_] "get the active theme paths") (get-active-themes [_] "get an ordered sequence of active themes in the library") - (active? [_ group name] "predicate if token theme is active") - (activate [_ group name] "adds theme from the active-themes") - (deactivate [_ group name] "removes theme from the active-themes") - (toggle-active? [_ group name] "toggles theme in the active-themes")) + (theme-active? [_ group name] "predicate if token theme is active") + (activate-theme [_ group name] "adds theme from the active-themes") + (deactivate-theme [_ group name] "removes theme from the active-themes") + (toggle-theme-active? [_ group name] "toggles theme in the active-themes")) (def schema:token-themes [:and @@ -483,7 +483,7 @@ (get-theme [_ group name] (dm/get-in themes [group name])) - (activate [this group name] + (activate-theme [this group name] (if (get-theme this group name) (let [group-themes (->> (get themes group) (map (comp token-theme->path val)) @@ -500,19 +500,19 @@ themes active-themes))) - (deactivate [_ group name] + (deactivate-theme [_ group name] (TokensLib. sets set-groups themes (disj active-themes (theme-path group name)))) - (active? [_ group name] + (theme-active? [_ group name] (contains? active-themes (theme-path group name))) - (toggle-active? [this group name] - (if (active? this group name) - (deactivate this group name) - (activate this group name))) + (toggle-theme-active? [this group name] + (if (theme-active? this group name) + (deactivate-theme this group name) + (activate-theme this group name))) (get-active-theme-paths [_] active-themes) @@ -522,7 +522,7 @@ (list) (comp (filter (partial instance? TokenTheme)) - (filter #(active? this (:group %) (:name %)))) + (filter #(theme-active? this (:group %) (:name %)))) (tree-seq d/ordered-map? vals themes))) ITokensLib diff --git a/common/test/common_tests/types/tokens_lib_test.cljc b/common/test/common_tests/types/tokens_lib_test.cljc index e0abee489..d12628cc5 100644 --- a/common/test/common_tests/types/tokens_lib_test.cljc +++ b/common/test/common_tests/types/tokens_lib_test.cljc @@ -397,9 +397,9 @@ (let [tokens-lib (-> (ctob/make-tokens-lib) (ctob/add-theme (ctob/make-token-theme :group "" :name "other-theme")) (ctob/add-theme (ctob/make-token-theme :group "" :name "theme-1")) - (ctob/activate "" "theme-1") + (ctob/activate-theme "" "theme-1") (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-2")) - (ctob/activate "group-1" "theme-2")) + (ctob/activate-theme "group-1" "theme-2")) expected-active-themes (->> (ctob/get-active-themes tokens-lib) (map #(select-keys % [:name :group])))] @@ -416,26 +416,26 @@ (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-2"))) tokens-lib' (-> tokens-lib - (ctob/activate "group-1" "theme-1") - (ctob/activate "group-1" "theme-2"))] + (ctob/activate-theme "group-1" "theme-1") + (ctob/activate-theme "group-1" "theme-2"))] - (t/is (not (ctob/active? tokens-lib' "group-1" "theme-1")) "theme-1 should be de-activated") - (t/is (ctob/active? tokens-lib' "group-1" "theme-2") "theme-1 should be activated"))) + (t/is (not (ctob/theme-active? tokens-lib' "group-1" "theme-1")) "theme-1 should be de-activated") + (t/is (ctob/theme-active? tokens-lib' "group-1" "theme-2") "theme-1 should be activated"))) (t/deftest toggle-theme-activity (let [tokens-lib (-> (ctob/make-tokens-lib) (ctob/add-theme (ctob/make-token-theme :group "group-1" :name "theme-1")) - (ctob/toggle-active? "group-1" "theme-1")) + (ctob/toggle-theme-active? "group-1" "theme-1")) tokens-lib' (-> tokens-lib - (ctob/toggle-active? "group-1" "theme-1"))] + (ctob/toggle-theme-active? "group-1" "theme-1"))] - (t/is (ctob/active? tokens-lib "group-1" "theme-1") "theme-1 should be activated") - (t/is (not (ctob/active? tokens-lib' "group-1" "theme-2")) "theme-1 got deactivated by toggling"))) + (t/is (ctob/theme-active? tokens-lib "group-1" "theme-1") "theme-1 should be activated") + (t/is (not (ctob/theme-active? tokens-lib' "group-1" "theme-2")) "theme-1 got deactivated by toggling"))) (t/deftest activating-missing-theme-noop (let [tokens-lib (-> (ctob/make-tokens-lib) - (ctob/toggle-active? "group-1" "theme-1"))] + (ctob/toggle-theme-active? "group-1" "theme-1"))] (t/is (= #{} (ctob/get-active-theme-paths tokens-lib)) "Should not non-existing theme to the active-themes")))) From 44e4e852017c5cbfd844bf246a30cbf3cde58a66 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 11:10:07 +0200 Subject: [PATCH 3/7] Add schema validation --- common/src/app/common/types/tokens_lib.cljc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 41ccce46e..83b1174a8 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -348,6 +348,12 @@ (def check-token-themes! (sm/check-fn ::token-themes)) +(def schema:active-token-themes + [:set string?]) + +(def valid-active-token-themes? + (sm/validator schema:active-token-themes)) + ;; === Tokens Lib (defprotocol ITokensLib @@ -564,7 +570,8 @@ (validate [_] (and (valid-token-sets? sets) ;; TODO: validate set-groups - (valid-token-themes? themes)))) + (valid-token-themes? themes) + (valid-active-token-themes? active-themes)))) (defn valid-tokens-lib? [o] From f2569a1c4a271190e2e5335e55cfe88c9cd7f999 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 11:13:41 +0200 Subject: [PATCH 4/7] Cleanup --- common/src/app/common/types/tokens_lib.cljc | 1 - 1 file changed, 1 deletion(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 83b1174a8..50b17c9c9 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -493,7 +493,6 @@ (if (get-theme this group name) (let [group-themes (->> (get themes group) (map (comp token-theme->path val)) - (#(doto % println)) (into #{})) active-themes' (-> (set/difference active-themes group-themes) (conj (theme-path group name)))] From d7d974242ee88aa9e0b90a4d1f35421afee65a3a Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 11:18:12 +0200 Subject: [PATCH 5/7] Add active-themes to data serialization tests --- common/test/common_tests/types/tokens_lib_test.cljc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/test/common_tests/types/tokens_lib_test.cljc b/common/test/common_tests/types/tokens_lib_test.cljc index d12628cc5..377372a84 100644 --- a/common/test/common_tests/types/tokens_lib_test.cljc +++ b/common/test/common_tests/types/tokens_lib_test.cljc @@ -448,13 +448,15 @@ :type :boolean :value true)) (ctob/add-theme (ctob/make-token-theme :name "test-token-theme")) - (ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set")) + (ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set") + (ctob/activate-theme "" "test-token-theme")) encoded-str (tr/encode-str tokens-lib) tokens-lib' (tr/decode-str encoded-str)] (t/is (ctob/valid-tokens-lib? tokens-lib')) (t/is (= (ctob/set-count tokens-lib') 1)) - (t/is (= (ctob/theme-count tokens-lib') 1)))) + (t/is (= (ctob/theme-count tokens-lib') 1)) + (t/is (= (ctob/get-active-theme-paths tokens-lib') #{"/test-token-theme"})))) (t/deftest fressian-serialization (let [tokens-lib (-> (ctob/make-tokens-lib) @@ -463,13 +465,15 @@ :type :boolean :value true)) (ctob/add-theme (ctob/make-token-theme :name "test-token-theme")) - (ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set")) + (ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set") + (ctob/activate-theme "" "test-token-theme")) encoded-blob (fres/encode tokens-lib) tokens-lib' (fres/decode encoded-blob)] (t/is (ctob/valid-tokens-lib? tokens-lib')) (t/is (= (ctob/set-count tokens-lib') 1)) - (t/is (= (ctob/theme-count tokens-lib') 1))))) + (t/is (= (ctob/theme-count tokens-lib') 1)) + (t/is (= (ctob/get-active-theme-paths tokens-lib') #{"/test-token-theme"}))))) (t/testing "grouping" From 49579d75c6b8ba03556b9208e207c8a63de36529 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 13:42:56 +0200 Subject: [PATCH 6/7] Simplify as this --- common/src/app/common/types/tokens_lib.cljc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 50b17c9c9..bad4c3860 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -500,10 +500,7 @@ set-groups themes active-themes')) - (TokensLib. sets - set-groups - themes - active-themes))) + this)) (deactivate-theme [_ group name] (TokensLib. sets From 6d75993fd70605d1403410948b01cf7903cc9354 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 14:24:35 +0200 Subject: [PATCH 7/7] Move theme-path impl to ITokenTheme --- common/src/app/common/types/tokens_lib.cljc | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index bad4c3860..a2e1e2ddf 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -96,14 +96,6 @@ (group? group)) (seq group)) -(def theme-separator "/") - -(defn theme-path [group name] - (join-path [group name] theme-separator)) - -(defn token-theme->path [token-theme] - (theme-path (:group token-theme) (:name token-theme))) - ;; === Token (defrecord Token [name type value description modified-at]) @@ -258,8 +250,14 @@ ;; === TokenTheme +(def theme-separator "/") + +(defn token-theme-path [group name] + (join-path [group name] theme-separator)) + (defprotocol ITokenTheme - (toggle-set [_ set-name] "togle a set used / not used in the theme")) + (toggle-set [_ set-name] "togle a set used / not used in the theme") + (theme-path [_] "get `token-theme-path` from theme")) (defrecord TokenTheme [name group description is-source modified-at sets] ITokenTheme @@ -271,7 +269,9 @@ (dt/now) (if (sets set-name) (disj sets set-name) - (conj sets set-name))))) + (conj sets set-name)))) + (theme-path [_] + (token-theme-path group name))) (def schema:token-theme [:and [:map {:title "TokenTheme"} @@ -468,7 +468,7 @@ (TokensLib. sets set-groups (d/dissoc-in themes [group name]) - (disj active-themes (theme-path group name)))) + (disj active-themes (token-theme-path group name)))) (get-theme-tree [_] themes) @@ -490,12 +490,12 @@ (dm/get-in themes [group name])) (activate-theme [this group name] - (if (get-theme this group name) + (if-let [theme (get-theme this group name)] (let [group-themes (->> (get themes group) - (map (comp token-theme->path val)) + (map (comp theme-path val)) (into #{})) active-themes' (-> (set/difference active-themes group-themes) - (conj (theme-path group name)))] + (conj (theme-path theme)))] (TokensLib. sets set-groups themes @@ -506,10 +506,10 @@ (TokensLib. sets set-groups themes - (disj active-themes (theme-path group name)))) + (disj active-themes (token-theme-path group name)))) (theme-active? [_ group name] - (contains? active-themes (theme-path group name))) + (contains? active-themes (token-theme-path group name))) (toggle-theme-active? [this group name] (if (theme-active? this group name)