From 6892cffe544743793ff494e18e4e29d307459401 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 23 Sep 2024 11:45:23 +0200 Subject: [PATCH 1/5] :bug: Removed "merge assets" option from export --- CHANGES.md | 4 ++++ frontend/src/app/main/ui/export.cljs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 83cce1003..202e1a813 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,10 @@ ### :boom: Breaking changes & Deprecations +- Removed "merge assets" option when exporting ".svg + .json" files. After the components changes the option wasn't +working properly and we're planning to change the format soon. We think it's better to deprecate the option for the +time being. + ### :heart: Community contributions (Thank you!) - Set proper default tenant on exporter (by @june128) [#4946](https://github.com/penpot/penpot/pull/4946) diff --git a/frontend/src/app/main/ui/export.cljs b/frontend/src/app/main/ui/export.cljs index c51deb748..fc15a04bb 100644 --- a/frontend/src/app/main/ui/export.cljs +++ b/frontend/src/app/main/ui/export.cljs @@ -369,7 +369,9 @@ selected (:selected state) status (:status state) - + ;; We've deprecated the merge option on non-binary files because it wasn't working + ;; and we're planning to remove this export in future releases. + export-types (if binary? export-types [:all :detach]) start-export (mf/use-fn From 1fa461e9968b45aef67f07890de6dc799ad8b82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Mon, 23 Sep 2024 14:09:30 +0200 Subject: [PATCH 2/5] :bug: Fix error when swapping a copy that is the only child of a group --- CHANGES.md | 1 + common/src/app/common/files/changes.cljc | 1 + common/src/app/common/logic/shapes.cljc | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 202e1a813..3e92235c3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -89,6 +89,7 @@ time being. - Fix issue when exporting libraries when merging libraries [Taiga #8758](https://tree.taiga.io/project/penpot/issue/8758) - Fix problem with comments max length [Taiga #8778](https://tree.taiga.io/project/penpot/issue/8778) - Fix copy/paste images in Safari [Taiga #8771](https://tree.taiga.io/project/penpot/issue/8771) +- Fix swap when the copy is the only child of a group [#5075](https://github.com/penpot/penpot/issues/5075) ## 2.1.5 diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 9df975937..8f7bd5b31 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -545,6 +545,7 @@ (d/update-in-when [pid :shapes] d/without-obj sid) (d/update-in-when [pid :shapes] d/vec-without-nils) (cond-> component? (d/update-when pid #(dissoc % :remote-synced)))))))) + (update-parent-id [objects id] (-> objects (d/update-when id assoc :parent-id parent-id))) diff --git a/common/src/app/common/logic/shapes.cljc b/common/src/app/common/logic/shapes.cljc index f5d38f0c2..00f1395eb 100644 --- a/common/src/app/common/logic/shapes.cljc +++ b/common/src/app/common/logic/shapes.cljc @@ -158,7 +158,11 @@ empty-parents ;; Any parent whose children are all deleted, must be deleted too. - (into (d/ordered-set) (find-all-empty-parents #{})) + ;; Unless we are during a component swap: in this case we are replacing a shape by + ;; other one, so must not delete empty parents. + (if-not component-swap + (into (d/ordered-set) (find-all-empty-parents #{})) + #{}) components-to-delete (if components-v2 From b8299a5ea5a2663c8f40fad3251f393a0b5d9f22 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Mon, 23 Sep 2024 10:52:38 +0200 Subject: [PATCH 3/5] :bug: Fix create team without invitations on onboarding --- frontend/src/app/main/ui/onboarding/team_choice.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/onboarding/team_choice.cljs b/frontend/src/app/main/ui/onboarding/team_choice.cljs index 79bcc98a9..c7b550b3a 100644 --- a/frontend/src/app/main/ui/onboarding/team_choice.cljs +++ b/frontend/src/app/main/ui/onboarding/team_choice.cljs @@ -57,7 +57,7 @@ (def ^:private schema:invite-form [:map {:title "InviteForm"} [:role :keyword] - [:emails [::sm/set {:kind ::sm/email}]]]) + [:emails {:optional true} [::sm/set {:kind ::sm/email}]]]) (defn- get-available-roles [] From 6db7fe5f7bf42937c5a7d402b204ac5560f07947 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Mon, 23 Sep 2024 17:03:25 +0200 Subject: [PATCH 4/5] :bug: Fix code block height --- frontend/src/app/main/ui/viewer/inspect/code.cljs | 3 ++- frontend/src/app/main/ui/viewer/inspect/code.scss | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/viewer/inspect/code.cljs b/frontend/src/app/main/ui/viewer/inspect/code.cljs index bceac31ad..abfc29b90 100644 --- a/frontend/src/app/main/ui/viewer/inspect/code.cljs +++ b/frontend/src/app/main/ui/viewer/inspect/code.cljs @@ -244,7 +244,8 @@ (fn [result] (reset! images-data* result))))) - [:div {:class (stl/css :element-options)} + [:div {:class (stl/css-case :element-options true + :viewer-code-block (= :viewer from))} [:div {:class (stl/css :attributes-block)} [:button {:class (stl/css :download-button) :on-click handle-copy-all-code} diff --git a/frontend/src/app/main/ui/viewer/inspect/code.scss b/frontend/src/app/main/ui/viewer/inspect/code.scss index 5786bd74f..341f26999 100644 --- a/frontend/src/app/main/ui/viewer/inspect/code.scss +++ b/frontend/src/app/main/ui/viewer/inspect/code.scss @@ -9,7 +9,7 @@ .element-options { display: flex; flex-direction: column; - height: calc(100vh - #{$s-128}); // TODO: Fix this hardcoded value + height: calc(100vh - #{$s-160}); // TODO: Fix this hardcoded value overflow: hidden; padding-bottom: $s-16; overflow-y: auto; @@ -17,6 +17,10 @@ scrollbar-gutter: stable; } +.viewer-code-block { + height: calc(100vh - #{$s-108}); // TODO: Fix this hardcoded value +} + .download-button { @extend .button-secondary; @include uppercaseTitleTipography; From f7cfe36f3712401b02cd83a386bf40f91f21f256 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 24 Sep 2024 08:49:52 +0200 Subject: [PATCH 5/5] :bug: Fix show in assets panel --- frontend/src/app/main/ui/ds/tab_switcher.cljs | 6 +++--- frontend/src/app/main/ui/workspace/sidebar.cljs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/ds/tab_switcher.cljs b/frontend/src/app/main/ui/ds/tab_switcher.cljs index fa17d1bc3..74ebec794 100644 --- a/frontend/src/app/main/ui/ds/tab_switcher.cljs +++ b/frontend/src/app/main/ui/ds/tab_switcher.cljs @@ -116,9 +116,9 @@ (mf/defc tab-switcher* {::mf/props :obj ::mf/schema schema:tab-switcher} - [{:keys [class tabs on-change-tab default-selected action-button-position action-button] :rest props}] - (let [selected* (mf/use-state #(get-selected-tab-id tabs default-selected)) - selected (deref selected*) + [{:keys [class tabs on-change-tab default-selected selected action-button-position action-button] :rest props}] + (let [selected* (mf/use-state #(or selected (get-selected-tab-id tabs default-selected))) + selected (or selected (deref selected*)) tabs-nodes-refs (mf/use-ref nil) tabs-ref (mf/use-ref nil) diff --git a/frontend/src/app/main/ui/workspace/sidebar.cljs b/frontend/src/app/main/ui/workspace/sidebar.cljs index 5b05aa25a..8bfc29ca7 100644 --- a/frontend/src/app/main/ui/workspace/sidebar.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar.cljs @@ -136,7 +136,8 @@ :else [:div {:class (stl/css :settings-bar-content)} [:> tab-switcher* {:tabs tabs - :default-selected (dm/str section) + :default-selected "layers" + :selected (name section) :on-change-tab on-tab-change :class (stl/css :left-sidebar-tabs) :action-button-position "start"