🐛 Convert token values for the plugins

This commit is contained in:
Andrés Moya 2026-02-25 12:23:15 +01:00 committed by Andrés Moya
parent ba87ea1a44
commit c72e9ee1a0
4 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,7 @@
(:require
[app.common.data.macros :as dm]
[app.common.files.tokens :as cfo]
[app.common.json :as json]
[app.common.schema :as sm]
[app.common.types.token :as cto]
[app.common.types.tokens-lib :as ctob]
@ -85,7 +86,7 @@
:get
(fn [_]
(let [token (u/locate-token file-id set-id id)]
(:value token)))
(json/->js (:value token))))
:schema (let [token (u/locate-token file-id set-id id)]
(cfo/make-token-value-schema (:type token)))
:set

View File

@ -118,7 +118,11 @@
class="body-m panel-item token-item"
(click)="applyToken(token.id)"
>
<span title="{{ token.resolvedValueString }}">
<span
title="Value: {{ token.valueString }}&#013;Resolved value: {{
token.resolvedValueString
}}"
>
{{ token.name }}
</span>
<button

View File

@ -24,6 +24,7 @@ type Token = {
id: string;
name: string;
description: string;
valueString: string;
resolvedValueString: string;
};

View File

@ -111,6 +111,7 @@ function loadTokens(setId: string) {
id: token.id,
name: token.name,
description: token.description,
valueString: JSON.stringify(token.value),
resolvedValueString: token.resolvedValueString,
};
}),