From a178de2c69d14171fd4bd3b715b28f315f01437a Mon Sep 17 00:00:00 2001 From: Dexterity <173429049+Dexterity104@users.noreply.github.com> Date: Wed, 10 Jun 2026 04:57:19 -0400 Subject: [PATCH] :recycle: Migrate v3 text-editor to modern component syntax (#9444) Co-authored-by: Andrey Antukh --- .../src/app/main/ui/workspace/shapes/text/v3_editor.cljs | 9 +++------ frontend/src/app/main/ui/workspace/viewport_wasm.cljs | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/shapes/text/v3_editor.cljs b/frontend/src/app/main/ui/workspace/shapes/text/v3_editor.cljs index d4a51bac77..749c5af69f 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/v3_editor.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/v3_editor.cljs @@ -17,7 +17,6 @@ [app.render-wasm.api :as wasm.api] [app.render-wasm.text-editor :as text-editor] [app.util.dom :as dom] - [app.util.object :as obj] [cuerdas.core :as str] [rumext.v2 :as mf])) @@ -40,12 +39,10 @@ (if (>= (count lang) 3) (str/capital lang) (str/upper lang))) "Noto Color Emoji")) -(mf/defc text-editor +(mf/defc text-editor* "Contenteditable element positioned over the text shape to capture input events." - {::mf/wrap-props false} - [props] - (let [shape (obj/get props "shape") - shape-id (dm/get-prop shape :id) + [{:keys [shape]}] + (let [shape-id (dm/get-prop shape :id) clip-id (dm/str "text-edition-clip" shape-id) diff --git a/frontend/src/app/main/ui/workspace/viewport_wasm.cljs b/frontend/src/app/main/ui/workspace/viewport_wasm.cljs index 40546618d8..8036612542 100644 --- a/frontend/src/app/main/ui/workspace/viewport_wasm.cljs +++ b/frontend/src/app/main/ui/workspace/viewport_wasm.cljs @@ -652,9 +652,9 @@ (when show-text-editor? (cond (features/active-feature? @st/state "text-editor-wasm/v1") - [:& editor-v3/text-editor {:shape editing-shape - :canvas-ref canvas-ref - :ref text-editor-ref}] + [:> editor-v3/text-editor* {:shape editing-shape + :canvas-ref canvas-ref + :ref text-editor-ref}] (features/active-feature? @st/state "text-editor/v2") [:& editor-v2/text-editor {:shape editing-shape