🐛 Fix activeSets in themes API

This commit is contained in:
Andrés Moya
2026-02-18 11:17:05 +01:00
committed by Andrés Moya
parent e2377e8fa8
commit 72a855d4ac
4 changed files with 20 additions and 2 deletions

View File

@@ -354,7 +354,17 @@
(st/emit! (dwtl/toggle-token-theme-active id)))
:activeSets
{:this true :get (fn [_])}
{:this true
:get (fn [_]
(let [tokens-lib (u/locate-tokens-lib file-id)
theme (u/locate-token-theme file-id id)]
(->> theme
:sets
(map #(->> %
(ctob/get-set-by-name tokens-lib)
(ctob/get-id)
(token-set-proxy plugin-id file-id)))
(apply array))))}
:addSet
{:enumerable false

View File

@@ -18,7 +18,12 @@
<ul data-handler="themes-list">
@for (theme of themes; track theme.id) {
<li class="body-m panel-item theme-item">
<span>{{ theme.group }} / {{ theme.name }}</span>
<span title="{{ theme.activeSets }}">
@if (theme.group) {
{{ theme.group }} /
}
{{ theme.name }}
</span>
<button
type="button"
data-appearance="secondary"

View File

@@ -10,6 +10,7 @@ type TokenTheme = {
group: string;
description: string;
active: boolean;
activeSets: string;
};
type TokenSet = {

View File

@@ -61,11 +61,13 @@ function loadLibrary() {
const themes = tokensCatalog.themes;
const themesData = themes.map((theme) => {
const activeSets = theme.activeSets.map((set) => set.name).join(', ');
return {
id: theme.id,
group: theme.group,
name: theme.name,
active: theme.active,
activeSets: activeSets,
};
});