From 9ca4fa752c32d9a43edb580af0019f5e02332901 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 21 May 2025 09:44:06 +0200 Subject: [PATCH] :bug: Add json encoding for tokenslib type --- CHANGES.md | 1 + common/src/app/common/types/tokens_lib.cljc | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 4771a8b57c..ee9d09ee2e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -53,6 +53,7 @@ - Fix share button being displayed with no permissions [Taiga #11086](https://tree.taiga.io/project/penpot/issue/11086) - Fix inline styles in code tab [Taiga Issue #7583](https://tree.taiga.io/project/penpot/issue/7583) - Fix exception on returning openapi.json +- Fix json encoding of TokensLib [Taiga #10994](https://tree.taiga.io/project/penpot/issue/10994) ## 2.6.2 diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 5e2d17ddf8..f96d1b0296 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -7,6 +7,7 @@ (ns app.common.types.tokens-lib (:require #?(:clj [app.common.fressian :as fres]) + #?(:clj [clojure.data.json :as json]) [app.common.data :as d] [app.common.data.macros :as dm] [app.common.files.helpers :as cfh] @@ -911,6 +912,12 @@ Will return a value that matches this schema: "themes" (clj->js themes) "active-themes" (clj->js active-themes)))]) + + #?@(:clj + [json/JSONWriter + (-write [this writter options] (json/-write (encode-dtcg this) writter options))]) + + ITokenSets (add-set [_ token-set] (let [path (get-token-set-prefixed-path token-set)