🎉 Allow to edit measures of multiple and grouped objects

This commit is contained in:
Andrés Moya 2020-07-01 13:38:41 +02:00
parent b640bc06ab
commit ceaea9d679
13 changed files with 152 additions and 98 deletions

View file

@ -168,24 +168,7 @@
:proportion 1 :proportion 1
:proportion-lock false)) :proportion-lock false))
;; --- Resize (Dimentsions) ;; --- Resize (Dimensions)
(defn resize-rect
[shape attr value]
(us/assert map? shape)
(us/assert #{:width :height} attr)
(us/assert number? value)
(let [{:keys [proportion proportion-lock]} shape]
(if-not proportion-lock
(assoc shape attr value)
(if (= attr :width)
(-> shape
(assoc :width value)
(assoc :height (/ value proportion)))
(-> shape
(assoc :height value)
(assoc :width (* value proportion)))))))
(defn resize (defn resize
[shape width height] [shape width height]
@ -199,6 +182,24 @@
:x2 (+ (:x1 selrect) width) :x2 (+ (:x1 selrect) width)
:y2 (+ (:y1 selrect) height)))))) :y2 (+ (:y1 selrect) height))))))
(defn resize-rect
[shape attr value]
(us/assert map? shape)
(us/assert #{:width :height} attr)
(us/assert number? value)
(let [{:keys [proportion proportion-lock]} shape
size (select-keys shape [:width :height])
new-size (if-not proportion-lock
(assoc size attr value)
(if (= attr :width)
(-> size
(assoc :width value)
(assoc :height (/ value proportion)))
(-> size
(assoc :height value)
(assoc :width (* value proportion)))))]
(resize shape (:width new-size) (:height new-size))))
;; --- Setup (Initialize) ;; --- Setup (Initialize)
(declare setup-rect) (declare setup-rect)

View file

@ -238,13 +238,17 @@
} }
&.selected { &.selected {
svg { svg {
fill: $color-primary; fill: $color-primary;
} }
} }
&.disabled {
cursor: unset;
svg {
fill: $color-gray-40;
}
}
} }
.save-btn { .save-btn {

View file

@ -924,29 +924,29 @@
;; object from workspace sidebar options inputs. ;; object from workspace sidebar options inputs.
(defn update-dimensions (defn update-dimensions
[id attr value] [ids attr value]
(us/verify ::us/uuid id) (us/verify (s/coll-of ::us/uuid) ids)
(us/verify #{:width :height} attr) (us/verify #{:width :height} attr)
(us/verify ::us/number value) (us/verify ::us/number value)
(ptk/reify ::update-dimensions (ptk/reify ::update-dimensions
ptk/WatchEvent ptk/WatchEvent
(watch [_ state stream] (watch [_ state stream]
(rx/of (dwc/update-shapes [id] #(geom/resize-rect % attr value)))))) (rx/of (dwc/update-shapes ids #(geom/resize-rect % attr value))))))
;; --- Shape Proportions ;; --- Shape Proportions
(defn toggle-shape-proportion-lock (defn set-shape-proportion-lock
[id] [id lock]
(ptk/reify ::toggle-shape-proportion-lock (ptk/reify ::set-shape-proportion-lock
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [page-id (:current-page-id state) (let [page-id (:current-page-id state)
shape (get-in state [:workspace-data page-id :objects id])] shape (get-in state [:workspace-data page-id :objects id])]
(if (:proportion-lock shape) (if-not lock
(assoc-in state [:workspace-data page-id :objects id :proportion-lock] false) (assoc-in state [:workspace-data page-id :objects id :proportion-lock] lock))
(->> (geom/assign-proportions (assoc shape :proportion-lock true)) (->> (geom/assign-proportions (assoc shape :proportion-lock lock))
(assoc-in state [:workspace-data page-id :objects id]))))))) (assoc-in state [:workspace-data page-id :objects id]))))))
;; --- Update Shape Position ;; --- Update Shape Position

View file

@ -133,8 +133,7 @@
[{:keys [page local] :as props}] [{:keys [page local] :as props}]
(let [section (:options-mode local) (let [section (:options-mode local)
shapes (mf/deref refs/selected-objects)] shapes (mf/deref refs/selected-objects)]
[:& options-content {:selected selected [:& options-content {:shapes shapes
:shape shape
:page page :page page
:section section}])) :section section}]))

View file

@ -10,17 +10,20 @@
(ns uxbox.main.ui.workspace.sidebar.options.circle (ns uxbox.main.ui.workspace.sidebar.options.circle
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]] [uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]])) [uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]]))
(mf/defc options (mf/defc options
[{:keys [shape] :as props}] [{:keys [shape] :as props}]
(let [ids [(:id shape)] (let [ids [(:id shape)]
type (:type shape) type (:type shape)
measure-values (select-keys shape measure-attrs)
stroke-values (select-keys shape stroke-attrs)] stroke-values (select-keys shape stroke-attrs)]
[:* [:*
[:& measures-menu {:shape shape [:& measures-menu {:ids ids
:type type
:values measure-values
:options #{:size :position :rotation}}] :options #{:size :position :rotation}}]
[:& fill-menu {:ids ids [:& fill-menu {:ids ids
:type type :type type

View file

@ -33,8 +33,8 @@
on-preset-selected on-preset-selected
(fn [width height] (fn [width height]
(st/emit! (udw/update-dimensions (:id shape) :width width) (st/emit! (udw/update-dimensions [(:id shape)] :width width)
(udw/update-dimensions (:id shape) :height height))) (udw/update-dimensions [(:id shape)] :height height)))
on-orientation-clicked on-orientation-clicked
(fn [orientation] (fn [orientation]
@ -42,19 +42,19 @@
height (:height shape) height (:height shape)
new-width (if (= orientation :horiz) (max width height) (min width height)) new-width (if (= orientation :horiz) (max width height) (min width height))
new-height (if (= orientation :horiz) (min width height) (max width height))] new-height (if (= orientation :horiz) (min width height) (max width height))]
(st/emit! (udw/update-dimensions (:id shape) :width new-width) (st/emit! (udw/update-dimensions [(:id shape)] :width new-width)
(udw/update-dimensions (:id shape) :height new-height)))) (udw/update-dimensions [(:id shape)] :height new-height))))
on-size-change on-size-change
(fn [event attr] (fn [event attr]
(let [value (-> (dom/get-target event) (let [value (-> (dom/get-target event)
(dom/get-value) (dom/get-value)
(d/parse-integer 0))] (d/parse-integer 0))]
(st/emit! (udw/update-dimensions (:id shape) attr value)))) (st/emit! (udw/update-dimensions [(:id shape)] attr value))))
on-proportion-lock-change on-proportion-lock-change
(fn [event] (fn [event]
(st/emit! (udw/toggle-shape-proportion-lock (:id shape)))) (st/emit! (udw/set-shape-proportion-lock (:id shape) (not (:proportion-lock shape)))))
on-position-change on-position-change
(fn [event attr] (fn [event attr]

View file

@ -12,8 +12,8 @@
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.multiple :refer [get-multi]] [uxbox.main.ui.workspace.sidebar.options.multiple :refer [get-multi]]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]] [uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]]
[uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]])) [uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]]))
@ -21,13 +21,14 @@
[{:keys [shape] :as props}] [{:keys [shape] :as props}]
(let [child-ids (:shapes shape) (let [child-ids (:shapes shape)
children (mf/deref (refs/objects-by-id child-ids)) children (mf/deref (refs/objects-by-id child-ids))
type (:type shape) type (:type shape)
measure-values (select-keys shape measure-attrs)
fill-values (get-multi children fill-attrs) fill-values (get-multi children fill-attrs)
stroke-values (get-multi children stroke-attrs)] stroke-values (get-multi children stroke-attrs)]
[:* [:*
[:& measures-menu {:options #{:position :rotation} [:& measures-menu {:ids (:id shape)
:shape shape}] :type type
:values measure-values}]
[:& fill-menu {:ids child-ids [:& fill-menu {:ids child-ids
:type type :type type
:values fill-values}] :values fill-values}]

View file

@ -10,7 +10,7 @@
(ns uxbox.main.ui.workspace.sidebar.options.icon (ns uxbox.main.ui.workspace.sidebar.options.icon
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]] [uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]] [uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]]
[uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]])) [uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]]))
@ -18,9 +18,12 @@
[{:keys [shape] :as props}] [{:keys [shape] :as props}]
(let [ids [(:id shape)] (let [ids [(:id shape)]
type (:type shape) type (:type shape)
measure-values (select-keys shape measure-attrs)
stroke-values (select-keys shape stroke-attrs)] stroke-values (select-keys shape stroke-attrs)]
[:* [:*
[:& measures-menu {:shape shape}] [:& measures-menu {:ids ids
:type type
:values measure-values}]
[:& fill-menu {:ids ids [:& fill-menu {:ids ids
:type type :type type
:values (select-keys shape fill-attrs)}] :values (select-keys shape fill-attrs)}]

View file

@ -10,9 +10,14 @@
(ns uxbox.main.ui.workspace.sidebar.options.image (ns uxbox.main.ui.workspace.sidebar.options.image
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]])) [uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]))
(mf/defc options (mf/defc options
[{:keys [shape] :as props}] [{:keys [shape] :as props}]
[:* (let [ids [(:id shape)]
[:& measures-menu {:shape shape}]]) type (:type shape)
measure-values (select-keys shape measure-attrs)]
[:*
[:& measures-menu {:ids ids
:type type
:values measure-values}]]))

