feat(frontend): add many adaptations to rumext breaking changes

This commit is contained in:
Andrey Antukh 2019-07-18 12:30:20 +02:00
parent 9ddd9f317d
commit 321c8d14e1
14 changed files with 149 additions and 174 deletions

View file

@ -106,7 +106,7 @@
(defn- text-shape-edit-did-mount
[own]
(let [[shape] (:rum/args own)
(let [[shape] (::mx/props own)
dom (mx/ref-node own "container")]
(set! (.-textContent dom) (:content shape ""))
(.focus dom)
@ -140,25 +140,15 @@
(defn text-shape-wrapper-did-mount
[own]
(let [[shape] (:rum/args own)
(let [[shape] (::mx/props own)
dom (mx/ref-node own "fobject")
html (dom/render-to-html (text-shape-html shape))]
(set! (.-innerHTML dom) html))
own)
(defn text-shape-wrapper-did-remount
[old own]
(let [[old-shape] (:rum/args old)
[shape] (:rum/args own)]
(when (not= shape old-shape)
(let [dom (mx/ref-node own "fobject")
html (dom/render-to-html (text-shape-html shape))]
(set! (.-innerHTML dom) html)))
own))
(mx/defc text-shape-wrapper
{:did-mount text-shape-wrapper-did-mount
:did-remount text-shape-wrapper-did-remount}
:key-fn #(pr-str %1)}
[{:keys [id modifiers] :as shape}]
(let [{:keys [displacement resize]} modifiers
xfmt (cond-> (gmt/matrix)
@ -188,7 +178,7 @@
(mx/defc text-shape
{:mixins [mx/static]
:did-mount text-shape-wrapper-did-mount
:did-remount text-shape-wrapper-did-remount}
:key-fn #(pr-str %1)}
[{:keys [id content modifiers] :as shape}]
(let [{:keys [displacement resize]} modifiers
xfmt (cond-> (gmt/matrix)