mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
Merge pull request #1017 from penpot/fix/style-block
✨ Move frame style block to workspace wrapper
This commit is contained in:
commit
71c4145ea2
2 changed files with 3 additions and 8 deletions
|
@ -8,15 +8,11 @@
|
|||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.main.ui.shapes.attrs :as attrs]
|
||||
[app.main.ui.shapes.text.fontfaces :as ff]
|
||||
[app.util.object :as obj]
|
||||
[rumext.alpha :as mf]))
|
||||
|
||||
(def frame-default-props {:fill-color "#ffffff"})
|
||||
|
||||
(defn is-text? [{type :type}]
|
||||
(= :text type))
|
||||
|
||||
(defn frame-shape
|
||||
[shape-wrapper]
|
||||
(mf/fnc frame-shape
|
||||
|
@ -26,8 +22,6 @@
|
|||
shape (unchecked-get props "shape")
|
||||
{:keys [id width height]} shape
|
||||
|
||||
text-childs (->> childs (filterv is-text?))
|
||||
|
||||
props (-> (merge frame-default-props shape)
|
||||
(attrs/extract-style-attrs)
|
||||
(obj/merge!
|
||||
|
@ -37,7 +31,6 @@
|
|||
:height height
|
||||
:className "frame-background"}))]
|
||||
[:*
|
||||
[:& ff/fontfaces-style {:shapes text-childs}]
|
||||
[:> :rect props]
|
||||
(for [[i item] (d/enumerate childs)]
|
||||
[:& shape-wrapper {:frame shape
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
[app.main.refs :as refs]
|
||||
[app.main.ui.shapes.frame :as frame]
|
||||
[app.main.ui.shapes.shape :refer [shape-container]]
|
||||
[app.main.ui.shapes.text.fontfaces :as ff]
|
||||
[app.util.object :as obj]
|
||||
[app.util.timers :as ts]
|
||||
[beicon.core :as rx]
|
||||
|
@ -92,11 +93,12 @@
|
|||
(fn [node]
|
||||
(ts/schedule-on-idle #(reset! rendered? (some? node)))))]
|
||||
|
||||
(when (and shape (not (:hidden shape)))
|
||||
(when (some? shape)
|
||||
[:g.frame-wrapper {:display (when (:hidden shape) "none")}
|
||||
|
||||
(when-not show-thumbnail?
|
||||
[:> shape-container {:shape shape :ref on-dom}
|
||||
[:& ff/fontfaces-style {:shapes children}]
|
||||
[:& frame-shape {:shape shape
|
||||
:childs children}]])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue