diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index e85efe6115..3f8d655a5b 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -11,6 +11,7 @@ [app.common.files.helpers :as cfh] [app.common.geom.rect :as grc] [app.common.geom.shapes :as gsh] + [app.common.json :as json] [app.common.path-names :as cpn] [app.common.record :as crc] [app.common.schema :as sm] @@ -1295,7 +1296,7 @@ (get :applied-tokens))] (reduce (fn [acc [prop name]] - (obj/set! acc (d/name prop) name)) + (obj/set! acc (json/write-camel-key prop) name)) #js {} tokens)))} diff --git a/frontend/src/app/plugins/tokens.cljs b/frontend/src/app/plugins/tokens.cljs index 2c45878ca3..f46722884a 100644 --- a/frontend/src/app/plugins/tokens.cljs +++ b/frontend/src/app/plugins/tokens.cljs @@ -16,7 +16,7 @@ [app.main.data.workspace.tokens.application :as dwta] [app.main.data.workspace.tokens.library-edit :as dwtl] [app.main.store :as st] - ;; [app.plugins.shape :as shape] + ;; [app.plugins.shape :as shape] [app.plugins.utils :as u] [app.util.object :as obj] [beicon.v2.core :as rx] @@ -118,12 +118,12 @@ ;; should be fixed to keep the original proxy objects coming from the plugin. ;; [:vector [:fn shape/shape-proxy?]] [:vector [:map [:id ::sm/uuid]]] - [:maybe [:set ::sm/keyword]]] + [:maybe [:set [:set [:and ::sm/keyword [:fn cto/token-attr?]]]]]] :fn (fn [shapes attrs] (apply-token-to-shapes file-id set-id id (map :id shapes) attrs))} :applyToSelected - {:schema [:tuple [:maybe [:set ::sm/keyword]]] + {:schema [:tuple [:maybe [:set [:and ::sm/keyword [:fn cto/token-attr?]]]]] :fn (fn [attrs] (let [selected (get-in @st/state [:workspace-local :selected])] (apply-token-to-shapes file-id set-id id selected attrs)))})) diff --git a/plugins/libs/plugin-types/index.d.ts b/plugins/libs/plugin-types/index.d.ts index 4b2fbe1c96..d302adabf6 100644 --- a/plugins/libs/plugin-types/index.d.ts +++ b/plugins/libs/plugin-types/index.d.ts @@ -3744,7 +3744,7 @@ export interface ShapeBase extends PluginData { * and the value set to the attributes will depend on which sets are active * (and will change if different sets or themes are activated later). */ - readonly tokens: { [property: string]: string }; + readonly tokens: { [property in TokenProperty]: string }; /** * @return Returns true if the current shape is inside a component instance @@ -5221,7 +5221,7 @@ type TokenDimensionProps = | 'y' // Stroke width - | 'stroke-width'; + | 'strokeWidth'; /** * The properties that a FontFamilies token can be applied to.