From 140731cf34abaab509f6712cbd9b7d1eaa175028 Mon Sep 17 00:00:00 2001 From: Eva Date: Tue, 2 Aug 2022 08:30:07 +0200 Subject: [PATCH 1/4] :bug: Change default team image in config --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/team.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 1a9713d0ac..5031225790 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,6 +33,7 @@ ### :bug: Bugs fixed +- Fix team default image [Taiga #3919](https://tree.taiga.io/project/penpot/issue/3919) - Fix problem with group coordinates [#2008](https://github.com/penpot/penpot/issues/2008) - Fix problem with line-height and texts [Taiga #3578](https://tree.taiga.io/project/penpot/issue/3578) - Fix moving frame-guides outside frames [Taiga #3839](https://tree.taiga.io/project/penpot/issue/3839) diff --git a/frontend/src/app/main/ui/dashboard/team.cljs b/frontend/src/app/main/ui/dashboard/team.cljs index 4281a8219c..b0fa099803 100644 --- a/frontend/src/app/main/ui/dashboard/team.cljs +++ b/frontend/src/app/main/ui/dashboard/team.cljs @@ -605,7 +605,7 @@ [:div.label (tr "dashboard.team-info")] [:div.name (:name team)] [:div.icon - [:span.update-overlay {:on-click on-image-click} i/exit] + [:span.update-overlay {:on-click on-image-click} i/image] [:img {:src (cfg/resolve-team-photo-url team)}] [:& file-uploader {:accept "image/jpeg,image/png" :multi false From 8795e134c15ecf8a7ca459b9d2c54e5d56a0c409 Mon Sep 17 00:00:00 2001 From: Eva Date: Wed, 3 Aug 2022 09:23:36 +0200 Subject: [PATCH 2/4] :bug: Fix intro action in multi input --- CHANGES.md | 1 + frontend/src/app/main/ui/components/forms.cljs | 9 ++++++--- frontend/src/app/main/ui/dashboard/team.cljs | 3 ++- frontend/src/app/main/ui/onboarding/team_choice.cljs | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5031225790..683ca998ae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,6 +33,7 @@ ### :bug: Bugs fixed +- Fix intro action in multi input [Taiga #3541](https://tree.taiga.io/project/penpot/issue/3541) - Fix team default image [Taiga #3919](https://tree.taiga.io/project/penpot/issue/3919) - Fix problem with group coordinates [#2008](https://github.com/penpot/penpot/issues/2008) - Fix problem with line-height and texts [Taiga #3578](https://tree.taiga.io/project/penpot/issue/3578) diff --git a/frontend/src/app/main/ui/components/forms.cljs b/frontend/src/app/main/ui/components/forms.cljs index 8b4723a286..24720a645f 100644 --- a/frontend/src/app/main/ui/components/forms.cljs +++ b/frontend/src/app/main/ui/components/forms.cljs @@ -243,7 +243,7 @@ (into [] (distinct) (conj coll item))) (mf/defc multi-input - [{:keys [form label class name trim valid-item-fn] :as props}] + [{:keys [form label class name trim valid-item-fn on-submit] :as props}] (let [form (or form (mf/use-ctx form-ctx)) input-name (get props :name) touched? (get-in @form [:touched input-name]) @@ -297,8 +297,11 @@ (dom/prevent-default event) (dom/stop-propagation event) (let [val (cond-> @value trim str/trim)] - (reset! value "") - (swap! items conj-dedup {:text val :valid (valid-item-fn val)}))) + (when (and (kbd/enter? event) (str/empty? @value) (not-empty @items)) + (on-submit form)) + (when (not (str/empty? @value)) + (reset! value "") + (swap! items conj-dedup {:text val :valid (valid-item-fn val)})))) (and (kbd/backspace? event) (str/empty? @value)) diff --git a/frontend/src/app/main/ui/dashboard/team.cljs b/frontend/src/app/main/ui/dashboard/team.cljs index b0fa099803..98c92857f2 100644 --- a/frontend/src/app/main/ui/dashboard/team.cljs +++ b/frontend/src/app/main/ui/dashboard/team.cljs @@ -142,7 +142,8 @@ :auto-focus? true :trim true :valid-item-fn us/parse-email - :label (tr "modals.invite-member.emails")}] + :label (tr "modals.invite-member.emails") + :on-submit on-submit}] [:& fm/select {:name :role :options roles}]] [:div.action-buttons diff --git a/frontend/src/app/main/ui/onboarding/team_choice.cljs b/frontend/src/app/main/ui/onboarding/team_choice.cljs index 43c62616aa..2247fe9e31 100644 --- a/frontend/src/app/main/ui/onboarding/team_choice.cljs +++ b/frontend/src/app/main/ui/onboarding/team_choice.cljs @@ -171,7 +171,8 @@ :auto-focus? true :trim true :valid-item-fn us/parse-email - :label (tr "modals.invite-member.emails")}] + :label (tr "modals.invite-member.emails") + :on-submit on-submit}] [:& fm/select {:name :role :options roles}]] [:div.buttons From 52cc91f4c44554efeb8c1698fc5e924cad58bf2b Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 2 Aug 2022 12:57:58 +0200 Subject: [PATCH 3/4] :sparkles: Select all inside a group select only the objects at this group level --- CHANGES.md | 3 +- .../app/main/data/workspace/selection.cljs | 61 +++++++++++++------ 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 909f62349a..5a6c66d343 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,7 +29,8 @@ - Improved share link options. Now you can allow non-team members to comment and/or inspect [Taiga #3056] (https://tree.taiga.io/project/penpot/us/3056) - Signin/Signup from shared link [Taiga #3472](https://tree.taiga.io/project/penpot/us/3472) - Support for import/export binary format [Taiga #2991](https://tree.taiga.io/project/penpot/us/2991) -- Comments positioning [Taiga #https://2007](tree.taiga.io/project/penpot/us/2007) +- Comments positioning [Taiga #2007](https://tree.taiga.io/project/penpot/us/2007) +- Select all inside a group select only the objects at this group level [Taiga #2382](https://tree.taiga.io/project/penpot/issue/2382) ### :bug: Bugs fixed diff --git a/frontend/src/app/main/data/workspace/selection.cljs b/frontend/src/app/main/data/workspace/selection.cljs index 777a5d49c8..ef31404018 100644 --- a/frontend/src/app/main/data/workspace/selection.cljs +++ b/frontend/src/app/main/data/workspace/selection.cljs @@ -178,29 +178,56 @@ (let [objects (wsh/lookup-page-objects state)] (rx/of (dwc/expand-all-parents ids objects)))))) + + +(defn- select-siblings + [state parent] + (let [children (wsh/lookup-shapes state (:shapes parent)) + selected (into (d/ordered-set) + (comp (remove :blocked) (map :id)) + children)] + (rx/of (select-shapes selected)))) + +(defn- select-all-frame + [state] + (let [focus (:workspace-focus-selected state) + objects (-> (wsh/lookup-page-objects state) + (cp/focus-objects focus)) + + selected (let [frame-ids (into #{} (comp + (map (d/getf objects)) + (map :frame-id)) + (wsh/lookup-selected state)) + frame-id (if (= 1 (count frame-ids)) + (first frame-ids) + uuid/zero)] + (cph/get-immediate-children objects frame-id)) + + selected (into (d/ordered-set) + (comp (remove :blocked) (map :id)) + selected)] + + (rx/of (select-shapes selected)))) + + (defn select-all [] (ptk/reify ::select-all ptk/WatchEvent (watch [_ state _] - (let [focus (:workspace-focus-selected state) - objects (-> (wsh/lookup-page-objects state) - (cp/focus-objects focus)) + (let [current-selection-parents (->> (wsh/lookup-selected state) + (wsh/lookup-shapes state) + (into #{} (map :parent-id))) + num-parents (count current-selection-parents) + parent (when (= num-parents 1) + (wsh/lookup-shape state (first current-selection-parents)))] - selected (let [frame-ids (into #{} (comp - (map (d/getf objects)) - (map :frame-id)) - (wsh/lookup-selected state)) - frame-id (if (= 1 (count frame-ids)) - (first frame-ids) - uuid/zero)] - (cph/get-immediate-children objects frame-id)) - - selected (into (d/ordered-set) - (comp (remove :blocked) (map :id)) - selected)] - - (rx/of (select-shapes selected)))))) + (case num-parents + 0 (select-all-frame state) + 1 (if (cph/frame-shape? parent) + (select-all-frame state) + (select-siblings state parent)) + nil))))) (defn deselect-all "Clear all possible state of drawing, edition From 5febd35cfe7a5e105d5d8b770910fc191d95c4b4 Mon Sep 17 00:00:00 2001 From: Andrew Zhurov Date: Sat, 30 Jul 2022 12:15:01 +0300 Subject: [PATCH 4/4] :bug: Fix layers get out of their group when moved Signed-off-by: Andrei Zhurau --- CHANGES.md | 2 ++ frontend/src/app/main/data/workspace/transforms.cljs | 10 +--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ca06d87d72..3e3e8f5fe8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,8 @@ - Fix copy and paste layers order [Taiga #1617](https://tree.taiga.io/project/penpot/issue/1617) - Fix unexpected removal of guides on copy&paste frames [Taiga #3887](https://tree.taiga.io/project/penpot/issue/3887) by @andrewzhurov - Fix props preserving on copy&paste texts [Taiga #3629](https://tree.taiga.io/project/penpot/issue/3629) by @andrewzhurov +- Fix unexpected layers ungrouping on moving it [Taiga #3932](https://tree.taiga.io/project/penpot/issue/3932) by @andrewzhurov + ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 92c193c5f3..02d8d7fc8d 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -854,14 +854,6 @@ (rx/of (set-modifiers [id] {:displacement displ} false true) (apply-modifiers [id])))))) -(defn check-frame-move? - [target-frame-id objects position shape] - - (let [current-frame (get objects (:frame-id shape))] - ;; If the current frame contains the point and it's a child of the target - (and (gsh/has-point? current-frame position) - (cph/is-child? objects target-frame-id (:id current-frame))))) - (defn- calculate-frame-for-move [ids] (ptk/reify ::calculate-frame-for-move @@ -876,7 +868,7 @@ (->> ids (cph/clean-loops objects) (keep #(get objects %)) - (remove (partial check-frame-move? frame-id objects position))) + (remove #(= (:frame-id %) frame-id))) moving-frames (->> ids