mirror of
https://github.com/penpot/penpot.git
synced 2026-09-09 13:39:02 +00:00
🐛 Fix activeSets in themes API
This commit is contained in:
parent
e2377e8fa8
commit
72a855d4ac
@ -354,7 +354,17 @@
|
|||||||
(st/emit! (dwtl/toggle-token-theme-active id)))
|
(st/emit! (dwtl/toggle-token-theme-active id)))
|
||||||
|
|
||||||
:activeSets
|
: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
|
:addSet
|
||||||
{:enumerable false
|
{:enumerable false
|
||||||
|
|||||||
@ -18,7 +18,12 @@
|
|||||||
<ul data-handler="themes-list">
|
<ul data-handler="themes-list">
|
||||||
@for (theme of themes; track theme.id) {
|
@for (theme of themes; track theme.id) {
|
||||||
<li class="body-m panel-item theme-item">
|
<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
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
data-appearance="secondary"
|
data-appearance="secondary"
|
||||||
|
|||||||
@ -10,6 +10,7 @@ type TokenTheme = {
|
|||||||
group: string;
|
group: string;
|
||||||
description: string;
|
description: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
|
activeSets: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type TokenSet = {
|
type TokenSet = {
|
||||||
|
|||||||
@ -61,11 +61,13 @@ function loadLibrary() {
|
|||||||
const themes = tokensCatalog.themes;
|
const themes = tokensCatalog.themes;
|
||||||
|
|
||||||
const themesData = themes.map((theme) => {
|
const themesData = themes.map((theme) => {
|
||||||
|
const activeSets = theme.activeSets.map((set) => set.name).join(', ');
|
||||||
return {
|
return {
|
||||||
id: theme.id,
|
id: theme.id,
|
||||||
group: theme.group,
|
group: theme.group,
|
||||||
name: theme.name,
|
name: theme.name,
|
||||||
active: theme.active,
|
active: theme.active,
|
||||||
|
activeSets: activeSets,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user