diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 3f8a34596..36517b592 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -11,18 +11,19 @@ (:require ["slate" :as slate :refer [Editor Node Transforms Text]] ["slate-react" :as rslate] - [beicon.core :as rx] - [cljs.spec.alpha :as s] - [clojure.walk :as walk] - [goog.object :as gobj] - [potok.core :as ptk] - [app.common.geom.shapes :as gsh] [app.common.attrs :as attrs] + [app.common.geom.shapes :as gsh] + [app.common.pages :as cp] [app.main.data.workspace.common :as dwc] [app.main.data.workspace.transforms :as dwt] [app.main.fonts :as fonts] [app.util.object :as obj] - [app.util.text :as ut])) + [app.util.text :as ut] + [beicon.core :as rx] + [cljs.spec.alpha :as s] + [clojure.walk :as walk] + [goog.object :as gobj] + [potok.core :as ptk])) (defn create-editor [] @@ -179,7 +180,11 @@ (ptk/reify ::update-attrs ptk/WatchEvent (watch [_ state stream] - (rx/of (dwc/update-shapes [id] #(impl-update-shape-attrs % attrs pred))))))) + (let [objects (dwc/lookup-page-objects state) + shape (get objects id) + ids (cond (= (:type shape) :text) [id] + (= (:type shape) :group) (cp/get-children id objects))] + (rx/of (dwc/update-shapes ids #(impl-update-shape-attrs % attrs pred)))))))) (defn update-text-attrs [options] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs index 4a8f2f46a..d4730192b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs @@ -222,7 +222,8 @@ typography (generate-typography-name typography)] (let [id (uuid/next)] (st/emit! (dwl/add-typography (assoc typography :id id) false)) - (run! #(emit-update! % {:typography-ref-id id}) ids))))) + (run! #(emit-update! % {:typography-ref-id id + :typography-ref-file current-file-id}) ids))))) handle-deattach-typography (fn []