View file

@ -15,32 +15,58 @@
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.common.data :as d] [uxbox.common.data :as d]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.data :refer [classnames]]
[uxbox.common.geom.shapes :as gsh] [uxbox.common.geom.shapes :as gsh]
[uxbox.common.geom.point :as gpt] [uxbox.common.geom.point :as gpt]
[uxbox.main.data.workspace :as udw] [uxbox.main.data.workspace :as udw]
[uxbox.main.data.workspace.common :as dwc]
[uxbox.common.math :as math] [uxbox.common.math :as math]
[uxbox.util.i18n :refer [t] :as i18n])) [uxbox.util.i18n :refer [t] :as i18n]))
(def measure-attrs [:proportion-lock :width :height :x :y :rotation :rx :ry :selrect])
(defn attr->string [attr values]
(let [value (attr values)]
(if (= value :multiple)
""
(str (-> value
(d/coalesce 0)
(math/precision 2))))))
;; -- User/drawing coords ;; -- User/drawing coords
(mf/defc measures-menu (mf/defc measures-menu
[{:keys [shape options] :as props}] [{:keys [options ids values] :as props}]
(let [options (or options #{:size :position :rotation :radius}) (let [options (or options #{:size :position :rotation :radius})
locale (i18n/use-locale) locale (i18n/use-locale)
frame (deref (refs/object-by-id (:frame-id shape)))
old-shape shape old-shapes (deref (refs/objects-by-id ids))
shape (->> shape frames (map #(deref (refs/object-by-id (:frame-id %))) old-shapes)
(gsh/transform-shape frame)) shapes (map gsh/transform-shape frames old-shapes)
values (cond-> values
(not= (:x values) :multiple) (assoc :x (:x (:selrect (first shapes))))
(not= (:y values) :multiple) (assoc :y (:y (:selrect (first shapes)))))
proportion-lock (:proportion-lock values)
on-size-change on-size-change
(fn [event attr] (fn [event attr]
(let [value (-> (dom/get-target event) (let [value (-> (dom/get-target event)
(dom/get-value) (dom/get-value)
(d/parse-integer 0))] (d/parse-integer 0))]
(st/emit! (udw/update-dimensions (:id shape) attr value)))) (st/emit! (udw/update-dimensions ids attr value))))
on-proportion-lock-change on-proportion-lock-change
(fn [event] (fn [event]
(st/emit! (udw/toggle-shape-proportion-lock (:id shape)))) (let [new-lock (if (= proportion-lock :multiple) true (not proportion-lock))]
(run! #(st/emit! (udw/set-shape-proportion-lock % new-lock)) ids)))
do-position-change
(fn [shape' frame' value attr]
(let [from (-> shape' :selrect attr)
to (+ value (attr frame'))
target (+ (attr shape') (- to from))]
(st/emit! (udw/update-position (:id shape') {attr target}))))
on-position-change on-position-change
(fn [event attr] (fn [event attr]
@ -48,31 +74,37 @@
(dom/get-value) (dom/get-value)
(d/parse-integer 0))] (d/parse-integer 0))]
(when value (when value
(let [from (-> shape :selrect attr) (doall (map #(do-position-change %1 %2 value attr) shapes frames)))))
to (+ value (attr frame))
target (+ (attr shape) (- to from))] do-rotation-change
(st/emit! (udw/update-position (:id shape) {attr target})))))) (fn [shape' old-shape' value]
(st/emit! (udw/set-rotation (- value (:rotation shape')) [old-shape'])
(udw/apply-modifiers #{(:id shape')})))
on-rotation-change on-rotation-change
(fn [event] (fn [event]
(let [value (-> (dom/get-target event) (let [value (-> (dom/get-target event)
(dom/get-value) (dom/get-value)
(d/parse-integer 0))] (d/parse-integer 0))]
(st/emit! (udw/set-rotation (- value (:rotation shape)) [old-shape]) (doall (map #(do-rotation-change %1 %2 value) shapes old-shapes))))
(udw/apply-modifiers #{(:id shape)}))))
on-radius-change on-radius-change
(fn [event] (fn [event]
(let [value (-> (dom/get-target event) (let [value (-> (dom/get-target event)
(dom/get-value) (dom/get-value)
(d/parse-integer 0))] (d/parse-integer 0))]
(st/emit! (udw/update-shape (:id shape) {:rx value :ry value})))) (st/emit! (dwc/update-shapes-recursive
ids
#(if (:rx %)
(assoc % :rx value :ry value)
%)))))
on-width-change #(on-size-change % :width) on-width-change #(on-size-change % :width)
on-height-change #(on-size-change % :height) on-height-change #(on-size-change % :height)
on-pos-x-change #(on-position-change % :x) on-pos-x-change #(on-position-change % :x)
on-pos-y-change #(on-position-change % :y) on-pos-y-change #(on-position-change % :y)
select-all #(-> % (dom/get-target) (.select))] select-all #(-> % (dom/get-target) (.select))]
[:div.element-set [:div.element-set
[:div.element-set-content [:div.element-set-content
@ -80,50 +112,50 @@
(when (options :size) (when (options :size)
[:div.row-flex [:div.row-flex
[:span.element-set-subtitle (t locale "workspace.options.size")] [:span.element-set-subtitle (t locale "workspace.options.size")]
[:div.lock-size {:class (when (:proportion-lock shape) "selected") [:div.lock-size {:class (classnames
:selected (true? proportion-lock)
:disabled (= proportion-lock :multiple))
:on-click on-proportion-lock-change} :on-click on-proportion-lock-change}
(if (:proportion-lock shape) (if proportion-lock
i/lock i/lock
i/unlock)] i/unlock)]
[:div.input-element.width [:div.input-element.width
[:input.input-text {:type "number" [:input.input-text {:type "number"
:min "0" :min "0"
:no-validate true :no-validate true
:placeholder "--"
:on-click select-all :on-click select-all
:on-change on-width-change :on-change on-width-change
:value (str (-> (:width shape) :value (attr->string :width values)}]]
(d/coalesce 0)
(math/precision 2)))}]]
[:div.input-element.height [:div.input-element.height
[:input.input-text {:type "number" [:input.input-text {:type "number"
:min "0" :min "0"
:no-validate true :no-validate true
:placeholder "--"
:on-click select-all :on-click select-all
:on-change on-height-change :on-change on-height-change
:value (str (-> (:height shape) :value (attr->string :height values)}]]])
(d/coalesce 0)
(math/precision 2)))}]]])
;; POSITION ;; POSITION
(when (options :position) (when (options :position)
[:div.row-flex [:div.row-flex
[:span.element-set-subtitle (t locale "workspace.options.position")] [:span.element-set-subtitle (t locale "workspace.options.position")]
[:div.input-element.Xaxis [:div.input-element.Xaxis
[:input.input-text {:placeholder "x" [:input.input-text {:type "number"
:type "number"
:no-validate true :no-validate true
:placeholder "--"
:on-click select-all :on-click select-all
:on-change on-pos-x-change :on-change on-pos-x-change
:value (-> shape :selrect :x (math/precision 2))}]] :value (attr->string :x values)}]]
[:div.input-element.Yaxis [:div.input-element.Yaxis
[:input.input-text {:placeholder "y" [:input.input-text {:type "number"
:type "number"
:no-validate true :no-validate true
:placeholder "--"
:on-click select-all :on-click select-all
:on-change on-pos-y-change :on-change on-pos-y-change
:value (-> shape :selrect :y (math/precision 2))}]]]) :value (attr->string :y values)}]]])
;; ROTATION ;; ROTATION
(when (options :rotation) (when (options :rotation)
@ -131,16 +163,14 @@
[:span.element-set-subtitle (t locale "workspace.options.rotation")] [:span.element-set-subtitle (t locale "workspace.options.rotation")]
[:div.input-element.degrees [:div.input-element.degrees
[:input.input-text [:input.input-text
{:placeholder "" {:type "number"
:type "number"
:no-validate true :no-validate true
:min "0" :min "0"
:max "359" :max "359"
:placeholder "--"
:on-click select-all :on-click select-all
:on-change on-rotation-change :on-change on-rotation-change
:value (str (-> (:rotation shape) :value (attr->string :rotation values)}]]
(d/coalesce 0)
(math/precision 2)))}]]
[:input.slidebar [:input.slidebar
{:type "range" {:type "range"
:min "0" :min "0"
@ -148,9 +178,7 @@
:step "10" :step "10"
:no-validate true :no-validate true
:on-change on-rotation-change :on-change on-rotation-change
:value (str (-> (:rotation shape) :value (attr->string :rotation values)}]])
(d/coalesce 0)
(math/precision 2)))}]])
;; RADIUS ;; RADIUS
(when (options :radius) (when (options :radius)
@ -158,11 +186,9 @@
[:span.element-set-subtitle (t locale "workspace.options.radius")] [:span.element-set-subtitle (t locale "workspace.options.radius")]
[:div.input-element.pixels [:div.input-element.pixels
[:input.input-text [:input.input-text
{:placeholder "rx" {:type "number"
:type "number" :placeholder "--"
:on-click select-all :on-click select-all
:on-change on-radius-change :on-change on-radius-change
:value (str (-> (:rx shape) :value (attr->string :rx values)}]]
(d/coalesce 0)
(math/precision 2)))}]]
[:div.input-element]])]])) [:div.input-element]])]]))

View file

@ -10,7 +10,7 @@
(ns uxbox.main.ui.workspace.sidebar.options.multiple (ns uxbox.main.ui.workspace.sidebar.options.multiple
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]] [uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]] [uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]]
[uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]])) [uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]]))
@ -31,9 +31,13 @@
{::mf/wrap [mf/memo]} {::mf/wrap [mf/memo]}
[{:keys [shapes] :as props}] [{:keys [shapes] :as props}]
(let [ids (map :id shapes) (let [ids (map :id shapes)
measure-values (get-multi shapes measure-attrs)
fill-values (get-multi shapes fill-attrs) fill-values (get-multi shapes fill-attrs)
stroke-values (get-multi shapes stroke-attrs)] stroke-values (get-multi shapes stroke-attrs)]
[:div [:*
[:& measures-menu {:ids ids
:type :multiple
:values measure-values}]
[:& fill-menu {:ids ids [:& fill-menu {:ids ids
:type :multiple :type :multiple
:values fill-values}] :values fill-values}]

View file

@ -10,7 +10,7 @@
(ns uxbox.main.ui.workspace.sidebar.options.rect (ns uxbox.main.ui.workspace.sidebar.options.rect
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]] [uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]] [uxbox.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]]
[uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]])) [uxbox.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]]))
@ -19,10 +19,13 @@
[{:keys [shape] :as props}] [{:keys [shape] :as props}]
(let [ids [(:id shape)] (let [ids [(:id shape)]
type (:type shape) type (:type shape)
measure-values (select-keys shape measure-attrs)
fill-values (select-keys shape fill-attrs) fill-values (select-keys shape fill-attrs)
stroke-values (select-keys shape stroke-attrs)] stroke-values (select-keys shape stroke-attrs)]
[:* [:*
[:& measures-menu {:shape shape}] [:& measures-menu {:ids ids
:type type
:values measure-values}]
[:& fill-menu {:ids ids [:& fill-menu {:ids ids
:type type :type type
:values fill-values}] :values fill-values}]

View file

@ -18,7 +18,7 @@
[uxbox.main.data.workspace.texts :as dwt] [uxbox.main.data.workspace.texts :as dwt]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]] [uxbox.main.ui.workspace.sidebar.options.measures :refer [measure-attrs measures-menu]]
[uxbox.main.ui.workspace.sidebar.options.rows.color-row :refer [color-row]] [uxbox.main.ui.workspace.sidebar.options.rows.color-row :refer [color-row]]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.main.fonts :as fonts] [uxbox.main.fonts :as fonts]
@ -395,6 +395,11 @@
(mf/defc options (mf/defc options
[{:keys [shape] :as props}] [{:keys [shape] :as props}]
[:div (let [ids [(:id shape)]
[:& measures-menu {:shape shape}] type (:type shape)
[:& text-menu {:shape shape}]]) measure-values (select-keys shape measure-attrs)]
[:div
[:& measures-menu {:ids ids
:type type
:values measure-values}]
[:& text-menu {:shape shape}]]))