             [pepa.components.page :as page]
 
             [cljs.reader :refer [read-string]]
-            [goog.string :as gstring])
+            [goog.string :as gstring]
+            goog.events.KeyCodes)
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]
                    [cljs.core.match.macros :refer [match]])
   (:import [cljs.core.ExceptionInfo]

                   :on-drop (fn [e]
                              (println "[new-document-ui] on-drop")
                              (let [source-column (get-transfer-data e "application/x-pepa-column")
                                    page-ids (get-transfer-data e "application/x-pepa-pages")]
                                ;; Delegate to `inbox'
                                (handle-drop! (:id column)
                                              source-column
                                              page-ids
                                              0)))}
     [:header nil]
     [:.center
      "Drag pages here or press \"Open\" to open a document"

                                                         [:search (:search column)]
                                                         [:document (:id document)]))}})]]))

(defn ^:private inbox-handle-drop! [state owner page-cache target source page-ids target-idx copy?]
  (let [columns (om/get-state owner :columns)
        target  (first (filter #(= (:id %) target) columns))
        source  (first (filter #(= (:id %) source) columns))
