diff --git a/src/uxbox/main/constants.cljs b/src/uxbox/main/constants.cljs index 1edc1ea119..94aadee87b 100644 --- a/src/uxbox/main/constants.cljs +++ b/src/uxbox/main/constants.cljs @@ -7,16 +7,16 @@ (ns uxbox.main.constants) -(def ^:const grid-x-axis 10) -(def ^:const grid-y-axis 10) +(def grid-x-axis 10) +(def grid-y-axis 10) -(def ^:const viewport-width 4000) -(def ^:const viewport-height 4000) +(def viewport-width 4000) +(def viewport-height 4000) -(def ^:const canvas-start-x 1200) -(def ^:const canvas-start-y 1200) -(def ^:const canvas-scroll-padding 50) -(def ^:const canvas-start-scroll-x (- canvas-start-x canvas-scroll-padding)) -(def ^:const canvas-start-scroll-y (- canvas-start-y canvas-scroll-padding)) +(def canvas-start-x 1200) +(def canvas-start-y 1200) +(def canvas-scroll-padding 50) +(def canvas-start-scroll-x (- canvas-start-x canvas-scroll-padding)) +(def canvas-start-scroll-y (- canvas-start-y canvas-scroll-padding)) diff --git a/src/uxbox/main/data/messages.cljs b/src/uxbox/main/data/messages.cljs index 5bfc6a8983..8aac4398f7 100644 --- a/src/uxbox/main/data/messages.cljs +++ b/src/uxbox/main/data/messages.cljs @@ -13,7 +13,7 @@ ;; --- Constants -(def ^:const +animation-timeout+ 600) +(def +animation-timeout+ 600) ;; --- Message Event diff --git a/src/uxbox/main/data/workspace.cljs b/src/uxbox/main/data/workspace.cljs index 2d8d2aacda..75e6300f11 100644 --- a/src/uxbox/main/data/workspace.cljs +++ b/src/uxbox/main/data/workspace.cljs @@ -28,7 +28,7 @@ ;; --- Constants -(def ^:const zoom-levels +(def zoom-levels [0.20 0.21 0.22 0.23 0.24 0.25 0.27 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.51 0.54 0.57 0.60 0.63 0.66 0.69 0.73 0.77 0.81 0.85 0.90 0.95 1.00 1.05 diff --git a/src/uxbox/main/geom.cljs b/src/uxbox/main/geom.cljs index 4ec0395a91..46d19d1914 100644 --- a/src/uxbox/main/geom.cljs +++ b/src/uxbox/main/geom.cljs @@ -12,7 +12,7 @@ ;; --- Types -(def ^:const +hierarchy+ +(def +hierarchy+ (-> (make-hierarchy) (derive ::rect ::shape) (derive :icon ::rect) diff --git a/src/uxbox/main/library.cljs b/src/uxbox/main/library.cljs index ae2ab5309b..4837f23e7d 100644 --- a/src/uxbox/main/library.cljs +++ b/src/uxbox/main/library.cljs @@ -16,38 +16,38 @@ ;; Colors ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^:const +color-collections+ +(def +color-collections+ colors/+collections+) -(def ^:const +color-collections-by-id+ +(def +color-collections-by-id+ (index-by-id colors/+collections+)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Icons ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^:const +icon-collections+ +(def +icon-collections+ icons/+collections+) -(def ^:const +icon-collections-by-id+ +(def +icon-collections-by-id+ (index-by-id icons/+collections+)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Images ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^:const +image-collections+ +(def +image-collections+ images/+collections+) -(def ^:const +image-collections-by-id+ +(def +image-collections-by-id+ (index-by-id images/+collections+)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Fonts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^:const +fonts+ +(def +fonts+ fonts/+collections+) -(def ^:const +fonts-by-id+ +(def +fonts-by-id+ (index-by-id fonts/+collections+)) diff --git a/src/uxbox/main/library/fonts.cljs b/src/uxbox/main/library/fonts.cljs index 85369a2e90..af6027bf88 100644 --- a/src/uxbox/main/library/fonts.cljs +++ b/src/uxbox/main/library/fonts.cljs @@ -7,7 +7,7 @@ (ns uxbox.main.library.fonts) -(def ^:const +collections+ +(def +collections+ [{:id "sourcesanspro" :name "Source Sans Pro" :styles [{:name "Extra-Light" diff --git a/src/uxbox/main/state/clipboard.cljs b/src/uxbox/main/state/clipboard.cljs index 8db84686fa..d346cb12db 100644 --- a/src/uxbox/main/state/clipboard.cljs +++ b/src/uxbox/main/state/clipboard.cljs @@ -1,6 +1,6 @@ (ns uxbox.main.state.clipboard) -(defonce ^:private ^:const +max-items+ 5) +(defonce ^:private +max-items+ 5) (defn conj-item [state item] diff --git a/src/uxbox/main/ui.cljs b/src/uxbox/main/ui.cljs index ebb867ed00..fd87c73e0c 100644 --- a/src/uxbox/main/ui.cljs +++ b/src/uxbox/main/ui.cljs @@ -33,13 +33,13 @@ ;; --- Constants -(def ^:const +unrestricted+ +(def +unrestricted+ #{:auth/login :auth/register :auth/recovery-request :auth/recovery}) -(def ^:const restricted? +(def restricted? (complement +unrestricted+)) (def route-ref diff --git a/src/uxbox/main/ui/colorpicker.cljs b/src/uxbox/main/ui/colorpicker.cljs index 454863cc03..fe018d92a0 100644 --- a/src/uxbox/main/ui/colorpicker.cljs +++ b/src/uxbox/main/ui/colorpicker.cljs @@ -67,7 +67,7 @@ [:rect {:x 0 :y 0 :width "100%" :height "100%" :fill "url(#gradient-hsv)"}]])) -(def ^:const default-dimensions +(def default-dimensions {:pi-height 5 :pi-width 5 :si-height 10 @@ -75,7 +75,7 @@ :p-width 200 :s-height 200}) -(def ^:const small-dimensions +(def small-dimensions {:pi-height 5 :pi-width 5 :si-height 10 diff --git a/src/uxbox/main/ui/dashboard/elements.cljs b/src/uxbox/main/ui/dashboard/elements.cljs index 7fe62065d6..cf2414028e 100644 --- a/src/uxbox/main/ui/dashboard/elements.cljs +++ b/src/uxbox/main/ui/dashboard/elements.cljs @@ -29,7 +29,7 @@ [:span i/pencil] [:span i/trash]]])) -(def ^:const ^:private page-title +(def ^:private page-title (mx/component {:render page-title-render :name "page-title" @@ -124,7 +124,7 @@ [:div.project-th-icon.edit i/pencil] [:div.project-th-icon.delete i/trash]]]]])) -(def ^:const ^:private grid +(def ^:private grid (mx/component {:render grid-render :name "grid" @@ -180,7 +180,7 @@ (udl/close!))} i/close]])) -(def ^:const ^:private new-element-lightbox +(def ^:private new-element-lightbox (mx/component {:render new-element-lightbox-render :name "new-element-lightbox"})) diff --git a/src/uxbox/main/ui/dashboard/icons.cljs b/src/uxbox/main/ui/dashboard/icons.cljs index 3fa202f70f..87d07c81cf 100644 --- a/src/uxbox/main/ui/dashboard/icons.cljs +++ b/src/uxbox/main/ui/dashboard/icons.cljs @@ -47,7 +47,7 @@ [:span {:on-click (constantly nil)} i/trash]])]))) -(def ^:const ^:private page-title +(def ^:private page-title (mx/component {:render page-title-render :name "page-title" @@ -88,7 +88,7 @@ [:span.element-subtitle (str (count (:icons props)) " elements")]])]]]))) -(def ^:const ^:private nav +(def ^:private nav (mx/component {:render nav-render :name "nav" diff --git a/src/uxbox/main/ui/lightbox.cljs b/src/uxbox/main/ui/lightbox.cljs index 6c18d26561..b57907955d 100644 --- a/src/uxbox/main/ui/lightbox.cljs +++ b/src/uxbox/main/ui/lightbox.cljs @@ -13,7 +13,7 @@ ;; --- Lentes -(def ^:const ^:private lightbox-ref +(def ^:private lightbox-ref (-> (l/key :lightbox) (l/derive st/state))) diff --git a/src/uxbox/main/ui/messages.cljs b/src/uxbox/main/ui/messages.cljs index d246b056bf..ea39a9434e 100644 --- a/src/uxbox/main/ui/messages.cljs +++ b/src/uxbox/main/ui/messages.cljs @@ -12,7 +12,7 @@ ;; --- Lenses -(def ^:const ^:private message-ref +(def ^:private message-ref (-> (l/key :message) (l/derive st/state))) @@ -84,7 +84,7 @@ :dialog (dialog-box message) nil))) -(def ^:const messages +(def messages (mx/component {:render messages-render :name "messages" diff --git a/src/uxbox/main/ui/shapes/common.cljs b/src/uxbox/main/ui/shapes/common.cljs index 0df0d3e984..d826db977e 100644 --- a/src/uxbox/main/ui/shapes/common.cljs +++ b/src/uxbox/main/ui/shapes/common.cljs @@ -17,11 +17,11 @@ ;; --- Lenses -(def ^:const selected-shapes-ref +(def selected-shapes-ref (-> (l/in [:workspace :selected]) (l/derive st/state))) -(def ^:const drawing-state-ref +(def drawing-state-ref (-> (l/in [:workspace :drawing]) (l/derive st/state))) diff --git a/src/uxbox/main/ui/shapes/text.cljs b/src/uxbox/main/ui/shapes/text.cljs index 4d08745568..0fbdb52075 100644 --- a/src/uxbox/main/ui/shapes/text.cljs +++ b/src/uxbox/main/ui/shapes/text.cljs @@ -70,8 +70,8 @@ ;; --- Text Styles Helpers -(def ^:const +style-attrs+ [:font-size]) -(def ^:const +select-rect-attrs+ +(def +style-attrs+ [:font-size]) +(def +select-rect-attrs+ {:stroke-dasharray "5,5" :style {:stroke "#333" :fill "transparent" :stroke-opacity "0.4"}}) diff --git a/src/uxbox/main/ui/workspace/base.cljs b/src/uxbox/main/ui/workspace/base.cljs index 7fbac9d696..ce4ce478f5 100644 --- a/src/uxbox/main/ui/workspace/base.cljs +++ b/src/uxbox/main/ui/workspace/base.cljs @@ -38,27 +38,27 @@ (-> (l/lens getter) (l/derive st/state)))) -(def ^:const selected-shapes-ref +(def selected-shapes-ref (as-> (l/in [:selected]) $ (l/derive $ workspace-ref))) -(def ^:const toolboxes-ref +(def toolboxes-ref (as-> (l/in [:toolboxes]) $ (l/derive $ workspace-ref))) -(def ^:const flags-ref +(def flags-ref (as-> (l/in [:flags]) $ (l/derive $ workspace-ref))) -(def ^:const shapes-by-id-ref +(def shapes-by-id-ref (as-> (l/key :shapes-by-id) $ (l/derive $ st/state))) -(def ^:const zoom-ref +(def zoom-ref (-> (l/in [:workspace :zoom]) (l/derive st/state))) -(def ^:const alignment-ref +(def alignment-ref (letfn [(getter [flags] (and (contains? flags :grid/indexed) (contains? flags :grid/alignment) diff --git a/src/uxbox/main/ui/workspace/clipboard.cljs b/src/uxbox/main/ui/workspace/clipboard.cljs index 72442aedd1..eff8513bef 100644 --- a/src/uxbox/main/ui/workspace/clipboard.cljs +++ b/src/uxbox/main/ui/workspace/clipboard.cljs @@ -21,7 +21,7 @@ ;; --- Lenses -(def ^:const ^:private clipboard-ref +(def ^:private clipboard-ref (-> (l/key :clipboard) (l/derive st/state))) diff --git a/src/uxbox/main/ui/workspace/ruler.cljs b/src/uxbox/main/ui/workspace/ruler.cljs index 074d83498a..f8ee80de78 100644 --- a/src/uxbox/main/ui/workspace/ruler.cljs +++ b/src/uxbox/main/ui/workspace/ruler.cljs @@ -17,7 +17,7 @@ [uxbox.main.geom.point :as gpt] [uxbox.util.dom :as dom])) -(def ^:private ^:const immanted-zones +(def ^:private immanted-zones (let [transform #(vector (- % 7) (+ % 7) %)] (concat (mapv transform (range 0 181 15)) @@ -105,7 +105,7 @@ (if (and p1 p2) (overlay-line-render own p1 p2))]))) -(def ^:const overlay +(def overlay (mx/component {:render #(overlay-render % (:rum/local %)) :will-mount #(overlay-will-mount % (:rum/local %)) diff --git a/src/uxbox/main/ui/workspace/rules.cljs b/src/uxbox/main/ui/workspace/rules.cljs index ad82e4607b..4e2f82aab5 100644 --- a/src/uxbox/main/ui/workspace/rules.cljs +++ b/src/uxbox/main/ui/workspace/rules.cljs @@ -18,17 +18,17 @@ ;; --- Constants & Helpers -(def ^:const step-padding 20) -(def ^:const step-size 10) +(def step-padding 20) +(def step-size 10) (defn big-ticks-mod [zoom] (/ 100 zoom)) (defn mid-ticks-mod [zoom] (/ 50 zoom)) -(def ^:const +ticks+ +(def +ticks+ (concat (range (- (/ c/viewport-width 1)) 0 step-size) (range 0 (/ c/viewport-width 1) step-size))) -(def ^:const rule-padding 20) +(def rule-padding 20) (defn- make-vertical-tick [zoom acc value] @@ -115,7 +115,7 @@ [:path {:d (str/join " " path) :stroke "#9da2a6"}] labels]))) -(def ^:const ^:private horizontal-rule-ticks +(def ^:private horizontal-rule-ticks (mx/component {:render horizontal-rule-ticks-render :name "horizontal-rule-ticks" @@ -134,7 +134,7 @@ [:path {:d (str/join " " path) :stroke "#9da2a6"}] labels]))) -(def ^:const ^:private vertical-rule-ticks +(def ^:private vertical-rule-ticks (mx/component {:render vertical-rule-ticks-render :name "vertical-rule-ticks" diff --git a/src/uxbox/main/ui/workspace/selection.cljs b/src/uxbox/main/ui/workspace/selection.cljs index 2d2813f9ad..242fb69b51 100644 --- a/src/uxbox/main/ui/workspace/selection.cljs +++ b/src/uxbox/main/ui/workspace/selection.cljs @@ -18,7 +18,7 @@ ;; --- Constants -(def ^:const +circle-props+ +(def +circle-props+ {:r 6 :style {:fillOpacity "1" :strokeWidth "1px" @@ -28,7 +28,7 @@ ;; --- Lenses -(def ^:const selected-shapes-ref +(def selected-shapes-ref (letfn [(getter [state] (let [selected (get-in state [:workspace :selected])] (mapv #(get-in state [:shapes-by-id %]) selected)))] diff --git a/src/uxbox/main/ui/workspace/shortcuts.cljs b/src/uxbox/main/ui/workspace/shortcuts.cljs index 0cbbada435..d32d9eb5b9 100644 --- a/src/uxbox/main/ui/workspace/shortcuts.cljs +++ b/src/uxbox/main/ui/workspace/shortcuts.cljs @@ -23,7 +23,7 @@ ;; --- Shortcuts -(defonce ^:const +shortcuts+ +(defonce +shortcuts+ {:shift+g #(rs/emit! (dw/toggle-flag :grid)) :ctrl+g #(rs/emit! (uds/group-selected)) :ctrl+shift+g #(rs/emit! (uds/degroup-selected)) diff --git a/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs b/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs index e3b3e0052b..9d4bc0b5ea 100644 --- a/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs +++ b/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs @@ -37,27 +37,27 @@ ;; Draw Tools ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^:const +draw-tool-rect+ +(def +draw-tool-rect+ {:type :rect :name "Rect" :stroke "#000000"}) -(def ^:const +draw-tool-circle+ +(def +draw-tool-circle+ {:type :circle :name "Circle"}) -(def ^:const +draw-tool-line+ +(def +draw-tool-line+ {:type :line :name "Line" :stroke-type :solid :stroke "#000000"}) -(def ^:const +draw-tool-text+ +(def +draw-tool-text+ {:type :text :name "Text" :content "Hello world"}) -(def ^:const +draw-tools+ +(def +draw-tools+ {:rect {:icon i/box :help (tr "ds.help.rect") diff --git a/src/uxbox/main/ui/workspace/sidebar/history.cljs b/src/uxbox/main/ui/workspace/sidebar/history.cljs index 1db7a1d618..afce08d09f 100644 --- a/src/uxbox/main/ui/workspace/sidebar/history.cljs +++ b/src/uxbox/main/ui/workspace/sidebar/history.cljs @@ -27,7 +27,7 @@ ;; --- Lenses -(def ^:const history-ref +(def history-ref (as-> (l/in [:workspace :history]) $ (l/derive $ st/state))) diff --git a/src/uxbox/main/ui/workspace/sidebar/icons.cljs b/src/uxbox/main/ui/workspace/sidebar/icons.cljs index 5e75dd7acd..26f9b7cd30 100644 --- a/src/uxbox/main/ui/workspace/sidebar/icons.cljs +++ b/src/uxbox/main/ui/workspace/sidebar/icons.cljs @@ -25,7 +25,7 @@ ;; Lenses ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^:private ^:const drawing-shape +(def ^:private drawing-shape "A focused vision of the drawing property of the workspace status. This avoids rerender the whole toolbox on each workspace diff --git a/src/uxbox/main/ui/workspace/sidebar/options.cljs b/src/uxbox/main/ui/workspace/sidebar/options.cljs index 3264cb96ba..ac9b5b98bc 100644 --- a/src/uxbox/main/ui/workspace/sidebar/options.cljs +++ b/src/uxbox/main/ui/workspace/sidebar/options.cljs @@ -106,7 +106,7 @@ :name "options" :mixins [mx/static (mx/local)]})) -(def ^:const selected-shape-ref +(def selected-shape-ref (letfn [(getter [state] (let [selected (get-in state [:workspace :selected])] (when (= 1 (count selected)) diff --git a/src/uxbox/main/ui/workspace/sidebar/sitemap.cljs b/src/uxbox/main/ui/workspace/sidebar/sitemap.cljs index 5f69d34bd6..50a92e23e0 100644 --- a/src/uxbox/main/ui/workspace/sidebar/sitemap.cljs +++ b/src/uxbox/main/ui/workspace/sidebar/sitemap.cljs @@ -105,7 +105,7 @@ ;; --- Lightbox -(def ^:const +page-defaults+ +(def +page-defaults+ {:width 1920 :height 1080 :layout :desktop})