       (let [selected (get-in state [:workspace :selected])]
         (rx/from-coll
          (into [(deselect-all)] (map #(delete-shape %) selected)))))))
-
-(defn initialize
-  "Initialize the workspace state."
-  [projectid pageid]
-  (reify
-    rs/UpdateEvent
-    (-apply-update [_ state]
-      (let [s {:project projectid
-               :toolboxes #{}
-               :flags #{}
-               :drawing nil
-               :selected #{}
-               :page pageid}]
-        (assoc state :workspace s)))))
-
-(defn move-shape
-  "Mark a shape selected for drawing in the canvas."
-  [sid [dx dy :as delta]]
-  (reify
-    rs/UpdateEvent
-    (-apply-update [_ state]
-      (let [shape (get-in state [:shapes-by-id sid])]
-        (update-in state [:shapes-by-id sid] shapes/-move {:dx dx :dy dy})))))
 
 (defn move-selected
   "Move a minimal position unit the selected shapes."

   :y [v/integer]})

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Events
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn toggle-tool
  "Toggle the enabled flag of the specified tool."

                        (map :id))]
        (assoc-in state [:workspace :selected] (into #{} shapes))))))

(defn add-shape
  "Mark a shape selected for drawing in the canvas."
  [shape props]
