diff --git a/CHANGES.md b/CHANGES.md index 207dfb7183..2189481aad 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -61,6 +61,7 @@ - Keep color data when copying from info tab into CSS [Taiga #11144](https://tree.taiga.io/project/penpot/issue/11144) - Update HSL values to modern syntax as defined in W3C CSS Color Module Level 4 [Taiga #11144](https://tree.taiga.io/project/penpot/issue/11144) - Fix main component receives focus and is selected when using 'Show Main Component' [Taiga #11402](https://tree.taiga.io/project/penpot/issue/11402) +- Fix UI theme selection from main menu [Taiga #11567](https://tree.taiga.io/project/penpot/issue/11567) - Fix duplicating pages with mainInstance shapes nested inside groups [Taiga #10774](https://tree.taiga.io/project/penpot/issue/10774) - Fix ESC key not closing Add/Manage Libraries modal [Taiga #11523](https://tree.taiga.io/project/penpot/issue/11523) - Fix copying a shadow color from info tab [Taiga #11211](https://tree.taiga.io/project/penpot/issue/11211) @@ -73,15 +74,16 @@ - Fix the context menu always closes after any action [Taiga #11624](https://tree.taiga.io/project/penpot/issue/11624) - Fix X & Y position do not sincronize with tokens [Taiga #11617](https://tree.taiga.io/project/penpot/issue/11617) - Fix tooltip position after first time [Taiga #11688](https://tree.taiga.io/project/penpot/issue/11688) +- Fix export button width on inspect tab [Taiga #11394](https://tree.taiga.io/project/penpot/issue/11394) +- Fix stroke width token application [Taiga #11724](https://tree.taiga.io/project/penpot/issue/11724) -## 2.8.1 (Unreleased) +## 2.8.1 ### :bug: Bugs fixed - Fix unexpected exception on processing old texts [Github #6889](https://github.com/penpot/penpot/pull/6889) -- Fix UI theme selection from main menu [Taiga #11567](https://tree.taiga.io/project/penpot/issue/11567) -- Add missing migration information to file snapshots [Github #686](https://github.com/penpot/penpot/pull/6864) - Fix error on inspect tab when selecting multiple shapes [Taiga #11655](https://tree.taiga.io/project/penpot/issue/11655) +- Fix missing package for the penport_exporter Docker image [GitHub #7205](https://github.com/penpot/penpot/issues/7025) ## 2.8.0 diff --git a/common/src/app/common/types/stroke.cljc b/common/src/app/common/types/stroke.cljc new file mode 100644 index 0000000000..ef52ccefd8 --- /dev/null +++ b/common/src/app/common/types/stroke.cljc @@ -0,0 +1,20 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns app.common.types.stroke + (:require + [app.common.colors :as clr])) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; SCHEMAS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(def default-stroke + {:stroke-alignment :inner + :stroke-style :solid + :stroke-color clr/black + :stroke-opacity 1 + :stroke-width 1}) \ No newline at end of file diff --git a/frontend/src/app/main/data/workspace/tokens/application.cljs b/frontend/src/app/main/data/workspace/tokens/application.cljs index 747596ae7f..f6277f24ff 100644 --- a/frontend/src/app/main/data/workspace/tokens/application.cljs +++ b/frontend/src/app/main/data/workspace/tokens/application.cljs @@ -10,6 +10,7 @@ [app.common.files.tokens :as cft] [app.common.types.shape.layout :as ctsl] [app.common.types.shape.radius :as ctsr] + [app.common.types.stroke :as cts] [app.common.types.text :as txt] [app.common.types.token :as ctt] [app.common.types.tokens-lib :as ctob] @@ -93,8 +94,10 @@ (when (number? value) (dwsh/update-shapes shape-ids (fn [shape] - (when (seq (:strokes shape)) - (assoc-in shape [:strokes 0 :stroke-width] value))) + (if (seq (:strokes shape)) + (assoc-in shape [:strokes 0 :stroke-width] value) + (let [stroke (assoc cts/default-stroke :stroke-width value)] + (assoc shape :strokes [stroke])))) {:reg-objects? true :ignore-touched true :page-id page-id diff --git a/frontend/src/app/main/ui/inspect/exports.scss b/frontend/src/app/main/ui/inspect/exports.scss index a5137d5c07..1b3b7aa4f6 100644 --- a/frontend/src/app/main/ui/inspect/exports.scss +++ b/frontend/src/app/main/ui/inspect/exports.scss @@ -101,5 +101,5 @@ @extend .button-secondary; @include uppercaseTitleTipography; height: $s-32; - width: $s-252; + width: 100%; } diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs index c1ba291098..456189b621 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs @@ -9,7 +9,7 @@ (:require [app.common.data :as d] [app.common.data.macros :as dm] - [app.common.types.color :as clr] + [app.common.types.stroke :as cts] [app.main.data.workspace :as udw] [app.main.data.workspace.colors :as dc] [app.main.store :as st] @@ -157,11 +157,7 @@ on-add-stroke (fn [_] (st/emit! (udw/trigger-bounding-box-cloaking ids)) - (st/emit! (dc/add-stroke ids {:stroke-alignment :inner - :stroke-style :solid - :stroke-color clr/black - :stroke-opacity 1 - :stroke-width 1})) + (st/emit! (dc/add-stroke ids cts/default-stroke)) (when (not (some? (seq strokes))) (open-content))) disable-drag (mf/use-state false) diff --git a/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs b/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs index e66ff0b54f..3181d95cb5 100644 --- a/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs +++ b/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs @@ -452,9 +452,9 @@ (t/testing "token got applied to rect with stroke and shape stroke got updated" (t/is (= (:stroke-width (:applied-tokens rect-with-stroke')) (:name token-target'))) (t/is (= (get-in rect-with-stroke' [:strokes 0 :stroke-width]) 10))) - (t/testing "token got applied to rect without stroke but shape didnt get updated" + (t/testing "token got applied to rect without stroke and shape stroke got updated" (t/is (= (:stroke-width (:applied-tokens rect-without-stroke')) (:name token-target'))) - (t/is (empty? (:strokes rect-without-stroke'))))))))))) + (t/is (= (get-in rect-without-stroke' [:strokes 0 :stroke-width]) 10)))))))))) (t/deftest test-apply-font-size (t/testing "applies font-size token and updates the text font-size"