From f11c782c0fa0edb4469fe8fb7e98b683ea7f29c2 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 24 Mar 2023 15:09:40 +0100 Subject: [PATCH 1/9] :bug: Fix problem when copy/pasting shapes --- CHANGES.md | 1 + frontend/src/app/main/data/workspace.cljs | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 706c30f83a..be95c060fd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -54,6 +54,7 @@ - Fix problem with guides not showing when moving over nested frames [Taiga #4905](https://tree.taiga.io/project/penpot/issue/4905) - Fix change email and password for users signed in via social login [Taiga #4273](https://tree.taiga.io/project/penpot/issue/4273) - Fix drag and drop files from browser or file explorer under circumstances [Taiga #5054](https://tree.taiga.io/project/penpot/issue/5054) +- Fix problem when copy/pasting shapes [Taiga #4931](https://tree.taiga.io/project/penpot/issue/4931) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 816ed7e7e4..a24dd1c301 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1326,14 +1326,19 @@ res))) (maybe-translate [shape objects selected+children] - (let [root-frame-id (cph/get-shape-id-root-frame objects (:id shape))] - (if (and (not (cph/root-frame? shape)) - (not (contains? selected+children root-frame-id))) - ;; When the parent frame is not selected we change to relative - ;; coordinates + (let [frame-id (:frame-id shape) + root-frame-id (cph/get-shape-id-root-frame objects (:id shape))] + (cond + (cph/root-frame? shape) shape + (contains? selected+children root-frame-id) shape + + (cph/frame-shape? shape) (let [frame (get objects root-frame-id)] (gsh/translate-to-frame shape frame)) - shape))) + + :else + (let [frame (get objects frame-id)] + (gsh/translate-to-frame shape frame))))) (on-copy-error [error] (js/console.error "Clipboard blocked:" error) From 7256759488a342fb50f6c53596de914b2b3d9029 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 24 Mar 2023 15:29:46 +0100 Subject: [PATCH 2/9] :bug: Fix problem with color picker not able to change hue --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/colorpicker.cljs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index be95c060fd..6bfdb56bfb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -55,6 +55,7 @@ - Fix change email and password for users signed in via social login [Taiga #4273](https://tree.taiga.io/project/penpot/issue/4273) - Fix drag and drop files from browser or file explorer under circumstances [Taiga #5054](https://tree.taiga.io/project/penpot/issue/5054) - Fix problem when copy/pasting shapes [Taiga #4931](https://tree.taiga.io/project/penpot/issue/4931) +- Fix problem with color picker not able to change hue [Taiga #5065](https://tree.taiga.io/project/penpot/issue/5065) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index 77d54ab031..b99302e36f 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -67,7 +67,8 @@ (mf/use-fn (mf/deps current-color @drag?) (fn [color] - (when (not= (str/lower (:hex color)) (str/lower (:hex current-color))) + (when (or (not= (str/lower (:hex color)) (str/lower (:hex current-color))) + (not= (:h color) (:h current-color))) (let [recent-color (merge current-color color) recent-color (dc/materialize-color-components recent-color)] (st/emit! (dc/update-colorpicker-color recent-color (not @drag?))))))) From 1d7b43ffbce0ade143127bc989afe0390d1216e5 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 24 Mar 2023 16:24:38 +0100 Subject: [PATCH 3/9] :bug: Fix problem with outer stroke in texts --- CHANGES.md | 1 + common/src/app/common/geom/shapes.cljc | 4 + .../src/app/main/ui/shapes/custom_stroke.cljs | 103 ++++++++++-------- 3 files changed, 62 insertions(+), 46 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6bfdb56bfb..5b74fe0c83 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -56,6 +56,7 @@ - Fix drag and drop files from browser or file explorer under circumstances [Taiga #5054](https://tree.taiga.io/project/penpot/issue/5054) - Fix problem when copy/pasting shapes [Taiga #4931](https://tree.taiga.io/project/penpot/issue/4931) - Fix problem with color picker not able to change hue [Taiga #5065](https://tree.taiga.io/project/penpot/issue/5065) +- Fix problem with outer stroke in texts [Taiga #5078](https://tree.taiga.io/project/penpot/issue/5078) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/common/src/app/common/geom/shapes.cljc b/common/src/app/common/geom/shapes.cljc index 5158ed32ef..fabefe36b1 100644 --- a/common/src/app/common/geom/shapes.cljc +++ b/common/src/app/common/geom/shapes.cljc @@ -17,6 +17,7 @@ [app.common.geom.shapes.modifiers :as gsm] [app.common.geom.shapes.path :as gsp] [app.common.geom.shapes.rect :as gpr] + [app.common.geom.shapes.text :as gst] [app.common.geom.shapes.transforms :as gtr] [app.common.math :as mth])) @@ -195,3 +196,6 @@ ;; Modifiers (dm/export gsm/set-objects-modifiers) + +;; Text +(dm/export gst/position-data-selrect) diff --git a/frontend/src/app/main/ui/shapes/custom_stroke.cljs b/frontend/src/app/main/ui/shapes/custom_stroke.cljs index 2c0be8a8b7..ebc89b5d2e 100644 --- a/frontend/src/app/main/ui/shapes/custom_stroke.cljs +++ b/frontend/src/app/main/ui/shapes/custom_stroke.cljs @@ -38,20 +38,27 @@ [:use {:href (str "#" shape-id)}]])) (mf/defc outer-stroke-mask - [{:keys [shape render-id index]}] + [{:keys [shape stroke render-id index]}] (let [suffix (if index (str "-" index) "") stroke-mask-id (str "outer-stroke-" render-id "-" (:id shape) suffix) shape-id (str "stroke-shape-" render-id "-" (:id shape) suffix) - stroke-width (case (:stroke-alignment shape :center) - :center (/ (:stroke-width shape 0) 2) - :outer (:stroke-width shape 0) + stroke-width (case (:stroke-alignment stroke :center) + :center (/ (:stroke-width stroke 0) 2) + :outer (:stroke-width stroke 0) 0) - margin (gsb/shape-stroke-margin shape stroke-width) - bounding-box (-> (gsh/points->selrect (:points shape)) - (update :x - (+ stroke-width margin)) - (update :y - (+ stroke-width margin)) - (update :width + (* 2 (+ stroke-width margin))) - (update :height + (* 2 (+ stroke-width margin))))] + margin (gsb/shape-stroke-margin stroke stroke-width) + + selrect + (if (cph/text-shape? shape) + (gsh/position-data-selrect shape) + (gsh/points->selrect (:points shape))) + + bounding-box + (-> selrect + (update :x - (+ stroke-width margin)) + (update :y - (+ stroke-width margin)) + (update :width + (* 2 (+ stroke-width margin))) + (update :height + (* 2 (+ stroke-width margin))))] [:mask {:id stroke-mask-id :x (:x bounding-box) @@ -67,17 +74,17 @@ :stroke "none"}}]])) (mf/defc cap-markers - [{:keys [shape render-id index]}] + [{:keys [stroke render-id index]}] (let [marker-id-prefix (str "marker-" render-id) - cap-start (:stroke-cap-start shape) - cap-end (:stroke-cap-end shape) + cap-start (:stroke-cap-start stroke) + cap-end (:stroke-cap-end stroke) - stroke-color (if (:stroke-color-gradient shape) + stroke-color (if (:stroke-color-gradient stroke) (str/format "url(#%s)" (str "stroke-color-gradient_" render-id "_" index)) - (:stroke-color shape)) + (:stroke-color stroke)) - stroke-opacity (when-not (:stroke-color-gradient shape) - (:stroke-opacity shape))] + stroke-opacity (when-not (:stroke-color-gradient stroke) + (:stroke-opacity stroke))] [:* (when (or (= cap-start :line-arrow) (= cap-end :line-arrow)) @@ -169,36 +176,37 @@ [:rect {:x 3 :y 2.5 :width 0.5 :height 1}]])])) (mf/defc stroke-defs - [{:keys [shape render-id index]}] + [{:keys [shape stroke render-id index]}] (let [open-path? (and (= :path (:type shape)) (gsh/open-path? shape))] [:* - (cond (some? (:stroke-color-gradient shape)) - (case (:type (:stroke-color-gradient shape)) + (cond (some? (:stroke-color-gradient stroke)) + (case (:type (:stroke-color-gradient stroke)) :linear [:> grad/linear-gradient #js {:id (str (name :stroke-color-gradient) "_" render-id "_" index) - :gradient (:stroke-color-gradient shape) + :gradient (:stroke-color-gradient stroke) :shape shape}] :radial [:> grad/radial-gradient #js {:id (str (name :stroke-color-gradient) "_" render-id "_" index) - :gradient (:stroke-color-gradient shape) + :gradient (:stroke-color-gradient stroke) :shape shape}])) (cond (and (not open-path?) - (= :inner (:stroke-alignment shape :center)) - (> (:stroke-width shape 0) 0)) + (= :inner (:stroke-alignment stroke :center)) + (> (:stroke-width stroke 0) 0)) [:& inner-stroke-clip-path {:shape shape :render-id render-id :index index}] (and (not open-path?) - (= :outer (:stroke-alignment shape :center)) - (> (:stroke-width shape 0) 0)) + (= :outer (:stroke-alignment stroke :center)) + (> (:stroke-width stroke 0) 0)) [:& outer-stroke-mask {:shape shape + :stroke stroke :render-id render-id :index index}] - (or (some? (:stroke-cap-start shape)) - (some? (:stroke-cap-end shape))) - [:& cap-markers {:shape shape + (or (some? (:stroke-cap-start stroke)) + (some? (:stroke-cap-end stroke))) + [:& cap-markers {:stroke stroke :render-id render-id :index index}])])) @@ -216,8 +224,9 @@ base-props (obj/get child "props") elem-name (obj/get child "type") shape (obj/get props "shape") + stroke (obj/get props "stroke") index (obj/get props "index") - stroke-width (:stroke-width shape) + stroke-width (:stroke-width stroke) suffix (if index (str "-" index) "") stroke-mask-id (str "outer-stroke-" render-id "-" (:id shape) suffix) @@ -225,7 +234,7 @@ [:g.outer-stroke-shape [:defs - [:& stroke-defs {:shape shape :render-id render-id :index index}] + [:& stroke-defs {:shape shape :stroke stroke :render-id render-id :index index}] [:> elem-name (-> (obj/clone base-props) (obj/set! "id" shape-id) (obj/set! @@ -258,10 +267,11 @@ base-props (obj/get child "props") elem-name (obj/get child "type") shape (obj/get props "shape") + stroke (obj/get props "stroke") index (obj/get props "index") transform (obj/get base-props "transform") - stroke-width (:stroke-width shape 0) + stroke-width (:stroke-width stroke 0) suffix (if index (str "-" index) "") clip-id (str "inner-stroke-" render-id "-" (:id shape) suffix) @@ -275,7 +285,7 @@ [:g.inner-stroke-shape {:transform transform} [:defs - [:& stroke-defs {:shape shape :render-id render-id :index index}] + [:& stroke-defs {:shape shape :stroke stroke :render-id render-id :index index}] [:> elem-name shape-props]] [:use {:href (str "#" shape-id) @@ -290,33 +300,34 @@ {::mf/wrap-props false} [props] - (let [child (obj/get props "children") - shape (obj/get props "shape") + (let [child (obj/get props "children") + shape (obj/get props "shape") + stroke (obj/get props "stroke") + render-id (mf/use-ctx muc/render-id) index (obj/get props "index") - stroke-width (:stroke-width shape 0) - stroke-style (:stroke-style shape :none) - stroke-position (:stroke-alignment shape :center) + stroke-width (:stroke-width stroke 0) + stroke-style (:stroke-style stroke :none) + stroke-position (:stroke-alignment stroke :center) has-stroke? (and (> stroke-width 0) (not= stroke-style :none)) - closed? (or (not= :path (:type shape)) - (not (gsh/open-path? shape))) + closed? (or (not= :path (:type shape)) (not (gsh/open-path? shape))) inner? (= :inner stroke-position) outer? (= :outer stroke-position)] (cond (and has-stroke? inner? closed?) - [:& inner-stroke {:shape shape :index index} + [:& inner-stroke {:shape shape :stroke stroke :index index} child] (and has-stroke? outer? closed?) - [:& outer-stroke {:shape shape :index index} + [:& outer-stroke {:shape shape :stroke stroke :index index} child] :else [:g.stroke-shape [:defs - [:& stroke-defs {:shape shape :render-id render-id :index index}]] + [:& stroke-defs {:shape shape :stroke stroke :render-id render-id :index index}]] child]))) (defn build-fill-props [shape child position render-id] @@ -426,6 +437,7 @@ [props] (let [child (obj/get props "children") shape (obj/get props "shape") + elem-name (obj/get child "type") render-id (or (obj/get props "render-id") (mf/use-ctx muc/render-id)) stroke-id (dm/fmt "strokes-%" (:id shape)) @@ -445,9 +457,8 @@ (d/not-empty? (:strokes shape)) [:> :g stroke-props (for [[index value] (-> (d/enumerate (:strokes shape)) reverse)] - (let [props (build-stroke-props index child value render-id) - shape (assoc value :points (:points shape))] - [:& shape-custom-stroke {:shape shape :index index :key (dm/str index "-" stroke-id)} + (let [props (build-stroke-props index child value render-id)] + [:& shape-custom-stroke {:shape shape :stroke value :index index :key (dm/str index "-" stroke-id)} [:> elem-name props]]))])])) (mf/defc shape-custom-strokes From 391ba77da96c019e6be1eba54461a25e3aeefbbd Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 27 Mar 2023 10:58:25 +0200 Subject: [PATCH 4/9] :bug: Fix scaling of texts --- common/src/app/common/types/modifiers.cljc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/common/src/app/common/types/modifiers.cljc b/common/src/app/common/types/modifiers.cljc index 6c3b3acde4..7ce687cadf 100644 --- a/common/src/app/common/types/modifiers.cljc +++ b/common/src/app/common/types/modifiers.cljc @@ -645,12 +645,16 @@ (recur matrix (next modifiers))))))) (defn transform-text-node [value attrs] - (let [font-size (-> (get attrs :font-size 14) - (d/parse-double) - (* value) - (str))] + (let [font-size (-> (get attrs :font-size 14) d/parse-double (* value) str) + letter-spacing (-> (get attrs :letter-spacing 0) d/parse-double (* value) str)] + (d/txt-merge attrs {:font-size font-size + :letter-spacing letter-spacing}))) + +(defn transform-paragraph-node [value attrs] + (let [font-size (-> (get attrs :font-size 14) d/parse-double (* value) str)] (d/txt-merge attrs {:font-size font-size}))) + (defn update-text-content [shape scale-text-content value] (update shape :content scale-text-content value)) @@ -661,9 +665,8 @@ (letfn [(scale-text-content [content value] (->> content - (txt/transform-nodes - txt/is-text-node? - (partial transform-text-node value)))) + (txt/transform-nodes txt/is-text-node? (partial transform-text-node value)) + (txt/transform-nodes txt/is-paragraph-node? (partial transform-paragraph-node value)))) (apply-scale-content [shape value] From f7bba745ab9aeef02d87338ff6937118d56c4f9a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 27 Mar 2023 12:09:33 +0200 Subject: [PATCH 5/9] :bug: Changes to the header menu --- .../src/app/main/ui/workspace/header.cljs | 22 ++++++++++++++----- frontend/translations/en.po | 12 ++++++++++ frontend/translations/es.po | 12 ++++++++++ 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/header.cljs b/frontend/src/app/main/ui/workspace/header.cljs index 8c5418ff46..1ccd70f2a5 100644 --- a/frontend/src/app/main/ui/workspace/header.cljs +++ b/frontend/src/app/main/ui/workspace/header.cljs @@ -15,6 +15,7 @@ [app.main.data.modal :as modal] [app.main.data.workspace :as dw] [app.main.data.workspace.colors :as dc] + [app.main.data.workspace.common :as dwc] [app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.shortcuts :as sc] [app.main.refs :as refs] @@ -306,12 +307,14 @@ [:li {:on-click #(st/emit! (dw/select-all))} [:span (tr "workspace.header.menu.select-all")] [:span.shortcut (sc/get-tooltip :select-all)]] - [:li {:on-click #(st/emit! (toggle-flag :scale-text))} - [:span - (if (contains? layout :scale-text) - (tr "workspace.header.menu.disable-scale-text") - (tr "workspace.header.menu.enable-scale-text"))] - [:span.shortcut (sc/get-tooltip :toggle-scale-text)]]]] + + [:li {:on-click #(st/emit! dwc/undo)} + [:span (tr "workspace.header.menu.undo")] + [:span.shortcut (sc/get-tooltip :undo)]] + + [:li {:on-click #(st/emit! dwc/redo)} + [:span (tr "workspace.header.menu.redo")] + [:span.shortcut (sc/get-tooltip :redo)]]]] [:& dropdown {:show (= @show-sub-menu? :view) :on-close #(reset! show-sub-menu? false)} @@ -374,6 +377,13 @@ [:& dropdown {:show (= @show-sub-menu? :preferences) :on-close #(reset! show-sub-menu? false)} [:ul.sub-menu.preferences + [:li {:on-click #(st/emit! (toggle-flag :scale-text))} + [:span + (if (contains? layout :scale-text) + (tr "workspace.header.menu.disable-scale-content") + (tr "workspace.header.menu.enable-scale-content"))] + [:span.shortcut (sc/get-tooltip :toggle-scale-text)]] + [:li {:on-click #(st/emit! (toggle-flag :snap-guides))} [:span (if (contains? layout :snap-guides) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 75e81ef1ee..41756fd419 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -3049,6 +3049,18 @@ msgstr "Show rulers" msgid "workspace.header.menu.show-textpalette" msgstr "Show fonts palette" +msgid "workspace.header.menu.enable-scale-content" +msgstr "Enable proportional scale" + +msgid "workspace.header.menu.disable-scale-content" +msgstr "Disable proportional scale" + +msgid "workspace.header.menu.undo" +msgstr "Undo" + +msgid "workspace.header.menu.redo" +msgstr "Redo" + #: src/app/main/ui/workspace/header.cljs msgid "workspace.header.reset-zoom" msgstr "Reset" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 19b30a5751..e644c7d21e 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -3212,6 +3212,18 @@ msgstr "Mostrar reglas" msgid "workspace.header.menu.show-textpalette" msgstr "Mostrar paleta de textos" +msgid "workspace.header.menu.enable-scale-content" +msgstr "Activar escala proporcional" + +msgid "workspace.header.menu.disable-scale-content" +msgstr "Desactivar escala proporcional" + +msgid "workspace.header.menu.undo" +msgstr "Deshacer" + +msgid "workspace.header.menu.redo" +msgstr "Rehacer" + #: src/app/main/ui/workspace/header.cljs msgid "workspace.header.reset-zoom" msgstr "Restablecer" From 1f9e7f2ae8ee352f2e9ad27db1dbaa11ee8fb7a3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 27 Mar 2023 13:16:28 +0200 Subject: [PATCH 6/9] :bug: Fix markdown message --- frontend/src/app/main/ui/dashboard/team.cljs | 3 ++- frontend/translations/ar.po | 1 + frontend/translations/ca.po | 1 + frontend/translations/cs.po | 1 + frontend/translations/de.po | 1 + frontend/translations/en.po | 1 + frontend/translations/es.po | 1 + frontend/translations/eu.po | 1 + frontend/translations/fa.po | 1 + frontend/translations/fr.po | 1 + frontend/translations/he.po | 1 + frontend/translations/hr.po | 1 + frontend/translations/id.po | 1 + frontend/translations/it.po | 1 + frontend/translations/pl.po | 1 + frontend/translations/pt_BR.po | 1 + frontend/translations/pt_PT.po | 1 + frontend/translations/ro.po | 1 + frontend/translations/ru.po | 1 + frontend/translations/tr.po | 1 + frontend/translations/zh_CN.po | 1 + 21 files changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/dashboard/team.cljs b/frontend/src/app/main/ui/dashboard/team.cljs index 3d6250d3b0..adbc6b0f83 100644 --- a/frontend/src/app/main/ui/dashboard/team.cljs +++ b/frontend/src/app/main/ui/dashboard/team.cljs @@ -586,7 +586,8 @@ [:div.empty-invitations [:span (tr "labels.no-invitations")] (when can-invite? - [:span (tr "labels.no-invitations-hint")])]) + [:& i18n/tr-html {:label "labels.no-invitations-hint" + :tag-name "span"}])]) (mf/defc invitation-section [{:keys [team invitations] :as props}] diff --git a/frontend/translations/ar.po b/frontend/translations/ar.po index 73806e3a40..159d4533ae 100644 --- a/frontend/translations/ar.po +++ b/frontend/translations/ar.po @@ -1304,6 +1304,7 @@ msgid "labels.no-invitations" msgstr "لا توجد دعوات." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "اضغط على الزر \"دعوة إلى الفريق\" لدعوة المزيد من الأعضاء إلى هذا الفريق." diff --git a/frontend/translations/ca.po b/frontend/translations/ca.po index 6ddf990fed..48f11b611b 100644 --- a/frontend/translations/ca.po +++ b/frontend/translations/ca.po @@ -1298,6 +1298,7 @@ msgid "labels.no-invitations" msgstr "No hi ha invitacions." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Feu clic al botó «Convida a l'equip» per convidar més membres a aquest " diff --git a/frontend/translations/cs.po b/frontend/translations/cs.po index 304937d01e..06cb4df2c7 100644 --- a/frontend/translations/cs.po +++ b/frontend/translations/cs.po @@ -1197,6 +1197,7 @@ msgid "labels.no-invitations" msgstr "Nejsou žádné pozvánky." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Chcete-li do tohoto týmu pozvat další členy, stiskněte tlačítko „Pozvat do " diff --git a/frontend/translations/de.po b/frontend/translations/de.po index 925ea6fe00..8d1288458b 100644 --- a/frontend/translations/de.po +++ b/frontend/translations/de.po @@ -1337,6 +1337,7 @@ msgid "labels.no-invitations" msgstr "Es gibt keine Einladungen." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Drücken Sie die Schaltfläche \"Zum Team einladen\", um weitere Mitglieder " diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 41756fd419..6ba10ca4f0 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -1379,6 +1379,7 @@ msgid "labels.no-invitations" msgstr "No pending invitations." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "Click the **Invite people** button to invite people to this team." diff --git a/frontend/translations/es.po b/frontend/translations/es.po index e644c7d21e..36b754898d 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -1450,6 +1450,7 @@ msgid "labels.no-invitations" msgstr "No hay invitaciones." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "Pulsa el botón 'Invitar al equipo' para añadir más integrantes al equipo." diff --git a/frontend/translations/eu.po b/frontend/translations/eu.po index f5fab6f0ee..14619ece52 100644 --- a/frontend/translations/eu.po +++ b/frontend/translations/eu.po @@ -1294,6 +1294,7 @@ msgid "labels.no-invitations" msgstr "Ez dago gonbidapenik." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "Sakatu 'Taldera gonbdiatu' taldekide gehiago izateko." diff --git a/frontend/translations/fa.po b/frontend/translations/fa.po index 6d5bff5b9f..0998135233 100644 --- a/frontend/translations/fa.po +++ b/frontend/translations/fa.po @@ -1289,6 +1289,7 @@ msgid "labels.no-invitations" msgstr "هیچ دعوتنامه‌ای وجود ندارد." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "دکمه \"دعوت به تیم\" را فشار دهید تا اعضای بیشتری را به این تیم دعوت کنید." diff --git a/frontend/translations/fr.po b/frontend/translations/fr.po index 49a66359e8..8293f224b9 100644 --- a/frontend/translations/fr.po +++ b/frontend/translations/fr.po @@ -1339,6 +1339,7 @@ msgid "labels.no-invitations" msgstr "Il n'y a pas d'invitations." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Appuyez sur le bouton \"Inviter à l'équipe\" pour inviter d'autres membres " diff --git a/frontend/translations/he.po b/frontend/translations/he.po index d3b2bc8e25..6e1122b181 100644 --- a/frontend/translations/he.po +++ b/frontend/translations/he.po @@ -1301,6 +1301,7 @@ msgid "labels.no-invitations" msgstr "אין הזמנות." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "לחיצה על הכפתור „הזמנה לצוות” תאפשר להזמין חברים נוספים לצוות הזה." diff --git a/frontend/translations/hr.po b/frontend/translations/hr.po index 64f30bcc15..05a2b3b167 100644 --- a/frontend/translations/hr.po +++ b/frontend/translations/hr.po @@ -1289,6 +1289,7 @@ msgid "labels.no-invitations" msgstr "Nema pozivnica." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "Pritisni gumb \"Pozovi u tim\" da pozoveš više članova u ovaj tim." diff --git a/frontend/translations/id.po b/frontend/translations/id.po index 4fe22e7987..3abd0c93c8 100644 --- a/frontend/translations/id.po +++ b/frontend/translations/id.po @@ -1195,6 +1195,7 @@ msgid "labels.no-invitations" msgstr "Tidak ada undangan." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Tekan tombol \"Undang ke tim\" untuk mengundang lebih banyak anggota ke tim " diff --git a/frontend/translations/it.po b/frontend/translations/it.po index 586ad43540..74568c6568 100644 --- a/frontend/translations/it.po +++ b/frontend/translations/it.po @@ -1294,6 +1294,7 @@ msgid "labels.no-invitations" msgstr "Non ci sono inviti." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Premi il pulsante \"Invita nel team\" per invitare altri membri in questo " diff --git a/frontend/translations/pl.po b/frontend/translations/pl.po index 0af0a74c54..22f5cb6a67 100644 --- a/frontend/translations/pl.po +++ b/frontend/translations/pl.po @@ -1280,6 +1280,7 @@ msgid "labels.no-invitations" msgstr "Brak zaproszeń." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Naciśnij przycisk „Zaproś do zespołu”, aby zaprosić więcej członków do tego " diff --git a/frontend/translations/pt_BR.po b/frontend/translations/pt_BR.po index b52393be3e..69eb0dd08c 100644 --- a/frontend/translations/pt_BR.po +++ b/frontend/translations/pt_BR.po @@ -1295,6 +1295,7 @@ msgid "labels.no-invitations" msgstr "Não há convites." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Pressione o botão \"Convidar para equipe\" para convidar mais membros para " diff --git a/frontend/translations/pt_PT.po b/frontend/translations/pt_PT.po index 0075cd9078..7664dc9364 100644 --- a/frontend/translations/pt_PT.po +++ b/frontend/translations/pt_PT.po @@ -1298,6 +1298,7 @@ msgid "labels.no-invitations" msgstr "Não há convites." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Clica no botão \"Convidar para a equipa\" para convidar mais membros para " diff --git a/frontend/translations/ro.po b/frontend/translations/ro.po index c9beab607f..f988d98d41 100644 --- a/frontend/translations/ro.po +++ b/frontend/translations/ro.po @@ -1291,6 +1291,7 @@ msgid "labels.no-invitations" msgstr "Nu există invitații." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Apăsați butonul „Invitați în echipă” pentru a invita mai mulți membri în " diff --git a/frontend/translations/ru.po b/frontend/translations/ru.po index 77a2cef084..8f1d36d01a 100644 --- a/frontend/translations/ru.po +++ b/frontend/translations/ru.po @@ -1278,6 +1278,7 @@ msgid "labels.no-invitations" msgstr "Приглашений нет." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Нажмите кнопку «Пригласить в команду», чтобы пригласить в эту команду " diff --git a/frontend/translations/tr.po b/frontend/translations/tr.po index 12ca5b133d..8edfa5b086 100644 --- a/frontend/translations/tr.po +++ b/frontend/translations/tr.po @@ -1324,6 +1324,7 @@ msgid "labels.no-invitations" msgstr "Davet yok." #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "" "Bu takıma daha fazla üye davet etmek için \"Takıma davet et\" düğmesine " diff --git a/frontend/translations/zh_CN.po b/frontend/translations/zh_CN.po index aeab841232..7165e9b2a4 100644 --- a/frontend/translations/zh_CN.po +++ b/frontend/translations/zh_CN.po @@ -1252,6 +1252,7 @@ msgid "labels.no-invitations" msgstr "没有邀请。" #: src/app/main/ui/dashboard/team.cljs +#, markdown msgid "labels.no-invitations-hint" msgstr "点击\"邀请加入团队\",邀请更多成员加入这个团队。" From 4313c45870d842b6f65a6258ef08098c60b687f5 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 27 Mar 2023 13:17:30 +0200 Subject: [PATCH 7/9] :bug: Fix sending invitation to existing members --- backend/src/app/rpc/commands/teams.clj | 8 +++++++- frontend/src/app/main/ui/dashboard/team.cljs | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/src/app/rpc/commands/teams.clj b/backend/src/app/rpc/commands/teams.clj index 2d6f6e22e0..483f94266c 100644 --- a/backend/src/app/rpc/commands/teams.clj +++ b/backend/src/app/rpc/commands/teams.clj @@ -729,8 +729,13 @@ (let [perms (get-permissions conn profile-id team-id) profile (db/get-by-id conn :profile profile-id) team (db/get-by-id conn :team team-id) - emails (cond-> (or emails #{}) (string? email) (conj email))] + ;; Members emails. We don't re-send inviation to already existing members + member? (into #{} + (map :email) + (db/exec! conn [sql:team-members team-id])) + + emails (cond-> (or emails #{}) (string? email) (conj email))] (run! (partial quotes/check-quote! conn) (list {::quotes/id ::quotes/invitations-per-team @@ -754,6 +759,7 @@ (let [cfg (assoc cfg ::db/conn conn) invitations (->> emails + (remove member?) (map (fn [email] {:email (str/lower email) :team team diff --git a/frontend/src/app/main/ui/dashboard/team.cljs b/frontend/src/app/main/ui/dashboard/team.cljs index adbc6b0f83..1df6d70eee 100644 --- a/frontend/src/app/main/ui/dashboard/team.cljs +++ b/frontend/src/app/main/ui/dashboard/team.cljs @@ -177,7 +177,9 @@ :on-submit on-submit}]] [:div.action-buttons - [:& fm/submit-button {:label (tr "modals.invite-member-confirm.accept")}]]]])) + [:& fm/submit-button {:label (tr "modals.invite-member-confirm.accept") + :disabled (and (boolean (some current-data-emails current-members-emails)) + (empty? (remove current-members-emails current-data-emails)))}]]]])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; MEMBERS SECTION From 5079582e1fa3ee9b2a88ad870a861f66bf3d9a23 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 27 Mar 2023 13:26:24 +0200 Subject: [PATCH 8/9] :bug: Fix problem with round corners scaling --- common/src/app/common/types/modifiers.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/app/common/types/modifiers.cljc b/common/src/app/common/types/modifiers.cljc index 7ce687cadf..fb336ae3bb 100644 --- a/common/src/app/common/types/modifiers.cljc +++ b/common/src/app/common/types/modifiers.cljc @@ -674,7 +674,7 @@ (cph/text-shape? shape) (update-text-content scale-text-content value) - (cph/rect-shape? shape) + :always (gsc/update-corners-scale value) (d/not-empty? (:strokes shape)) From 6832b4a304ab7c697c07e670f6771d6e5754e977 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 27 Mar 2023 17:06:45 +0200 Subject: [PATCH 9/9] :bug: Fix problem with text carring over next line when changing to fixed --- CHANGES.md | 1 + frontend/src/app/main/data/workspace/texts.cljs | 2 +- .../app/main/ui/workspace/shapes/text/viewport_texts_html.cljs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5b74fe0c83..022c4eb8e3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -57,6 +57,7 @@ - Fix problem when copy/pasting shapes [Taiga #4931](https://tree.taiga.io/project/penpot/issue/4931) - Fix problem with color picker not able to change hue [Taiga #5065](https://tree.taiga.io/project/penpot/issue/5065) - Fix problem with outer stroke in texts [Taiga #5078](https://tree.taiga.io/project/penpot/issue/5078) +- Fix problem with text carring over next line when changing to fixed [Taiga #5067](https://tree.taiga.io/project/penpot/issue/5067) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 53343202a9..4475f95a00 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -377,7 +377,7 @@ (assoc-in [:workspace-local :edition] (-> selected first :id))))))) (defn not-changed? [old-dim new-dim] - (> (mth/abs (- old-dim new-dim)) 1)) + (> (mth/abs (- old-dim new-dim)) 0.1)) (defn commit-resize-text [] diff --git a/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs b/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs index 14ef7aaceb..a6633ccd74 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs @@ -66,7 +66,8 @@ (when (contains? #{:auto-height :auto-width} grow-type) (let [{:keys [width height]} (-> (dom/query node ".paragraph-set") - (dom/get-client-size)) + (dom/get-bounding-rect)) + width (mth/ceil width) height (mth/ceil height)] (when (and (not (mth/almost-zero? width))