mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 05:06:11 +02:00
feat(frontend): add many adaptations to rumext breaking changes
This commit is contained in:
parent
9ddd9f317d
commit
321c8d14e1
14 changed files with 149 additions and 174 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue