From 18190edcc8368fd533918912302e07c207b7512a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 18 Apr 2016 22:04:11 +0300 Subject: [PATCH] Adapt the code to use new shape geometry primitives. --- src/uxbox/data/shapes.cljs | 32 +++++++++++-------- src/uxbox/data/workspace.cljs | 1 - src/uxbox/schema.cljs | 2 +- src/uxbox/state/shapes.cljs | 3 +- src/uxbox/ui/shapes/circle.cljs | 6 ++-- src/uxbox/ui/shapes/core.cljs | 19 ++++++----- src/uxbox/ui/shapes/group.cljs | 4 +-- src/uxbox/ui/shapes/icon.cljs | 10 +++--- src/uxbox/ui/shapes/line.cljs | 1 - src/uxbox/ui/shapes/rect.cljs | 6 ++-- src/uxbox/ui/shapes/text.cljs | 10 +++--- src/uxbox/ui/workspace/align.cljs | 1 - src/uxbox/ui/workspace/base.cljs | 2 +- src/uxbox/ui/workspace/canvas.cljs | 1 - src/uxbox/ui/workspace/drawarea.cljs | 11 +++---- src/uxbox/ui/workspace/movement.cljs | 4 +-- src/uxbox/ui/workspace/resize.cljs | 1 - src/uxbox/ui/workspace/selection.cljs | 6 ++-- src/uxbox/ui/workspace/selrect.cljs | 1 - src/uxbox/ui/workspace/sidebar/drawtools.cljs | 1 - src/uxbox/ui/workspace/sidebar/history.cljs | 1 - src/uxbox/ui/workspace/sidebar/options.cljs | 6 ++-- src/uxbox/ui/workspace/sidebar/sitemap.cljs | 1 - 23 files changed, 64 insertions(+), 66 deletions(-) diff --git a/src/uxbox/data/shapes.cljs b/src/uxbox/data/shapes.cljs index 7ceffd499d..fc9a72574a 100644 --- a/src/uxbox/data/shapes.cljs +++ b/src/uxbox/data/shapes.cljs @@ -7,13 +7,13 @@ (ns uxbox.data.shapes (:require [beicon.core :as rx] - [uxbox.shapes :as sh] [uxbox.rstore :as rs] [uxbox.router :as r] [uxbox.state :as st] [uxbox.state.shapes :as stsh] [uxbox.schema :as sc] [uxbox.data.pages :as udp] + [uxbox.util.geom :as geom] [uxbox.util.geom.point :as gpt] [uxbox.util.data :refer (index-of)])) @@ -54,7 +54,7 @@ rs/UpdateEvent (-apply-update [_ state] (let [shape (get-in state [:shapes-by-id sid])] - (update-in state [:shapes-by-id sid] sh/move delta))))) + (update-in state [:shapes-by-id sid] geom/move delta))))) (defn update-line-attrs [sid {:keys [x1 y1 x2 y2] :as opts}] @@ -65,7 +65,7 @@ (let [shape (get-in state [:shapes-by-id sid]) props (select-keys opts [:x1 :y1 :x2 :y2]) props' (select-keys shape [:x1 :y1 :x2 :y2])] - (update-in state [:shapes-by-id sid] sh/initialize + (update-in state [:shapes-by-id sid] geom/setup (merge props' props)))))) (defn update-rotation @@ -78,7 +78,7 @@ rs/UpdateEvent (-apply-update [_ state] (update-in state [:shapes-by-id sid] - sh/rotate rotation)))) + geom/rotate rotation)))) (defn update-size "A helper event just for update the position @@ -92,9 +92,15 @@ udp/IPageUpdate rs/UpdateEvent (-apply-update [_ state] - (let [shape (get-in state [:shapes-by-id sid]) - size (merge (sh/size shape) opts)] - (update-in state [:shapes-by-id sid] sh/resize' size))))) + (letfn [(resize [shape {:keys [width height] :as size}] + (let [x1 (:x1 shape) + y1 (:y1 shape)] + (assoc shape + :x2 (+ x1 width) + :y2 (+ y1 height))))] + (let [shape (get-in state [:shapes-by-id sid]) + size (merge (geom/size shape) opts)] + (update-in state [:shapes-by-id sid] resize size)))))) (defn update-vertex-position [id {:keys [vid delta]}] @@ -102,7 +108,7 @@ udp/IPageUpdate rs/UpdateEvent (-apply-update [_ state] - (update-in state [:shapes-by-id id] sh/move-vertex vid delta)))) + (update-in state [:shapes-by-id id] geom/move-vertex vid delta)))) (defn update-position "Update the start position coordenate of the shape." @@ -110,7 +116,7 @@ (reify rs/UpdateEvent (-apply-update [_ state] - (update-in state [:shapes-by-id sid] sh/move' opts)))) + (update-in state [:shapes-by-id sid] geom/absolute-move opts)))) (defn update-text "Update the start position coordenate of the shape." @@ -314,11 +320,11 @@ (defn- has-blocked-parent? "Check if shape has blocked parent." [shape] - (sh/parent-satisfies? shape :blocked)) + (geom/parent-satisfies? shape :blocked)) (defn- has-locked-parent? [shape] - (sh/parent-satisfies? shape :locked)) + (geom/parent-satisfies? shape :locked)) (defrecord SelectShapes [selrect] rs/UpdateEvent @@ -330,8 +336,8 @@ (remove not-blocked-group?) (remove has-locked-parent?) (remove has-blocked-parent?) - (map sh/outer-rect') - (filter #(sh/contained-in? % selrect)) + (map geom/outer-rect) + (filter #(geom/contained-in? % selrect)) (map :id))] (->> (into #{} xform (vals (:shapes-by-id state))) (assoc-in state [:workspace :selected]))))) diff --git a/src/uxbox/data/workspace.cljs b/src/uxbox/data/workspace.cljs index db61a49857..b963d95278 100644 --- a/src/uxbox/data/workspace.cljs +++ b/src/uxbox/data/workspace.cljs @@ -8,7 +8,6 @@ (ns uxbox.data.workspace (:require [beicon.core :as rx] [uxbox.constants :as c] - [uxbox.shapes :as sh] [uxbox.rstore :as rs] [uxbox.state.shapes :as stsh] [uxbox.schema :as sc] diff --git a/src/uxbox/schema.cljs b/src/uxbox/schema.cljs index fe88c70c57..0f3769df1a 100644 --- a/src/uxbox/schema.cljs +++ b/src/uxbox/schema.cljs @@ -9,7 +9,7 @@ (:refer-clojure :exclude [keyword uuid vector boolean map set]) (:require [struct.core :as st] [uxbox.locales :refer (tr)] - [uxbox.shapes :refer (shape?)])) + [uxbox.util.geom :refer (shape?)])) ;; (def datetime ;; {:message "must be an instant" diff --git a/src/uxbox/state/shapes.cljs b/src/uxbox/state/shapes.cljs index 8ccb38bfa8..562dc8b4ed 100644 --- a/src/uxbox/state/shapes.cljs +++ b/src/uxbox/state/shapes.cljs @@ -1,7 +1,6 @@ (ns uxbox.state.shapes "A collection of functions for manage shapes insinde the state." - (:require [uxbox.shapes :as sh] - [uxbox.util.data :refer (index-of)])) + (:require [uxbox.util.data :refer (index-of)])) ;; --- Shape Creation diff --git a/src/uxbox/ui/shapes/circle.cljs b/src/uxbox/ui/shapes/circle.cljs index 715362baa7..890a022f9f 100644 --- a/src/uxbox/ui/shapes/circle.cljs +++ b/src/uxbox/ui/shapes/circle.cljs @@ -5,13 +5,13 @@ [lentes.core :as l] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as ush] [uxbox.data.workspace :as dw] [uxbox.ui.core :as uuc] [uxbox.ui.mixins :as mx] [uxbox.ui.keyboard :as kbd] [uxbox.ui.shapes.core :as uusc] [uxbox.ui.shapes.icon :as uusi] + [uxbox.util.geom :as geom] [uxbox.util.dom :as dom])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -49,7 +49,7 @@ (on-mouse-up [vid event] (dom/stop-propagation event) (uuc/release-action! "ui.shape.resize"))] - (let [{:keys [x y width height]} (ush/outer-rect' shape)] + (let [{:keys [x y width height]} (geom/outer-rect shape)] (html [:g.controls [:rect {:x x :y y :width width :height height :stroke-dasharray "5,5" @@ -93,7 +93,7 @@ (defmethod uusc/render-shape :builtin/circle [{:keys [id] :as shape}] (let [key (str id) - rfm (ush/transformation shape) + rfm (geom/transformation-matrix shape) props (select-keys shape [:cx :cy :rx :ry]) attrs (-> (uusc/extract-style-attrs shape) (merge {:id key :key key :transform (str rfm)}) diff --git a/src/uxbox/ui/shapes/core.cljs b/src/uxbox/ui/shapes/core.cljs index 0851d8492a..49fce455f4 100644 --- a/src/uxbox/ui/shapes/core.cljs +++ b/src/uxbox/ui/shapes/core.cljs @@ -2,10 +2,9 @@ (:require [lentes.core :as l] [cuerdas.core :as str] [rum.core :as rum] - [beicon.core :as rx] [uxbox.state :as st] - [uxbox.shapes :as sh] - [uxbox.ui.mixins :as mx])) + [uxbox.ui.mixins :as mx] + [uxbox.util.geom :as geom])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Common constants @@ -23,17 +22,21 @@ ;; Implementation Api ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defn dispatch-by-type + [shape & params] + (:type shape)) + (defmulti render-component (fn [own shape] (:type shape)) - :hierarchy #'sh/+hierarchy+) + :hierarchy #'geom/+hierarchy+) (defmulti render-shape - sh/dispatch-by-type - :hierarchy #'sh/+hierarchy+) + dispatch-by-type + :hierarchy #'geom/+hierarchy+) (defmulti render-shape-svg - sh/dispatch-by-type - :hierarchy #'sh/+hierarchy+) + dispatch-by-type + :hierarchy #'geom/+hierarchy+) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Lenses diff --git a/src/uxbox/ui/shapes/group.cljs b/src/uxbox/ui/shapes/group.cljs index a8a03f8e8b..ff49389d3d 100644 --- a/src/uxbox/ui/shapes/group.cljs +++ b/src/uxbox/ui/shapes/group.cljs @@ -5,17 +5,17 @@ [lentes.core :as l] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as ush] [uxbox.data.workspace :as dw] [uxbox.ui.core :as uuc] [uxbox.ui.keyboard :as kbd] [uxbox.ui.shapes.core :as uusc] + [uxbox.util.geom :as geom] [uxbox.util.dom :as dom])) (defmethod uusc/render-shape :builtin/group [{:keys [items id dx dy rotation] :as shape} factory] (let [key (str "group-" id) - rfm (ush/transformation shape) + rfm (geom/transformation-matrix shape) attrs (merge {:id key :key key :transform (str rfm)} (uusc/extract-style-attrs shape) (uusc/make-debug-attrs shape)) diff --git a/src/uxbox/ui/shapes/icon.cljs b/src/uxbox/ui/shapes/icon.cljs index d2e3962885..a4d39e8b1c 100644 --- a/src/uxbox/ui/shapes/icon.cljs +++ b/src/uxbox/ui/shapes/icon.cljs @@ -5,13 +5,13 @@ [lentes.core :as l] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as ush] [uxbox.data.workspace :as dw] [uxbox.data.shapes :as uds] [uxbox.ui.core :as uuc] [uxbox.ui.mixins :as mx] [uxbox.ui.keyboard :as kbd] [uxbox.ui.shapes.core :as uusc] + [uxbox.util.geom :as geom] [uxbox.util.dom :as dom])) ;; --- Icon Component @@ -23,7 +23,7 @@ (when-not (:blocked shape) (cond (or drawing? - (and group (:locked (ush/resolve-parent shape)))) + (and group (:locked (geom/resolve-parent shape)))) nil (and (not selected?) (empty? selected)) @@ -50,7 +50,7 @@ (defn on-mouse-up [event {:keys [id group] :as shape}] (cond - (and group (:locked (ush/resolve-parent shape))) + (and group (:locked (geom/resolve-parent shape))) nil :else @@ -87,7 +87,7 @@ (on-mouse-up [vid event] (dom/stop-propagation event) (uuc/release-action! "ui.shape.resize"))] - (let [{:keys [x y width height]} (ush/outer-rect' shape)] + (let [{:keys [x y width height]} (geom/outer-rect shape)] (html [:g.controls [:rect {:x x :y y :width width :height height :stroke-dasharray "5,5" @@ -129,7 +129,7 @@ (defmethod uusc/render-shape :builtin/icon [{:keys [data id] :as shape} _] (let [key (str id) - rfm (ush/transformation shape) + rfm (geom/transformation-matrix shape) attrs (merge {:id key :key key :transform (str rfm)} (uusc/extract-style-attrs shape) (uusc/make-debug-attrs shape))] diff --git a/src/uxbox/ui/shapes/line.cljs b/src/uxbox/ui/shapes/line.cljs index 9d5fa80849..073ac51248 100644 --- a/src/uxbox/ui/shapes/line.cljs +++ b/src/uxbox/ui/shapes/line.cljs @@ -5,7 +5,6 @@ [lentes.core :as l] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as ush] [uxbox.data.workspace :as dw] [uxbox.ui.core :as uuc] [uxbox.ui.keyboard :as kbd] diff --git a/src/uxbox/ui/shapes/rect.cljs b/src/uxbox/ui/shapes/rect.cljs index 7fb7a12817..43025ba5fd 100644 --- a/src/uxbox/ui/shapes/rect.cljs +++ b/src/uxbox/ui/shapes/rect.cljs @@ -5,18 +5,18 @@ [lentes.core :as l] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as ush] [uxbox.data.workspace :as dw] [uxbox.ui.core :as uuc] [uxbox.ui.keyboard :as kbd] [uxbox.ui.shapes.core :as uusc] + [uxbox.util.geom :as geom] [uxbox.util.dom :as dom])) (defmethod uusc/render-shape :builtin/rect [{:keys [id x1 y1 x2 y2] :as shape}] (let [key (str id) - rfm (ush/transformation shape) - size (ush/size shape) + rfm (geom/transformation-matrix shape) + size (geom/size shape) props {:x x1 :y y1 :id key :key key :transform (str rfm)} attrs (-> (uusc/extract-style-attrs shape) (merge props size))] diff --git a/src/uxbox/ui/shapes/text.cljs b/src/uxbox/ui/shapes/text.cljs index 0f58f80913..c364f4a362 100644 --- a/src/uxbox/ui/shapes/text.cljs +++ b/src/uxbox/ui/shapes/text.cljs @@ -6,7 +6,6 @@ [goog.events :as events] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as ush] [uxbox.data.shapes :as uds] [uxbox.data.workspace :as dw] [uxbox.ui.core :as uuc] @@ -14,6 +13,7 @@ [uxbox.ui.keyboard :as kbd] [uxbox.ui.shapes.core :as uusc] [uxbox.ui.shapes.icon :as uusi] + [uxbox.util.geom :as geom] [uxbox.util.color :as color] [uxbox.util.dom :as dom]) (:import goog.events.EventType)) @@ -27,7 +27,7 @@ (cond (or drawing? (:edition @local) - (and group (:locked (ush/resolve-parent shape)))) + (and group (:locked (geom/resolve-parent shape)))) nil (and (not selected?) (empty? selected)) @@ -52,7 +52,7 @@ (defn on-mouse-up [event {:keys [id group] :as shape}] (cond - (and group (:locked (ush/resolve-parent shape))) + (and group (:locked (geom/resolve-parent shape))) nil :else @@ -167,8 +167,8 @@ (defmethod uusc/render-shape :builtin/text [{:keys [id x1 y1 x2 y2 content drawing? editing?] :as shape}] (let [key (str id) - rfm (ush/transformation shape) - size (ush/size shape) + rfm (geom/transformation-matrix shape) + size (geom/size shape) props {:x x1 :y y1 :transform (str rfm)} attrs (merge props size) diff --git a/src/uxbox/ui/workspace/align.cljs b/src/uxbox/ui/workspace/align.cljs index 0eb28517f1..1640b25490 100644 --- a/src/uxbox/ui/workspace/align.cljs +++ b/src/uxbox/ui/workspace/align.cljs @@ -9,7 +9,6 @@ (:require [beicon.core :as rx] [lentes.core :as l] [uxbox.state :as st] - [uxbox.shapes :as sh] [uxbox.data.core :refer (worker)] [uxbox.ui.workspace.base :as wb] [uxbox.util.geom.point :as gpt] diff --git a/src/uxbox/ui/workspace/base.cljs b/src/uxbox/ui/workspace/base.cljs index b1c1c49c12..477bd134ab 100644 --- a/src/uxbox/ui/workspace/base.cljs +++ b/src/uxbox/ui/workspace/base.cljs @@ -28,7 +28,7 @@ (letfn [(getter [state] (let [project (get-in state [:workspace :project])] (get-in state [:projects-by-id project])))] - (as-> (ul/getter getter) $ + (as-> (l/getter getter) $ (l/focus-atom $ st/state)))) (def ^:const page-l diff --git a/src/uxbox/ui/workspace/canvas.cljs b/src/uxbox/ui/workspace/canvas.cljs index 794e354532..dcc825d6f9 100644 --- a/src/uxbox/ui/workspace/canvas.cljs +++ b/src/uxbox/ui/workspace/canvas.cljs @@ -13,7 +13,6 @@ [goog.events :as events] [uxbox.constants :as c] [uxbox.rstore :as rs] - [uxbox.shapes :as sh] [uxbox.data.projects :as dp] [uxbox.data.workspace :as dw] [uxbox.data.shapes :as uds] diff --git a/src/uxbox/ui/workspace/drawarea.cljs b/src/uxbox/ui/workspace/drawarea.cljs index 63de16dce2..0f06ed5b96 100644 --- a/src/uxbox/ui/workspace/drawarea.cljs +++ b/src/uxbox/ui/workspace/drawarea.cljs @@ -6,13 +6,11 @@ ;; Copyright (c) 2015-2016 Juan de la Cruz (ns uxbox.ui.workspace.drawarea - (:require-macros [uxbox.util.syntax :refer [define-once]]) (:require [sablono.core :as html :refer-macros [html]] [rum.core :as rum] [beicon.core :as rx] [lentes.core :as l] [uxbox.rstore :as rs] - [uxbox.shapes :as ush] [uxbox.state :as st] [uxbox.data.workspace :as udw] [uxbox.data.shapes :as uds] @@ -20,6 +18,7 @@ [uxbox.ui.shapes.core :as uusc] [uxbox.ui.workspace.base :as wb] [uxbox.ui.mixins :as mx] + [uxbox.util.geom :as geom] [uxbox.util.geom.point :as gpt] [uxbox.util.dom :as dom])) @@ -38,7 +37,7 @@ position (rum/react drawing-position)] (when shape (-> (assoc shape :drawing? true) - (ush/resize position) + (geom/resize position) (uusc/render-shape identity))))) (defn- draw-area-will-mount @@ -88,7 +87,7 @@ [shape] (let [{:keys [x y]} (gpt/divide @wb/mouse-canvas-a @wb/zoom-l) props {:x1 x :y1 y :x2 (+ x 100) :y2 (+ y 100)} - shape (ush/initialize shape props)] + shape (geom/setup shape props)] (rs/emit! (uds/add-shape shape) (udw/select-for-drawing nil) (uds/select-first-shape)))) @@ -103,7 +102,7 @@ (on-complete [] (let [shape @drawing-shape shpos @drawing-position - shape (ush/resize shape shpos)] + shape (geom/resize shape shpos)] (rs/emit! (uds/add-shape shape) (udw/select-for-drawing nil) (uds/select-first-shape)) @@ -111,7 +110,7 @@ (reset! drawing-shape nil)))] (let [{:keys [x y] :as pt} (gpt/divide @wb/mouse-canvas-a @wb/zoom-l) - shape (ush/initialize shape {:x1 x :y1 y :x2 x :y2 y}) + shape (geom/setup shape {:x1 x :y1 y :x2 x :y2 y}) stoper (->> uuc/actions-s (rx/map :type) (rx/filter #(empty? %)) diff --git a/src/uxbox/ui/workspace/movement.cljs b/src/uxbox/ui/workspace/movement.cljs index d7ae197ce6..e7a493b11c 100644 --- a/src/uxbox/ui/workspace/movement.cljs +++ b/src/uxbox/ui/workspace/movement.cljs @@ -12,11 +12,11 @@ [uxbox.constants :as c] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as sh] [uxbox.ui.core :as uuc] [uxbox.ui.workspace.base :as wb] [uxbox.ui.workspace.align :as align] [uxbox.data.shapes :as uds] + [uxbox.util.geom :as geom] [uxbox.util.geom.point :as gpt])) (declare initialize) @@ -98,7 +98,7 @@ (rx/take-until stoper $) (rx/map #(gpt/divide % @wb/zoom-l) $) (rx/scan (fn [acc delta] - (let [xf (map #(sh/move % delta))] + (let [xf (map #(geom/move % delta))] (into [] xf acc))) shapes $) (rx/mapcat (fn [items] (if align? diff --git a/src/uxbox/ui/workspace/resize.cljs b/src/uxbox/ui/workspace/resize.cljs index e5cb4714c8..e60e5158f0 100644 --- a/src/uxbox/ui/workspace/resize.cljs +++ b/src/uxbox/ui/workspace/resize.cljs @@ -8,7 +8,6 @@ (ns uxbox.ui.workspace.resize (:require [beicon.core :as rx] [uxbox.rstore :as rs] - [uxbox.shapes :as ush] [uxbox.data.shapes :as uds] [uxbox.ui.core :as uuc] [uxbox.ui.workspace.base :as uuwb] diff --git a/src/uxbox/ui/workspace/selection.cljs b/src/uxbox/ui/workspace/selection.cljs index a66cecf4c8..5ea58e20d7 100644 --- a/src/uxbox/ui/workspace/selection.cljs +++ b/src/uxbox/ui/workspace/selection.cljs @@ -11,8 +11,8 @@ [rum.core :as rum] [lentes.core :as l] [uxbox.state :as st] - [uxbox.shapes :as ush] - [uxbox.ui.mixins :as mx])) + [uxbox.ui.mixins :as mx] + [uxbox.util.geom :as geom])) ;; --- Lenses @@ -29,7 +29,7 @@ [own] (let [shapes (rum/react selected-shapes-l)] (when (> (count shapes) 1) - (let [{:keys [width height x y]} (ush/outer-rect shapes)] + (let [{:keys [width height x y]} (geom/outer-rect-coll shapes)] (html [:g.controls [:rect {:x x :y y :width width :height height diff --git a/src/uxbox/ui/workspace/selrect.cljs b/src/uxbox/ui/workspace/selrect.cljs index a1a168440b..a0aaa1392f 100644 --- a/src/uxbox/ui/workspace/selrect.cljs +++ b/src/uxbox/ui/workspace/selrect.cljs @@ -12,7 +12,6 @@ [beicon.core :as rx] [uxbox.constants :as c] [uxbox.rstore :as rs] - [uxbox.shapes :as sh] [uxbox.data.workspace :as dw] [uxbox.data.shapes :as uds] [uxbox.ui.core :as uuc] diff --git a/src/uxbox/ui/workspace/sidebar/drawtools.cljs b/src/uxbox/ui/workspace/sidebar/drawtools.cljs index 47c3810db9..225d58fd46 100644 --- a/src/uxbox/ui/workspace/sidebar/drawtools.cljs +++ b/src/uxbox/ui/workspace/sidebar/drawtools.cljs @@ -13,7 +13,6 @@ [uxbox.router :as r] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as shapes] [uxbox.library :as library] [uxbox.util.data :refer (read-string)] [uxbox.data.workspace :as dw] diff --git a/src/uxbox/ui/workspace/sidebar/history.cljs b/src/uxbox/ui/workspace/sidebar/history.cljs index c4ead997d2..8bfb8c98ab 100644 --- a/src/uxbox/ui/workspace/sidebar/history.cljs +++ b/src/uxbox/ui/workspace/sidebar/history.cljs @@ -13,7 +13,6 @@ [uxbox.router :as r] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as shapes] [uxbox.library :as library] [uxbox.data.workspace :as dw] [uxbox.data.pages :as udp] diff --git a/src/uxbox/ui/workspace/sidebar/options.cljs b/src/uxbox/ui/workspace/sidebar/options.cljs index ee77321f2c..cd489a7d93 100644 --- a/src/uxbox/ui/workspace/sidebar/options.cljs +++ b/src/uxbox/ui/workspace/sidebar/options.cljs @@ -13,7 +13,6 @@ [uxbox.router :as r] [uxbox.rstore :as rs] [uxbox.state :as st] - [uxbox.shapes :as sh] [uxbox.library :as library] [uxbox.data.workspace :as udw] [uxbox.data.shapes :as uds] @@ -23,6 +22,7 @@ [uxbox.ui.colorpicker :refer (colorpicker)] [uxbox.ui.workspace.recent-colors :refer (recent-colors)] [uxbox.ui.workspace.base :as wb] + [uxbox.util.geom :as geom] [uxbox.util.lens :as ul] [uxbox.util.dom :as dom] [uxbox.util.data :refer (parse-int parse-float read-string)])) @@ -216,7 +216,7 @@ sid (:id shape) props {attr value}] (rs/emit! (uds/update-radius-attrs sid props))))] - (let [size (sh/size shape)] + (let [size (geom/size shape)] (html [:div.element-set {:key (str (:id menu))} [:div.element-set-title (:name menu)] @@ -308,7 +308,7 @@ sid (:id shape) props {attr value}] (rs/emit! (uds/update-position sid props))))] - (let [size (sh/size shape)] + (let [size (geom/size shape)] (html [:div.element-set {:key (str (:id menu))} [:div.element-set-title (:name menu)] diff --git a/src/uxbox/ui/workspace/sidebar/sitemap.cljs b/src/uxbox/ui/workspace/sidebar/sitemap.cljs index 33560971f6..ea291ec6b8 100644 --- a/src/uxbox/ui/workspace/sidebar/sitemap.cljs +++ b/src/uxbox/ui/workspace/sidebar/sitemap.cljs @@ -15,7 +15,6 @@ [uxbox.rstore :as rs] [uxbox.state :as st] [uxbox.state.project :as stpr] - [uxbox.shapes :as shapes] [uxbox.library :as library] [uxbox.data.projects :as dp] [uxbox.data.pages :as udp]