mirror of
https://github.com/penpot/penpot.git
synced 2026-03-03 16:54:19 +00:00
🐛 Fix activeSets in themes API
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -10,6 +10,7 @@ type TokenTheme = {
|
||||
group: string;
|
||||
description: string;
|
||||
active: boolean;
|
||||
activeSets: string;
|
||||
};
|
||||
|
||||
type TokenSet = {
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user