mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Convert token values for the plugins
This commit is contained in:
parent
ba87ea1a44
commit
c72e9ee1a0
@ -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
|
||||
|
||||
@ -118,7 +118,11 @@
|
||||
class="body-m panel-item token-item"
|
||||
(click)="applyToken(token.id)"
|
||||
>
|
||||
<span title="{{ token.resolvedValueString }}">
|
||||
<span
|
||||
title="Value: {{ token.valueString }}
Resolved value: {{
|
||||
token.resolvedValueString
|
||||
}}"
|
||||
>
|
||||
{{ token.name }}
|
||||
</span>
|
||||
<button
|
||||
|
||||
@ -24,6 +24,7 @@ type Token = {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
valueString: string;
|
||||
resolvedValueString: string;
|
||||
};
|
||||
|
||||
|
||||
@ -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,
|
||||
};
|
||||
}),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user