mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
add document history clojure structure
This commit is contained in:
parent
f3d268a764
commit
482bf4e5e1
@ -24,6 +24,7 @@
|
|||||||
"ds.element-options" "Element options"
|
"ds.element-options" "Element options"
|
||||||
"ds.draw-tools" "Draw tools"
|
"ds.draw-tools" "Draw tools"
|
||||||
"ds.sitemap" "Sitemap"
|
"ds.sitemap" "Sitemap"
|
||||||
|
"ds.document-history" "Document history"
|
||||||
|
|
||||||
"ds.help.rect" "Box (Ctrl + B)"
|
"ds.help.rect" "Box (Ctrl + B)"
|
||||||
"ds.help.circle" "Circle (Ctrl + E)"
|
"ds.help.circle" "Circle (Ctrl + E)"
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
(defn- workspace-render
|
(defn- workspace-render
|
||||||
[own projectid]
|
[own projectid]
|
||||||
(let [{:keys [flags] :as workspace} (rum/react wb/workspace-l)
|
(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
|
right-sidebar? (not (empty? (keep flags [:icons :drawtools
|
||||||
:element-options])))
|
:element-options])))
|
||||||
local (:rum/local own)
|
local (:rum/local own)
|
||||||
|
|||||||
@ -81,8 +81,8 @@
|
|||||||
i/options]
|
i/options]
|
||||||
[:li.tooltip.tooltip-bottom
|
[:li.tooltip.tooltip-bottom
|
||||||
{:alt "History (Ctrl + Shift + H)"
|
{:alt "History (Ctrl + Shift + H)"
|
||||||
:class (when (contains? flags :element-options))
|
:class (when (contains? flags :document-history))
|
||||||
:on-click (partial toggle :element-options)}
|
:on-click (partial toggle :document-history)}
|
||||||
i/undo-history]]
|
i/undo-history]]
|
||||||
[:ul.options-btn
|
[:ul.options-btn
|
||||||
[:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}
|
[:li.tooltip.tooltip-bottom {:alt "Undo (Ctrl + Z)"}
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
[uxbox.ui.workspace.sidebar.options :refer (options-toolbox)]
|
[uxbox.ui.workspace.sidebar.options :refer (options-toolbox)]
|
||||||
[uxbox.ui.workspace.sidebar.layers :refer (layers-toolbox)]
|
[uxbox.ui.workspace.sidebar.layers :refer (layers-toolbox)]
|
||||||
[uxbox.ui.workspace.sidebar.sitemap :refer (sitemap-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.icons :refer (icons-toolbox)]
|
||||||
[uxbox.ui.workspace.sidebar.drawtools :refer (draw-toolbox)]))
|
[uxbox.ui.workspace.sidebar.drawtools :refer (draw-toolbox)]))
|
||||||
|
|
||||||
@ -25,6 +26,8 @@
|
|||||||
[:div.settings-bar-inside
|
[:div.settings-bar-inside
|
||||||
(when (contains? flags :sitemap)
|
(when (contains? flags :sitemap)
|
||||||
(sitemap-toolbox))
|
(sitemap-toolbox))
|
||||||
|
(when (contains? flags :document-history)
|
||||||
|
(document-history-toolbox))
|
||||||
(when (contains? flags :layers)
|
(when (contains? flags :layers)
|
||||||
(layers-toolbox))]])))
|
(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…
x
Reference in New Issue
Block a user