From e9e6796f05f322ed62a71d7c93a814411e0f2321 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 2 Apr 2026 16:39:13 +0000 Subject: [PATCH] :recycle: Convert text-menu and sub-components to modern rumext * format Rename text-align-options, text-direction-options, vertical-align, grow-options, text-decoration-options and text-menu to their * variants. Update all call sites in shapes/text.cljs, shapes/group.cljs and shapes/multiple.cljs. --- .../workspace/sidebar/options/menus/text.cljs | 22 +++++++++---------- .../sidebar/options/shapes/group.cljs | 2 +- .../sidebar/options/shapes/multiple.cljs | 2 +- .../sidebar/options/shapes/text.cljs | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs index daf8f09e7e..f4f1bd7ee3 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs @@ -38,7 +38,7 @@ [potok.v2.core :as ptk] [rumext.v2 :as mf])) -(mf/defc text-align-options +(mf/defc text-align-options* [{:keys [values on-change on-blur] :as props}] (let [{:keys [text-align]} values handle-change @@ -70,7 +70,7 @@ :title (tr "workspace.options.text-options.text-align-justify") :icon i/text-justify}]]])) -(mf/defc text-direction-options +(mf/defc text-direction-options* [{:keys [values on-change on-blur] :as props}] (let [direction (:text-direction values) handle-change @@ -98,7 +98,7 @@ :title (tr "workspace.options.text-options.direction-rtl") :icon i/text-rtl}]]])) -(mf/defc vertical-align +(mf/defc vertical-align* [{:keys [values on-change on-blur] :as props}] (let [{:keys [vertical-align]} values vertical-align (or vertical-align "top") @@ -126,7 +126,7 @@ :title (tr "workspace.options.text-options.align-bottom") :icon i/text-bottom}]]])) -(mf/defc grow-options +(mf/defc grow-options* [{:keys [ids values on-blur] :as props}] (let [grow-type (:grow-type values) @@ -172,7 +172,7 @@ :title (tr "workspace.options.text-options.grow-auto-height") :icon i/text-auto-height}]]])) -(mf/defc text-decoration-options +(mf/defc text-decoration-options* [{:keys [values on-change on-blur] :as props}] (let [text-decoration (or (:text-decoration values) "none") handle-change @@ -199,7 +199,7 @@ :title (tr "workspace.options.text-options.strikethrough" (sc/get-tooltip :line-through)) :icon i/text-stroked}]]])) -(mf/defc text-menu +(mf/defc text-menu* {::mf/wrap [mf/memo]} [{:keys [ids type values] :as props}] @@ -349,8 +349,8 @@ [:> text-options opts]) [:div {:class (stl/css :text-align-options)} - [:> text-align-options opts] - [:> grow-options opts] + [:> text-align-options* opts] + [:> grow-options* opts] [:> icon-button* {:variant "ghost" :aria-label (tr "labels.options") :data-testid "text-align-options-button" @@ -359,6 +359,6 @@ (when more-options-open? [:div {:class (stl/css :text-decoration-options)} - [:> vertical-align opts] - [:> text-decoration-options opts] - [:> text-direction-options opts]])])])) + [:> vertical-align* opts] + [:> text-decoration-options* opts] + [:> text-direction-options* opts]])])])) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs index 30d19bc83c..80cfe2bd36 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs @@ -171,7 +171,7 @@ [:> blur-menu* {:type type :ids blur-ids :values blur-values}]) (when-not (empty? text-ids) - [:& ot/text-menu {:type type :ids text-ids :values text-values}]) + [:> ot/text-menu* {:type type :ids text-ids :values text-values}]) (when-not (empty? svg-values) [:& svg-attrs-menu {:ids ids :values svg-values}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs index 34b7f1c098..4a810239f1 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs @@ -478,7 +478,7 @@ [:> constraints-menu* {:ids constraint-ids :values constraint-values}]) (when-not (empty? text-ids) - [:& ot/text-menu {:type type :ids text-ids :values text-values}]) + [:> ot/text-menu* {:type type :ids text-ids :values text-values}]) (when-not (empty? fill-ids) [:> fill/fill-menu* {:type type diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs index 17f239bcb4..96cc29b6ba 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs @@ -26,7 +26,7 @@ [app.main.ui.workspace.sidebar.options.menus.measures :refer [measure-attrs measures-menu*]] [app.main.ui.workspace.sidebar.options.menus.shadow :refer [shadow-menu*]] [app.main.ui.workspace.sidebar.options.menus.stroke :refer [stroke-attrs stroke-menu*]] - [app.main.ui.workspace.sidebar.options.menus.text :refer [text-menu]] + [app.main.ui.workspace.sidebar.options.menus.text :refer [text-menu*]] [rumext.v2 :as mf])) (mf/defc options* @@ -176,7 +176,7 @@ {:ids ids :values (select-keys shape constraint-attrs)}]) - [:& text-menu + [:> text-menu* {:ids ids :type type :values text-values}]