From a180c33a32a6949202a04950a9ceb3b8effee40c Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 5 Sep 2024 09:26:22 +0200 Subject: [PATCH 1/4] :bug: Fix problem with SVG import --- CHANGES.md | 1 + frontend/src/app/main/data/workspace/svg_upload.cljs | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2667f4c75b..a09d96f2a9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -76,6 +76,7 @@ - Fix fill collapsed options [Taiga #8351](https://tree.taiga.io/project/penpot/issue/8351) - Fix scroll on color picker modal [Taiga #8353](https://tree.taiga.io/project/penpot/issue/8353) - Fix components are not dragged from the group to the assets tab [Taiga #8273](https://tree.taiga.io/project/penpot/issue/8273) +- Fix problem with SVG import [Github #4888](https://github.com/penpot/penpot/issues/4888) ## 2.1.5 diff --git a/frontend/src/app/main/data/workspace/svg_upload.cljs b/frontend/src/app/main/data/workspace/svg_upload.cljs index 169e2dd3ed..6f04e7c668 100644 --- a/frontend/src/app/main/data/workspace/svg_upload.cljs +++ b/frontend/src/app/main/data/workspace/svg_upload.cljs @@ -73,7 +73,6 @@ (let [id (d/nilv id (uuid/next)) page-id (:current-page-id state) objects (wsh/lookup-page-objects state page-id) - frame-id (ctst/top-nested-frame objects position) selected (if ignore-selection? #{} (wsh/lookup-selected state)) base (cfh/get-base-shape objects selected) @@ -81,9 +80,16 @@ selected-frame? (and (= 1 (count selected)) (= :frame (dm/get-in objects [selected-id :type]))) + base-id (:parent-id base) + + frame-id (if (or selected-frame? (empty? selected) + (not= :frame (dm/get-in objects [base-id :type]))) + (ctst/top-nested-frame objects position) + base-id) + parent-id (if (or selected-frame? (empty? selected)) frame-id - (:parent-id base)) + base-id) [new-shape new-children] (csvg.shapes-builder/create-svg-shapes id svg-data position objects frame-id parent-id selected true) From 6a161267ba8a3683fb523252cbba3c9b7b37a16d Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 5 Sep 2024 10:48:00 +0200 Subject: [PATCH 2/4] :bug: Fix problem with overlay positions in viewer --- CHANGES.md | 1 + frontend/src/app/main/ui/viewer/shapes.cljs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a09d96f2a9..619de08d60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -77,6 +77,7 @@ - Fix scroll on color picker modal [Taiga #8353](https://tree.taiga.io/project/penpot/issue/8353) - Fix components are not dragged from the group to the assets tab [Taiga #8273](https://tree.taiga.io/project/penpot/issue/8273) - Fix problem with SVG import [Github #4888](https://github.com/penpot/penpot/issues/4888) +- Fix problem with overlay positions in viewer [Taiga #8464](https://tree.taiga.io/project/penpot/issue/8464) ## 2.1.5 diff --git a/frontend/src/app/main/ui/viewer/shapes.cljs b/frontend/src/app/main/ui/viewer/shapes.cljs index 833a9fd79b..0f9aec6bf8 100644 --- a/frontend/src/app/main/ui/viewer/shapes.cljs +++ b/frontend/src/app/main/ui/viewer/shapes.cljs @@ -427,7 +427,8 @@ (let [childs (mapv #(get objects %) (:shapes (unchecked-get props "shape"))) props (obj/merge! #js {} props #js {:childs childs - :objects objects})] + :objects objects + :all-objects all-objects})] (when (not-empty childs) [:> group-wrapper props]))))) From caf78a6b4d91f826a68354c305beb38753088254 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 5 Sep 2024 11:50:16 +0200 Subject: [PATCH 3/4] :bug: Fix layer panel overflowing --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/sidebar/sitemap.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 619de08d60..ebd9aa992a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -78,6 +78,7 @@ - Fix components are not dragged from the group to the assets tab [Taiga #8273](https://tree.taiga.io/project/penpot/issue/8273) - Fix problem with SVG import [Github #4888](https://github.com/penpot/penpot/issues/4888) - Fix problem with overlay positions in viewer [Taiga #8464](https://tree.taiga.io/project/penpot/issue/8464) +- Fix layer panel overflowing [Taiga #8665](https://tree.taiga.io/project/penpot/issue/8665) ## 2.1.5 diff --git a/frontend/src/app/main/ui/workspace/sidebar/sitemap.scss b/frontend/src/app/main/ui/workspace/sidebar/sitemap.scss index cd12ae5727..c24801d0f5 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/sitemap.scss +++ b/frontend/src/app/main/ui/workspace/sidebar/sitemap.scss @@ -55,6 +55,7 @@ overflow-x: hidden; overflow-y: overlay; scrollbar-gutter: stable; + max-width: var(--width); } .pages-list { From b15b394c65112faf9cc0cad5a643f771530049bc Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 5 Sep 2024 14:41:09 +0200 Subject: [PATCH 4/4] :bug: Fix problem when creating a component instance from grid layout --- CHANGES.md | 1 + common/src/app/common/types/shape/layout.cljc | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ebd9aa992a..39f0a47a30 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -79,6 +79,7 @@ - Fix problem with SVG import [Github #4888](https://github.com/penpot/penpot/issues/4888) - Fix problem with overlay positions in viewer [Taiga #8464](https://tree.taiga.io/project/penpot/issue/8464) - Fix layer panel overflowing [Taiga #8665](https://tree.taiga.io/project/penpot/issue/8665) +- Fix problem when creating a component instance from grid layout [Github #4881](https://github.com/penpot/penpot/issues/4881) ## 2.1.5 diff --git a/common/src/app/common/types/shape/layout.cljc b/common/src/app/common/types/shape/layout.cljc index a999145cbd..9a71931cc0 100644 --- a/common/src/app/common/types/shape/layout.cljc +++ b/common/src/app/common/types/shape/layout.cljc @@ -1622,13 +1622,17 @@ (defn remap-grid-cells "Remaps the shapes ids inside the cells" [shape ids-map] - (let [do-remap-cells + (let [remap-shape + (fn [id] + (get ids-map id id)) + + remap-cell (fn [cell] (-> cell - (update :shapes #(into [] (keep ids-map) %)))) + (update :shapes #(into [] (keep remap-shape) %)))) shape (-> shape - (update :layout-grid-cells update-vals do-remap-cells))] + (update :layout-grid-cells update-vals remap-cell))] shape)) (defn merge-cells