mirror of
https://github.com/penpot/penpot.git
synced 2025-07-27 23:07:18 +02:00
🐛 Fixed problem with typographies and groups
This commit is contained in:
parent
09bce9c285
commit
c674a300c6
2 changed files with 15 additions and 9 deletions
|
@ -11,18 +11,19 @@
|
||||||
(:require
|
(:require
|
||||||
["slate" :as slate :refer [Editor Node Transforms Text]]
|
["slate" :as slate :refer [Editor Node Transforms Text]]
|
||||||
["slate-react" :as rslate]
|
["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.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.common :as dwc]
|
||||||
[app.main.data.workspace.transforms :as dwt]
|
[app.main.data.workspace.transforms :as dwt]
|
||||||
[app.main.fonts :as fonts]
|
[app.main.fonts :as fonts]
|
||||||
[app.util.object :as obj]
|
[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
|
(defn create-editor
|
||||||
[]
|
[]
|
||||||
|
@ -179,7 +180,11 @@
|
||||||
(ptk/reify ::update-attrs
|
(ptk/reify ::update-attrs
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(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
|
(defn update-text-attrs
|
||||||
[options]
|
[options]
|
||||||
|
|
|
@ -222,7 +222,8 @@
|
||||||
typography (generate-typography-name typography)]
|
typography (generate-typography-name typography)]
|
||||||
(let [id (uuid/next)]
|
(let [id (uuid/next)]
|
||||||
(st/emit! (dwl/add-typography (assoc typography :id id) false))
|
(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
|
handle-deattach-typography
|
||||||
(fn []
|
(fn []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue