diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index ead4a64017..8af67981ea 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -5,7 +5,7 @@ ;; This Source Code Form is "Incompatible With Secondary Licenses", as ;; defined by the Mozilla Public License, v. 2.0. ;; -;; Copyright (c) 2015-2019 Andrey Antukh +;; Copyright (c) 2015-2020 Andrey Antukh (ns uxbox.main.data.workspace (:require @@ -1779,23 +1779,23 @@ ;; --- Initial Path Point Alignment -;; TODO: revisit on alignemt refactor -(deftype InitialPathPointAlign [id index] - ptk/WatchEvent - (watch [_ state s] - (let [shape (get-in state [:workspace-data :objects id]) - point (get-in shape [:segments index])] - (->> (uwrk/align-point point) - (rx/map #(update-path id index %)))))) +;; ;; TODO: revisit on alignemt refactor +;; (deftype InitialPathPointAlign [id index] +;; ptk/WatchEvent +;; (watch [_ state s] +;; (let [shape (get-in state [:workspace-data :objects id]) +;; point (get-in shape [:segments index])] +;; (->> (uwrk/align-point point) +;; (rx/map #(update-path id index %)))))) -(defn initial-path-point-align - "Event responsible of align a specified point of the - shape by `index` with the grid." - [id index] - {:pre [(uuid? id) - (number? index) - (not (neg? index))]} - (InitialPathPointAlign. id index)) +;; (defn initial-path-point-align +;; "Event responsible of align a specified point of the +;; shape by `index` with the grid." +;; [id index] +;; {:pre [(uuid? id) +;; (number? index) +;; (not (neg? index))]} +;; (InitialPathPointAlign. id index)) ;; --- Shape Visibility diff --git a/frontend/src/uxbox/main/streams.cljs b/frontend/src/uxbox/main/streams.cljs index 9b4c41d808..27e5cbe95d 100644 --- a/frontend/src/uxbox/main/streams.cljs +++ b/frontend/src/uxbox/main/streams.cljs @@ -79,10 +79,10 @@ (->> (rx/concat (rx/of current) (rx/sample 10 mouse-position)) (rx/map #(gpt/divide % (gpt/point @refs/selected-zoom))) - (rx/mapcat (fn [point] - (if @refs/selected-alignment - (uwrk/align-point point) - (rx/of point)))) + ;; (rx/mapcat (fn [point] + ;; (if @refs/selected-alignment + ;; (uwrk/align-point point) + ;; (rx/of point)))) (rx/buffer 2 1) (rx/map (fn [[old new]] (gpt/subtract new old))))) diff --git a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs index c3f4beccc9..d501d03b34 100644 --- a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs +++ b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs @@ -136,7 +136,7 @@ stoper (rx/filter stoper? stream) mouse (->> ms/mouse-position - (rx/mapcat #(conditional-align % align?)) + ;; (rx/mapcat #(conditional-align % align?)) (rx/map #(gpt/divide % (gpt/point zoom))))] (rx/concat (->> mouse @@ -187,7 +187,7 @@ (rx/share)) mouse (->> (rx/sample 10 ms/mouse-position) - (rx/mapcat #(conditional-align % align?)) + ;; (rx/mapcat #(conditional-align % align?)) (rx/map #(gpt/divide % (gpt/point zoom)))) points (->> stream @@ -256,7 +256,7 @@ align? (refs/alignment-activated? flags) stoper (rx/filter stoper-event? stream) mouse (->> (rx/sample 10 ms/mouse-position) - (rx/mapcat #(conditional-align % align?)) + ;; (rx/mapcat #(conditional-align % align?)) (rx/map #(gpt/divide % (gpt/point zoom))))] (rx/concat (rx/of initialize-drawing) @@ -349,7 +349,7 @@ :on-mouse-enter on-mouse-enter :on-mouse-leave on-mouse-leave}])]))) -(defn- conditional-align [point align?] - (if align? - (uwrk/align-point point) - (rx/of point))) +;; (defn- conditional-align [point align?] +;; (if align? +;; (uwrk/align-point point) +;; (rx/of point))) diff --git a/frontend/src/uxbox/main/ui/workspace/selection.cljs b/frontend/src/uxbox/main/ui/workspace/selection.cljs index 80c0907150..68b97766f0 100644 --- a/frontend/src/uxbox/main/ui/workspace/selection.cljs +++ b/frontend/src/uxbox/main/ui/workspace/selection.cljs @@ -46,10 +46,11 @@ ;; Applies alginment to point if it is currently ;; activated on the current workspace - (apply-grid-alignment [point] - (if @refs/selected-alignment - (uwrk/align-point point) - (rx/of point)))] + ;; (apply-grid-alignment [point] + ;; (if @refs/selected-alignment + ;; (uwrk/align-point point) + ;; (rx/of point))) + ] (reify ptk/WatchEvent (watch [_ state stream] @@ -59,7 +60,7 @@ (rx/concat (->> ms/mouse-position (rx/map apply-zoom) - (rx/mapcat apply-grid-alignment) + ;; (rx/mapcat apply-grid-alignment) (rx/with-latest vector ms/mouse-position-ctrl) (rx/map normalize-proportion-lock) (rx/mapcat (partial resize shape)) @@ -202,8 +203,8 @@ (let [stoper (get-edition-stream-stoper) stream (->> (ms/mouse-position-deltas @ms/mouse-position) (rx/take-until stoper))] - (when @refs/selected-alignment - (st/emit! (dw/initial-path-point-align (:id shape) index))) + ;; (when @refs/selected-alignment + ;; (st/emit! (dw/initial-path-point-align (:id shape) index))) (rx/subscribe stream #(on-handler-move % index)))) (get-edition-stream-stoper [] diff --git a/frontend/src/uxbox/main/workers.cljs b/frontend/src/uxbox/main/workers.cljs index 808f8f4442..9b7d3ce2ed 100644 --- a/frontend/src/uxbox/main/workers.cljs +++ b/frontend/src/uxbox/main/workers.cljs @@ -12,30 +12,30 @@ [uxbox.common.spec :as us] [uxbox.util.workers :as uw])) -(s/def ::width number?) -(s/def ::height number?) -(s/def ::x-axis number?) -(s/def ::y-axis number?) +;; (s/def ::width number?) +;; (s/def ::height number?) +;; (s/def ::x-axis number?) +;; (s/def ::y-axis number?) -(s/def ::initialize-alignment-params - (s/keys :req-un [::width - ::height - ::x-axis - ::y-axis])) +;; (s/def ::initialize-alignment-params +;; (s/keys :req-un [::width +;; ::height +;; ::x-axis +;; ::y-axis])) -;; This excludes webworker instantiation on nodejs where -;; the tests are run. -(when (not= *target* "nodejs") - (defonce worker (uw/init "js/worker.js"))) +;; ;; This excludes webworker instantiation on nodejs where +;; ;; the tests are run. +;; (when (not= *target* "nodejs") +;; (defonce worker (uw/init "js/worker.js"))) -(defn align-point - [point] - (let [message {:cmd :grid-align :point point}] - (->> (uw/ask! worker message) - (rx/map :point)))) +;; (defn align-point +;; [point] +;; (let [message {:cmd :grid-align :point point}] +;; (->> (uw/ask! worker message) +;; (rx/map :point)))) -(defn initialize-alignment - [params] - (us/verify ::initialize-alignment-params params) - (let [message (assoc params :cmd :grid-init)] - (uw/send! worker message))) +;; (defn initialize-alignment +;; [params] +;; (us/verify ::initialize-alignment-params params) +;; (let [message (assoc params :cmd :grid-init)] +;; (uw/send! worker message))) diff --git a/frontend/src/uxbox/util/data.cljs b/frontend/src/uxbox/util/data.cljs index a26fa54c42..0ea8ba0972 100644 --- a/frontend/src/uxbox/util/data.cljs +++ b/frontend/src/uxbox/util/data.cljs @@ -9,7 +9,7 @@ (:require [cljs.reader :as r] [cuerdas.core :as str])) -;; TODO: partially move to uxbox.common.helpers +;; TODO: partially move to uxbox.common.data ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Data structure manipulation diff --git a/frontend/tools.clj b/frontend/tools.clj index 57c4377471..0926483d3c 100644 --- a/frontend/tools.clj +++ b/frontend/tools.clj @@ -60,12 +60,12 @@ ;; :output-to "resources/public/js/view.js"} }}) -(def worker-build-options - {:main 'uxbox.worker - :target :webworker - :output-to "resources/public/js/worker.js" - :output-dir "resources/public/js/worker" - :asset-path "/js/worker"}) +;; (def worker-build-options +;; {:main 'uxbox.worker +;; :target :webworker +;; :output-to "resources/public/js/worker.js" +;; :output-dir "resources/public/js/worker" +;; :asset-path "/js/worker"}) (def main-dist-build-options (-> (merge default-build-options @@ -84,22 +84,22 @@ (assoc-in [:modules :main :output-to] "target/dist/dbg/js/main.js") #_(assoc-in [:modules :view :output-to] "target/dist/dbg/js/view.js"))) -(def worker-dist-build-options - (merge default-build-options - worker-build-options - dist-build-options - {:output-to "target/dist/js/worker.js" - :output-dir "target/dist/js/worker" - :source-map "target/dist/js/worker.js.map"})) +;; (def worker-dist-build-options +;; (merge default-build-options +;; worker-build-options +;; dist-build-options +;; {:output-to "target/dist/js/worker.js" +;; :output-dir "target/dist/js/worker" +;; :source-map "target/dist/js/worker.js.map"})) -(def worker-dist-dbg-build-options - (merge worker-dist-build-options - {:optimizations :advanced - :pseudo-names true - :pretty-print true - :output-to "target/dist/dbg/js/worker.js" - :output-dir "target/dist/dbg/js/worker" - :source-map "target/dist/dbg/js/worker.js.map"})) +;; (def worker-dist-dbg-build-options +;; (merge worker-dist-build-options +;; {:optimizations :advanced +;; :pseudo-names true +;; :pretty-print true +;; :output-to "target/dist/dbg/js/worker.js" +;; :output-dir "target/dist/dbg/js/worker" +;; :source-map "target/dist/dbg/js/worker.js.map"})) ;; --- Tasks Definitions @@ -109,11 +109,11 @@ ;; (pprint cfg) (api/build (api/inputs "src") cfg))) -(defmethod task "dist:worker" - [args] - (let [cfg worker-dist-build-options] - ;; (pprint cfg) - (api/build (api/inputs "src") cfg))) +;; (defmethod task "dist:worker" +;; [args] +;; (let [cfg worker-dist-build-options] +;; ;; (pprint cfg) +;; (api/build (api/inputs "src") cfg))) (defmethod task "dist-dbg:main" [args] @@ -121,18 +121,18 @@ ;; (pprint cfg) (api/build (api/inputs "src") cfg))) -(defmethod task "dist-dbg:worker" - [args] - (let [cfg worker-dist-dbg-build-options] - ;; (pprint cfg) - (api/build (api/inputs "src") cfg))) +;; (defmethod task "dist-dbg:worker" +;; [args] +;; (let [cfg worker-dist-dbg-build-options] +;; ;; (pprint cfg) +;; (api/build (api/inputs "src") cfg))) (defmethod task "dist:all" [args] (task ["dist:main"]) - (task ["dist:worker"]) + #_(task ["dist:worker"]) (task ["dist-dbg:main"]) - (task ["dist-dbg:worker"])) + #_(task ["dist-dbg:worker"])) (defmethod task "repl:node" [args] @@ -189,8 +189,9 @@ (def figwheel-builds {:main {:id "main" :options (merge default-build-options main-build-options)} - :worker {:id "worker" - :options (merge default-build-options worker-build-options)}}) + ;; :worker {:id "worker" + ;; :options (merge default-build-options worker-build-options)} + }) (def figwheel-options {:open-url false @@ -208,7 +209,7 @@ (figwheel/start figwheel-options (:main figwheel-builds) - (:worker figwheel-builds))) + #_(:worker figwheel-builds))) ;;; Build script entrypoint. This should be the last expression.