From 31b784f0465bf8ba9d71a5ab0bff7c5c8724214b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 30 Jan 2017 17:50:44 +0100 Subject: [PATCH] Fix depreaction warnings (changes introduced in 2.9.0 of beicon). --- .../uxbox/main/data/workspace/drawing.cljs | 8 ++--- frontend/src/uxbox/main/exports.cljs | 30 ++++++++++--------- .../src/uxbox/main/ui/shapes/selection.cljs | 2 +- .../src/uxbox/main/ui/workspace/ruler.cljs | 2 +- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/frontend/src/uxbox/main/data/workspace/drawing.cljs b/frontend/src/uxbox/main/data/workspace/drawing.cljs index 6674ca304..df4d95ce5 100644 --- a/frontend/src/uxbox/main/data/workspace/drawing.cljs +++ b/frontend/src/uxbox/main/data/workspace/drawing.cljs @@ -233,7 +233,7 @@ (rx/mapcat conditional-align) (rx/map translate-to-canvas) (rx/take-until stoper) - (rx/with-latest-from vector streams/mouse-position-ctrl))] + (rx/with-latest vector streams/mouse-position-ctrl))] (letfn [(on-position [[point ctrl?]] (if @start? @@ -322,13 +322,13 @@ (rx/mapcat conditional-align) (rx/map translate-to-canvas)) points (->> (get-path-point-stream) - (rx/with-latest-from vector mouse) + (rx/with-latest vector mouse) (rx/map second) (rx/take-until stoper)) counter (rx/merge (rx/scan #(inc %) 1 points) (rx/of 1)) stream (->> mouse - (rx/with-latest-from vector streams/mouse-position-ctrl) - (rx/with-latest-from vector counter) + (rx/with-latest vector streams/mouse-position-ctrl) + (rx/with-latest vector counter) (rx/map flatten) (rx/take-until stoper))] diff --git a/frontend/src/uxbox/main/exports.cljs b/frontend/src/uxbox/main/exports.cljs index 41f34da11..d3f4b57aa 100644 --- a/frontend/src/uxbox/main/exports.cljs +++ b/frontend/src/uxbox/main/exports.cljs @@ -26,25 +26,27 @@ :height "100%" :fill "white"}]) -(declare shape) -(declare shape*) +(declare shape-component) +(declare shape-wrapper) -(mx/defc shape* - [{:keys [type] :as s}] +(mx/defc shape-wrapper + [{:keys [type] :as shape}] (case type - :group (group-shape s shape) - :text (text-shape s) - :icon (icon-shape s) - :rect (rect-shape s) - :path (path-shape s) - :circle (circle-shape s) - :image (let [image-id (:image s) + :group (group-shape shape shape-component) + :text (text-shape shape) + :icon (icon-shape shape) + :rect (rect-shape shape) + :path (path-shape shape) + :circle (circle-shape shape) + :image (let [image-id (:image shape) image (get-in @*state* [:images image-id])] - (image-shape (assoc s :image image))))) + ;; (println "shape-wrapper" image) + (image-shape (assoc shape :image image))))) -(mx/defc shape +(mx/defc shape-component [sid] - (shape* (get-in @*state* [:shapes sid]))) + (let [shape (get-in @*state* [:shapes sid])] + (shape-wrapper shape))) (mx/defc page-svg [{:keys [metadata] :as page}] diff --git a/frontend/src/uxbox/main/ui/shapes/selection.cljs b/frontend/src/uxbox/main/ui/shapes/selection.cljs index 632ad0e21..881adbad0 100644 --- a/frontend/src/uxbox/main/ui/shapes/selection.cljs +++ b/frontend/src/uxbox/main/ui/shapes/selection.cljs @@ -224,7 +224,7 @@ (uwrk/align-point point) (rx/of point)))) (rx/take-until stoper) - (rx/with-latest-from vector streams/mouse-position-ctrl) + (rx/with-latest vector streams/mouse-position-ctrl) (rx/scan accumulate-width shape) (rx/map (partial calculate-ratio shape)))] (rx/subscribe stream diff --git a/frontend/src/uxbox/main/ui/workspace/ruler.cljs b/frontend/src/uxbox/main/ui/workspace/ruler.cljs index 4da709a06..3ccd536bc 100644 --- a/frontend/src/uxbox/main/ui/workspace/ruler.cljs +++ b/frontend/src/uxbox/main/ui/workspace/ruler.cljs @@ -78,7 +78,7 @@ (let [stream (->> streams/window-mouse-position (rx/filter #(:active @local)) (rx/map #(resolve-position own %)) - (rx/with-latest-from vector streams/mouse-position-ctrl)) + (rx/with-latest vector streams/mouse-position-ctrl)) sub (rx/on-value stream on-value)] (assoc own ::sub sub))))