From b86ea5b5e2b0553fabe5a7172becf1976a1ba9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 5 May 2022 12:11:31 +0200 Subject: [PATCH 1/3] :bug: Fix notifications of external library changes https://tree.taiga.io/project/penpot/issue/3348 --- frontend/src/app/main/data/workspace/notifications.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace/notifications.cljs b/frontend/src/app/main/data/workspace/notifications.cljs index 40f6f8ae1a..fa88c508aa 100644 --- a/frontend/src/app/main/data/workspace/notifications.cljs +++ b/frontend/src/app/main/data/workspace/notifications.cljs @@ -54,8 +54,8 @@ ;; Subscribe to notifications of the subscription (->> stream (rx/filter (ptk/type? ::dws/message)) - (rx/map deref) - (rx/filter #(= subs-id (:subs-id %))) + (rx/map deref) ;; :library-change events occur in a different file, but need to be processed anyway + (rx/filter #(or (= subs-id (:subs-id %)) (= (:type %) :library-change))) (rx/map process-message)) ;; On reconnect, send again the subscription messages From 7e05b7e6d9130cc83b35dab953c20eaef3a547c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 5 May 2022 16:02:39 +0200 Subject: [PATCH 2/3] :bug: Fix group typographies https://tree.taiga.io/project/penpot/issue/3338 --- .../app/main/data/workspace/libraries.cljs | 2 ++ .../sidebar/options/menus/typography.cljs | 27 +++---------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index be53b16d27..285e855231 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -221,6 +221,8 @@ ptk/WatchEvent (watch [it state _] (let [data (get state :workspace-data) + [path name] (cph/parse-path-name (:name typography)) + typography (assoc typography :path path :name name) changes (-> (pcb/empty-changes it) (pcb/with-library-data data) (pcb/update-typography typography))] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index 3967aa506a..9471d34bc7 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -462,21 +462,13 @@ name-input-ref (mf/use-ref) on-change-ref (mf/use-ref nil) - name-ref (mf/use-ref (:name typography)) - on-name-blur (mf/use-callback (mf/deps on-change) (fn [event] - (let [content (dom/get-target-val event)] - (when-not (str/blank? content) - (let [[path name] (cph/parse-path-name content)] - (on-change {:name name :path path})))))) - - on-name-change - (mf/use-callback - (fn [event] - (mf/set-ref-val! name-ref (dom/get-target-val event))))] + (let [name (dom/get-target-val event)] + (when-not (str/blank? name) + (on-change {:name name })))))] (mf/use-effect (mf/deps editing?) @@ -498,16 +490,6 @@ (fn [] (mf/set-ref-val! on-change-ref {:on-change on-change}))) - (mf/use-effect - (fn [] - (fn [] - (let [content (mf/ref-val name-ref)] - ;; On destroy we check if it changed - (when (and (some? content) (not= content (:name typography))) - (let [{:keys [on-change]} (mf/ref-val on-change-ref) - [path name] (cph/parse-path-name content)] - (on-change {:name name :path path}))))))) - [:* [:div.element-set-options-group.typography-entry {:class (when selected? "selected") @@ -582,8 +564,7 @@ {:type "text" :ref name-input-ref :default-value (cph/merge-path-item (:path typography) (:name typography)) - :on-blur on-name-blur - :on-change on-name-change}] + :on-blur on-name-blur}] [:div.element-set-actions-button {:on-click #(reset! open? false)} From 9b8b6134c55d5cc672f84947ac1f8ddd61c5f4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 6 May 2022 12:07:19 +0200 Subject: [PATCH 3/3] :bug: Allow images to adjust to the shape size https://tree.taiga.io/project/penpot/issue/3329 --- frontend/src/app/main/ui/shapes/fills.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/app/main/ui/shapes/fills.cljs b/frontend/src/app/main/ui/shapes/fills.cljs index df285209e9..45ba0586e4 100644 --- a/frontend/src/app/main/ui/shapes/fills.cljs +++ b/frontend/src/app/main/ui/shapes/fills.cljs @@ -80,5 +80,6 @@ (when has-image? [:image {:xlinkHref (get embed uri uri) + :preserveAspectRatio "none" :width width :height height}])]])])))))