<commit_before>;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2015-2016 <NAME> <<EMAIL>>
;; Copyright (c) 2015-2016 <NAME> <<EMAIL>>

(ns uxbox.main.ui.workspace.sidebar
  (:require [sablono.core :as html :refer-macros [html]]
            [rum.core :as rum]
            [lentes.core :as l]
            [uxbox.main.state :as st]
            [uxbox.util.router :as r]
            [uxbox.util.rstore :as rs]
            [uxbox.util.mixins :as mx]
            [uxbox.main.ui.workspace.base :as wb]
            [uxbox.main.ui.workspace.sidebar.options :refer (options-toolbox)]
            [uxbox.main.ui.workspace.sidebar.layers :refer (layers-toolbox)]
            [uxbox.main.ui.workspace.sidebar.sitemap :refer (sitemap-toolbox)]
            [uxbox.main.ui.workspace.sidebar.history :refer (history-toolbox)]
            [uxbox.main.ui.workspace.sidebar.icons :refer (icons-toolbox)]
            [uxbox.main.ui.workspace.sidebar.drawtools :refer (draw-toolbox)]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Left Sidebar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn left-sidebar-render
  [own]
  (let [flags (mx/react wb/flags-ref)]
    (html
     [:aside#settings-bar.settings-bar.settings-bar-left
      [:div.settings-bar-inside
       (when (contains? flags :sitemap)
         (sitemap-toolbox))
       (when (contains? flags :document-history)
         (history-toolbox))
       (when (contains? flags :layers)
         (layers-toolbox))]])))

(def left-sidebar
  (mx/component
   {:render left-sidebar-render
    :name "left-sidebar"
    :mixins [mx/reactive mx/static]}))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Right Sidebar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn right-sidebar-render
  [own]
  (let [flags (mx/react wb/flags-ref)]
    (html
     [:aside#settings-bar.settings-bar
      [:div.settings-bar-inside
       (when (contains? flags :drawtools)
         (draw-toolbox))
       (when (contains? flags :element-options)
         (options-toolbox))
       (when (contains? flags :icons)
         (icons-toolbox))]])))

(def right-sidebar
  (mx/component
   {:render right-sidebar-render
    :name "right-sidebar"
    :mixins [mx/reactive mx/static]}))<commit_msg>Use new components macros for sidebar ns.<commit_after>;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2015-2016 <NAME> <<EMAIL>>
;; Copyright (c) 2015-2016 <NAME> <<EMAIL>>

(ns uxbox.main.ui.workspace.sidebar
  (:require [lentes.core :as l]
            [uxbox.main.state :as st]
            [uxbox.util.router :as r]
            [uxbox.util.rstore :as rs]
            [uxbox.util.mixins :as mx]
            [uxbox.main.ui.workspace.base :as wb]
            [uxbox.main.ui.workspace.sidebar.options :refer (options-toolbox)]
            [uxbox.main.ui.workspace.sidebar.layers :refer (layers-toolbox)]
            [uxbox.main.ui.workspace.sidebar.sitemap :refer (sitemap-toolbox)]
            [uxbox.main.ui.workspace.sidebar.history :refer (history-toolbox)]
            [uxbox.main.ui.workspace.sidebar.icons :refer (icons-toolbox)]
            [uxbox.main.ui.workspace.sidebar.drawtools :refer (draw-toolbox)]))

;; --- Left Sidebar (Component)

(mx/defc left-sidebar
  {:mixins [mx/reactive mx/static]}
  []
  (let [flags (mx/react wb/flags-ref)]
    [:aside#settings-bar.settings-bar.settings-bar-left
     [:div.settings-bar-inside
      (when (contains? flags :sitemap)
        (sitemap-toolbox))
      (when (contains? flags :document-history)
        (history-toolbox))
      (when (contains? flags :layers)
        (layers-toolbox))]]))

;; --- Right Sidebar (Component)

(mx/defc right-sidebar
  {:mixins [mx/reactive mx/static]}
  []
  (let [flags (mx/react wb/flags-ref)]
    [:aside#settings-bar.settings-bar
     [:div.settings-bar-inside
      (when (contains? flags :drawtools)
        (draw-toolbox))
      (when (contains? flags :element-options)
        (options-toolbox))
      (when (contains? flags :icons)
        (icons-toolbox))]]))

{'fraction_non_alphanumeric': 0.21520963425512935, 'fraction_numerical': 0.008920606601248885, 'mean_word_length': 2.9342105263157894, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5204209', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1487, 'n_words': 313}