From 2d52c4f4f5f845a72f2565983f6c913c07bff107 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 24 Mar 2022 12:19:06 +0100 Subject: [PATCH 1/7] :bug: Fix export translation --- frontend/translations/en.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 0282446f1..ab4f85169 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -275,7 +275,7 @@ msgstr "%s de %s elements selected" #: src/app/main/ui/workspace/header.cljs msgid "dashboard.export-shapes" -msgstr "Exportar" +msgstr "Export" #: src/app/main/ui/export.cljs msgid "dashboard.export-shapes.how-to" @@ -3658,4 +3658,4 @@ msgid "workspace.updates.update" msgstr "Update" msgid "workspace.viewport.click-to-close-path" -msgstr "Click to close the path" \ No newline at end of file +msgstr "Click to close the path" From effb76c8db731dea4760d393de4256fe91b1b0ae Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 24 Mar 2022 12:38:31 +0100 Subject: [PATCH 2/7] :bug: Fix export multiple styles --- frontend/resources/styles/main/partials/modal.scss | 3 ++- frontend/src/app/main/ui/export.cljs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/resources/styles/main/partials/modal.scss b/frontend/resources/styles/main/partials/modal.scss index 5510537fd..242b5c846 100644 --- a/frontend/resources/styles/main/partials/modal.scss +++ b/frontend/resources/styles/main/partials/modal.scss @@ -1420,7 +1420,7 @@ .body { overflow-y: auto; - margin: 0.5rem 0.5rem 0.5rem 0; + margin: 0 0.5rem 0rem 0; } .field { @@ -1438,6 +1438,7 @@ display: flex; justify-content: center; height: 32px; + margin: 0 8px; width: 32px; svg { diff --git a/frontend/src/app/main/ui/export.cljs b/frontend/src/app/main/ui/export.cljs index 5a2b2d471..b96b8eab9 100644 --- a/frontend/src/app/main/ui/export.cljs +++ b/frontend/src/app/main/ui/export.cljs @@ -74,8 +74,8 @@ [:div.header [:div.field.check {:on-click change-all} (cond - all-checked? [:span i/checkbox-checked] - all-unchecked? [:span i/checkbox-unchecked] + all-checked? [:span.checked i/checkbox-checked] + all-unchecked? [:span.unchecked i/checkbox-unchecked] :else [:span i/checkbox-intermediate])] [:div.field.title (tr "dashboard.export-multiple.selected" (c (count enabled-exports)) From ea7266dc3b7c5c9ae10ce2e9f642b7d75e732812 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 24 Mar 2022 13:48:06 +0100 Subject: [PATCH 3/7] :bug: Fix performance problem with new texts --- frontend/src/app/main/ui/workspace/shapes.cljs | 3 ++- frontend/src/app/main/ui/workspace/shapes/frame.cljs | 5 ++--- frontend/src/app/main/ui/workspace/viewport/utils.cljs | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index aa1ad4990..d45dd9149 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -41,7 +41,8 @@ (mf/defc root-shape "Draws the root shape of the viewport and recursively all the shapes" - {::mf/wrap-props false} + {::mf/wrap [mf/memo] + ::mf/wrap-props false} [props] (let [objects (obj/get props "objects") active-frames (obj/get props "active-frames") diff --git a/frontend/src/app/main/ui/workspace/shapes/frame.cljs b/frontend/src/app/main/ui/workspace/shapes/frame.cljs index 444502d14..7a7f2fa92 100644 --- a/frontend/src/app/main/ui/workspace/shapes/frame.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/frame.cljs @@ -114,11 +114,10 @@ (mf/deps all-children) (fn [] (->> all-children - (filter #(= :text (:type %))) + (filter #(and (= :text (:type %)) (not (:hidden %)))) (every? #(some? (:position-data %)))))) - show-thumbnail? - (and thumbnail? (some? (:thumbnail shape)) all-svg-text?)] + show-thumbnail? (and thumbnail? (some? (:thumbnail shape)) all-svg-text?)] [:g.frame-wrapper {:display (when (:hidden shape) "none")} [:> shape-container {:shape shape} diff --git a/frontend/src/app/main/ui/workspace/viewport/utils.cljs b/frontend/src/app/main/ui/workspace/viewport/utils.cljs index 4caedeeb1..c87ba7c97 100644 --- a/frontend/src/app/main/ui/workspace/viewport/utils.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/utils.cljs @@ -7,6 +7,7 @@ (ns app.main.ui.workspace.viewport.utils (:require [app.common.data :as d] + [app.common.data.macros :as dm] [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] [app.main.ui.cursors :as cur] @@ -158,10 +159,10 @@ (dom/remove-attribute node "transform"))))))) (defn format-viewbox [vbox] - (str/join " " [(:x vbox 0) - (:y vbox 0) - (:width vbox 0) - (:height vbox 0)])) + (dm/str (:x vbox 0) " " + (:y vbox 0) " " + (:width vbox 0) " " + (:height vbox 0))) (defn translate-point-to-viewport [viewport zoom pt] (let [vbox (.. ^js viewport -viewBox -baseVal) From 8b44b4d8f10e1b4c115f487b9dd399d650b07d24 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 24 Mar 2022 15:14:43 +0100 Subject: [PATCH 4/7] :bug: Fix unexpected decoding of fresian data --- backend/src/app/util/fressian.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/app/util/fressian.clj b/backend/src/app/util/fressian.clj index d81c92db2..fa04e419b 100644 --- a/backend/src/app/util/fressian.clj +++ b/backend/src/app/util/fressian.clj @@ -203,7 +203,7 @@ (Instant/ofEpochMilli (.readInt rdr)))) - "clj/ratio" + "ratio" (reify ReadHandler (read [_ rdr _ _] (Ratio. (biginteger (.readObject rdr)) From 1bbcf67396536df6875b80488225fef754dff9c0 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 24 Mar 2022 15:32:19 +0100 Subject: [PATCH 5/7] :bug: Fix paths with no fill --- frontend/src/app/main/ui/shapes/custom_stroke.cljs | 5 ++++- frontend/src/app/main/ui/workspace/viewport/utils.cljs | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/custom_stroke.cljs b/frontend/src/app/main/ui/shapes/custom_stroke.cljs index c9f8d1f70..2c951ecdf 100644 --- a/frontend/src/app/main/ui/shapes/custom_stroke.cljs +++ b/frontend/src/app/main/ui/shapes/custom_stroke.cljs @@ -374,7 +374,10 @@ (cond-> (obj/merge! props fill-props) (some? style) - (obj/set! "style" style)))))) + (obj/set! "style" style))) + + :else + props))) (defn build-stroke-props [position child value render-id] (let [props (-> (obj/get child "props") diff --git a/frontend/src/app/main/ui/workspace/viewport/utils.cljs b/frontend/src/app/main/ui/workspace/viewport/utils.cljs index c87ba7c97..416077562 100644 --- a/frontend/src/app/main/ui/workspace/viewport/utils.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/utils.cljs @@ -11,8 +11,7 @@ [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] [app.main.ui.cursors :as cur] - [app.util.dom :as dom] - [cuerdas.core :as str])) + [app.util.dom :as dom])) (defn- text-corrected-transform "If we apply a scale directly to the texts it will show deformed so we need to create this From 5264863863cf4311d16e52170bee076c6d6de8ed Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Wed, 23 Mar 2022 13:36:31 +0100 Subject: [PATCH 6/7] :bug: Fix enter on empty search page --- CHANGES.md | 1 + frontend/src/app/main/ui/auth.cljs | 2 +- frontend/src/app/main/ui/dashboard/sidebar.cljs | 11 ++++++++++- frontend/translations/en.po | 6 +++--- frontend/translations/es.po | 6 +++--- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c6ef612cb..b0bf82c88 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,7 @@ ### :bug: Bugs fixed +- On dashboard enter on empty search refresh the page [Taiga #2597](https://tree.taiga.io/project/penpot/issue/2597) - Pencil cursor changes when activated [Taiga #2276](https://tree.taiga.io/project/penpot/issue/2276) - Fix icon placement in Mixed message [Taiga #3037](https://tree.taiga.io/project/penpot/issue/3037) - Fix scroll in comment section [Taiga #3068](https://tree.taiga.io/project/penpot/issue/3068) diff --git a/frontend/src/app/main/ui/auth.cljs b/frontend/src/app/main/ui/auth.cljs index a3e55fad9..c40af3605 100644 --- a/frontend/src/app/main/ui/auth.cljs +++ b/frontend/src/app/main/ui/auth.cljs @@ -28,7 +28,7 @@ [:a {:href cf/terms-of-service-uri :target "_blank"} (tr "auth.terms-of-service")]) (when show-all? - [:span (tr "auth.and")]) + [:span (tr "labels.and")]) (when show-privacy? [:a {:href cf/privacy-policy-uri :target "_blank"} (tr "auth.privacy-policy")])]))) diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index 6ab4627ab..39c929ff1 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -26,6 +26,7 @@ [app.util.dom :as dom] [app.util.dom.dnd :as dnd] [app.util.i18n :as i18n :refer [tr]] + [app.util.keyboard :as kbd] [app.util.object :as obj] [app.util.router :as rt] [beicon.core :as rx] @@ -169,7 +170,14 @@ (let [search-input (dom/get-element "search-input")] (dom/clean-value! search-input) (dom/focus! search-input) - (emit! (dd/go-to-search)))))] + (emit! (dd/go-to-search))))) + + on-key-press + (mf/use-callback + (fn [e] + (when (kbd/enter? e) + (dom/prevent-default e) + (dom/stop-propagation e))))] [:form.sidebar-search [:input.input-text @@ -182,6 +190,7 @@ :on-focus on-search-focus :on-blur on-search-blur :on-change on-search-change + :on-key-press on-key-press :ref #(when % (set! (.-value %) search-term))}] (if (or @focused? (seq search-term)) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index ab4f85169..9ad21b2c0 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -117,9 +117,6 @@ msgstr "Password" msgid "auth.password-length-hint" msgstr "At least 8 characters" -msgid "auth.and" -msgstr "and" - msgid "auth.privacy-policy" msgstr "Privacy policy" @@ -1022,6 +1019,9 @@ msgstr "Admin" msgid "labels.all" msgstr "All" +msgid "labels.and" +msgstr "and" + #: src/app/main/ui/static.cljs msgid "labels.bad-gateway.desc-message" msgstr "" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 2ccfefcfe..ccc402c43 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -121,9 +121,6 @@ msgstr "Contraseña" msgid "auth.password-length-hint" msgstr "8 caracteres como mínimo" -msgid "auth.and" -msgstr "y" - msgid "auth.privacy-policy" msgstr "Política de privacidad" @@ -1023,6 +1020,9 @@ msgstr "Administración" msgid "labels.all" msgstr "Todo" +msgid "labels.and" +msgstr "y" + #: src/app/main/ui/static.cljs msgid "labels.bad-gateway.desc-message" msgstr "" From 5ed84e3ae5a74b9727ca589bd69b74c6fa09946d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 24 Mar 2022 17:02:38 +0100 Subject: [PATCH 7/7] :bug: Set proper extension on download exported asset --- frontend/src/app/util/dom.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/app/util/dom.cljs b/frontend/src/app/util/dom.cljs index 1357cf2a1..499881ecf 100644 --- a/frontend/src/app/util/dom.cljs +++ b/frontend/src/app/util/dom.cljs @@ -412,6 +412,7 @@ "image/webp" "webp" "application/zip" "zip" "application/penpot" "penpot" + "application/pdf" "pdf" nil)) (defn set-attribute [^js node ^string attr value]