♻️ Major refactor of page data structure.

In preparation to future collaborative edition.
This commit is contained in:
Andrey Antukh 2019-12-04 20:13:35 +01:00
parent 8c4bdc3f31
commit af62d949d8
33 changed files with 1025 additions and 1124 deletions

View file

@ -29,9 +29,8 @@
(ptk/reify ::start-move-selected
ptk/WatchEvent
(watch [_ state stream]
(let [pid (get-in state [:workspace :current])
flags (get-in state [:workspace pid :flags])
selected (get-in state [:workspace pid :selected])
(let [flags (get-in state [:workspace-local :flags])
selected (get-in state [:workspace-local :selected])
stoper (rx/filter uws/mouse-up? stream)
position @uws/mouse-position]
(rx/concat
@ -40,7 +39,8 @@
(->> (uws/mouse-position-deltas position)
(rx/map #(dw/apply-temporal-displacement-in-bulk selected %))
(rx/take-until stoper))
(rx/of (dw/materialize-current-modifier-in-bulk selected)))))))
(rx/of (dw/materialize-current-modifier-in-bulk selected)
::dw/page-data-update))))))
(defn on-mouse-down
[event {:keys [id type] :as shape} selected]