mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
add document history clojure structure
This commit is contained in:
parent
f3d268a764
commit
482bf4e5e1
5 changed files with 47 additions and 3 deletions
|
@ -24,6 +24,7 @@
|
|||
"ds.element-options" "Element options"
|
||||
"ds.draw-tools" "Draw tools"
|
||||
"ds.sitemap" "Sitemap"
|
||||
"ds.document-history" "Document history"
|
||||
|
||||
"ds.help.rect" "Box (Ctrl + B)"
|
||||
"ds.help.circle" "Circle (Ctrl + E)"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
(defn- workspace-render
|
||||
[own projectid]
|
||||
(let [{:keys [flags] :as workspace} (rum/react wb/workspace-l)
|
||||
left-sidebar? (not (empty? (keep flags [:layers :sitemap])))
|
||||
left-sidebar? (not (empty? (keep flags [:layers :sitemap :document-history])))
|
||||
right-sidebar? (not (empty? (keep flags [:icons :drawtools
|
||||
:element-options])))
|
||||
local (:rum/local own)
|
||||
|
|
|
@ -81,8 +81,8 @@
|
|||
i/options]
|
||||
[:li.tooltip.tooltip-bottom
|
||||
{:alt "History (Ctrl + Shift + H)"
|
||||
:class (when (contains? flags :element-options))
|
||||
:on-click (partial toggle :element-options)}
|
||||
:class (when (contains? flags :document-history))
|
||||
:on-click (partial toggle :document-history)}
|
||||
i/undo-history]]
|
||||
[:ul.options-btn
|
||||
[:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
[uxbox.ui.workspace.sidebar.options :refer (options-toolbox)]
|
||||
[uxbox.ui.workspace.sidebar.layers :refer (layers-toolbox)]
|
||||
[uxbox.ui.workspace.sidebar.sitemap :refer (sitemap-toolbox)]
|
||||
[uxbox.ui.workspace.sidebar.document-history :refer (document-history-toolbox)]
|
||||
[uxbox.ui.workspace.sidebar.icons :refer (icons-toolbox)]
|
||||
[uxbox.ui.workspace.sidebar.drawtools :refer (draw-toolbox)]))
|
||||
|
||||
|
@ -25,6 +26,8 @@
|
|||
[:div.settings-bar-inside
|
||||
(when (contains? flags :sitemap)
|
||||
(sitemap-toolbox))
|
||||
(when (contains? flags :document-history)
|
||||
(document-history-toolbox))
|
||||
(when (contains? flags :layers)
|
||||
(layers-toolbox))]])))
|
||||
|
||||
|
|
40
src/uxbox/ui/workspace/sidebar/document-history.cljs
Normal file
40
src/uxbox/ui/workspace/sidebar/document-history.cljs
Normal file
|
@ -0,0 +1,40 @@
|
|||
(ns uxbox.ui.workspace.sidebar.document-history
|
||||
(: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 document-history-toolbox-render
|
||||
[open-toolboxes]
|
||||
(let [workspace (rum/react wb/workspace-l)
|
||||
close #(rs/emit! (dw/toggle-flag :document-history))]
|
||||
(html
|
||||
[:div.document-history.tool-window
|
||||
[:div.tool-window-bar
|
||||
[:div.tool-window-icon i/undo-history]
|
||||
[:span (tr "ds.document-history")]
|
||||
[:div.tool-window-close {:on-click close} i/close]]
|
||||
[:div.tool-window-content
|
||||
[:span "DOCUMENT HISTORY CONTENT"]
|
||||
]])))
|
||||
|
||||
(def ^:static document-history-toolbox
|
||||
(mx/component
|
||||
{:render document-history-toolbox-render
|
||||
:name "document-history-toolbox"
|
||||
:mixins [mx/static rum/reactive]}))
|
Loading…
Add table
Reference in a new issue