diff --git a/project.clj b/project.clj index b0cdb8e11d..3f9ae9b286 100644 --- a/project.clj +++ b/project.clj @@ -10,12 +10,11 @@ ;; runtime [rum "0.6.0" :exclusions [sablono]] - [sablono "0.5.3"] + [sablono "0.6.0"] [cljsjs/react "0.14.3-0"] [cljsjs/react-dom "0.14.3-1"] - [cljsjs/react-dom-server "0.14.3-0"] [cljsjs/moment "2.10.6-1"] - [funcool/promesa "0.7.0"] + [funcool/promesa "0.8.1"] [funcool/beicon "0.6.1"] [funcool/cuerdas "0.7.1"] [funcool/hodgepodge "0.1.4"] diff --git a/src/uxbox/locales/en.cljs b/src/uxbox/locales/en.cljs index a220be6a3d..63fe70cbd4 100644 --- a/src/uxbox/locales/en.cljs +++ b/src/uxbox/locales/en.cljs @@ -13,6 +13,7 @@ "ds.recent-colors" "Recent colors" "ds.tools" "Tools" + "ds.sitemap" "Sitemap" "ds.help.rect" "Box (Ctrl + B)" "ds.help.circle" "Circle (Ctrl + E)" diff --git a/src/uxbox/ui/workspace.cljs b/src/uxbox/ui/workspace.cljs index 154443e5d9..ca3b8dfaa3 100644 --- a/src/uxbox/ui/workspace.cljs +++ b/src/uxbox/ui/workspace.cljs @@ -53,7 +53,7 @@ (defn- workspace-render [own projectid] (let [{:keys [flags] :as workspace} (rum/react wb/workspace-l) - left-sidebar? (not (empty? (keep flags [:layers]))) + left-sidebar? (not (empty? (keep flags [:layers :sitemap]))) right-sidebar? (not (empty? (keep flags [:icons :drawtools]))) classes (classnames :no-tool-bar-right (not right-sidebar?) diff --git a/src/uxbox/ui/workspace/header.cljs b/src/uxbox/ui/workspace/header.cljs index 182c9d6dc7..03caf7bc46 100644 --- a/src/uxbox/ui/workspace/header.cljs +++ b/src/uxbox/ui/workspace/header.cljs @@ -50,6 +50,11 @@ {:alt "Elements (Ctrl + Shift + L)" :class (when (contains? flags :layers) "selected") :on-click (partial toggle :layers)} + i/layers] + [:li.tooltip.tooltip-bottom + {:alt "Sitemap (Ctrl + Shift + S)" + :class (when (contains? flags :sitemap) "selected") + :on-click (partial toggle :sitemap)} i/layers]] [:ul.options-btn [:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"} diff --git a/src/uxbox/ui/workspace/sidebar.cljs b/src/uxbox/ui/workspace/sidebar.cljs index 329ffd6aaa..e33d80ab51 100644 --- a/src/uxbox/ui/workspace/sidebar.cljs +++ b/src/uxbox/ui/workspace/sidebar.cljs @@ -8,9 +8,31 @@ [uxbox.ui.mixins :as mx] [uxbox.ui.workspace.base :as wb] [uxbox.ui.workspace.sidebar.layers :refer (layers-toolbox)] + [uxbox.ui.workspace.sidebar.sitemap :refer (sitemap-toolbox)] [uxbox.ui.workspace.sidebar.icons :refer (icons-toolbox)] [uxbox.ui.workspace.sidebar.drawtools :refer (draw-toolbox)])) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Left Sidebar +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defn left-sidebar-render + [own] + (let [flags (rum/react wb/flags-l)] + (html + [:aside#settings-bar.settings-bar.settings-bar-left + [:div.settings-bar-inside + (when (contains? flags :sitemap) + (sitemap-toolbox)) + (when (contains? flags :layers) + (layers-toolbox))]]))) + +(def left-sidebar + (mx/component + {:render left-sidebar-render + :name "aside" + :mixins [rum/reactive mx/static]})) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Right Sidebar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -31,22 +53,3 @@ {:render right-sidebar-render :name "aside" :mixins [rum/reactive mx/static]})) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Left Sidebar -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defn left-sidebar-render - [own] - (let [flags (rum/react wb/flags-l)] - (html - [:aside#settings-bar.settings-bar.settings-bar-left - [:div.settings-bar-inside - (when (contains? flags :layers) - (layers-toolbox))]]))) - -(def left-sidebar - (mx/component - {:render left-sidebar-render - :name "aside" - :mixins [rum/reactive mx/static]})) diff --git a/src/uxbox/ui/workspace/sidebar/sitemap.cljs b/src/uxbox/ui/workspace/sidebar/sitemap.cljs new file mode 100644 index 0000000000..1dd5ef7552 --- /dev/null +++ b/src/uxbox/ui/workspace/sidebar/sitemap.cljs @@ -0,0 +1,45 @@ +(ns uxbox.ui.workspace.sidebar.sitemap + (:require [sablono.core :as html :refer-macros [html]] + [rum.core :as rum] + [cats.labs.lens :as l] + [uxbox.locales :refer (tr)] + [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] + [uxbox.ui.workspace.base :as wb] + [uxbox.ui.icons :as i] + [uxbox.ui.mixins :as mx] + [uxbox.util.dom :as dom])) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Component +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defn sitemap-toolbox-render + [open-toolboxes] + (let [workspace (rum/react wb/workspace-l) + close #(rs/emit! (dw/toggle-flag :sitemap))] + (html + [:div.sitemap.tool-window + [:div.tool-window-bar + [:div.tool-window-icon i/window] + [:span (tr "ds.sitemap")] + [:div.tool-window-close {:on-click close} i/close]] + [:div.tool-window-content {:style {:color "white"}} + [:div "Project name"] + [:ul.element-list + (for [i (range 10)] + [:li {:key i :class (when (= i 2) "selected")} + (str "Page " i)]) + ]]]))) + +(def ^:static sitemap-toolbox + (mx/component + {:render sitemap-toolbox-render + :name "sitemap-toolbox" + :mixins [mx/static rum/reactive]})) +