From 1afecf23aa56c517241a3e348cb9676b2fa0d225 Mon Sep 17 00:00:00 2001 From: elhombretecla Date: Mon, 3 Apr 2023 12:52:53 +0200 Subject: [PATCH 1/7] :bug: Fix onboarding slides typo --- frontend/src/app/main/ui/releases/v1_18.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/releases/v1_18.cljs b/frontend/src/app/main/ui/releases/v1_18.cljs index 22ae6b153..e6fbcae68 100644 --- a/frontend/src/app/main/ui/releases/v1_18.cljs +++ b/frontend/src/app/main/ui/releases/v1_18.cljs @@ -39,7 +39,7 @@ [:img {:src "images/features/1.18-spacing.gif" :border "0" :alt "Spacing management"}]] [:div.modal-right [:div.modal-title - [:h2 "Spacing management for Flex layoutFlex-Layout"]] + [:h2 "Spacing management for Flex layout"]] [:div.modal-content [:p "Managing Flex Layout spacing is much more intuitive now. Visualize paddings, margins and gaps and drag to resize them."] [:p "And not only that, when creating Flex layouts, the spacing is predicted, helping you to maintain your design composition."]] From 3222583a69e487872645034ba7967ac27b43e965 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 3 Apr 2023 23:07:34 +0200 Subject: [PATCH 2/7] :bug: Fix incorrect metrics reference on rpc methods middleware --- backend/src/app/rpc.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/app/rpc.clj b/backend/src/app/rpc.clj index 617f0ea70..9af1f396f 100644 --- a/backend/src/app/rpc.clj +++ b/backend/src/app/rpc.clj @@ -149,7 +149,7 @@ (defn- wrap-metrics "Wrap service method with metrics measurement." - [{:keys [metrics ::metrics-id]} f mdata] + [{:keys [::mtx/metrics ::metrics-id]} f mdata] (let [labels (into-array String [(::sv/name mdata)])] (fn [cfg params] (let [tp (dt/tpoint)] From cdaf63afa0b2bd11a3c084b980b4bd365c30a643 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 4 Apr 2023 08:38:05 +0200 Subject: [PATCH 3/7] :bug: Enable by default mattermost webhook error reporter --- backend/src/app/loggers/mattermost.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/app/loggers/mattermost.clj b/backend/src/app/loggers/mattermost.clj index 51a627ff1..344fcf80b 100644 --- a/backend/src/app/loggers/mattermost.clj +++ b/backend/src/app/loggers/mattermost.clj @@ -19,7 +19,7 @@ [promesa.exec :as px] [promesa.exec.csp :as sp])) -(defonce enabled (atom false)) +(defonce enabled (atom true)) (defn- send-mattermost-notification! [cfg {:keys [id public-uri] :as report}] From 4b086ab2bc995dfd595cc43f4ce56e69c0c49b13 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 3 Apr 2023 12:28:57 +0200 Subject: [PATCH 4/7] :bug: Fix problems with imported SVG shadows --- CHANGES.md | 6 ++++++ frontend/src/app/main/ui/shapes/shape.cljs | 15 ++++++++++----- frontend/src/app/main/ui/shapes/svg_defs.cljs | 10 ++++++++++ .../workspace/shapes/frame/dynamic_modifiers.cljs | 13 ++++++++----- version.txt | 2 +- 5 files changed, 35 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 65a48dc53..af8a2b425 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # CHANGELOG +## 1.18.1 + +### :bug: Bugs fixed + +- Fix problems with imported SVG shadows [Taiga #4922](https://tree.taiga.io/project/penpot/issue/4922) + ## 1.18.0 ### :sparkles: New features diff --git a/frontend/src/app/main/ui/shapes/shape.cljs b/frontend/src/app/main/ui/shapes/shape.cljs index c3b4c70d3..7e398d302 100644 --- a/frontend/src/app/main/ui/shapes/shape.cljs +++ b/frontend/src/app/main/ui/shapes/shape.cljs @@ -67,6 +67,14 @@ shape-without-blur (dissoc shape :blur) shape-without-shadows (assoc shape :shadow []) + + filter-str + (when (and (or (cph/group-shape? shape) + (cph/frame-shape? shape) + (cph/svg-raw-shape? shape)) + (not disable-shadows?)) + (filters/filter-str filter-id shape)) + wrapper-props (-> (obj/clone props) (obj/without ["shape" "children" "disable-shadows?"]) @@ -79,11 +87,8 @@ (= :group type) (attrs/add-style-attrs shape render-id) - (and (or (cph/group-shape? shape) - (cph/frame-shape? shape) - (cph/svg-raw-shape? shape)) - (not disable-shadows?)) - (obj/set! "filter" (filters/filter-str filter-id shape))) + (some? filter-str) + (obj/set! "filter" filter-str)) svg-group? (and (contains? shape :svg-attrs) (= :group type)) diff --git a/frontend/src/app/main/ui/shapes/svg_defs.cljs b/frontend/src/app/main/ui/shapes/svg_defs.cljs index 174e095ea..1be7aade5 100644 --- a/frontend/src/app/main/ui/shapes/svg_defs.cljs +++ b/frontend/src/app/main/ui/shapes/svg_defs.cljs @@ -64,6 +64,16 @@ (or transform-filter? transform-mask?) (merge bounds))) + ;; Fixes race condition with dynamic modifiers forcing redraw this properties before + ;; the effect triggers + attrs + (cond-> attrs + (or (= tag :filter) (= tag :mask)) + (merge {:data-old-x (:x attrs) + :data-old-y (:y attrs) + :data-old-width (:width attrs) + :data-old-height (:height attrs)})) + [wrapper wrapper-props] (if (= tag :mask) ["g" #js {:className "svg-mask-wrapper" :transform (str transform)}] diff --git a/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs b/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs index 1863e9cd3..caba728b9 100644 --- a/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs @@ -181,11 +181,14 @@ (or (= (dom/get-tag-name node) "mask") (= (dom/get-tag-name node) "filter")) - (do - (dom/set-attribute! node "x" (dom/get-attribute node "data-old-x")) - (dom/set-attribute! node "y" (dom/get-attribute node "data-old-y")) - (dom/set-attribute! node "width" (dom/get-attribute node "data-old-width")) - (dom/set-attribute! node "height" (dom/get-attribute node "data-old-height")) + (let [old-x (dom/get-attribute node "data-old-x") + old-y (dom/get-attribute node "data-old-y") + old-width (dom/get-attribute node "data-old-width") + old-height (dom/get-attribute node "data-old-height")] + (dom/set-attribute! node "x" old-x) + (dom/set-attribute! node "y" old-y) + (dom/set-attribute! node "width" old-width) + (dom/set-attribute! node "height" old-height) (dom/remove-attribute! node "data-old-x") (dom/remove-attribute! node "data-old-y") diff --git a/version.txt b/version.txt index 84cc52946..ec6d649be 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.18.0 +1.18.1 From da953f0bc00558e73bf0d584836fde4c87f89867 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 3 Apr 2023 14:12:24 +0200 Subject: [PATCH 5/7] :bug: Fix problems with imported SVG embedded images and transforms --- CHANGES.md | 1 + .../app/main/data/workspace/svg_upload.cljs | 22 +++++++++---------- .../src/app/main/ui/workspace/shapes.cljs | 4 +--- frontend/src/app/util/svg.cljs | 9 +++++++- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index af8a2b425..347147c73 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### :bug: Bugs fixed - Fix problems with imported SVG shadows [Taiga #4922](https://tree.taiga.io/project/penpot/issue/4922) +- Fix problems with imported SVG embedded images and transforms [Taiga #4639](https://tree.taiga.io/project/penpot/issue/4639) ## 1.18.0 diff --git a/frontend/src/app/main/data/workspace/svg_upload.cljs b/frontend/src/app/main/data/workspace/svg_upload.cljs index ae5354b15..0a9b3c5d0 100644 --- a/frontend/src/app/main/data/workspace/svg_upload.cljs +++ b/frontend/src/app/main/data/workspace/svg_upload.cljs @@ -181,7 +181,7 @@ (-> (update-in [:svg-attrs :style] dissoc :mix-blend-mode) (assoc :blend-mode (-> (get-in shape [:svg-attrs :style :mix-blend-mode]) keyword))))) -(defn create-raw-svg [name frame-id svg-data {:keys [attrs] :as data}] +(defn create-raw-svg [name frame-id svg-data {:keys [tag attrs] :as data}] (let [{:keys [x y width height offset-x offset-y]} svg-data] (-> {:id (uuid/next) :type :svg-raw @@ -191,6 +191,7 @@ :height height :x x :y y + :hidden (= tag :defs) :content (cond-> data (map? data) (update :attrs usvg/clean-attrs))} (assoc :svg-attrs attrs) @@ -388,7 +389,7 @@ disp-matrix (str (gmt/translate-matrix displacement)) element-data (-> element-data (assoc :tag :g) - (update :attrs dissoc :x :y :width :height :href :xlink:href) + (update :attrs dissoc :x :y :width :height :href :xlink:href :transform) (update :attrs usvg/add-transform disp-matrix) (assoc :content [use-data]))] (parse-svg-element frame-id svg-data element-data unames)) @@ -419,7 +420,7 @@ hidden (assoc :hidden true)) children (cond->> (:content element-data) - (or (= tag :g) (= tag :svg)) + (contains? usvg/parent-tags tag) (mapv #(usvg/inherit-attributes attrs %)))] [shape children])))))) @@ -469,12 +470,12 @@ (rx/map (fn [uri] (merge {:file-id file-id - :is-local true} + :is-local true + :url uri} (if (str/starts-with? uri "data:") {:name "image" :content (data-uri->blob uri)} - {:name (extract-name uri) - :url uri})))) + {:name (extract-name uri)})))) (rx/mapcat (fn [uri-data] (->> (rp/command! (if (contains? uri-data :content) :upload-file-media-object @@ -577,12 +578,9 @@ (pcb/add-object new-shape)) changes - (reduce (fn [changes [index new-child]] - (-> changes - (pcb/add-object new-child) - (pcb/change-parent (:parent-id new-child) [new-child] index))) - changes - (d/enumerate new-children)) + (reduce (fn [changes new-child] + (-> changes (pcb/add-object new-child))) + changes new-children) changes (pcb/resize-parents changes (->> changes diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index 1bc7e29d0..e7b5ae517 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -100,10 +100,8 @@ opts #js {:shape shape :thumbnail? thumbnail?} - svg-leaf? (and (= :svg-raw (:type shape)) (string? (:content shape))) - [wrapper wrapper-props] - (if svg-leaf? + (if (= :svg-raw (:type shape)) [mf/Fragment nil] ["g" #js {:className "workspace-shape-wrapper"}])] diff --git a/frontend/src/app/util/svg.cljs b/frontend/src/app/util/svg.cljs index 21f084d84..e724136a5 100644 --- a/frontend/src/app/util/svg.cljs +++ b/frontend/src/app/util/svg.cljs @@ -389,7 +389,8 @@ :mask-type}) (defonce inheritable-props - [:clip-rule + [:style + :clip-rule :color :color-interpolation :color-interpolation-filters @@ -458,6 +459,12 @@ :feTile :feTurbulence}) +(def parent-tags + #{:g + :svg + :text + :tspan}) + ;; By spec: https://www.w3.org/TR/SVG11/single-page.html#struct-GElement (defonce svg-group-safe-tags #{:animate From e9daaa2eb8df84bb1ef670b61388f555de71e9de Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 4 Apr 2023 14:55:58 +0200 Subject: [PATCH 6/7] :bug: Fix default port for penpot-exporter on nginx entrypoint By default, penpot-frontend will try to reach penpot-export on port 80, this is wrong, the exporter listens by default to port 6061. --- docker/images/files/nginx-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/images/files/nginx-entrypoint.sh b/docker/images/files/nginx-entrypoint.sh index d8fc93567..00d8fddc9 100644 --- a/docker/images/files/nginx-entrypoint.sh +++ b/docker/images/files/nginx-entrypoint.sh @@ -20,7 +20,7 @@ update_flags /var/www/app/js/config.js ######################################### export PENPOT_BACKEND_URI=${PENPOT_BACKEND_URI:-http://penpot-backend:6060}; -export PENPOT_EXPORTER_URI=${PENPOT_EXPORTER_URI:-http://penpot-exporter}; +export PENPOT_EXPORTER_URI=${PENPOT_EXPORTER_URI:-http://penpot-exporter:6061}; envsubst "\$PENPOT_BACKEND_URI,\$PENPOT_EXPORTER_URI" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf From 30e1c7d54ee146c369172bbbf288b90eb606e648 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 4 Apr 2023 19:19:11 +0200 Subject: [PATCH 7/7] :bug: Add missing storage dependency to dbg routes module --- backend/src/app/http/debug.clj | 2 ++ backend/src/app/main.clj | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/app/http/debug.clj b/backend/src/app/http/debug.clj index 5abfea32d..36886cddd 100644 --- a/backend/src/app/http/debug.clj +++ b/backend/src/app/http/debug.clj @@ -18,6 +18,7 @@ [app.rpc.commands.binfile :as binf] [app.rpc.commands.files-create :refer [create-file]] [app.rpc.commands.profile :as profile] + [app.storage :as-alias sto] [app.util.blob :as blob] [app.util.template :as tmpl] [app.util.time :as dt] @@ -389,6 +390,7 @@ (defmethod ig/pre-init-spec ::routes [_] (s/keys :req [::db/pool ::wrk/executor + ::sto/storage ::session/manager])) (defmethod ig/init-key ::routes diff --git a/backend/src/app/main.clj b/backend/src/app/main.clj index 9e6da0164..2f9624fe1 100644 --- a/backend/src/app/main.clj +++ b/backend/src/app/main.clj @@ -300,7 +300,8 @@ :app.http.debug/routes {::db/pool (ig/ref ::db/pool) ::wrk/executor (ig/ref ::wrk/executor) - ::session/manager (ig/ref ::session/manager)} + ::session/manager (ig/ref ::session/manager) + ::sto/storage (ig/ref ::sto/storage)} :app.http.websocket/routes {::db/pool (ig/ref ::db/pool)