diff --git a/CHANGES.md b/CHANGES.md index c5434e9ed9..b7d0b9eb65 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,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) @@ -97,6 +101,7 @@ - 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 de735fde09..c013433ded 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -711,6 +711,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 6f9897f08f..de3bd4c83d 100644 --- a/common/src/app/common/logic/shapes.cljc +++ b/common/src/app/common/logic/shapes.cljc @@ -149,7 +149,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 diff --git a/frontend/src/app/main/ui/ds/tab_switcher.cljs b/frontend/src/app/main/ui/ds/tab_switcher.cljs index 6ebb4d7902..711da9490b 100644 --- a/frontend/src/app/main/ui/ds/tab_switcher.cljs +++ b/frontend/src/app/main/ui/ds/tab_switcher.cljs @@ -118,9 +118,9 @@ (mf/defc tab-switcher* {::mf/props :obj ::mf/schema schema:tab-switcher} - [{:keys [tabs class 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 [tabs class 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/export.cljs b/frontend/src/app/main/ui/export.cljs index c51deb7486..fc15a04bbc 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 diff --git a/frontend/src/app/main/ui/onboarding/team_choice.cljs b/frontend/src/app/main/ui/onboarding/team_choice.cljs index 79bcc98a98..c7b550b3ab 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 [] diff --git a/frontend/src/app/main/ui/viewer/inspect/code.cljs b/frontend/src/app/main/ui/viewer/inspect/code.cljs index bceac31ade..abfc29b90b 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 5786bd74f8..341f269991 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; diff --git a/frontend/src/app/main/ui/workspace/sidebar.cljs b/frontend/src/app/main/ui/workspace/sidebar.cljs index 5b05aa25ae..8bfc29ca73 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"