From e636bdd0b0ec0771c4236bb23e0d045f881a311a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 12 Apr 2024 11:47:43 +0200 Subject: [PATCH 1/4] :bug: Fix problem copy/paste svg text --- frontend/src/app/main/data/workspace.cljs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 52aef6249e..1f48ae4ed0 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1711,8 +1711,14 @@ (process-entry [[type data]] (case type :text - (if (str/empty? data) + (cond + (str/empty? data) (rx/empty) + + (re-find #" pdata wapi/extract-text) transit-data (ex/ignoring (some-> text-data t/decode-str))] (cond - (and (string? text-data) - (str/includes? text-data " Date: Fri, 12 Apr 2024 12:41:55 +0200 Subject: [PATCH 2/4] :bug: Fix crash when removing multiple text fills --- .../workspace/sidebar/options/menus/fill.cljs | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs index 82e8fe530b..7dfc6f0758 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs @@ -69,33 +69,34 @@ on-add (mf/use-fn - (mf/deps ids) + (mf/deps ids fills) (fn [_] (st/emit! (dc/add-fill ids {:color default-color :opacity 1})) - (when (not (some? (seq fills))) (open-content)))) + (when (or (= :multiple fills) + (not (some? (seq fills)))) + (open-content)))) on-change - (mf/use-fn - (mf/deps ids) - (fn [index] - (fn [color] - (st/emit! (dc/change-fill ids color index))))) + (fn [index] + (fn [color] + (st/emit! (dc/change-fill ids color index)))) on-reorder - (mf/use-fn - (mf/deps ids) - (fn [new-index] - (fn [index] - (st/emit! (dc/reorder-fills ids index new-index))))) + (fn [new-index] + (fn [index] + (st/emit! (dc/reorder-fills ids index new-index)))) on-remove (fn [index] (fn [] (st/emit! (dc/remove-fill ids {:color default-color :opacity 1} index)) - (when (= 1 (count (seq fills))) (close-content)))) + (when (or (= :multiple fills) + (= 1 (count (seq fills)))) + (close-content)))) + on-remove-all (fn [_] (st/emit! (dc/remove-all-fills ids {:color clr/black From 8e71d219ca1cf4ba7b2b7eb1334b9afd7245da77 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 12 Apr 2024 12:42:08 +0200 Subject: [PATCH 3/4] :bug: Fix editor when several colors are in a single word --- frontend/resources/styles/main/partials/texts.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/resources/styles/main/partials/texts.scss b/frontend/resources/styles/main/partials/texts.scss index 0bece2924d..ad53796b62 100644 --- a/frontend/resources/styles/main/partials/texts.scss +++ b/frontend/resources/styles/main/partials/texts.scss @@ -21,6 +21,10 @@ flex-direction: column; } + .public-DraftStyleDefault-block { + white-space: pre; + } + &.align-top { .DraftEditor-root { justify-content: flex-start; From 4838571ec2331bbb34c704386a865b01086604a0 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 12 Apr 2024 15:21:30 +0200 Subject: [PATCH 4/4] :bug: Fix problem with position-data overriding in copies --- .../main/data/workspace/libraries_helpers.cljs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index f6de7fb462..ff03da46e9 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -1491,9 +1491,22 @@ container {:type :reg-objects :shapes all-parents})])))) - (let [roperation {:type :set + (let [;; position-data is a special case because can be affected by :geometry-group and :content-group + ;; so, if the position-data changes but the geometry is touched we need to reset the position-data + ;; so it's calculated again + reset-pos-data? + (and (cfh/text-shape? origin-shape) + (= attr :position-data) + (not= (get origin-shape attr) (get dest-shape attr)) + (touched :geometry-group)) + + roperation {:type :set :attr attr - :val (get origin-shape attr) + :val (cond + ;; If position data changes and the geometry group is touched + ;; we need to put to nil so we can regenerate it + reset-pos-data? nil + :else (get origin-shape attr)) :ignore-touched true} uoperation {:type :set :attr attr