From 53700e3cb6657c1c8a56a4bf397023f0ccc01536 Mon Sep 17 00:00:00 2001
From: Andrey Antukh
Date: Wed, 11 Mar 2020 11:44:00 +0100
Subject: [PATCH 1/3] :construction: Comment worker code (temporary disabled).
---
frontend/src/uxbox/main/data/workspace.cljs | 34 ++++-----
frontend/src/uxbox/main/streams.cljs | 8 +-
.../src/uxbox/main/ui/workspace/drawarea.cljs | 14 ++--
.../uxbox/main/ui/workspace/selection.cljs | 15 ++--
frontend/src/uxbox/main/workers.cljs | 46 ++++++------
frontend/src/uxbox/util/data.cljs | 2 +-
frontend/tools.clj | 73 ++++++++++---------
7 files changed, 97 insertions(+), 95 deletions(-)
diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs
index ead4a6401..8af67981e 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 9b4c41d80..27e5cbe95 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 c3f4beccc..d501d03b3 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 80c090715..68b97766f 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 808f8f444..9b7d3ce2e 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 a26fa54c4..0ea8ba097 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 57c437747..0926483d3 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.
From 648dfdab80f155ad61d04efeb1248cce636b95af Mon Sep 17 00:00:00 2001
From: Andrey Antukh
Date: Wed, 11 Mar 2020 15:49:18 +0100
Subject: [PATCH 2/3] :fire: Remove unused Caddyfile.
---
frontend/Caddyfile | 5 -----
1 file changed, 5 deletions(-)
delete mode 100644 frontend/Caddyfile
diff --git a/frontend/Caddyfile b/frontend/Caddyfile
deleted file mode 100644
index 4b9a29232..000000000
--- a/frontend/Caddyfile
+++ /dev/null
@@ -1,5 +0,0 @@
-:2015 {
- gzip
- root ./dist
- proxy /api https://app.uxbox.io
-}
From 45290441debb284bc111ff082518e1242adc620d Mon Sep 17 00:00:00 2001
From: Andrey Antukh
Date: Wed, 11 Mar 2020 15:50:18 +0100
Subject: [PATCH 3/3] :fire: Remove view sub application.
---
frontend/gulpfile.js | 5 +-
frontend/resources/templates/index.mustache | 1 -
frontend/resources/templates/view.mustache | 22 --
frontend/src/uxbox/view.cljs | 80 ------
frontend/src/uxbox/view/data/lightbox.cljs | 46 ----
frontend/src/uxbox/view/data/viewer.cljs | 144 ----------
frontend/src/uxbox/view/locales/en.cljs | 14 -
frontend/src/uxbox/view/locales/fr.cljs | 14 -
frontend/src/uxbox/view/store.cljs | 41 ---
frontend/src/uxbox/view/ui.cljs | 68 -----
frontend/src/uxbox/view/ui/keyboard.cljs | 24 --
frontend/src/uxbox/view/ui/lightbox.cljs | 67 -----
frontend/src/uxbox/view/ui/loader.cljs | 19 --
frontend/src/uxbox/view/ui/notfound.cljs | 14 -
frontend/src/uxbox/view/ui/viewer.cljs | 48 ----
frontend/src/uxbox/view/ui/viewer/frame.cljs | 40 ---
.../uxbox/view/ui/viewer/interactions.cljs | 259 ------------------
frontend/src/uxbox/view/ui/viewer/nav.cljs | 43 ---
frontend/src/uxbox/view/ui/viewer/shapes.cljs | 118 --------
.../src/uxbox/view/ui/viewer/sitemap.cljs | 31 ---
frontend/tools.clj | 31 +--
21 files changed, 18 insertions(+), 1111 deletions(-)
delete mode 100644 frontend/resources/templates/view.mustache
delete mode 100644 frontend/src/uxbox/view.cljs
delete mode 100644 frontend/src/uxbox/view/data/lightbox.cljs
delete mode 100644 frontend/src/uxbox/view/data/viewer.cljs
delete mode 100644 frontend/src/uxbox/view/locales/en.cljs
delete mode 100644 frontend/src/uxbox/view/locales/fr.cljs
delete mode 100644 frontend/src/uxbox/view/store.cljs
delete mode 100644 frontend/src/uxbox/view/ui.cljs
delete mode 100644 frontend/src/uxbox/view/ui/keyboard.cljs
delete mode 100644 frontend/src/uxbox/view/ui/lightbox.cljs
delete mode 100644 frontend/src/uxbox/view/ui/loader.cljs
delete mode 100644 frontend/src/uxbox/view/ui/notfound.cljs
delete mode 100644 frontend/src/uxbox/view/ui/viewer.cljs
delete mode 100644 frontend/src/uxbox/view/ui/viewer/frame.cljs
delete mode 100644 frontend/src/uxbox/view/ui/viewer/interactions.cljs
delete mode 100644 frontend/src/uxbox/view/ui/viewer/nav.cljs
delete mode 100644 frontend/src/uxbox/view/ui/viewer/shapes.cljs
delete mode 100644 frontend/src/uxbox/view/ui/viewer/sitemap.cljs
diff --git a/frontend/gulpfile.js b/frontend/gulpfile.js
index 968fe3717..41fd60fd0 100644
--- a/frontend/gulpfile.js
+++ b/frontend/gulpfile.js
@@ -211,7 +211,10 @@ gulp.task("watch:main", function() {
gulp.watch([paths.resources + "templates/*.mustache",
paths.resources + "locales.json",
paths.resources + "images/**/*"],
- gulp.series("templates", "dev:copy:images", "dev:copy:icons-sprite"));
+ gulp.series("templates",
+ "dev:copy:images",
+ "dev:copy:templates",
+ "dev:copy:icons-sprite"));
});
gulp.task("watch", gulp.series(
diff --git a/frontend/resources/templates/index.mustache b/frontend/resources/templates/index.mustache
index 88c30382e..b98fb14a9 100644
--- a/frontend/resources/templates/index.mustache
+++ b/frontend/resources/templates/index.mustache
@@ -18,7 +18,6 @@
window.uxboxConfig = JSON.parse({{& config }});
window.uxboxTranslations = JSON.parse({{& translations }});
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/resources/templates/view.mustache b/frontend/resources/templates/view.mustache
deleted file mode 100644
index ef12f25a5..000000000
--- a/frontend/resources/templates/view.mustache
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-