🐛 Fixed problem with typographies and groups

This commit is contained in:
alonso.torres 2020-12-21 11:41:32 +01:00
parent 09bce9c285
commit c674a300c6
2 changed files with 15 additions and 9 deletions

View file

@ -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]

View file

@ -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 []