From 3f413e49206c2267d2a20d0843e4e58a85d5eee4 Mon Sep 17 00:00:00 2001 From: Eva Date: Fri, 13 May 2022 12:44:11 +0200 Subject: [PATCH] :bug: Show strokes and fills in text when in handoff --- .../resources/styles/main/partials/handoff.scss | 2 +- .../src/app/main/ui/viewer/handoff/attributes.cljs | 2 +- .../main/ui/viewer/handoff/attributes/fill.cljs | 4 ++-- .../main/ui/viewer/handoff/attributes/stroke.cljs | 4 ++-- .../main/ui/viewer/handoff/attributes/text.cljs | 14 ++++++++------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/frontend/resources/styles/main/partials/handoff.scss b/frontend/resources/styles/main/partials/handoff.scss index 6a2b949d1..adcb45082 100644 --- a/frontend/resources/styles/main/partials/handoff.scss +++ b/frontend/resources/styles/main/partials/handoff.scss @@ -144,7 +144,7 @@ .color-bullet { width: 24px; height: 24px; - border-radius: $br-small; + border-radius: 50%; border: 1px solid $color-gray-60; } diff --git a/frontend/src/app/main/ui/viewer/handoff/attributes.cljs b/frontend/src/app/main/ui/viewer/handoff/attributes.cljs index ae9e5fe93..69ac8723f 100644 --- a/frontend/src/app/main/ui/viewer/handoff/attributes.cljs +++ b/frontend/src/app/main/ui/viewer/handoff/attributes.cljs @@ -27,7 +27,7 @@ :circle [:layout :fill :stroke :shadow :blur :svg] :path [:layout :fill :stroke :shadow :blur :svg] :image [:image :layout :fill :stroke :shadow :blur :svg] - :text [:layout :text :shadow :blur]}) + :text [:layout :text :shadow :blur :stroke]}) (mf/defc attributes [{:keys [page-id file-id shapes frame]}] diff --git a/frontend/src/app/main/ui/viewer/handoff/attributes/fill.cljs b/frontend/src/app/main/ui/viewer/handoff/attributes/fill.cljs index f24df7b6e..878014efa 100644 --- a/frontend/src/app/main/ui/viewer/handoff/attributes/fill.cljs +++ b/frontend/src/app/main/ui/viewer/handoff/attributes/fill.cljs @@ -58,7 +58,7 @@ (for [shape shapes] (if (seq (:fills shape)) (for [value (:fills shape [])] - [:& fill-block {:key (str "fill-block-" (:id shape)) + [:& fill-block {:key (str "fill-block-" (:id shape) value) :shape value}]) - [:& fill-block {:key (str "fill-block-" (:id shape)) + [:& fill-block {:key (str "fill-block-only" (:id shape)) :shape shape}]))]))) diff --git a/frontend/src/app/main/ui/viewer/handoff/attributes/stroke.cljs b/frontend/src/app/main/ui/viewer/handoff/attributes/stroke.cljs index a5fea5283..bb4158060 100644 --- a/frontend/src/app/main/ui/viewer/handoff/attributes/stroke.cljs +++ b/frontend/src/app/main/ui/viewer/handoff/attributes/stroke.cljs @@ -84,7 +84,7 @@ (for [shape shapes] (if (seq (:strokes shape)) (for [value (:strokes shape [])] - [:& stroke-block {:key (str "stroke-color-" (:id shape)) + [:& stroke-block {:key (str "stroke-color-" (:id shape) value) :shape value}]) - [:& stroke-block {:key (str "stroke-color-" (:id shape)) + [:& stroke-block {:key (str "stroke-color-only" (:id shape)) :shape shape}]))]))) diff --git a/frontend/src/app/main/ui/viewer/handoff/attributes/text.cljs b/frontend/src/app/main/ui/viewer/handoff/attributes/text.cljs index 2cfdda7bd..9fd0cda4c 100644 --- a/frontend/src/app/main/ui/viewer/handoff/attributes/text.cljs +++ b/frontend/src/app/main/ui/viewer/handoff/attributes/text.cljs @@ -101,12 +101,13 @@ [:div.attributes-content-row [:pre.attributes-content (str/trim text)] [:& copy-button {:data (str/trim text)}]] + (when (:fills style) + (for [fill (:fills style)] - (when (or (:fill-color style) (:fill-color-gradient style)) - [:& color-row {:format @color-format - :color (shape->color style) - :copy-data (copy-style-data style :fill-color :fill-color-gradient) - :on-change-format #(reset! color-format %)}]) + [:& color-row {:format @color-format + :color (shape->color fill) + :copy-data (copy-style-data fill :fill-color :fill-color-gradient) + :on-change-format #(reset! color-format %)}])) (when (:font-id style) [:div.attributes-unit-row @@ -186,4 +187,5 @@ [:div.attributes-block-title-text (tr "handoff.attributes.typography")]] (for [shape shapes] - [:& text-block {:shape shape}])])) + [:& text-block {:shape shape + :key (str "text-block" (:id shape))}])]))