mirror of
https://github.com/penpot/penpot.git
synced 2025-03-20 19:51:23 -05:00
Add method and state for manage the clipboard.
This commit is contained in:
parent
c2821ea617
commit
11e399ae21
1 changed files with 19 additions and 0 deletions
|
@ -3,6 +3,25 @@
|
|||
[uxbox.ui.mixins :as mx]
|
||||
[uxbox.ui.lightbox :as lightbox]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; State
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defonce ^:private state (atom #queue []))
|
||||
(defonce ^:private ^:const +max-items+ 5)
|
||||
|
||||
(defn add
|
||||
[item]
|
||||
(swap! state (fn [v]
|
||||
(let [v (conj v item)]
|
||||
(if (> (count v) +max-items+)
|
||||
(pop v)
|
||||
v)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Component
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn- clipboard-dialog-render
|
||||
[own]
|
||||
(html
|
||||
|
|
Loading…
Add table
Reference in a new issue